jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1399692 - in /jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk: core/MicroKernelImpl.java model/tree/DiffBuilder.java
Date Thu, 18 Oct 2012 15:14:07 GMT
Author: stefan
Date: Thu Oct 18 15:14:07 2012
New Revision: 1399692

URL: http://svn.apache.org/viewvc?rev=1399692&view=rev
Log:
OAK-384: get rid of add-property json diff syntax

Modified:
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/DiffBuilder.java

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java?rev=1399692&r1=1399691&r2=1399692&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
Thu Oct 18 15:14:07 2012
@@ -393,29 +393,14 @@ public class MicroKernelImpl implements 
                         pos = t.getLastPos();
                         String subPath = t.readString();
                         t.read(':');
-                        if (t.matches('{')) {
-                            String nodePath = PathUtils.concat(path, subPath);
-                            if (!PathUtils.isAbsolute(nodePath)) {
-                                throw new Exception("absolute path expected: " + nodePath
+ ", pos: " + pos);
-                            }
-                            String parentPath = PathUtils.getParentPath(nodePath);
-                            String nodeName = PathUtils.getName(nodePath);
-                            cb.addNode(parentPath, nodeName, JsonObject.create(t));
-                        } else {
-                            String value;
-                            if (t.matches(JsopReader.NULL)) {
-                                value = null;
-                            } else {
-                                value = t.readRawValue().trim();
-                            }
-                            String targetPath = PathUtils.concat(path, subPath);
-                            if (!PathUtils.isAbsolute(targetPath)) {
-                                throw new Exception("absolute path expected: " + targetPath
+ ", pos: " + pos);
-                            }
-                            String parentPath = PathUtils.getParentPath(targetPath);
-                            String propName = PathUtils.getName(targetPath);
-                            cb.setProperty(parentPath, propName, value);
-                        }
+                        t.read('{');
+                        String nodePath = PathUtils.concat(path, subPath);
+                        if (!PathUtils.isAbsolute(nodePath)) {
+                            throw new Exception("absolute path expected: " + nodePath + ",
pos: " + pos);
+                        }
+                        String parentPath = PathUtils.getParentPath(nodePath);
+                        String nodeName = PathUtils.getName(nodePath);
+                        cb.addNode(parentPath, nodeName, JsonObject.create(t));
                         break;
                     }
                     case '-': {

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/DiffBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/DiffBuilder.java?rev=1399692&r1=1399691&r2=1399692&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/DiffBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/DiffBuilder.java
Thu Oct 18 15:14:07 2012
@@ -78,7 +78,7 @@ public class DiffBuilder {
             public void propertyAdded(PropertyState after) {
                 String p = PathUtils.concat(getCurrentPath(), after.getName());
                 if (p.startsWith(pathFilter)) {
-                    buff.tag('+').
+                    buff.tag('^').
                             key(p).
                             encodedValue(after.getEncodedValue()).
                             newline();
@@ -173,7 +173,7 @@ public class DiffBuilder {
                 public void propertyAdded(PropertyState after) {
                     String p = PathUtils.concat(getCurrentPath(), after.getName());
                     if (p.startsWith(pathFilter)) {
-                        buff.tag('+').
+                        buff.tag('^').
                                 key(p).
                                 encodedValue(after.getEncodedValue()).
                                 newline();



Mime
View raw message