{"record":{"id":"514ee6bef822cbff","repo":"apache/maven","slug":"cannot-add-left-and-right","errorCode":null,"errorMessage":"Cannot add ${left} and ${right}","messagePattern":"Cannot add (.+?) and (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java","lineNumber":433,"sourceCode":"        current++; // Skip the closing parenthesis\n        return result;\n    }\n\n    /**\n     * Adds two objects, handling string concatenation and numeric addition.\n     *\n     * @param left the left operand\n     * @param right the right operand\n     * @return the result of the addition\n     * @throws RuntimeException if the operands cannot be added\n     */\n    private static Object add(Object left, Object right) {\n        if (left instanceof String || right instanceof String) {\n            return toString(left) + toString(right);\n        } 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    /**","sourceCodeStart":415,"sourceCodeEnd":451,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java#L415-L451","documentation":"Error \"Cannot add ${left} and ${right}\" thrown in apache/maven.","triggerScenarios":"Thrown at impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java:433 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"}