IDEA-136997 External system: descendants of ExternalEntityData in plugins are not...
authorVladislav.Soroka <Vladislav.Soroka@jetbrains.com>
Thu, 26 Feb 2015 09:01:14 +0000 (12:01 +0300)
committerVladislav.Soroka <Vladislav.Soroka@jetbrains.com>
Thu, 26 Feb 2015 09:04:14 +0000 (12:04 +0300)
platform/external-system-api/src/com/intellij/openapi/externalSystem/model/DataNode.java

index 1e879da7e92235e2f0bf79250bffeb86414c92d2..4658f0c7b9f01adebe8c462bb99d6e3588b4a90b 100644 (file)
@@ -59,6 +59,10 @@ public class DataNode<T> implements Serializable {
     myParent = parent;
   }
 
+  private DataNode(@NotNull Key<T> key) {
+    myKey = key;
+  }
+
   @Nullable
   public DataNode<?> getParent() {
     return myParent;
@@ -308,7 +312,9 @@ public class DataNode<T> implements Serializable {
   }
 
   private static <T> DataNode<T> nodeCopy(@NotNull DataNode<T> dataNode, @Nullable DataNode<?> newParent) {
-    DataNode<T> copy = new DataNode<T>(dataNode.myKey, dataNode.myData, newParent);
+    DataNode<T> copy = new DataNode<T>(dataNode.myKey);
+    copy.myParent = newParent;
+    copy.myData = dataNode.myData;
     copy.myRawData = dataNode.myRawData;
     for (DataNode<?> child : dataNode.myChildren) {
       copy.addChild(nodeCopy(child, copy));