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