mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Fix three Java lint errors
* Add braces to conditions. * Remove an unnecessary semicolon. * Remove an unnecessary constructor. This fixes all the Java lint errors of these types.
This commit is contained in:
parent
3a55583460
commit
7f1dc52a73
3 changed files with 7 additions and 6 deletions
|
|
@ -44,7 +44,7 @@ public class CheckBoxTriStates extends AppCompatCheckBox {
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case UNKNOWN:
|
case UNKNOWN:
|
||||||
setState(UNCHECKED);;
|
setState(UNCHECKED);
|
||||||
break;
|
break;
|
||||||
case UNCHECKED:
|
case UNCHECKED:
|
||||||
setState(CHECKED);
|
setState(CHECKED);
|
||||||
|
|
|
||||||
|
|
@ -105,9 +105,6 @@ public class Sitelinks implements Parcelable {
|
||||||
private String commonsLink;
|
private String commonsLink;
|
||||||
private String wikipediaLink;
|
private String wikipediaLink;
|
||||||
|
|
||||||
public Builder() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public Sitelinks.Builder setWikipediaLink(String link) {
|
public Sitelinks.Builder setWikipediaLink(String link) {
|
||||||
this.wikipediaLink = link;
|
this.wikipediaLink = link;
|
||||||
return this;
|
return this;
|
||||||
|
|
|
||||||
|
|
@ -21,14 +21,18 @@ public class TextUtils {
|
||||||
* mocks TextUtils.equals
|
* mocks TextUtils.equals
|
||||||
*/
|
*/
|
||||||
public static boolean equals(CharSequence a, CharSequence b) {
|
public static boolean equals(CharSequence a, CharSequence b) {
|
||||||
if (a == b) return true;
|
if (a == b) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
int length;
|
int length;
|
||||||
if (a != null && b != null && (length = a.length()) == b.length()) {
|
if (a != null && b != null && (length = a.length()) == b.length()) {
|
||||||
if (a instanceof String && b instanceof String) {
|
if (a instanceof String && b instanceof String) {
|
||||||
return a.equals(b);
|
return a.equals(b);
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < length; i++) {
|
for (int i = 0; i < length; i++) {
|
||||||
if (a.charAt(i) != b.charAt(i)) return false;
|
if (a.charAt(i) != b.charAt(i)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue