jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1336698 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel: CoreValueMapper.java KernelNodeState.java
Date Thu, 10 May 2012 14:00:49 GMT
Author: thomasm
Date: Thu May 10 14:00:48 2012
New Revision: 1336698

URL: http://svn.apache.org/viewvc?rev=1336698&view=rev
Log:
OAK-73 JsopReader

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/CoreValueMapper.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/CoreValueMapper.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/CoreValueMapper.java?rev=1336698&r1=1336697&r2=1336698&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/CoreValueMapper.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/CoreValueMapper.java
Thu May 10 14:00:48 2012
@@ -18,7 +18,6 @@ package org.apache.jackrabbit.oak.kernel
 
 import org.apache.jackrabbit.mk.json.JsonBuilder;
 import org.apache.jackrabbit.mk.json.JsopReader;
-import org.apache.jackrabbit.mk.json.JsopTokenizer;
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
 
@@ -39,7 +38,7 @@ class CoreValueMapper {
 
     static {
         for (int type = PropertyType.UNDEFINED; type <= PropertyType.DECIMAL; type++)
{
-            String hint = PropertyType.nameFromValue(type).substring(0,3).toLowerCase();
+            String hint = PropertyType.nameFromValue(type).substring(0, 3).toLowerCase();
             TYPE2HINT.put(type, hint);
             HINT2TYPE.put(hint, type);
         }
@@ -119,17 +118,17 @@ class CoreValueMapper {
      */
     public static CoreValue fromJsopReader(JsopReader reader, CoreValueFactory valueFactory)
{
         CoreValue value;
-        if (reader.matches(JsopTokenizer.NUMBER)) {
+        if (reader.matches(JsopReader.NUMBER)) {
             String number = reader.getToken();
             value = valueFactory.createValue(Long.valueOf(number));
-        } else if (reader.matches(JsopTokenizer.TRUE)) {
+        } else if (reader.matches(JsopReader.TRUE)) {
             value = valueFactory.createValue(true);
-        } else if (reader.matches(JsopTokenizer.FALSE)) {
+        } else if (reader.matches(JsopReader.FALSE)) {
             value = valueFactory.createValue(false);
-        } else if (reader.matches(JsopTokenizer.STRING)) {
+        } else if (reader.matches(JsopReader.STRING)) {
             String jsonString = reader.getToken();
             if (startsWithHint(jsonString)) {
-                int type = HINT2TYPE.get(jsonString.substring(0,3));
+                int type = HINT2TYPE.get(jsonString.substring(0, 3));
                 value = valueFactory.createValue(jsonString.substring(4), type);
             } else {
                 value = valueFactory.createValue(jsonString);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java?rev=1336698&r1=1336697&r2=1336698&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
Thu May 10 14:00:48 2012
@@ -60,7 +60,8 @@ class KernelNodeState extends AbstractNo
 
     private long childNodeCount = -1;
 
-    private Map<String, NodeState> childNodes; // TODO: WeakReference?
+    // TODO: WeakReference?
+    private Map<String, NodeState> childNodes;
 
     /**
      * Create a new instance of this class representing the node at the
@@ -93,7 +94,7 @@ class KernelNodeState extends AbstractNo
                 reader.read(':');
                 if (":childNodeCount".equals(name)) {
                     childNodeCount =
-                            Long.valueOf(reader.read(JsopTokenizer.NUMBER));
+                            Long.valueOf(reader.read(JsopReader.NUMBER));
                 } else if (reader.matches('{')) {
                     reader.read('}');
                     String childPath = path + '/' + name;
@@ -109,7 +110,7 @@ class KernelNodeState extends AbstractNo
                 }
             } while (reader.matches(','));
             reader.read('}');
-            reader.read(JsopTokenizer.END);
+            reader.read(JsopReader.END);
         }
     }
 
@@ -152,7 +153,7 @@ class KernelNodeState extends AbstractNo
 
     @Override
     public Iterable<? extends ChildNodeEntry> getChildNodeEntries() {
-        return (new Iterable<ChildNodeEntry>() {
+        return new Iterable<ChildNodeEntry>() {
             @Override
             public Iterator<ChildNodeEntry> iterator() {
                 return Iterators.flatten(
@@ -163,7 +164,7 @@ class KernelNodeState extends AbstractNo
                         }
                 });
             }
-        });
+        };
     }
 
     //------------------------------------------------------------< internal >---
@@ -188,8 +189,7 @@ class KernelNodeState extends AbstractNo
             if (childNodeCount > count) {
                 throw new RuntimeException("Too many child nodes");
             }
-        }
-        else {
+        } else {
             all = false;
         }
 
@@ -229,7 +229,7 @@ class KernelNodeState extends AbstractNo
                 }
             } while (reader.matches(','));
             reader.read('}');
-            reader.read(JsopTokenizer.END);
+            reader.read(JsopReader.END);
         }
 
         return entries.iterator();



Mime
View raw message