jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1330762 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl2.java
Date Thu, 26 Apr 2012 10:37:14 GMT
Author: mduerig
Date: Thu Apr 26 10:37:14 2012
New Revision: 1330762

URL: http://svn.apache.org/viewvc?rev=1330762&view=rev
Log:
OAK-18: Define Oak API
- alternative implementation which implements a fully persisted transient space: improve listener
notification

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl2.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl2.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl2.java?rev=1330762&r1=1330761&r2=1330762&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl2.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl2.java
Thu Apr 26 10:37:14 2012
@@ -294,10 +294,10 @@ public class TreeImpl2 implements Tree {
 
     @Override
     public Tree addChild(String name) {
-        NodeStateBuilder childBuilder = builder.addNode(name);
-        TreeImpl2 added = new TreeImpl2(store, null, childBuilder, this, name, listener);
+        builder.addNode(name);
+        TreeImpl2 added = getChild(name);
         if (added != null) {
-            listener.addChild(this, name);
+            listener.addChild(added, name);
         }
         return added;
     }
@@ -313,8 +313,7 @@ public class TreeImpl2 implements Tree {
 
     @Override
     public void setProperty(String name, CoreValue value) {
-        PropertyState propertyState = new PropertyStateImpl(name, value);
-        builder.setProperty(propertyState);
+        builder.setProperty(new PropertyStateImpl(name, value));
         if (listener != null) {
             listener.setProperty(this, name, value);
         }
@@ -322,8 +321,7 @@ public class TreeImpl2 implements Tree {
 
     @Override
     public void setProperty(String name, List<CoreValue> values) {
-        PropertyState propertyState = new PropertyStateImpl(name, values);
-        builder.setProperty(propertyState);
+        builder.setProperty(new PropertyStateImpl(name, values));
         if (listener != null) {
             listener.setProperty(this, name, values);
         }
@@ -374,7 +372,7 @@ public class TreeImpl2 implements Tree {
         boolean result = builder.copyTo(destParent.builder, destName);
         if (result) {
             if (listener != null) {
-                // FIXME call listener listener.copy(parent, name, copy);
+                listener.copy(parent, name, destParent.getChild(destName));
             }
             return true;
         }



Mime
View raw message