{"record":{"id":"da815417c59402b5","repo":"oracle/graal","slug":"s-annotated-elements-reached-add-following-nati","errorCode":null,"errorMessage":"@%s annotated elements reached. Add following Native Image flags to see why they are reachable:","messagePattern":"@(.+?) annotated elements reached\\. Add following Native Image flags to see why they are reachable:","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler.libgraal/src/jdk/graal/compiler/libgraal/LibGraalFeature.java","lineNumber":436,"sourceCode":"                        value = dc.getName() + \".\" + dc.getSimpleName();\n                    }\n                    case Field f -> {\n                        name = \"Field\";\n                        value = f.getDeclaringClass().getName() + \".\" + f.getName();\n                    }\n                    case Class<?> c -> {\n                        name = \"Type\";\n                        value = c.getName();\n                    }\n                    case null, default -> throw new GraalError(\"Unexpected element: \", e);\n                }\n                suggestions.computeIfAbsent(name, k -> new TreeSet<>()).add(value);\n            }\n            var sep = System.lineSeparator() + \"  \";\n            var s = suggestions.entrySet().stream().map(e -> e.getValue().stream().map(v -> \"-H:AbortOn\" + e.getKey() + \"Reachable\" + \"=\" + v).collect(Collectors.joining(sep))).collect(\n                            Collectors.joining(sep));\n            String anno = HostedOnly.class.getSimpleName();\n            throw new IllegalArgumentException(\"@\" + anno + \" annotated elements reached. Add following Native Image flags to see why they are reachable:\" + sep + s);\n        }\n    }\n\n    @Override\n    public void beforeCompilation(BeforeCompilationAccess access) {\n        beforeCompilationAccess = access;\n    }\n}\n","sourceCodeStart":418,"sourceCodeEnd":445,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler.libgraal/src/jdk/graal/compiler/libgraal/LibGraalFeature.java#L418-L445","documentation":"Error \"@%s annotated elements reached. Add following Native Image flags to see why they are reachable:\" thrown in oracle/graal.","triggerScenarios":"Thrown at compiler/src/jdk.graal.compiler.libgraal/src/jdk/graal/compiler/libgraal/LibGraalFeature.java:436 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: @{} annotated elements reached. Add Native Image flags to see why they are reachable","solutions":["Fix the condition reported by the error: @{} annotated elements reached. Add Native Image flags to see why they are reachable","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: @{} annotated elements reached. Add Native Image flags to see why they are reachable","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"}