jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1420648 - /jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
Date Wed, 12 Dec 2012 12:52:21 GMT
Author: stefan
Date: Wed Dec 12 12:52:19 2012
New Revision: 1420648

URL: http://svn.apache.org/viewvc?rev=1420648&view=rev
Log:
OAK-503: Microkernel.commit throws AssertionError

Modified:
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.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=1420648&r1=1420647&r2=1420648&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
Wed Dec 12 12:52:19 2012
@@ -388,6 +388,9 @@ public class MicroKernelImpl implements 
         if (path.length() > 0 && !PathUtils.isAbsolute(path)) {
             throw new IllegalArgumentException("absolute path expected: " + path);
         }
+        if (jsonDiff == null || jsonDiff.length() == 0) {
+            return getHeadRevision();
+        }
 
         Id revId = revisionId == null ? getHeadRevisionId() : Id.fromString(revisionId);
 
@@ -483,7 +486,7 @@ public class MicroKernelImpl implements 
                         break;
                     }
                     default:
-                        throw new AssertionError("token type: " + t.getTokenType());
+                        throw new IllegalArgumentException("jsonDiff: illegal token '" +
t.getToken() + "' at pos: " + t.getLastPos());
                 }
             }
             Id newHead = cb.doCommit();



Mime
View raw message