{"record":{"id":"5ef2e8aad168a633","repo":"quarkusio/quarkus","slug":"no-getter-corresponding-to-methodinfo-declarin","errorCode":null,"errorMessage":"No getter corresponding to \" + methodInfo.declaringClass().name() + \"#\" + methodInfo.name() + \" found","messagePattern":"No getter corresponding to \" \\+ methodInfo\\.declaringClass\\(\\)\\.name\\(\\) \\+ \"#\" \\+ methodInfo\\.name\\(\\) \\+ \" found","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/resteasy-reactive/client/processor/src/main/java/org/jboss/resteasy/reactive/client/processor/beanparam/BeanParamParser.java","lineNumber":271,"sourceCode":"        if (annotation == null || annotation.value() == null)\n            return null;\n        return annotation.value().asString();\n    }\n\n    private static MethodInfo getGetterMethod(ClassInfo beanParamClass, MethodInfo methodInfo) {\n        MethodInfo getter = null;\n        if (methodInfo.parametersCount() > 0) { // should be setter\n            // find the corresponding getter:\n            String setterName = methodInfo.name();\n            if (setterName.startsWith(\"set\")) {\n                getter = beanParamClass.method(setterName.replace(\"^set\", \"^get\"));\n            }\n        } else if (methodInfo.name().startsWith(\"get\")) {\n            getter = methodInfo;\n        }\n\n        if (getter == null) {\n            throw new IllegalArgumentException(\n                    \"No getter corresponding to \" + methodInfo.declaringClass().name() + \"#\" + methodInfo.name() + \" found\");\n        }\n        return getter;\n    }\n\n    private static <T extends Item> List<T> paramItemsForFieldsAndMethods(ClassInfo beanParamClass, DotName parameterType,\n            BiFunction<String, FieldInfo, T> fieldExtractor, BiFunction<String, MethodInfo, T> methodExtractor) {\n        return ParamTypeAnnotations.of(beanParamClass, parameterType).itemsForFieldsAndMethods(fieldExtractor, methodExtractor);\n    }\n\n    private BeanParamParser() {\n    }\n\n    private static class ParamTypeAnnotations {\n        private final ClassInfo beanParamClass;\n        private final List<AnnotationInstance> annotations;\n\n        private ParamTypeAnnotations(ClassInfo beanParamClass, DotName parameterType) {","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/client/processor/src/main/java/org/jboss/resteasy/reactive/client/processor/beanparam/BeanParamParser.java#L253-L289","documentation":"BeanParamParser.getGetterMethod throws this when building a REST Client @BeanParam: it cannot find a getter method on the parameter class that matches the annotated field. RESTEasy Reactive's client processor needs a getter/setter pair to populate bean param properties at request build time; a field with @QueryParam/@PathParam etc. but no matching getXxx()/isXxx() method cannot be wired.","triggerScenarios":"Using a @BeanParam class in a REST Client interface where a field carries a REST parameter annotation (@QueryParam, @HeaderParam, @PathParam, @CookieParam) but has no corresponding getter (getXxx, isXxx for booleans) or the method name doesn't start with get/is.","commonSituations":"Refactoring a DTO and renaming a getter without renaming the field; using record-style or fluent (chained, non-get-prefixed) accessors; Kotlin `val` properties compiled without standard bean getters in some setups; copying server-side resource classes (where fields suffice) into client code.","solutions":["Add a standard getter for each annotated field (getName() or isName() for booleans).","Rename the field/method so the getter follows the get/is prefix convention matching the field name.","If using fluent accessors, add conventional getters alongside them, or use public setter+getter pairs.","Verify the class is not a Java record; records are not supported as BeanParam with this parser — convert to a plain class with getters/setters."],"exampleFix":"// before\nclass MyParams {\n  @QueryParam(\"q\")\n  String query;\n  String query() { return query; } // fluent, not a getter\n}\n// after\nclass MyParams {\n  @QueryParam(\"q\")\n  String query;\n  public String getQuery() { return query; }\n  public void setQuery(String q) { this.query = q; }\n}","handlingStrategy":"validation","validationCode":"// Build-time check: every annotated field in a @BeanParam class must have a getter\nfor (Field f : beanParamClass.getDeclaredFields()) {\n  if (f.isAnnotationPresent(QueryParam.class) || f.isAnnotationPresent(HeaderParam.class)) {\n    String g = \"get\" + Character.toUpperCase(f.getName().charAt(0)) + f.getName().substring(1);\n    boolean hasGetter = false;\n    for (Method m : beanParamClass.getMethods()) {\n      if (m.getName().equals(g) || (m.getName().equals(\"is\" + g.substring(3)) && (m.getReturnType() == boolean.class))) { hasGetter = true; break; }\n    }\n    if (!hasGetter) throw new IllegalStateException(f.getName() + \" has no getter\");\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair @BeanParam fields with standard get/is prefixed getters","Do not use Java records or fluent accessors for @BeanParam classes","Add an ArchUnit/unit test validating BeanParam classes have getters"],"tags":["rest-client","beanparam","reflection","build-time"],"backgroundTag":"missing-getter-method","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"}