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:
Note that this only test code.
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]