fixed two findbugs issues

This commit is contained in:
hneemann 2017-05-22 12:28:51 +02:00
parent 73f2ec2c64
commit e85604e3b6
2 changed files with 19 additions and 1 deletions

View File

@ -105,7 +105,7 @@ public class NodeException extends Exception {
}
}
} catch (Exception e) {
} catch (IllegalAccessException | NoSuchFieldException e) {
// ignore an error accessing the ElementTypeDescription
}
}

View File

@ -70,6 +70,24 @@ public final class NumStringComparator implements Comparator<String> {
}
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NumString numString = (NumString) o;
if (num != numString.num) return false;
return str != null ? str.equalsIgnoreCase(numString.str) : numString.str == null;
}
@Override
public int hashCode() {
int result = num;
result = 31 * result + (str != null ? str.toLowerCase().hashCode() : 0);
return result;
}
@Override
public int compareTo(NumString other) {
if (isNum && other.isNum) {