ExpressionDecomposer: Correct the JavaDoc for exposeExpression
The JavaDoc should encourage use of maybeExposeExpression() and discourage use
of exposeExpression().
@@ -98,10 +98,16 @@ class ExpressionDecomposer {
private static final int MAX_ITERATIONS = 100;
/**
- * If required, rewrite the statement containing the expression.
+ * Perform any rewriting necessary so that the specified expression is {@code MOVABLE}.
*
- * @param expression The expression to be exposed.
- * @see #canExposeExpression
+ * <p>This method is a primary entrypoint into this class. It performs expression decomposition
+ * such that {@code expression} can be moved to a preceding statement without changing behaviour.
+ *
+ * <p>Exposing {@code expression} generally doesn't mean that {@code expression} itself will
+ * moved. An expression is exposed within a larger statement if no preceding expression would
+ * interact with it.
+ *
+ * @see {@link #canExposeExpression}
*/
void maybeExposeExpression(Node expression) {
// If the expression needs to exposed.
@@ -117,17 +123,10 @@ class ExpressionDecomposer {
}
/**
- * Perform any rewriting necessary so that the specified expression is {@code MOVABLE}.
- *
- * <p>This method is a primary entrypoint into this class. It performs a partial expression
- * decomposition such that {@code expression} can be moved to a preceding statement without
- * changing behaviour.
+ * Perform partial decomposition to get the given expression closer to being {@code MOVEABLE}.
*
- * <p>Exposing {@code expression} generally doesn't mean that {@code expression} itself will
- * moved. An expression is exposed within a larger statement if no preceding expression would
- * interact with it.
- *
- * @see {@link #canExposeExpression}
+ * <p>This method should not be called from outside of this class. Instead call {@link
+ * #maybeExposeExpression(Node)}.
*/
void exposeExpression(Node expression) {
Node expressionRoot = findExpressionRoot(expression);
