apache/maven · error · RuntimeException

Cannot divide ${left} by ${right}

Error message

Cannot divide ${left} by ${right}

What it means

Error "Cannot divide ${left} by ${right}" thrown in apache/maven.

Source

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

    /**
     * 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");
            }
            return leftNumber.doubleValue() / divisor;
        } else {
            throw new RuntimeException("Cannot divide " + left + " by " + right);
        }
    }

    /**
     * Compares two objects based on the given operator.
     * Supports comparison of numbers and strings, and equality checks for null values.
     *
     * @param left the left operand
     * @param operator the comparison operator (">", "<", ">=", "<=", "==", or "!=")
     * @param right the right operand
     * @return the result of the comparison (a boolean value)
     * @throws IllegalStateException if an unknown operator is provided
     * @throws RuntimeException if the operands cannot be compared
     */
    private static Object compare(Object left, String operator, Object right) {
        if (left == null && right == null) {
            return true;
        }

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:500 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/e38a9577398463d0. Report an issue: GitHub.