-
Bug
-
Resolution: Fixed
-
P3
-
8, 9
-
None
-
b11
-
Verified
(as found by errorprone)
The code below is bogus because eras[i] is an Era while eraName is a String, and so it looks like getEra always returns null, which further suggests this method is never tested.
public Era getEra(String eraName) {
if (eras != null) {
for (int i = 0; i < eras.length; i++) {
if (eras[i].equals(eraName)) {
return eras[i];
}
}
}
return null;
}
The code below is bogus because eras[i] is an Era while eraName is a String, and so it looks like getEra always returns null, which further suggests this method is never tested.
public Era getEra(String eraName) {
if (eras != null) {
for (int i = 0; i < eras.length; i++) {
if (eras[i].equals(eraName)) {
return eras[i];
}
}
}
return null;
}