You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by mr...@apache.org on 2016/04/19 09:14:13 UTC

svn commit: r1739858 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document: Commit.java DocumentMK.java

Author: mreutegg
Date: Tue Apr 19 07:14:13 2016
New Revision: 1739858

URL: http://svn.apache.org/viewvc?rev=1739858&view=rev
Log:
OAK-4230: Remove unused JsopWriter in Commit

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/Commit.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/Commit.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/Commit.java?rev=1739858&r1=1739857&r2=1739858&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/Commit.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/Commit.java Tue Apr 19 07:14:13 2016
@@ -34,8 +34,6 @@ import com.google.common.collect.Iterabl
 import com.google.common.collect.Sets;
 
 import org.apache.jackrabbit.oak.api.PropertyState;
-import org.apache.jackrabbit.oak.commons.json.JsopStream;
-import org.apache.jackrabbit.oak.commons.json.JsopWriter;
 import org.apache.jackrabbit.oak.plugins.document.util.Utils;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
@@ -64,7 +62,6 @@ public class Commit {
     private final RevisionVector baseRevision;
     private final Revision revision;
     private final HashMap<String, UpdateOp> operations = new LinkedHashMap<String, UpdateOp>();
-    private final JsopWriter diff = new JsopStream();
     private final Set<Revision> collisions = new LinkedHashSet<Revision>();
     private Branch b;
 
@@ -145,14 +142,6 @@ public class Commit {
         return modifiedNodes;
     }
 
-    void addNodeDiff(DocumentNodeState n) {
-        diff.tag('+').key(n.getPath());
-        diff.object();
-        n.append(diff, false);
-        diff.endObject();
-        diff.newline();
-    }
-
     void updateProperty(String path, String propertyName, String value) {
         UpdateOp op = getUpdateOperationForNode(path);
         String key = Utils.escapePropertyName(propertyName);
@@ -684,14 +673,6 @@ public class Commit {
         cacheEntry.done();
     }
 
-    public void moveNode(String sourcePath, String targetPath) {
-        diff.tag('>').key(sourcePath).value(targetPath);
-    }
-
-    public void copyNode(String sourcePath, String targetPath) {
-        diff.tag('*').key(sourcePath).value(targetPath);
-    }
-
     private void markChanged(String path) {
         if (!denotesRoot(path) && !PathUtils.isAbsolute(path)) {
             throw new IllegalArgumentException("path: " + path);
@@ -707,14 +688,6 @@ public class Commit {
         }
     }
 
-    public void updatePropertyDiff(String path, String propertyName, String value) {
-        diff.tag('^').key(PathUtils.concat(path, propertyName)).value(value);
-    }
-
-    public void removeNodeDiff(String path) {
-        diff.tag('-').value(path).newline();
-    }
-
     public void removeNode(String path, NodeState state) {
         removedNodes.add(path);
         UpdateOp op = getUpdateOperationForNode(path);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java?rev=1739858&r1=1739857&r2=1739858&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java Tue Apr 19 07:14:13 2016
@@ -409,7 +409,6 @@ public class DocumentMK {
                     }
                     commit.removeNode(path, toRemove);
                     nodeStore.markAsDeleted(toRemove, commit, true);
-                    commit.removeNodeDiff(path);
                     break;
                 case '^':
                     t.read(':');
@@ -425,7 +424,6 @@ public class DocumentMK {
                     }
                     String propertyName = PathUtils.getName(path);
                     commit.updateProperty(p, propertyName, value);
-                    commit.updatePropertyDiff(p, propertyName, value);
                     break;
                 case '>': {
                     // TODO support moving nodes that were modified within this commit
@@ -440,7 +438,6 @@ public class DocumentMK {
                     } else if (nodeExists(targetPath, baseRevId)) {
                         throw new DocumentStoreException("Node already exists: " + targetPath + " in revision " + baseRevId);
                     }
-                    commit.moveNode(path, targetPath);
                     nodeStore.moveNode(source, targetPath, commit);
                     break;
                 }
@@ -457,7 +454,6 @@ public class DocumentMK {
                     } else if (nodeExists(targetPath, baseRevId)) {
                         throw new DocumentStoreException("Node already exists: " + targetPath + " in revision " + baseRevId);
                     }
-                    commit.copyNode(path, targetPath);
                     nodeStore.copyNode(source, targetPath, commit);
                     break;
                 }
@@ -485,7 +481,6 @@ public class DocumentMK {
             t.read('}');
         }
         commit.addNode(n);
-        commit.addNodeDiff(n);
     }
 
     //----------------------------< Builder >-----------------------------------