{"record":{"id":"96406c034c3bfb96","repo":"apache/maven","slug":"cannot-convert-to-integer-value","errorCode":null,"errorMessage":"Cannot convert to integer: {value}","messagePattern":"Cannot convert to integer: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java","lineNumber":651,"sourceCode":"     */\n    public static int toInt(Object value) {\n        if (value instanceof Number number) {\n            return number.intValue(); // Converts number to int\n        } else if (value instanceof String string) {\n            try {\n                return Integer.parseInt(string); // Tries to parse string as int\n            } catch (NumberFormatException e) {\n                // If string is not an int, tries parsing as double and converting to int\n                try {\n                    return (int) Double.parseDouble((String) value);\n                } catch (NumberFormatException e2) {\n                    throw new RuntimeException(\"Cannot convert string to integer: \" + value);\n                }\n            }\n        } else if (value instanceof Boolean bool) {\n            return bool ? 1 : 0; // True = 1, False = 0\n        } else {\n            throw new RuntimeException(\"Cannot convert to integer: \" + value);\n        }\n    }\n}\n","sourceCodeStart":633,"sourceCodeEnd":655,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java#L633-L655","documentation":"Error \"Cannot convert to integer: {value}\" thrown in apache/maven.","triggerScenarios":"Thrown at impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java:651 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"}