Replaced private method with calls to StringUtils.equalsIgnoreCase()

Former-commit-id: d4c92115e6f90109bfae9487ef3f4c829bf22232
This commit is contained in:
Dale Visser
2015-06-24 15:01:32 -04:00
parent 39e587085f
commit e2389b4992

View File

@@ -231,9 +231,9 @@ public class Evidence implements Serializable, Comparable<Evidence> {
if (o == null) {
return 1;
}
if (equalsWithNullCheck(source, o.source)) {
if (equalsWithNullCheck(name, o.name)) {
if (equalsWithNullCheck(value, o.value)) {
if (StringUtils.equalsIgnoreCase(source, o.source)) {
if (StringUtils.equalsIgnoreCase(name, o.name)) {
if (StringUtils.equalsIgnoreCase(value, o.value)) {
if (ObjectUtils.equals(confidence, o.confidence)) {
return 0; //they are equal
} else {
@@ -250,22 +250,6 @@ public class Evidence implements Serializable, Comparable<Evidence> {
}
}
/**
* Equality check with an exhaustive, possibly duplicative, check against nulls.
*
* @param me the value to be compared
* @param other the other value to be compared
* @return true if the values are equal; otherwise false
*/
private boolean equalsWithNullCheck(String me, String other) {
if (me == null && other == null) {
return true;
} else if (me == null || other == null) {
return false;
}
return me.equalsIgnoreCase(other);
}
/**
* Wrapper around {@link java.lang.String#compareToIgnoreCase(java.lang.String) String.compareToIgnoreCase} with an
* exhaustive, possibly duplicative, check against nulls.