{"record":{"id":"45614661f7981bb4","repo":"oracle/graal","slug":"cannot-downgrade-from-minimum-required-version","errorCode":null,"errorMessage":"Cannot downgrade from minimum required version ","messagePattern":"Cannot downgrade from minimum required version ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/GraphOutput.java","lineNumber":196,"sourceCode":"         * changed to other known versions manually by calling this method.\n         * <p>\n         * Note: the default version is 7.0 since version 20.2. Previous versions used default\n         * version 4.0\n         *\n         * @param majorVersion by default 7, newer version may be known\n         * @param minorVersion usually 0\n         * @return this builder\n         * @since 0.28\n         */\n        public Builder<G, N, M> protocolVersion(int majorVersion, int minorVersion) {\n            assert majorVersion >= 1 : \"Major must be positive\";\n            assert minorVersion >= 0 : \"Minor must not be negative\";\n\n            if (!(explicitVersionSet ||\n                            (majorVersion == 0) ||\n                            (majorVersion > major) ||\n                            ((majorVersion == major) && (minorVersion >= minor)))) {\n                throw new IllegalArgumentException(\"Cannot downgrade from minimum required version \" + (-major) + \".\" + minor);\n            }\n            this.major = majorVersion;\n            this.minor = minorVersion;\n            explicitVersionSet = true;\n            return this;\n        }\n\n        /**\n         * Asserts a specific version of the protocol. If not specified explicitly, upgrades the\n         * protocol version.\n         *\n         * @param reqMajor The required major version\n         * @param reqMinor the required minor version\n         */\n        private void requireVersion(int reqMajor, int reqMinor) {\n            assert reqMajor >= 1 : \"Major must be positive\";\n            assert reqMinor >= 0 : \"Minor must not be negative\";\n            if (explicitVersionSet) {","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/GraphOutput.java#L178-L214","documentation":"GraphOutput.Builder negotiates the graph-dumping protocol version. Once a minimum version has been required (by builder features such as pool-methods or dump-properties support), protocolVersion() rejects any request below that minimum with IllegalArgumentException. The message prints the minimum as (-major) + '.' + minor because the stored 'major' is negative while only a floor is set — the intent is 'cannot go below the required floor'.","triggerScenarios":"Calling builder.protocolVersion(m, n) with a version lower than one already required by earlier builder configuration, or calling protocolVersion twice with a descending second value after an explicit set. Using a pre-configured builder (e.g. one that already required version 6+ for .withPoolSupport or similar) and then pinning 5.0.","commonSituations":"Integrating GraphOutput with an older Ideal Graph Visualizer (IGV) and pinning a low protocol version, while the surrounding setup code already demanded a newer one. Copying version-pinning snippets between projects with different library versions. Upgrading the compiler library, which raises the internal minimum, without updating the pinned version.","solutions":["Raise the pinned version to at least the required minimum (the failing message tells you the floor).","Remove the explicit protocolVersion() call and let the builder auto-upgrade to the highest mutually supported version.","Set the version first, before adding features that requireVersion(), so the floor is not raised behind your back.","Pair the change with a matching IGV/tooling version that understands the newer protocol."],"exampleFix":"// before\nGraphOutput.Builder b = new GraphOutput.Builder<>(...).withPoolSupport(...);\nb.protocolVersion(5, 0); // IllegalArgumentException: below required floor\n\n// after\nb.protocolVersion(6, 0); // meet the floor, or drop the call entirely","handlingStrategy":"validation","validationCode":"// Do not pin below the floor your builder features impose; simplest safe policy is no pin at all:\nGraphOutput<G, N, M> out = new GraphOutput.Builder<G, N, M>(sparseCloneTable, blocksTable, typesTable, methodsTable)\n        .build(); // auto-upgrades as features require","typeGuard":null,"tryCatchPattern":"try {\n    builder.protocolVersion(major, minor);\n} catch (IllegalArgumentException e) {\n    // e.getMessage() names the required floor; adopt it or drop the pin\n    builder.protocolVersion(Integer.parseInt(e.getMessage().replaceAll(\"[^0-9.].*\", \"\").split(\"\\\\.\")[0]), 0);\n}","preventionTips":["Call protocolVersion() before enabling any feature that raises the version floor.","Never copy version pins between projects without checking each library's floor.","Prefer omitting the pin unless an old IGV client truly requires it."],"tags":["java","graal","graphio","protocol-version","dumping","igv","configuration"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}