archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1179998 - /archiva/trunk/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java
Date Fri, 07 Oct 2011 10:57:03 GMT
Author: olamy
Date: Fri Oct  7 10:57:02 2011
New Revision: 1179998

URL: http://svn.apache.org/viewvc?rev=1179998&view=rev
Log:
if equals is defined hashCode must be defined too

Modified:
    archiva/trunk/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java

Modified: archiva/trunk/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java?rev=1179998&r1=1179997&r2=1179998&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java
(original)
+++ archiva/trunk/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java
Fri Oct  7 10:57:02 2011
@@ -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 + '\'' +



Mime
View raw message