You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "garydgregory (via GitHub)" <gi...@apache.org> on 2024/10/21 12:59:04 UTC

Re: [PR] [COLLECTIONS-714] Throw exception when put \u0000 to trie [commons-collections]

garydgregory commented on code in PR #99:
URL: https://github.com/apache/commons-collections/pull/99#discussion_r1808769349


##########
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:
   Could/Should this method be rewritten to allow char 0 instead?



-- 
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: issues-unsubscribe@commons.apache.org

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