GitLab Mirror pushed to branch 2.12 at cms-community / hippo-jackrabbit

Commits:
30888f53 by Julian Reschke at 2017-01-17T12:06:49+00:00
JCR-4100: jackrabbit-webdav: Scope implements equals() but not 
hashCode()(ported to 2.12)

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/branches/2.12@1779176 
13f79535-47bb-0310-9956-ffa450edef68

- - - - -


1 changed file:

- jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/lock/Scope.java


Changes:

=====================================
jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/lock/Scope.java
=====================================
--- 
a/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/lock/Scope.java
+++ 
b/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/lock/Scope.java
@@ -63,22 +63,25 @@ public class Scope implements XmlSerializable {
         return lockScope;
     }
 
-    /**
-     * Returns <code>true</code> if this Scope is equal to the given one.
-     *
-     * @param obj
-     * @return
-     */
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + localName.hashCode();
+        result = prime * result + namespace.hashCode();
+        return result;
+    }
+
     @Override
     public boolean equals(Object obj) {
         if (this == obj) {
             return true;
-        }
-        if (obj instanceof Scope) {
+        } else if (obj instanceof Scope) {
             Scope other = (Scope) obj;
             return localName.equals(other.localName) && 
namespace.equals(other.namespace);
+        } else {
+            return false;
         }
-        return false;
     }
 
     /**



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-jackrabbit/commit/30888f53afe070f0f4e6117abdf285a2eef1e6e6
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to