Bug 1258789 - Add while to WhitespaceAround. r=grisha
MozReview-Commit-ID: HhbBCjojNiC
--- a/mobile/android/app/checkstyle.xml
+++ b/mobile/android/app/checkstyle.xml
@@ -50,13 +50,13 @@
</module>
<module name="OuterTypeFilename"/> <!-- `class Lol` only in Lol.java -->
<module name="WhitespaceAfter">
<!-- TODO: (bug 1263059) Remove specific tokens to enable CAST check. -->
<property name="tokens" value="COMMA, SEMI"/>
</module>
<module name="WhitespaceAround">
<property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN,
- LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY"/>
+ LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE"/>
</module>
</module>
</module>
--- a/mobile/android/base/java/org/mozilla/gecko/ContactService.java
+++ b/mobile/android/base/java/org/mozilla/gecko/ContactService.java
@@ -1725,17 +1725,17 @@ public class ContactService implements G
private long[] getAllRawContactIds() {
Cursor cursor = getAllRawContactIdsCursor();
// Put the ids into an array
long[] ids = new long[cursor.getCount()];
int index = 0;
cursor.moveToPosition(-1);
- while(cursor.moveToNext()) {
+ while (cursor.moveToNext()) {
ids[index] = cursor.getLong(cursor.getColumnIndex(RawContacts._ID));
index++;
}
cursor.close();
return ids;
}
--- a/mobile/android/base/java/org/mozilla/gecko/DownloadsIntegration.java
+++ b/mobile/android/base/java/org/mozilla/gecko/DownloadsIntegration.java
@@ -188,17 +188,17 @@ public class DownloadsIntegration implem
}
do {
final Download d = Download.fromCursor(c);
// Try hard as we can to verify this download is the one we think it is
if (download.equals(d)) {
dm.remove(d.id);
}
- } while(c.moveToNext());
+ } while (c.moveToNext());
} finally {
if (c != null) {
c.close();
}
}
}
private static final class GeckoMediaScannerClient implements MediaScannerConnectionClient {
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
@@ -942,17 +942,17 @@ public abstract class GeckoApp
byte[] buf = new byte[4192];
os = new ByteArrayOutputStream();
URL url = new URL(aSrc);
is = url.openStream();
// Cannot read from same stream twice. Also, InputStream from
// URL does not support reset. So converting to byte array.
- while((byteRead = is.read(buf)) != -1) {
+ while ((byteRead = is.read(buf)) != -1) {
os.write(buf, 0, byteRead);
}
byte[] imgBuffer = os.toByteArray();
image = BitmapUtils.decodeByteArray(imgBuffer);
}
if (image != null) {
// Some devices don't have a DCIM folder and the Media.insertImage call will fail.
File dcimDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
--- a/mobile/android/base/java/org/mozilla/gecko/db/LocalURLMetadata.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/LocalURLMetadata.java
@@ -194,17 +194,17 @@ public class LocalURLMetadata implements
}
do {
final Map<String, Object> metadata = fromCursor(cursor);
final String url = cursor.getString(cursor.getColumnIndexOrThrow(URLMetadataTable.URL_COLUMN));
data.put(url, metadata);
cache.put(url, metadata);
- } while(cursor.moveToNext());
+ } while (cursor.moveToNext());
} finally {
cursor.close();
}
return Collections.unmodifiableMap(data);
}
--- a/mobile/android/base/java/org/mozilla/gecko/db/PasswordsProvider.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/PasswordsProvider.java
@@ -337,13 +337,13 @@ public class PasswordsProvider extends S
String decrypted = doCrypto(cursor.getString(passwordIndex), uri, false);;
m.set(passwordIndex, decrypted);
}
if (usernameIndex > -1) {
String decrypted = doCrypto(cursor.getString(usernameIndex), uri, false);
m.set(usernameIndex, decrypted);
}
- } while(cursor.moveToNext());
+ } while (cursor.moveToNext());
}
}
}
}
--- a/mobile/android/base/java/org/mozilla/gecko/home/SearchEngineRow.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/SearchEngineRow.java
@@ -177,17 +177,17 @@ class SearchEngineRow extends AnimatedHe
if (TextUtils.isEmpty(pattern)) {
return;
}
final int patternLength = pattern.length();
int indexOfMatch = 0;
int lastIndexOfMatch = 0;
- while(indexOfMatch != -1) {
+ while (indexOfMatch != -1) {
indexOfMatch = string.indexOf(pattern, lastIndexOfMatch);
lastIndexOfMatch = indexOfMatch + patternLength;
if (indexOfMatch != -1) {
mOccurrences.add(indexOfMatch);
}
}
}
--- a/mobile/android/base/java/org/mozilla/gecko/lwt/LightweightTheme.java
+++ b/mobile/android/base/java/org/mozilla/gecko/lwt/LightweightTheme.java
@@ -366,17 +366,17 @@ public class LightweightTheme implements
}
parent = curView.getParent();
if (parent instanceof View) {
curView = (View) parent;
}
- } while(parent instanceof View);
+ } while (parent instanceof View);
// Adjust the coordinates for the offset.
left -= offsetX;
right -= offsetX;
top -= offsetY;
bottom -= offsetY;
// The either the required height may be less than the available image height or more than it.