From 37f50db00e9878c44b85cbea8e5b1ef714b8ee0b Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Sun, 9 Aug 2015 09:56:20 -0400 Subject: [PATCH] removed related dependencies from hashCode and equals to resolve issue #293 --- .../org/owasp/dependencycheck/dependency/Dependency.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/dependency/Dependency.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/dependency/Dependency.java index dd2f5bb26..26a6d1b56 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/dependency/Dependency.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/dependency/Dependency.java @@ -720,7 +720,7 @@ public class Dependency implements Serializable, Comparable { && ObjectUtils.equals(this.description, other.description) && ObjectUtils.equals(this.license, other.license) && ObjectUtils.equals(this.vulnerabilities, other.vulnerabilities) - && ObjectUtils.equals(this.relatedDependencies, other.relatedDependencies) + //&& ObjectUtils.equals(this.relatedDependencies, other.relatedDependencies) && ObjectUtils.equals(this.projectReferences, other.projectReferences) && ObjectUtils.equals(this.availableVersions, other.availableVersions); } @@ -735,8 +735,9 @@ public class Dependency implements Serializable, Comparable { int hash = MAGIC_HASH_INIT_VALUE; for (Object field : new Object[]{this.actualFilePath, this.filePath, this.fileName, this.md5sum, this.sha1sum, this.identifiers, this.vendorEvidence, this.productEvidence, this.versionEvidence, - this.description, this.license, this.vulnerabilities, this.relatedDependencies, this.projectReferences, - this.availableVersions}) { + this.description, this.license, this.vulnerabilities, + //this.relatedDependencies, + this.projectReferences, this.availableVersions}) { hash = MAGIC_HASH_MULTIPLIER * hash + ObjectUtils.hashCode(field); } return hash;