mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-23 01:29:43 +01:00
Replaced private method with calls to StringUtils.equalsIgnoreCase()
Former-commit-id: d4c92115e6f90109bfae9487ef3f4c829bf22232
This commit is contained in:
@@ -231,9 +231,9 @@ public class Evidence implements Serializable, Comparable<Evidence> {
|
|||||||
if (o == null) {
|
if (o == null) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (equalsWithNullCheck(source, o.source)) {
|
if (StringUtils.equalsIgnoreCase(source, o.source)) {
|
||||||
if (equalsWithNullCheck(name, o.name)) {
|
if (StringUtils.equalsIgnoreCase(name, o.name)) {
|
||||||
if (equalsWithNullCheck(value, o.value)) {
|
if (StringUtils.equalsIgnoreCase(value, o.value)) {
|
||||||
if (ObjectUtils.equals(confidence, o.confidence)) {
|
if (ObjectUtils.equals(confidence, o.confidence)) {
|
||||||
return 0; //they are equal
|
return 0; //they are equal
|
||||||
} else {
|
} 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
|
* Wrapper around {@link java.lang.String#compareToIgnoreCase(java.lang.String) String.compareToIgnoreCase} with an
|
||||||
* exhaustive, possibly duplicative, check against nulls.
|
* exhaustive, possibly duplicative, check against nulls.
|
||||||
|
|||||||
Reference in New Issue
Block a user