{"record":{"id":"d446111e696c8690","repo":"oracle/graal","slug":"the-s-is-not-a-valid-performance-warning-kind","errorCode":null,"errorMessage":"The \"%s\" is not a valid performance warning kind. Valid values are%n","messagePattern":"The \"(.+?)\" is not a valid performance warning kind\\. Valid values are%n","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/TruffleCompilerOptions.java","lineNumber":113,"sourceCode":"                for (String name : value.split(\",\")) {\n                    if (\"bailout\".equals(name)) {\n                        /*\n                         * The PerformanceWarningKind.BAILOUT was removed but 'bailout' can still\n                         * appear in option value due to backward compatibility. We need to ignore\n                         * the 'bailout' option value.\n                         */\n                        continue;\n                    }\n                    try {\n                        result.add(PerformanceWarningKind.forName(name));\n                    } catch (IllegalArgumentException e) {\n                        String message = String.format(\"The \\\"%s\\\" is not a valid performance warning kind. Valid values are%n\", name);\n                        for (PerformanceWarningKind kind : PerformanceWarningKind.values()) {\n                            message = message + String.format(\"%s%s%s%n\", kind.name, indent(kind.name.length()), kind.help);\n                        }\n                        message = message + String.format(\"all%sEnables all performance warnings%n\", indent(3));\n                        message = message + String.format(\"none%sDisables performance warnings%n\", indent(4));\n                        throw new IllegalArgumentException(message);\n                    }\n                }\n                return result;\n            }\n        }\n\n    }\n\n    public record CompilationTiers(Set<CompilationTier> tiers) {\n\n        public static CompilationTiers defaultValue() {\n            return new CompilationTiers(Set.of());\n        }\n\n        public static CompilationTiers parse(String s) {\n            return new CompilationTiers(parseImpl(s));\n        }\n","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/TruffleCompilerOptions.java#L95-L131","documentation":"PerformanceWarnings.parse splits a comma-separated option value and resolves each token through PerformanceWarningKind.forName (plus 'all'/'none' sentinels). An unknown token produces IllegalArgumentException with the offending name followed by the full list of valid kinds, each with its help text.","triggerScenarios":"Passing a performance-warnings option containing a token that is not a PerformanceWarningKind name, not 'all', and not 'none' — typo, old name from a previous release, or wrong casing.","commonSituations":"Enabling Truffle performance warnings via option strings copied from stale documentation; upgrading a release that renamed a warning kind.","solutions":["Read the valid names from the exception message itself (it enumerates every kind with help text) and correct the token.","Use 'all' to enable everything, 'none' to disable, and exact comma-separated kind names otherwise.","After upgrading GraalVM, re-check the kind list; kinds are added/renamed between releases."],"exampleFix":"# before\n-Dgraal.TrufflePerformanceWarnings=partialEscape,invalideName\n\n# after\n-Dgraal.TrufflePerformanceWarnings=partialEscape,all-invalidations","handlingStrategy":"validation","validationCode":"static boolean isValidWarningKind(String token) {\n    if (token.equals(\"all\") || token.equals(\"none\")) {\n        return true;\n    }\n    return java.util.Arrays.stream(PerformanceWarningKind.values())\n            .anyMatch(k -> k.name.equals(token));\n}\nfor (String token : requested.split(\",\")) {\n    if (!isValidWarningKind(token.trim())) {\n        throw new IllegalArgumentException(\"Invalid performance warning kind: \" + token);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate each comma-separated token against the current release's PerformanceWarningKind list before passing the option through.","Prefer 'all'/'none' plus stable kind names; re-check the list after every GraalVM upgrade."],"tags":["graal","truffle","options","performance-warnings","enum"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}