You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2019/11/03 13:29:45 UTC

[GitHub] [commons-collections] melloware commented on a change in pull request #99: [COLLECTIONS-714] Throw exception when put \u0000 to trie

melloware commented on a change in pull request #99: [COLLECTIONS-714] Throw exception when put \u0000 to trie
URL: https://github.com/apache/commons-collections/pull/99#discussion_r341851667
 
 

 ##########
 File path: src/main/java/org/apache/commons/collections4/trie/analyzer/StringKeyAnalyzer.java
 ##########
 @@ -82,6 +82,9 @@ public int bitIndex(final String key, final int offsetInBits, final int lengthIn
                 k = 0;
             } else {
                 k = key.charAt(index1);
+                if (k == 0) {
+                    throw new IllegalArgumentException("Don't support '\\u0000' in the key.");
+                }
 
 Review comment:
   A better message might be "Character '\\u0000' is not supported in the key."

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services