{"record":{"id":"dc83ed275b2270ba","repo":"quarkusio/quarkus","slug":"methodname-is-not-a-getter","errorCode":null,"errorMessage":"${methodName} is not a getter","messagePattern":"(.+?) is not a getter","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/bean/JavaBeanUtil.java","lineNumber":70,"sourceCode":"                return new String(chars);\n            }\n        } else {\n            return name;\n        }\n    }\n\n    /**\n     * Returns the corresponding property name for a getter method name\n     *\n     * @throws IllegalArgumentException if the method name does not follow the getter name convention\n     */\n    public static String getPropertyNameFromGetter(String methodName) {\n        if (methodName.startsWith(GET)) {\n            return decapitalize(methodName.substring(GET.length()));\n        } else if (methodName.startsWith(IS)) {\n            return decapitalize(methodName.substring(IS.length()));\n        } else {\n            throw new IllegalArgumentException(methodName + \" is not a getter\");\n        }\n    }\n}\n","sourceCodeStart":52,"sourceCodeEnd":74,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/bean/JavaBeanUtil.java#L52-L74","documentation":"JavaBeanUtil.getPropertyNameFromGetter derives a property name from a getter method name (getXxx/isXxx). If the method name starts with neither 'get' nor 'is', it cannot be a getter and an IllegalArgumentException is thrown.","triggerScenarios":"Calling getPropertyNameFromGetter with a method name like 'size()', 'toString()', or any non-getter name; reflection-based bean scanning passing a method that is not a standard JavaBean accessor.","commonSituations":"Bean introspection utilities encountering irregular accessors; passing field-like method names without the get/is prefix; custom config or bean mapping code feeding arbitrary methods in.","solutions":["Filter candidate methods with name.startsWith(\"get\") || name.startsWith(\"is\") before calling this utility.","Rename the method to follow JavaBean conventions (getXxx/isXxx) if it is intended to be a property accessor.","Handle the IllegalArgumentException if non-getter methods are expected in your scan."],"exampleFix":"// before\nString prop = JavaBeanUtil.getPropertyNameFromGetter(method.getName());\n// after\nString name = method.getName();\nif (name.startsWith(\"get\") || name.startsWith(\"is\")) {\n    String prop = JavaBeanUtil.getPropertyNameFromGetter(name);\n}","handlingStrategy":"type-guard","validationCode":"String n = method.getName();\nif (!(n.startsWith(\"get\") || n.startsWith(\"is\"))) {\n    throw new IllegalArgumentException(\"Not a JavaBean getter: \" + n);\n}","typeGuard":"static boolean isGetterName(String methodName) {\n    return methodName.startsWith(\"get\") || methodName.startsWith(\"is\");\n}","tryCatchPattern":"try {\n    prop = JavaBeanUtil.getPropertyNameFromGetter(name);\n} catch (IllegalArgumentException e) {\n    prop = null; // skip non-getter methods\n}","preventionTips":["Filter methods by JavaBean naming conventions before property extraction.","Use Introspector.getBeanInfo for standard bean introspection instead of manual name parsing.","Ensure accessor methods follow getXxx/isXxx conventions."],"tags":["javabeans","reflection","naming"],"backgroundTag":"invalid-getter-name","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"}