Bug 1258789 - Add a few more to WhitespaceAround and fix. r=grisha
MozReview-Commit-ID: AkJEXhlp3Rf
--- a/mobile/android/app/checkstyle.xml
+++ b/mobile/android/app/checkstyle.xml
@@ -49,14 +49,19 @@
<property name="tokens" value="IMPORT,PACKAGE_DEF"/>
</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="allowEmptyConstructors" value="true"/>
+ <property name="allowEmptyMethods" value="true"/>
+ <property name="allowEmptyTypes" value="true"/>
+ <property name="allowEmptyLoops" value="true"/>
<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_WHILE"/>
+ LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE,
+ LOR, LT, NOT_EQUAL, QUESTION"/>
</module>
</module>
</module>
--- a/mobile/android/base/java/org/mozilla/gecko/prompts/PromptListAdapter.java
+++ b/mobile/android/base/java/org/mozilla/gecko/prompts/PromptListAdapter.java
@@ -144,28 +144,28 @@ public class PromptListAdapter extends A
boolean isSelected(int position){
return getItem(position).getSelected();
}
ArrayList<Integer> getSelected() {
int length = getCount();
ArrayList<Integer> selected = new ArrayList<Integer>();
- for (int i = 0; i< length; i++) {
+ for (int i = 0; i < length; i++) {
if (isSelected(i)) {
selected.add(i);
}
}
return selected;
}
int getSelectedIndex() {
int length = getCount();
- for (int i = 0; i< length; i++) {
+ for (int i = 0; i < length; i++) {
if (isSelected(i)) {
return i;
}
}
return -1;
}
private View getActionView(PromptListItem item, final ListView list, final int position) {