dlmarion commented on code in PR #31:
URL: https://github.com/apache/accumulo-access/pull/31#discussion_r1462134251


##########
src/main/java/org/apache/accumulo/access/AccessExpression.java:
##########
@@ -34,70 +30,62 @@
  * var auth3 = AccessExpression.quote("🦖");
  * var visExp = AccessExpression
  *     .of("(" + auth1 + "&" + auth3 + ")|(" + auth1 + "&" + auth2 + "&" + 
auth1 + ")");
- * System.out.println(visExp.getExpression());
- * System.out.println(visExp.normalize());
- * System.out.println(visExp.getAuthorizations());
+ * System.out.println(visExp);
+ * System.out.println(AccessExpression.getAuthorizations(visExp));
  * }
  * </pre>
  *
  * The above example will print the following.
  *
  * <pre>
  * (CAT&amp;"🦖")|(CAT&amp;"🦕"&amp;CAT)
- * ("🦕"&amp;CAT)|("🦖"&amp;CAT)
  * [🦖, CAT, 🦕]
  * </pre>
  *
+ * The following code will throw an {@link IllegalAccessExpressionException} 
because the expression
+ * is not valid.
+ *
+ * <pre>
+ *     {@code
+ * AccessExpression.validate("A&B|C");
+ * }
+ * </pre>
+ *
+ *
  * @see <a href="https://github.com/apache/accumulo-access";>Accumulo Access 
Documentation</a>
  * @since 1.0.0
  */
 public interface AccessExpression {

Review Comment:
   Thinking about this more - if we moved the automatic quoting into the 
`normalize` method, then we could have just two ways for creating 
AccessExpression and maybe not need the builder.
   
   ```
   AccessExpression.of(String)
   AccessExpression.normalize(String)
   ```
   
   The callers uses `of()` when they want the AccessExpression to use the 
literal string that they supply - we only do validation. The caller uses 
`normalize()` when they want deduplication, sorting, quoting, and flattening.



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