{"record":{"id":"efe18635b6183a0b","repo":"quarkusio/quarkus","slug":"parameter-names-not-recorded-for-compile-the-cla","errorCode":null,"errorMessage":"Parameter names not recorded for : compile the class with -parameters","messagePattern":"Parameter names not recorded for : compile the class with -parameters","errorType":"exception","errorClass":"TemplateException","httpStatus":null,"severity":"error","filePath":"independent-projects/qute/generator/src/main/java/io/quarkus/qute/generator/ExtensionMethodGenerator.java","lineNumber":950,"sourceCode":"    }\n\n    public static final class Parameters implements Iterable<Param> {\n\n        final boolean isNameParameterRequired;\n        final List<Param> params;\n\n        public Parameters(MethodInfo method, boolean isNameParameterRequired, boolean hasNamespace) {\n            this.isNameParameterRequired = isNameParameterRequired;\n            List<Type> parameters = method.parameterTypes();\n            Map<Integer, String> attributeParamNames = new HashMap<>();\n            for (AnnotationInstance annotation : method.annotations()) {\n                if (annotation.target().kind() == org.jboss.jandex.AnnotationTarget.Kind.METHOD_PARAMETER\n                        && annotation.name().equals(TEMPLATE_ATTRIBUTE)) {\n                    AnnotationValue value = annotation.value();\n                    int position = (int) annotation.target().asMethodParameter().position();\n                    String name = value != null ? value.asString() : method.parameterName(position);\n                    if (name == null) {\n                        throw new TemplateException(\"Parameter names not recorded for \" + method.declaringClass().name()\n                                + \": compile the class with -parameters\");\n                    }\n                    attributeParamNames.put(position, name);\n                }\n            }\n            List<Param> params = new ArrayList<>(parameters.size());\n            int indexed = 0;\n            for (int i = 0; i < parameters.size(); i++) {\n                if (attributeParamNames.containsKey(i)) {\n                    params.add(new Param(attributeParamNames.get(i), parameters.get(i), i, ParamKind.ATTR));\n                } else if (indexed == 0) {\n                    indexed++;\n                    if (hasNamespace) {\n                        // Namespace and matches any or regex - first indexed param is the name\n                        if (isNameParameterRequired) {\n                            params.add(new Param(method.parameterName(i), parameters.get(i), i, ParamKind.NAME));\n                        } else {\n                            params.add(new Param(method.parameterName(i), parameters.get(i), i, ParamKind.EVAL));","sourceCodeStart":932,"sourceCodeEnd":968,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/qute/generator/src/main/java/io/quarkus/qute/generator/ExtensionMethodGenerator.java#L932-L968","documentation":"Qute needs parameter names of @TemplateAttribute-annotated parameters to build the generated invoker. When the method has no -parameters compiler flag, Jandex cannot supply parameter names and the extension method declares no explicit name in @TemplateAttribute, so a TemplateException is thrown.","triggerScenarios":"A template extension method parameter annotated @TemplateAttribute without an explicit value, compiled without javac's -parameters flag; Qute's generator then gets null from method.parameterName(position).","commonSituations":"Maven/Gradle builds missing maven.compiler.parameters=true; annotation processing or AOT pipeline that strips parameter names; IDE builds without -parameters while the app expects it.","solutions":["Compile with the -parameters flag (set <maven.compiler.parameters>true</maven.compiler.parameters> in Maven)","Provide the name explicitly: @TemplateAttribute(\"myName\") instead of relying on the parameter name","Check that the annotation processor/toolchain isn't stripping parameter name metadata"],"exampleFix":"// before\n@TemplateAttribute Object locale\n// after\n@TemplateAttribute(\"locale\") Object locale\n// or in pom.xml\n// <maven.compiler.parameters>true</maven.compiler.parameters>","handlingStrategy":"validation","validationCode":"<!-- pom.xml -->\n<properties>\n  <maven.compiler.parameters>true</maven.compiler.parameters>\n</properties>","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always enable -parameters for Quarkus projects","Prefer explicit @TemplateAttribute(\"name\") over relying on parameter names","Verify after compiler/toolchain upgrades that parameter names are retained"],"tags":["qute","build-time","compiler-flags","parameters"],"backgroundTag":"missing-parameter-names-compile-with-parameters","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"}