mihaibudiu commented on code in PR #3536:
URL: https://github.com/apache/calcite/pull/3536#discussion_r1399565253


##########
core/src/main/java/org/apache/calcite/rex/RexChecker.java:
##########
@@ -31,31 +31,24 @@
 /**
  * Visitor which checks the validity of a {@link RexNode} expression.
  *
- * <p>There are two modes of operation:
- *
+ * <p>This visitor can operate in two modes, controlled by the {@link Litmus} 
argument:
  * <ul>
- * <li>Use<code>fail=true</code> to throw an {@link AssertionError} as soon as
- * an invalid node is detected:
- *
- * <blockquote><code>RexNode node;<br>
- * RelDataType rowType;<br>
- * assert new RexChecker(rowType, true).isValid(node);</code></blockquote>
- *
- * <p>This mode requires that assertions are enabled.</li>
- *
- * <li>Use <code>fail=false</code> to test for validity without throwing an
- * error.
- *
- * <blockquote><code>RexNode node;<br>
- * RelDataType rowType;<br>
- * RexChecker checker = new RexChecker(rowType, false);<br>
- * node.accept(checker);<br>
- * if (!checker.valid) {<br>
- * &nbsp;&nbsp;&nbsp;...<br>
- * }</code></blockquote>
- * </li>
+ * <li>{@link Litmus#THROW} causes the checker to throw an {@link 
AssertionError}
+ * as soon as an invalid node is detected. Note: This mode requires that 
assertions are enabled.</li>
+ * <li>{@link Litmus#IGNORE} tests validity without throwing an error.</li>
  * </ul>
  *
+ * <p>Example usage:
+ * <blockquote><pre>
+ * RexNode node;
+ * RelDataType rowType;
+ * RexChecker checker = new RexChecker(rowType, Litmus.IGNORE);
+ * node.accept(checker);
+ * if (!checker.isValid()) {

Review Comment:
   The original javadoc had two examples, whereas here there is only one.
   I do find that the assert-based example is useful.
   



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