jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1324678 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: core/ConnectionImpl.java core/TmpRepositoryService.java kernel/KernelNodeStateEditor.java kernel/TransientNodeState.java
Date Wed, 11 Apr 2012 09:51:08 GMT
Author: mduerig
Date: Wed Apr 11 09:51:08 2012
New Revision: 1324678

URL: http://svn.apache.org/viewvc?rev=1324678&view=rev
Log:
OAK-18: Define Oak API 
- minor cleanup 
- fixed javadoc 
- correct encoding of empty arrays of scalar

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TmpRepositoryService.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientNodeState.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java?rev=1324678&r1=1324677&r2=1324678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java
Wed Apr 11 09:51:08 2012
@@ -47,10 +47,9 @@ public class ConnectionImpl implements C
     private final SimpleCredentials credentials;
     private final String workspaceName;
     private final NodeStore store;
+    private final NodeState root;
     private final QueryEngine queryEngine;
 
-    private NodeState root;
-
     public ConnectionImpl(SimpleCredentials credentials, String workspaceName,
             NodeStore store, NodeState root, QueryEngine queryEngine) {
         this.credentials = credentials;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TmpRepositoryService.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TmpRepositoryService.java?rev=1324678&r1=1324677&r2=1324678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TmpRepositoryService.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TmpRepositoryService.java
Wed Apr 11 09:51:08 2012
@@ -68,7 +68,7 @@ public class TmpRepositoryService implem
         if (sc != null) {
             return ConnectionImpl.createWorkspaceConnection(
                     sc, wspName, wspName.equals(DEFAULT_WORKSPACE_NAME),
-                    microKernelUrl, getRevision(credentials));
+                    microKernelUrl, revision);
         } else {
             throw new LoginException("login failed...");
         }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditor.java?rev=1324678&r1=1324677&r2=1324678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditor.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditor.java
Wed Apr 11 09:51:08 2012
@@ -34,7 +34,7 @@ import static org.apache.jackrabbit.mk.u
 /**
  * This {@code NodeStateEditor} implementation accumulates all changes into a json diff
  * and applies them to the microkernel on
- * {@link org.apache.jackrabbit.mk.model.NodeStore#merge(NodeStateEditor, NodeState)}.
+ * {@link org.apache.jackrabbit.oak.api.NodeStore#merge(NodeStateEditor, NodeState)}
  *
  * TODO: review/rewrite when OAK-45 is resolved
  * When the MicroKernel has support for branching and merging private working copies,
@@ -219,7 +219,7 @@ public class KernelNodeStateEditor imple
         return path.isEmpty() ? name : path + '/' + name;
     }
 
-    private String encode(PropertyState state) {
+    private static String encode(PropertyState state) {
         if (state.isArray()) {
             return encode(state.getArray());
         } else {
@@ -227,7 +227,7 @@ public class KernelNodeStateEditor imple
         }
     }
 
-    private String encode(Scalar scalar) {
+    private static String encode(Scalar scalar) {
         switch (scalar.getType()) {
             case BOOLEAN: return JsonBuilder.encode(scalar.getBoolean());
             case LONG:    return JsonBuilder.encode(scalar.getLong());
@@ -239,14 +239,16 @@ public class KernelNodeStateEditor imple
         throw new IllegalStateException("unreachable");  // Make javac happy
     }
 
-    private String encode(Iterable<Scalar> scalars) {
+    private static String encode(Iterable<Scalar> scalars) {
         StringBuilder sb = new StringBuilder();
         sb.append('[');
         for (Scalar scalar : scalars) {
             sb.append(encode(scalar));
             sb.append(',');
         }
-        sb.deleteCharAt(sb.length() - 1);
+        if (sb.length() > 1) {
+            sb.deleteCharAt(sb.length() - 1);
+        }
         sb.append(']');
         return sb.toString();
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientNodeState.java?rev=1324678&r1=1324677&r2=1324678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientNodeState.java
Wed Apr 11 09:51:08 2012
@@ -43,7 +43,7 @@ import static org.apache.jackrabbit.oak.
 
 /**
  * A transient node state represents a node being edited. All edit operations are
- * done through an associated {@link org.apache.jackrabbit.mk.model.NodeStateEditor}.
+ * done through an associated {@link org.apache.jackrabbit.oak.api.NodeStateEditor}.
  * <p>
  * A transient node state contains the current state of a node and is
  * in contrast to {@link org.apache.jackrabbit.mk.model.NodeState} instances



Mime
View raw message