{"record":{"id":"8445792a6c668ec6","repo":"apache/maven","slug":"division-by-zero","errorCode":null,"errorMessage":"Division by zero","messagePattern":"Division by zero","errorType":"exception","errorClass":"ArithmeticException","httpStatus":null,"severity":"error","filePath":"impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java","lineNumber":496,"sourceCode":"        } else {\n            throw new RuntimeException(\"Cannot multiply \" + left + \" and \" + right);\n        }\n    }\n\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     */","sourceCodeStart":478,"sourceCodeEnd":514,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java#L478-L514","documentation":"Error \"Division by zero\" thrown in apache/maven.","triggerScenarios":"Thrown at impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java:496 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"}