{"record":{"id":"0a36c3a97d2941d0","repo":"oracle/graal","slug":"versions-must-not-be-negative","errorCode":null,"errorMessage":"Versions must not be negative.","messagePattern":"Versions must not be negative\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdk/src/org.graalvm.home/src/org/graalvm/home/Version.java","lineNumber":394,"sourceCode":"    }\n\n    /**\n     * Constructs a new GraalVM version from a list of version numbers. The versions must not be\n     * <code>null</code> and none of the version numbers must be negative. At least one version\n     * number must be non-zero.\n     *\n     * @see #compareTo(int...)\n     * @since 19.3\n     */\n    public static Version create(int... versions) throws IllegalArgumentException {\n        Objects.requireNonNull(versions);\n        int[] useVersions = trimTrailingZeros(versions);\n        if (useVersions.length == 0) {\n            throw new IllegalArgumentException(\"At least one non-zero version must be specified.\");\n        }\n        for (int i = 0; i < useVersions.length; i++) {\n            if (useVersions[i] < 0) {\n                throw new IllegalArgumentException(\"Versions must not be negative.\");\n            }\n        }\n        return new Version(useVersions);\n    }\n\n    /**\n     * Returns the current GraalVM version of the installed component. Never <code>null</code>.\n     *\n     * @see HomeFinder#getVersion()\n     * @since 19.3\n     */\n    public static Version getCurrent() {\n        return parse(HomeFinder.getInstance().getVersion());\n    }\n\n}\n","sourceCodeStart":376,"sourceCodeEnd":411,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/sdk/src/org.graalvm.home/src/org/graalvm/home/Version.java#L376-L411","documentation":"Error \"Versions must not be negative.\" thrown in oracle/graal.","triggerScenarios":"Thrown at sdk/src/org.graalvm.home/src/org/graalvm/home/Version.java:394 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Versions must not be negative.","solutions":["Fix the condition reported by the error: Versions must not be negative.","Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call."],"exampleFix":"Validate inputs and environment so that the failing condition does not occur: Versions must not be negative.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}