{"record":{"id":"51e98952abb69d4e","repo":"oracle/graal","slug":"java-livenessanalysis-can-only-be-none-false","errorCode":null,"errorMessage":"--java.LivenessAnalysis can only be 'none'|'false', 'auto' or 'all'|'true'.","messagePattern":"--java\\.LivenessAnalysis can only be 'none'\\|'false', 'auto' or 'all'\\|'true'\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/EspressoOptions.java","lineNumber":371,"sourceCode":"        NONE,\n        ALL,\n        AUTO // Activate liveness analysis for certain methods.\n    }\n\n    private static final OptionType<LivenessAnalysisMode> LIVENESS_ANALYSIS_MODE_OPTION_TYPE = new OptionType<>(\"LivenessAnalysisMode\", new Function<String, LivenessAnalysisMode>() {\n        @Override\n        public LivenessAnalysisMode apply(String s) {\n            // To maintain backwards compatibility with the boolean option.\n            if (\"true\".equalsIgnoreCase(s)) {\n                return LivenessAnalysisMode.ALL;\n            }\n            if (\"false\".equalsIgnoreCase(s)) {\n                return LivenessAnalysisMode.NONE;\n            }\n            try {\n                return LivenessAnalysisMode.valueOf(s.toUpperCase(Locale.ROOT));\n            } catch (IllegalArgumentException e) {\n                throw new IllegalArgumentException(\"--java.LivenessAnalysis can only be 'none'|'false', 'auto' or 'all'|'true'.\");\n            }\n        }\n    });\n\n    @Option(help = \"Controls static liveness analysis of bytecodes, allowing to clear local variables during execution if they become stale.\\\\n\" + //\n                    \"Liveness analysis, if enabled, only affects compiled code.\", //\n                    category = OptionCategory.EXPERT, //\n                    stability = OptionStability.STABLE, //\n                    usageSyntax = \"auto|true|all|false|none\") //\n    public static final OptionKey<LivenessAnalysisMode> LivenessAnalysis = new OptionKey<>(LivenessAnalysisMode.AUTO, LIVENESS_ANALYSIS_MODE_OPTION_TYPE);\n\n    @Option(help = \"Minimum number of locals to run liveness analysis.\\\\n\" + //\n                    \"Liveness analysis, if enabled, only affects compiled code.\", //\n                    category = OptionCategory.EXPERT, //\n                    stability = OptionStability.EXPERIMENTAL, //\n                    usageSyntax = \"[0, 65535]\") //\n    public static final OptionKey<Integer> LivenessAnalysisMinimumLocals = new OptionKey<>(8);\n","sourceCodeStart":353,"sourceCodeEnd":389,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/EspressoOptions.java#L353-L389","documentation":"The converter for --java.LivenessAnalysis accepts 'true'/'false' as legacy boolean aliases (mapped to ALL/NONE) plus the enum names NONE/AUTO/ALL, case-insensitively. Any other string throws IllegalArgumentException from the option parser.","triggerScenarios":"Passing --java.LivenessAnalysis=<value> where value is not none/false, auto, or all/true (e.g. 'on', 'off', 'minimal', or a numeric value).","commonSituations":"Configs migrated between GraalVM versions where the option changed from boolean to enum; guessing values from the help text incorrectly; YAML/env-var templating that substitutes empty strings.","solutions":["Use --java.LivenessAnalysis=auto (default), all|true, or none|false.","If your config was written for the old boolean option, map true->all and false->none (though the legacy spellings still work).","Check for empty values caused by unset environment variables in launch scripts."],"exampleFix":"# before\n--java.LivenessAnalysis=on\n\n# after\n--java.LivenessAnalysis=all","handlingStrategy":"validation","validationCode":"if (!List.of(\"none\",\"false\",\"auto\",\"all\",\"true\").contains(s.toLowerCase(Locale.ROOT))) {\n    throw new ConfigException(\"LivenessAnalysis must be none|false|auto|all|true\");\n}","typeGuard":"static boolean validLiveness(String s) {\n    return s != null && s.matches(\"(?i)(none|false|auto|all|true)\");\n}","tryCatchPattern":null,"preventionTips":["Prefer enum names (none/auto/all) over legacy booleans in new configs.","Lint config files for unknown/misspelled option values."],"tags":["espresso","graalvm","configuration","options","liveness"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}