jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1303940 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
Date Thu, 22 Mar 2012 18:04:09 GMT
Author: mduerig
Date: Thu Mar 22 18:04:09 2012
New Revision: 1303940

URL: http://svn.apache.org/viewvc?rev=1303940&view=rev
Log:
OAK-39: KernelNodeState does not handle boolean values correctly

Modified:
    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/KernelNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java?rev=1303940&r1=1303939&r2=1303940&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 Mar 22 18:04:09 2012
@@ -86,11 +86,15 @@ class KernelNodeState extends AbstractNo
                     childNodes.put(name, new KernelNodeState(
                             kernel, childPath, revision));
                 } else if (reader.matches(JsopTokenizer.NUMBER) ||
-                        reader.matches(JsopTokenizer.TRUE) ||
-                        reader.matches(JsopTokenizer.FALSE) ||
                         reader.matches(JsopTokenizer.STRING)) {
                     properties.put(name, new KernelPropertyState(
                             name, reader.getToken()));
+                } else if (reader.matches(JsopTokenizer.TRUE)) {
+                    properties.put(name, new KernelPropertyState(
+                            name, "true"));
+                } else if (reader.matches(JsopTokenizer.FALSE)) {
+                    properties.put(name, new KernelPropertyState(
+                            name, "false"));
                 } else if (reader.matches('[')) {
                     properties.put(name, new KernelPropertyState(
                             name, readArray(reader)));
@@ -210,17 +214,20 @@ class KernelNodeState extends AbstractNo
         StringBuilder sb = new StringBuilder("[");
         String sep = "";
         while (!reader.matches(']')) {
+            String v;
             if (reader.matches(JsopTokenizer.NUMBER) ||
-                    reader.matches(JsopTokenizer.TRUE) ||
-                    reader.matches(JsopTokenizer.FALSE) ||
                     reader.matches(JsopTokenizer.STRING)) {
-                sb.append(sep);
-                sep = ",";
-                sb.append(reader.getToken());
-            }
-            else {
+                v = reader.getToken();
+            } else if (reader.matches(JsopTokenizer.TRUE)) {
+                v = "true";
+            } else if (reader.matches(JsopTokenizer.FALSE)) {
+                v = "false";
+            } else {
                 throw new IllegalArgumentException("Unexpected token: " + reader.getToken());
             }
+            sb.append(sep);
+            sep = ",";
+            sb.append(v);
             reader.matches(',');
         }
         sb.append(']');



Mime
View raw message