From 39e587085f69a381906d0247a96bbc82e25b0b59 Mon Sep 17 00:00:00 2001 From: Dale Visser Date: Wed, 24 Jun 2015 14:57:10 -0400 Subject: [PATCH] Replaced private method with equivalent ObjectUtils.equals() call. Former-commit-id: 9d460788899a3cb6e0891d63e39f50c3f96fc385 --- .../dependencycheck/dependency/Evidence.java | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/dependency/Evidence.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/dependency/Evidence.java index f69731401..241791dea 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/dependency/Evidence.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/dependency/Evidence.java @@ -234,7 +234,7 @@ public class Evidence implements Serializable, Comparable { 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 { 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.