mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-21 16:49:43 +01:00
Replaced private method with equivalent ObjectUtils.equals() call.
Former-commit-id: 9d460788899a3cb6e0891d63e39f50c3f96fc385
This commit is contained in:
@@ -234,7 +234,7 @@ public class Evidence implements Serializable, Comparable<Evidence> {
|
|||||||
if (equalsWithNullCheck(source, o.source)) {
|
if (equalsWithNullCheck(source, o.source)) {
|
||||||
if (equalsWithNullCheck(name, o.name)) {
|
if (equalsWithNullCheck(name, o.name)) {
|
||||||
if (equalsWithNullCheck(value, o.value)) {
|
if (equalsWithNullCheck(value, o.value)) {
|
||||||
if (equalsWithNullCheck(confidence, o.confidence)) {
|
if (ObjectUtils.equals(confidence, o.confidence)) {
|
||||||
return 0; //they are equal
|
return 0; //they are equal
|
||||||
} else {
|
} else {
|
||||||
return compareToWithNullCheck(confidence, o.confidence);
|
return compareToWithNullCheck(confidence, o.confidence);
|
||||||
@@ -266,22 +266,6 @@ public class Evidence implements Serializable, Comparable<Evidence> {
|
|||||||
return me.equalsIgnoreCase(other);
|
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
|
* 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