GitLab Mirror pushed to branch 2.8 at cms-community / hippo-jackrabbit
Commits: 013a690f by Julian Reschke at 2017-01-17T12:51:18+00:00 JCR-4100: jackrabbit-webdav: Scope implements equals() but not hashCode()(ported to 2.8) git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/branches/2.8@1779185 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/013a690f75e3399cf422d39f47881cce155a2bfb
_______________________________________________ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn