This is an automated email from the ASF dual-hosted git repository.

mbudiu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite.git


The following commit(s) were added to refs/heads/main by this push:
     new a7cc2bb9ab [MINOR] Update javadoc for RexChecker with Litmus argument
a7cc2bb9ab is described below

commit a7cc2bb9abd83cea1dea5a7ad29ef673c916bab6
Author: Rob D'Hondt <[email protected]>
AuthorDate: Sun Nov 19 13:36:05 2023 -0500

    [MINOR] Update javadoc for RexChecker with Litmus argument
---
 .../java/org/apache/calcite/rex/RexChecker.java    | 43 +++++++++++-----------
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/core/src/main/java/org/apache/calcite/rex/RexChecker.java 
b/core/src/main/java/org/apache/calcite/rex/RexChecker.java
index edf9b2bc63..1ecf8ea767 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexChecker.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexChecker.java
@@ -31,28 +31,29 @@ import static java.util.Objects.requireNonNull;
 /**
  * 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>{@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.
+ * <blockquote><pre>
+ * // Example usage of Litmus.THROW
+ * RexNode node;
+ * RelDataType rowType;
+ * RexChecker checker = new RexChecker(rowType, Litmus.THROW);
+ * node.accept(checker); // Will throw an AssertionError if node is invalid
+ * </pre></blockquote>
+ * </li>
+ * <li>{@link Litmus#IGNORE} tests validity without throwing an error.
+ * <blockquote><pre>
+ * // Example usage of Litmus.IGNORE
+ * RexNode node;
+ * RelDataType rowType;
+ * RexChecker checker = new RexChecker(rowType, Litmus.IGNORE);
+ * node.accept(checker);
+ * if (!checker.isValid()) {
+ *     // Handle invalid node
+ * }
+ * </pre></blockquote>
  * </li>
  * </ul>
  *

Reply via email to