{"record":{"id":"619bf3d5c4e6e290","repo":"oracle/graal","slug":"feature-unsupported-in-version","errorCode":null,"errorMessage":"Feature unsupported in version ","messagePattern":"Feature unsupported in version ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/GraphOutput.java","lineNumber":216,"sourceCode":"            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) {\n                if (major < reqMajor || (major == reqMajor && minor < reqMinor)) {\n                    throw new IllegalStateException(\"Feature unsupported in version \" + major + \".\" + minor);\n                }\n            } else {\n                if (major < reqMajor) {\n                    major = reqMajor;\n                    minor = reqMinor;\n                } else if (major == reqMajor) {\n                    minor = Math.max(minor, reqMinor);\n                }\n            }\n        }\n\n        /**\n         * Sets {@link GraphOutput} as embedded. The embedded {@link GraphOutput} shares\n         * {@link WritableByteChannel channel} with another already open non parent\n         * {@link GraphOutput}. The embedded {@link GraphOutput} flushes data after each\n         * {@link GraphOutput#print print}, {@link GraphOutput#beginGroup beginGroup} and\n         * {@link GraphOutput#endGroup endGroup} call.\n         *","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/GraphOutput.java#L198-L234","documentation":"GraphOutput.Builder.requireVersion(int,int) is called internally when a feature needs a minimum graph-dumping protocol version. If the user explicitly pinned a version with protocolVersion(), that pin is authoritative; using a feature that needs a newer protocol then throws IllegalStateException('Feature unsupported in version X.Y'). Without an explicit pin the builder silently auto-upgrades, so this error only occurs for pinned configurations.","triggerScenarios":"Calling builder.protocolVersion(6, 0) and then enabling a feature whose requireVersion needs 7.x (e.g. dump properties via startDocument). Building a GraphOutput for an embedded/legacy consumer that forces an old version, then dumping graphs that exercise newer protocol elements.","commonSituations":"Supporting an old Ideal Graph Visualizer client by pinning the protocol, while the dumping code uses newer APIs. Library upgrades that raise feature requirements past a version the integrator pinned years ago. Partial migration: some dump sites updated to new features, pin left in place.","solutions":["Remove the explicit protocolVersion() pin so the builder can auto-upgrade to what the features need.","Raise the pin to at least the version named by the failing feature's requirement (e.g. 7.0 for dump properties).","Drop the feature that requires the newer protocol from your dumping path when the old pinned client must be supported.","Update the consuming tool (IGV) to a release that understands the newer protocol, then unpin."],"exampleFix":"// before\nbuilder.protocolVersion(6, 0).build();\noutput.startDocument(props); // needs v7 -> IllegalStateException\n\n// after\nbuilder.protocolVersion(7, 0).build();\noutput.startDocument(props);","handlingStrategy":"validation","validationCode":"// know the feature floors: dump properties need 7.0. If you must pin, pin at/above every feature you use:\nbuilder.protocolVersion(7, 0); // >= 7.0 for startDocument properties","typeGuard":null,"tryCatchPattern":"try {\n    output.startDocument(props);\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"Feature unsupported\")) {\n        // rebuild output without the pin or without this feature\n    } else throw e;\n}","preventionTips":["When pinning a protocol version, audit every dumping API you call against its version requirement.","After upgrading Graal/graphio, re-run dump-enabled tests to catch newly-raised floors."],"tags":["java","graal","graphio","protocol-version","dumping","feature-detection"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}