ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject svn commit: r471287 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Manifest.java
Date Sat, 04 Nov 2006 22:42:01 GMT
Author: peterreilly
Date: Sat Nov  4 14:42:00 2006
New Revision: 471287

URL: http://svn.apache.org/viewvc?view=rev&rev=471287
Log:
checkstyle + align hashCode with equals

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Manifest.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Manifest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Manifest.java?view=diff&rev=471287&r1=471286&r2=471287
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Manifest.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Manifest.java Sat Nov  4 14:42:00
2006
@@ -151,12 +151,13 @@
 
         /**
          * @see java.lang.Object#hashCode
+         * @return a hashcode based on the key and values.
          */
         public int hashCode() {
             int hashCode = 0;
 
             if (name != null) {
-                hashCode += name.hashCode();
+                hashCode += getKey().hashCode();
             }
 
             hashCode += values.hashCode();
@@ -164,7 +165,9 @@
         }
 
         /**
+         * @param rhs the object to check for equality.
          * @see java.lang.Object#equals
+         * @return true if the key and values are the same.
          */
         public boolean equals(Object rhs) {
             if (rhs == null || rhs.getClass() != getClass()) {
@@ -684,20 +687,16 @@
 
         /**
          * @see java.lang.Object#hashCode
+         * @return a hash value based on the attributes.
          */
         public int hashCode() {
-            int hashCode = 0;
-
-            if (name != null) {
-                hashCode += name.hashCode();
-            }
-
-            hashCode += attributes.hashCode();
-            return hashCode;
+            return attributes.hashCode();
         }
 
         /**
          * @see java.lang.Object#equals
+         * @param rhs the object to check for equality.
+         * @return true if the attributes are the same.
          */
         public boolean equals(Object rhs) {
             if (rhs == null || rhs.getClass() != getClass()) {
@@ -992,6 +991,7 @@
 
     /**
      * @see java.lang.Object#hashCode
+     * @return a hashcode based on the version, main and sections.
      */
     public int hashCode() {
         int hashCode = 0;
@@ -1007,6 +1007,8 @@
 
     /**
      * @see java.lang.Object#equals
+     * @param rhs the object to check for equality.
+     * @return true if the version, main and sections are the same.
      */
     public boolean equals(Object rhs) {
         if (rhs == null || rhs.getClass() != getClass()) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message