apache/maven · error · RuntimeException

Cannot multiply ${left} and ${right}

Error message

Cannot multiply ${left} and ${right}

What it means

Error "Cannot multiply ${left} and ${right}" thrown in apache/maven.

Source

Thrown at impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java:479

            return leftNumber.doubleValue() - rightNumber.doubleValue();
        } else {
            throw new RuntimeException("Cannot subtract " + right + " from " + left);
        }
    }

    /**
     * Multiplies two numeric operands.
     *
     * @param left the left operand
     * @param right the right operand
     * @return the result of the multiplication
     * @throws RuntimeException if the operands cannot be multiplied
     */
    private static Object multiply(Object left, Object right) {
        if (left instanceof Number leftNumber && right instanceof Number rightNumber) {
            return leftNumber.doubleValue() * rightNumber.doubleValue();
        } else {
            throw new RuntimeException("Cannot multiply " + left + " and " + right);
        }
    }

    /**
     * Divides the left operand by the right operand.
     *
     * @param left the left operand (dividend)
     * @param right the right operand (divisor)
     * @return the result of the division
     * @throws RuntimeException if the operands cannot be divided
     * @throws ArithmeticException if attempting to divide by zero
     */
    private static Object divide(Object left, Object right) {
        if (left instanceof Number leftNumber && right instanceof Number rightNumber) {
            double divisor = rightNumber.doubleValue();
            if (divisor == 0) {
                throw new ArithmeticException("Division by zero");
            }

View on GitHub (pinned to e4093d4e12)

When it happens

Trigger: Thrown at impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java:479 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21). Data as JSON: /api/errors/7b9786dc3448718d. Report an issue: GitHub.