jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1133776 - in /jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util: Json.java Values.java
Date Thu, 09 Jun 2011 10:23:40 GMT
Author: thomasm
Date: Thu Jun  9 10:23:40 2011
New Revision: 1133776

URL: http://svn.apache.org/viewvc?rev=1133776&view=rev
Log:
Fix quoting.

Modified:
    jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Json.java
    jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Values.java

Modified: jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Json.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Json.java?rev=1133776&r1=1133775&r2=1133776&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Json.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Json.java
Thu Jun  9 10:23:40 2011
@@ -104,7 +104,7 @@ public final class Json {
     public static PropertyInfo buildPropertyInfo(Path path, String json) throws RepositoryException
{
         final Name name = path.getName();
         final PropertyInfo[] propertyInfos = new PropertyInfo[1];
-        
+
         InfoListener infoListener = new InfoListener() {
             public void createNodeInfo(NodeInfo nodeInfo) {}
             public void createChildInfos(NodeId id, Iterator<ChildInfo> childInfos)
{}
@@ -126,7 +126,7 @@ public final class Json {
             return propertyInfos[0];
         }
         catch (ParseException e) {
-            throw new RepositoryException(e.getMessage(), e);
+            throw new RepositoryException(json + " " + e.getMessage(), e);
         }
     }
 
@@ -139,7 +139,7 @@ public final class Json {
     private static Path parent(Path path) throws RepositoryException {
         return path.denotesRoot() ? null : path.getAncestor(1);
     }
-    
+
     private static class JsonHandler extends JsonHandlerBase {
         private final Path parent;
         private final InfoListener infoListener;
@@ -220,15 +220,6 @@ public final class Json {
             }
         }
 
-        @Override
-        public boolean startArray() throws ParseException, IOException {
-            throw new ParseException(3, "Array not expected");
-        }
-
-        @Override
-        public boolean endArray() throws ParseException, IOException {
-            throw new ParseException(3, "Array not expected");
-        }
     }
-    
+
 }
\ No newline at end of file

Modified: jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Values.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Values.java?rev=1133776&r1=1133775&r2=1133776&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Values.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Values.java
Thu Jun  9 10:23:40 2011
@@ -86,7 +86,7 @@ public final class Values {
     public static String create(QValue value) throws RepositoryException {
         switch(value.getType()) {
             case PropertyType.STRING:
-                return JsonBuilder.escape(value.getString());
+                return JsonBuilder.quote(value.getString());
 
             case PropertyType.LONG:
             case PropertyType.DOUBLE:
@@ -131,7 +131,7 @@ public final class Values {
         }
         catch (RepositoryException e) {
             // Should not happen
-            throw new IllegalStateException(e.getMessage(), e);  
+            throw new IllegalStateException(e.getMessage(), e);
         }
     }
 



Mime
View raw message