{"record":{"id":"e38a9577398463d0","repo":"apache/maven","slug":"cannot-divide-left-by-right","errorCode":null,"errorMessage":"Cannot divide ${left} by ${right}","messagePattern":"Cannot divide (.+?) by (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java","lineNumber":500,"sourceCode":"\n    /**\n     * Divides the left operand by the right operand.\n     *\n     * @param left the left operand (dividend)\n     * @param right the right operand (divisor)\n     * @return the result of the division\n     * @throws RuntimeException if the operands cannot be divided\n     * @throws ArithmeticException if attempting to divide by zero\n     */\n    private static Object divide(Object left, Object right) {\n        if (left instanceof Number leftNumber && right instanceof Number rightNumber) {\n            double divisor = rightNumber.doubleValue();\n            if (divisor == 0) {\n                throw new ArithmeticException(\"Division by zero\");\n            }\n            return leftNumber.doubleValue() / divisor;\n        } else {\n            throw new RuntimeException(\"Cannot divide \" + left + \" by \" + right);\n        }\n    }\n\n    /**\n     * Compares two objects based on the given operator.\n     * Supports comparison of numbers and strings, and equality checks for null values.\n     *\n     * @param left the left operand\n     * @param operator the comparison operator (\">\", \"<\", \">=\", \"<=\", \"==\", or \"!=\")\n     * @param right the right operand\n     * @return the result of the comparison (a boolean value)\n     * @throws IllegalStateException if an unknown operator is provided\n     * @throws RuntimeException if the operands cannot be compared\n     */\n    private static Object compare(Object left, String operator, Object right) {\n        if (left == null && right == null) {\n            return true;\n        }","sourceCodeStart":482,"sourceCodeEnd":518,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java#L482-L518","documentation":"Error \"Cannot divide ${left} by ${right}\" thrown in apache/maven.","triggerScenarios":"Thrown at impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java:500 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}