{"record":{"id":"e3f18c02dd5048c7","repo":"quarkusio/quarkus","slug":"unsupported-target-e-getvalue","errorCode":null,"errorMessage":"Unsupported target: \" + e.getValue()","messagePattern":"Unsupported target: \" \\+ e\\.getValue\\(\\)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"independent-projects/qute/generator/src/main/java/io/quarkus/qute/generator/TemplateGlobalGenerator.java","lineNumber":143,"sourceCode":"\n                mc.body(bc -> {\n                    Expr name = bc.invokeInterface(Descriptors.GET_NAME, evalContext);\n                    bc.switch_(name, sc -> {\n                        for (Entry<String, AnnotationTarget> e : targets.entrySet()) {\n                            sc.caseOf(Const.of(e.getKey()), cbc -> {\n                                switch (e.getValue().kind()) {\n                                    case FIELD:\n                                        FieldInfo field = e.getValue().asField();\n                                        LocalVar val = cbc.localVar(\"val\", cbc.getStaticField(fieldDescOf(field)));\n                                        processReturnVal(cbc, field.type(), val, cc);\n                                        break;\n                                    case METHOD:\n                                        MethodInfo method = e.getValue().asMethod();\n                                        LocalVar val2 = cbc.localVar(\"val\", cbc.invokeStatic(methodDescOf(method)));\n                                        processReturnVal(cbc, method.returnType(), val2, cc);\n                                        break;\n                                    default:\n                                        throw new IllegalStateException(\"Unsupported target: \" + e.getValue());\n                                }\n                            });\n                        }\n                        sc.default_(dbc -> {\n                        });\n                    });\n                    bc.return_(bc.invokeStatic(Descriptors.RESULTS_NOT_FOUND_EC, evalContext));\n                });\n            });\n        });\n        return generatedClassName;\n    }\n\n    public Set<String> getGeneratedTypes() {\n        return generatedTypes;\n    }\n\n    public static void validate(MethodInfo method) {","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/qute/generator/src/main/java/io/quarkus/qute/generator/TemplateGlobalGenerator.java#L125-L161","documentation":"@TemplateGlobal can only be applied to supported targets (fields and specific method kinds). When processing the annotated members, the generator switches on the annotation target kind and throws IllegalStateException for any kind it does not handle (e.g. an unexpected member type like CONSTRUCTOR or unsupported element).","triggerScenarios":"Placing @TemplateGlobal on a member type not supported by the generator, or an internal inconsistency in the Jandex annotation target map; raised in TemplateGlobalGenerator.generate during build.","commonSituations":"Annotating a constructor or static initializer by mistake; a library version where new target kinds exist but the generator hasn't been updated; custom annotation copying that mislabels targets.","solutions":["Ensure @TemplateGlobal is only on supported members: fields and no-arg methods with non-void returns","Remove the annotation from the unsupported member","Upgrade/patch Quarkus if a legitimate target kind is unsupported (file a Quarkus issue)"],"exampleFix":"// before\n@TemplateGlobal\npublic MyGlobal() {}\n// after\n@TemplateGlobal\npublic static String globalName() { return \"x\"; }","handlingStrategy":"validation","validationCode":"if (m.isAnnotationPresent(TemplateGlobal.class) && (m.getParameterCount() != 0 || m.getReturnType() == void.class))\n    throw new IllegalStateException(\"@TemplateGlobal methods must be no-arg with non-void return\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only annotate fields and simple no-arg getter-like methods with @TemplateGlobal","Never annotate constructors or initializers","Consult the @TemplateGlobal javadoc for supported targets before use"],"tags":["qute","template-global","build-time","unsupported-target"],"backgroundTag":"unsupported-annotation-target","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}