From e2389b49922b639b9d468c1d99c28e3a7c92dbbd Mon Sep 17 00:00:00 2001 From: Dale Visser Date: Wed, 24 Jun 2015 15:01:32 -0400 Subject: [PATCH] Replaced private method with calls to StringUtils.equalsIgnoreCase() Former-commit-id: d4c92115e6f90109bfae9487ef3f4c829bf22232 --- .../dependencycheck/dependency/Evidence.java | 22 +++---------------- 1 file changed, 3 insertions(+), 19 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 241791dea..bddd69bc8 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 @@ -231,9 +231,9 @@ public class Evidence implements Serializable, Comparable { 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 { } } - /** - * 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.