summaryrefslogtreecommitdiffstats
path: root/archiva-modules/metadata/metadata-model
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2011-10-07 10:57:02 +0000
committerOlivier Lamy <olamy@apache.org>2011-10-07 10:57:02 +0000
commit4e5ff7650c76d69764556eb72b421b68e4d9248b (patch)
tree70369024a95f3427d023b619eedf2bf3de215c23 /archiva-modules/metadata/metadata-model
parent659ab05e9f56f07d42afb49fc3f738d41c5e9108 (diff)
downloadarchiva-4e5ff7650c76d69764556eb72b421b68e4d9248b.tar.gz
archiva-4e5ff7650c76d69764556eb72b421b68e4d9248b.zip
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
Diffstat (limited to 'archiva-modules/metadata/metadata-model')
-rw-r--r--archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java17
1 files changed, 17 insertions, 0 deletions
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
@@ -272,6 +272,23 @@ public class ArtifactMetadata
}
@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()
{
return "ArtifactMetadata{" + "id='" + id + '\'' + ", size=" + size + ", version='" + version + '\'' +