reschke commented on code in PR #1516:
URL: https://github.com/apache/jackrabbit-oak/pull/1516#discussion_r1634507096


##########
oak-store-spi/src/main/java/org/apache/jackrabbit/oak/json/JsonDeserializer.java:
##########
@@ -240,9 +239,10 @@ boolean hasOrderableChildren(NodeBuilder builder) {
         }
 
         private boolean hasSingleColon(String jsonString) {
-            //In case the primaryType was encoded then it would be like 
nam:oak:Unstructured
-            //So check if there is only one occurrence of ';'
-            return CharMatcher.is(':').countIn(jsonString) == 1;
+            // In case the primaryType was encoded then it would be like
+            // "nam:oak:Unstructured". So check if there is only one occurrence
+            // of ':'.
+            return jsonString.replace(":", "").length() == jsonString.length() 
- 1;

Review Comment:
   (I somehow thought that this was just test code, but I was wrong; thanks for 
pointing it out)
   
   Of course we could just walk the string until the end and count the colons.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to