Block formatting fixes

This commit is contained in:
Daniel Martí 2015-09-10 19:02:25 -07:00
parent cba2e67a70
commit d415ceae15
12 changed files with 19 additions and 31 deletions

View File

@ -50,7 +50,7 @@ public class BluetoothSwap extends SwapType {
}
@Override
public boolean isDiscoverable () {
public boolean isDiscoverable() {
return isDiscoverable;
}
@ -120,8 +120,7 @@ public class BluetoothSwap extends SwapType {
}
}
if (adapter.isEnabled())
{
if (adapter.isEnabled()) {
setConnected(true);
} else {
Log.i(TAG, "Didn't start Bluetooth swapping server, because Bluetooth is disabled and couldn't be enabled.");

View File

@ -33,8 +33,7 @@ public abstract class SwapType {
abstract protected String getBroadcastAction();
public boolean isDiscoverable ()
{
public boolean isDiscoverable() {
return isConnected();
}

View File

@ -97,8 +97,7 @@ public class BluetoothDownloader extends Downloader {
}
@Override
public void close ()
{
public void close() {
if (connection != null)
connection.closeQuietly();
}

View File

@ -166,8 +166,7 @@ public abstract class Downloader {
int readLength = Math.min(input.available(), buffer.length);
count = input.read(buffer, 0, readLength);
}
else {
} else {
count = input.read(buffer);
}

View File

@ -48,8 +48,7 @@ public class HttpDownloader extends Downloader {
* only stream the file through the {@link HttpDownloader#getInputStream()}
* @return
*/
public HttpDownloader streamDontDownload()
{
public HttpDownloader streamDontDownload() {
onlyStream = true;
return this;
}
@ -69,8 +68,7 @@ public class HttpDownloader extends Downloader {
return stream;
}
public BufferedReader getBufferedReader () throws IOException
{
public BufferedReader getBufferedReader() throws IOException {
return new BufferedReader(new InputStreamReader(getInputStream()));
}
@ -169,8 +167,7 @@ public class HttpDownloader extends Downloader {
return statusCode;
}
public void close ()
{
public void close() {
try {
if (stream != null)
stream.close();

View File

@ -33,8 +33,7 @@ public class IconDownloader extends BaseImageDownloader {
}
//bluetooth isn't a scheme in the Scheme. library, so we can add a check here
if (imageUri.toLowerCase().startsWith("bluetooth"))
{
if (imageUri.toLowerCase().startsWith("bluetooth")) {
Downloader downloader = DownloaderFactory.create(context, imageUri);
ByteArrayOutputStream baos = new ByteArrayOutputStream();

View File

@ -276,9 +276,9 @@ public class LocalHTTPD extends NanoHTTPD {
res.addHeader("ETag", etag);
}
} else {
if (etag.equals(header.get("if-none-match")))
if (etag.equals(header.get("if-none-match"))) {
res = createResponse(Response.Status.NOT_MODIFIED, mime, "");
else {
} else {
res = createResponse(Response.Status.OK, mime, new FileInputStream(file));
res.addHeader("Content-Length", "" + fileLen);
res.addHeader("ETag", etag);

View File

@ -311,9 +311,9 @@ public class BluetoothServer extends Thread {
res.addHeader("ETag", etag);
}
} else {
if (etag.equals(header.get("if-none-match")))
if (etag.equals(header.get("if-none-match"))) {
res = createResponse(NanoHTTPD.Response.Status.NOT_MODIFIED, mime, "");
else {
} else {
res = createResponse(NanoHTTPD.Response.Status.OK, mime, new FileInputStream(file));
res.addHeader("Content-Length", "" + fileLen);
res.addHeader("ETag", etag);

View File

@ -44,8 +44,7 @@ public class Request {
input = connection.getInputStream();
}
public static Request createHEAD(String path, BluetoothConnection connection)
{
public static Request createHEAD(String path, BluetoothConnection connection) {
return new Request(Methods.HEAD, path, connection);
}
@ -141,8 +140,7 @@ public class Request {
return Integer.parseInt(status);
}
private String readLine () throws IOException
{
private String readLine() throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
String line = null;

View File

@ -62,8 +62,7 @@ public class Response {
this.contentStream = contentStream;
}
public void addHeader (String key, String value)
{
public void addHeader (String key, String value) {
headers.put(key, value);
}

View File

@ -38,8 +38,7 @@ public abstract class ThemeableListFragment extends ListFragment {
}
}
private LayoutInflater getThemedInflater(Context context)
{
private LayoutInflater getThemedInflater(Context context) {
Context c = (getThemeStyle() == 0) ? context : new ContextThemeWrapper(context, getThemeStyle());
return (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}