{"record":{"id":"87cf34cc90a8f0ad","repo":"apache/maven","slug":"cannot-negate-non-numeric-value-value","errorCode":null,"errorMessage":"Cannot negate non-numeric value: ${value}","messagePattern":"Cannot negate non-numeric value: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java","lineNumber":448,"sourceCode":"        } else if (left instanceof Number leftNumber && right instanceof Number rightNumber) {\n            return leftNumber.doubleValue() + rightNumber.doubleValue();\n        } else {\n            throw new RuntimeException(\"Cannot add \" + left + \" and \" + right);\n        }\n    }\n\n    /**\n     * Negates a numeric value.\n     *\n     * @param value the value to negate\n     * @return the negated value\n     * @throws RuntimeException if the value cannot be negated\n     */\n    private Object negate(Object value) {\n        if (value instanceof Number number) {\n            return -number.doubleValue();\n        }\n        throw new RuntimeException(\"Cannot negate non-numeric value: \" + value);\n    }\n\n    /**\n     * Subtracts the right operand from the left operand.\n     *\n     * @param left the left operand\n     * @param right the right operand\n     * @return the result of the subtraction\n     * @throws RuntimeException if the operands cannot be subtracted\n     */\n    private static Object subtract(Object left, Object right) {\n        if (left instanceof Number leftNumber && right instanceof Number rightNumber) {\n            return leftNumber.doubleValue() - rightNumber.doubleValue();\n        } else {\n            throw new RuntimeException(\"Cannot subtract \" + right + \" from \" + left);\n        }\n    }\n","sourceCodeStart":430,"sourceCodeEnd":466,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java#L430-L466","documentation":"Error \"Cannot negate non-numeric value: ${value}\" thrown in apache/maven.","triggerScenarios":"Thrown at impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java:448 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"}