Replaced private method with equivalent ObjectUtils.equals() call.

Former-commit-id: 9d460788899a3cb6e0891d63e39f50c3f96fc385
This commit is contained in:
Dale Visser
2015-06-24 14:57:10 -04:00
parent 42e77c77a9
commit 39e587085f

View File

@@ -234,7 +234,7 @@ public class Evidence implements Serializable, Comparable<Evidence> {
if (equalsWithNullCheck(source, o.source)) {
if (equalsWithNullCheck(name, o.name)) {
if (equalsWithNullCheck(value, o.value)) {
if (equalsWithNullCheck(confidence, o.confidence)) {
if (ObjectUtils.equals(confidence, o.confidence)) {
return 0; //they are equal
} else {
return compareToWithNullCheck(confidence, o.confidence);
@@ -266,22 +266,6 @@ public class Evidence implements Serializable, Comparable<Evidence> {
return me.equalsIgnoreCase(other);
}
/**
* 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(Confidence me, Confidence other) {
if (me == null && other == null) {
return true;
} else if (me == null || other == null) {
return false;
}
return me.equals(other);
}
/**
* Wrapper around {@link java.lang.String#compareToIgnoreCase(java.lang.String) String.compareToIgnoreCase} with an
* exhaustive, possibly duplicative, check against nulls.