mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-23 09:31:32 +01:00
Replaced hashCode to leverage builder instead of deprecated ObjectUtils methods.
This commit is contained in:
@@ -19,6 +19,7 @@ package org.owasp.dependencycheck.dependency;
|
|||||||
|
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@@ -198,12 +199,12 @@ public class Evidence implements Serializable, Comparable<Evidence> {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = MAGIC_HASH_INIT_VALUE;
|
return new HashCodeBuilder(MAGIC_HASH_INIT_VALUE, MAGIC_HASH_MULTIPLIER)
|
||||||
hash = MAGIC_HASH_MULTIPLIER * hash + ObjectUtils.hashCode(StringUtils.lowerCase(this.name));
|
.append(StringUtils.lowerCase(name))
|
||||||
hash = MAGIC_HASH_MULTIPLIER * hash + ObjectUtils.hashCode(StringUtils.lowerCase(this.source));
|
.append(StringUtils.lowerCase(source))
|
||||||
hash = MAGIC_HASH_MULTIPLIER * hash + ObjectUtils.hashCode(StringUtils.lowerCase(this.value));
|
.append(StringUtils.lowerCase(value))
|
||||||
hash = MAGIC_HASH_MULTIPLIER * hash + ObjectUtils.hashCode(this.confidence);
|
.append(confidence)
|
||||||
return hash;
|
.toHashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user