Skip to content

Commit beaf211

Browse files
authored
Fix three Java lint errors (#6531)
* Add braces to conditions. * Remove an unnecessary semicolon. * Remove an unnecessary constructor. This fixes all the Java lint errors of these types.
1 parent 3549789 commit beaf211

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

app/src/main/java/fr/free/nrw/commons/nearby/CheckBoxTriStates.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void setCallback(Callback callback) {
4444
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
4545
switch (state) {
4646
case UNKNOWN:
47-
setState(UNCHECKED);;
47+
setState(UNCHECKED);
4848
break;
4949
case UNCHECKED:
5050
setState(CHECKED);

app/src/main/java/fr/free/nrw/commons/nearby/Sitelinks.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ public static class Builder {
105105
private String commonsLink;
106106
private String wikipediaLink;
107107

108-
public Builder() {
109-
}
110-
111108
public Sitelinks.Builder setWikipediaLink(String link) {
112109
this.wikipediaLink = link;
113110
return this;

app/src/test/java/android/text/TextUtils.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,18 @@ public static boolean isEmpty(@Nullable CharSequence str) {
2121
* mocks TextUtils.equals
2222
*/
2323
public static boolean equals(CharSequence a, CharSequence b) {
24-
if (a == b) return true;
24+
if (a == b) {
25+
return true;
26+
}
2527
int length;
2628
if (a != null && b != null && (length = a.length()) == b.length()) {
2729
if (a instanceof String && b instanceof String) {
2830
return a.equals(b);
2931
} else {
3032
for (int i = 0; i < length; i++) {
31-
if (a.charAt(i) != b.charAt(i)) return false;
33+
if (a.charAt(i) != b.charAt(i)) {
34+
return false;
35+
}
3236
}
3337
return true;
3438
}

0 commit comments

Comments
 (0)