From 4e5ff7650c76d69764556eb72b421b68e4d9248b Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 7 Oct 2011 10:57:02 +0000 Subject: [PATCH] if equals is defined hashCode must be defined too git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1179998 13f79535-47bb-0310-9956-ffa450edef68 --- .../metadata/model/ArtifactMetadata.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java index 6d408726d..92205119b 100644 --- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java +++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java @@ -271,6 +271,23 @@ public class ArtifactMetadata return true; } + @Override + public int hashCode() + { + int result = id != null ? id.hashCode() : 0; + result = 31 * result + ( repositoryId != null ? repositoryId.hashCode() : 0 ); + result = 31 * result + ( namespace != null ? namespace.hashCode() : 0 ); + result = 31 * result + ( project != null ? project.hashCode() : 0 ); + result = 31 * result + ( projectVersion != null ? projectVersion.hashCode() : 0 ); + result = 31 * result + ( version != null ? version.hashCode() : 0 ); + result = 31 * result + ( fileLastModified != null ? fileLastModified.hashCode() : 0 ); + result = 31 * result + (int) ( size ^ ( size >>> 32 ) ); + result = 31 * result + ( md5 != null ? md5.hashCode() : 0 ); + result = 31 * result + ( sha1 != null ? sha1.hashCode() : 0 ); + result = 31 * result + ( whenGathered != null ? whenGathered.hashCode() : 0 ); + return result; + } + @Override public String toString() { -- 2.39.5