Hi,

On 15.10.13 2:42 , [email protected] wrote:
Author: tripod
Date: Tue Oct 15 00:42:21 2013
New Revision: 1532157

URL: http://svn.apache.org/r1532157
Log:
OAK-1086 NodeTypes of successive calls to node.getPrimaryNodetypes() are not 
equal

- implement equals and hashcode based on the CND of the node type definition.

[...]

+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o instanceof NodeTypeImpl) {
+            return getCnd().equals(((NodeTypeImpl) o).getCnd());
+        } else if (o instanceof NodeType) {

Should we even consider this case? If so, below implementation is not symmetric wrt. e.g. the NodeType implementation of JR2.

I'd rather return false for unknown NodeType instances.

+            try {
+                return getCnd().equals(getCnd((NodeType) o));
+            } catch (IOException e) {
+                return false;
+            }
+        } else {
+            return false;
+        }
+    }

Michael

Reply via email to