ctubbsii commented on code in PR #104:
URL: https://github.com/apache/accumulo-access/pull/104#discussion_r2914867607


##########
modules/core/src/test/java/org/apache/accumulo/access/tests/AccessEvaluatorTest.java:
##########
@@ -200,8 +202,16 @@ public void testQuote() {
     assertEquals("九", access.unquote(access.quote("九")));
     assertEquals("\"五十\"", access.quote("五十"));
     assertEquals("五十", access.unquote(access.quote("五十")));
+
     assertThrows(IllegalArgumentException.class, () -> access.quote(""));
-    assertThrows(IllegalArgumentException.class, () -> access.unquote(""));
+    for (var illegalInput : List.of("", "\"\"", "\"", "AB\"", "\"AB")) {
+      assertThrows(IllegalArgumentException.class, () -> 
access.unquote(illegalInput),
+          illegalInput);
+      // test with an input that is not a string
+      CharSequence charSeq = new CharsWrapper(illegalInput.toCharArray());

Review Comment:
   Your solution was better. I didn't realize CharBuffer.wrap already did what 
I was suggesting.



##########
modules/core/src/main/java/org/apache/accumulo/access/impl/CharsWrapper.java:
##########
@@ -26,7 +26,7 @@ public final class CharsWrapper implements CharSequence {
   private int offset;
   private int len;
 
-  CharsWrapper(char[] wrapped) {
+  public CharsWrapper(char[] wrapped) {

Review Comment:
   Your solution was better. I didn't realize CharBuffer.wrap already did what 
I was suggesting.



-- 
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]

Reply via email to