Replaced hashCode to leverage builder instead of deprecated ObjectUtils methods.

This commit is contained in:
Anthony Whitford
2015-09-13 10:55:02 -07:00
parent f17d8f38fb
commit 9d9b1cbcd5

View File

@@ -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();
} }
/** /**