{"record":{"id":"988f3b1852ece080","repo":"quarkusio/quarkus","slug":"parameter-names-not-recorded-for-targetclass-co","errorCode":null,"errorMessage":"Parameter names not recorded for <targetClass>: compile the class with -parameters","messagePattern":"Parameter names not recorded for <targetClass>: compile the class with -parameters","errorType":"exception","errorClass":"io.quarkus.qute.TemplateException","httpStatus":null,"severity":"error","filePath":"extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java","lineNumber":416,"sourceCode":"                    if (startsWith.isEmpty()) {\n                        throw new TemplateException(\n                                \"No template matching the path \" + templatePath + \" could be found for: \"\n                                        + targetClass.name() + \".\" + method.name());\n                    } else {\n                        throw new TemplateException(\n                                startsWith + \" match the path \" + templatePath\n                                        + \" but the file suffix is not configured via the quarkus.qute.suffixes property\");\n                    }\n                }\n\n                Map<String, String> bindings = new HashMap<>();\n                List<Type> parameters = method.parameterTypes();\n                List<String> parameterNames = new ArrayList<>(parameters.size());\n                for (int i = 0; i < parameters.size(); i++) {\n                    Type type = parameters.get(i);\n                    String name = method.parameterName(i);\n                    if (name == null) {\n                        throw new TemplateException(\"Parameter names not recorded for \" + targetClass.name()\n                                + \": compile the class with -parameters\");\n                    }\n                    bindings.put(name, getCheckedTemplateParameterTypeName(type));\n                    parameterNames.add(name);\n                }\n                AnnotationValue requireTypeSafeExpressions = annotation.value(CHECKED_TEMPLATE_REQUIRE_TYPE_SAFE);\n                ret.add(new CheckedTemplateBuildItem(templatePath, fragmentId, bindings, method, null,\n                        requireTypeSafeExpressions != null ? requireTypeSafeExpressions.asBoolean() : true));\n                enhancer.implement(method, templatePath, fragmentId, parameterNames, adaptor);\n            }\n            transformers.produce(new BytecodeTransformerBuildItem(targetClass.name().toString(),\n                    enhancer));\n        }\n\n        // Find all Java records that implement TemplateInstance and interfaces adapted by CheckedTemplateAdapter\n        List<DotName> recordInterfaceNames = new ArrayList<>();\n        recordInterfaceNames.add(Names.TEMPLATE_INSTANCE);\n        adaptors.keySet().forEach(recordInterfaceNames::add);","sourceCodeStart":398,"sourceCodeEnd":434,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java#L398-L434","documentation":"Qute @CheckedTemplate binds interface method parameters to template data by parameter NAME, read from the compiled class bytecode. If the class was compiled without the -parameters javac flag, names are absent (null) and the build fails with this TemplateException. Maven/Gradle must pass -parameters for the module containing the checked template class.","triggerScenarios":"A @CheckedTemplate interface method declares parameters, and method.parameterName(i) returns null during collectCheckedTemplates because the class file has no MethodParameters attribute (compiled with default javac settings without -parameters).","commonSituations":"Building with a plain javac or an old pom.xml lacking maven-compiler-plugin <parameters>true</parameters>; adding a Quarkus module outside the standard Quarkus parent POM; third-party/generated classes annotated with @CheckedTemplate compiled elsewhere; Gradle build without 'options.parameters = true' or without the Quarkus plugin applying it.","solutions":["Enable parameter names in Maven: in maven-compiler-plugin set <configuration><parameters>true</parameters></configuration> (Quarkus parent POM does this by default)","In Gradle, apply the Quarkus plugin or set tasks.withType(JavaCompile) { options.parameters = true }","Rebuild the module containing the @CheckedTemplate class after enabling -parameters","If the class comes from a dependency, compile it yourself with -parameters or convert to inline templates / explicit TemplateData"],"exampleFix":"// before (pom.xml)\n<artifactId>maven-compiler-plugin</artifactId>\n<!-- no configuration -->\n// after\n<artifactId>maven-compiler-plugin</artifactId>\n<configuration><parameters>true</parameters></configuration>","handlingStrategy":"validation","validationCode":"// verify parameter names are recorded before relying on @CheckedTemplate\nClass<?> c = com.acme.Templates.class;\nfor (Method m : c.getDeclaredMethods()) {\n    if (m.getParameterCount() > 0 && m.getParameterAnnotations().length != m.getParameterCount()) {\n        throw new IllegalStateException(\"Recompile with -parameters: \" + c);\n    }\n}\n// or: javap -parameters target/classes/com/acme/Templates.class","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always keep maven-compiler-plugin <parameters>true</parameters> or Gradle options.parameters = true","Inherit from the Quarkus parent POM/BOM which sets it by default","Never compile @CheckedTemplate classes in dependency JARs built without -parameters","Run mvn dependency:purge/local-repository cleanups when upgrading Quarkus"],"tags":["qute","build-time","compiler","parameters"],"backgroundTag":"missing-parameters-compiler-flag","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}