subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1605871 - /subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/ExternalItem.java
Date Thu, 26 Jun 2014 18:20:00 GMT
Author: brane
Date: Thu Jun 26 18:20:00 2014
New Revision: 1605871

URL: http://svn.apache.org/r1605871
Log:
Fix a Java 8 compiler warning in JavaHL.

* subversion/bindings/javahl/src/org/apache/subversion/javahl/types/ExternalItem.java
  (ExternalItem.hashCode): Override this method here since equals() was also
   overriden.
  (ExternalItem.serialVersionUID): Update comment.

Modified:
    subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/ExternalItem.java

Modified: subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/ExternalItem.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/ExternalItem.java?rev=1605871&r1=1605870&r2=1605871&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/ExternalItem.java
(original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/ExternalItem.java
Thu Jun 26 18:20:00 2014
@@ -31,8 +31,9 @@ import org.apache.subversion.javahl.Subv
  */
 public class ExternalItem implements java.io.Serializable
 {
-    // Update the serialVersionUID when there is a incompatible change
-    // made to this class.
+    // Update the serialVersionUID when there is a incompatible change made to
+    // this class.  See the java documentation for when a change is incompatible.
+    // http://java.sun.com/javase/7/docs/platform/serialization/spec/version.html#6678
     private static final long serialVersionUID = 1L;
 
     /**
@@ -127,6 +128,19 @@ public class ExternalItem implements jav
                 && this.pegRevision.equals(that.pegRevision));
     }
 
+    /**
+     * Return a hash code for this object.
+     */
+    public int hashCode()
+    {
+        int hash = 17;
+        hash = hash * 33 + (null != targetDir ? targetDir.hashCode() : 0);
+        hash = hash * 33 + (null != url ? url.hashCode() : 0);
+        hash = hash * 33 + (null != revision ? revision.hashCode() : 0);
+        hash = hash * 33 + (null != pegRevision ? pegRevision.hashCode() : 0);
+        return hash;
+    }
+
     /* Exception class for failed revision kind validation. */
     private static class BadRevisionKindException extends SubversionException
     {



Mime
View raw message