jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1151776 - in /jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel: RepositoryServiceImpl.java util/Values.java
Date Thu, 28 Jul 2011 09:37:13 GMT
Author: mduerig
Date: Thu Jul 28 09:37:12 2011
New Revision: 1151776

URL: http://svn.apache.org/viewvc?rev=1151776&view=rev
Log:
spi2microkernel (WIP)
- clean up value encoding 

Modified:
    jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.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/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java?rev=1151776&r1=1151775&r2=1151776&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
Thu Jul 28 09:37:12 2011
@@ -80,14 +80,12 @@ import java.util.Set;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ConcurrentHashMap;
 
-import static javax.jcr.PropertyType.NAME;
 import static javax.jcr.Repository.*;
 import static org.apache.jackrabbit.spi.commons.name.NameConstants.*;
 import static org.apache.jackrabbit.spi2microkernel.util.Arrays.contains;
 import static org.apache.jackrabbit.spi2microkernel.util.ItemInfos.*;
 import static org.apache.jackrabbit.spi2microkernel.util.Predicates.containsElement;
 import static org.apache.jackrabbit.spi2microkernel.util.Predicates.exists;
-import static org.apache.jackrabbit.spi2microkernel.util.Values.encodeValue;
 
 public class RepositoryServiceImpl extends AbstractRepositoryService {
     static final Logger log = LoggerFactory.getLogger(RepositoryServiceImpl.class);
@@ -538,7 +536,7 @@ public class RepositoryServiceImpl exten
             try {
                 StringBuilder sb = new StringBuilder();
                 JsonBuilder.create(sb)
-                    .value(Paths.nameToString(JCR_PRIMARYTYPE), encodeValue(NAME, nodetypeName.toString()))
 
+                    .valueEncoded(Paths.nameToString(JCR_PRIMARYTYPE), Values.nameToString(nodetypeName))
                     .build();
 
                 jsop.append('+').append(target(parentId, nodeName)).append(" : ").append(sb.toString()).append('\n');

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=1151776&r1=1151775&r2=1151776&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 Jul 28 09:37:12 2011
@@ -355,10 +355,6 @@ public final class Values {
         return sb.toString();
     }
 
-    public static String encodeValue(int type, String value) {
-        return TYPES[type] + ":" + value;
-    }
-
     //------------------------------------------< private >---
 
     private static Character toHex(int i) {
@@ -368,7 +364,7 @@ public final class Values {
     }
 
     private static String quoteAndEncode(int type, String value) {
-        return '\"' + encodeValue(type, value) + '\"';
+        return "\"" + TYPES[type] + ':' + value + '\"';
     }
 
     private static QValue create(boolean value) {



Mime
View raw message