# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: C:\Progetti\NetBeansProjects\jackrabbit-spi-commons-2.6.1\src\main\java\org\apache\jackrabbit\spi\commons\nodetype # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: NodeTypeDefDiff.java --- NodeTypeDefDiff.java Base (BASE) +++ NodeTypeDefDiff.java Locally Modified (Based On LOCAL) @@ -669,11 +669,13 @@ */ static class QNodeDefinitionId { + Name[] requiredPrimaryTypes; Name declaringNodeType; Name name; QNodeDefinitionId(QNodeDefinition def) { declaringNodeType = def.getDeclaringNodeType(); + requiredPrimaryTypes = def.getRequiredPrimaryTypes(); name = def.getName(); } @@ -686,17 +688,35 @@ if (obj instanceof QNodeDefinitionId) { QNodeDefinitionId other = (QNodeDefinitionId) obj; return declaringNodeType.equals(other.declaringNodeType) - && name.equals(other.name); + && name.equals(other.name) + && compareRequiredPrimaryTypeNames( + requiredPrimaryTypes, other.requiredPrimaryTypes); } return false; } + private boolean compareRequiredPrimaryTypeNames(Name[] obj, Name[] other) { + HashSet set1 = new HashSet(Arrays.asList(obj)); + HashSet set2 = new HashSet(Arrays.asList(other)); + return set1.equals(set2); + } + +// @Override +// public int hashCode() { +// int h = 17; +// h = 37 * h + declaringNodeType.hashCode(); +// h = 37 * h + name.hashCode(); +// h = 37 * h + requiredPrimaryTypes.hashCode(); +// return h; +// } + @Override public int hashCode() { - int h = 17; - h = 37 * h + declaringNodeType.hashCode(); - h = 37 * h + name.hashCode(); - return h; + int hash = 7; + hash = 61 * hash + Arrays.deepHashCode(this.requiredPrimaryTypes); + hash = 61 * hash + (this.declaringNodeType != null ? this.declaringNodeType.hashCode() : 0); + hash = 61 * hash + (this.name != null ? this.name.hashCode() : 0); + return hash; } } }