You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by st...@apache.org on 2014/07/09 13:21:24 UTC

svn commit: r1609105 - /sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/JcrNode.java

Author: stefanegli
Date: Wed Jul  9 11:21:24 2014
New Revision: 1609105

URL: http://svn.apache.org/r1609105
Log:
SLING-3753 : fix 'Widget is disposed' by making hashCode and equals dependent on only the current node, not including the children

Modified:
    sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/JcrNode.java

Modified: sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/JcrNode.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/JcrNode.java?rev=1609105&r1=1609104&r2=1609105&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/JcrNode.java (original)
+++ sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/JcrNode.java Wed Jul  9 11:21:24 2014
@@ -190,7 +190,9 @@ public class JcrNode implements IAdaptab
 				if (domElement==null) {
 					return toString().hashCode();
 				} else {
-					return domElement.toString().hashCode() + parent.hashCode();
+				    Element domElementCopy = domElement.copy();
+				    domElementCopy.clearChildren();
+					return domElementCopy.toString().hashCode() + parent.hashCode();
 				}
 			} else {
 				return resource.getFullPath().hashCode();
@@ -199,7 +201,9 @@ public class JcrNode implements IAdaptab
 			if (domElement==null) {
 				return underlying.hashCode();
 			}
-			return underlying.hashCode() + domElement.toString().hashCode();
+            Element domElementCopy = domElement.copy();
+            domElementCopy.clearChildren();
+			return underlying.hashCode() + domElementCopy.toString().hashCode();
 		}
 	}
 	
@@ -235,7 +239,11 @@ public class JcrNode implements IAdaptab
 			if (!parent.equals(other.parent)) {
 				return false;
 			}
-			return domElement.toString().equals(other.domElement.toString());
+			Element domElementCopy = domElement.copy();
+			domElementCopy.clearChildren();
+			Element otherDomElementCopy = other.domElement.copy();
+			otherDomElementCopy.clearChildren();
+			return domElementCopy.toString().equals(otherDomElementCopy.toString());
 		}
 		return toString().equals(obj.toString());
 	}