{"record":{"id":"dfd4ef79bcc7d7a2","repo":"quarkusio/quarkus","slug":"method-method-name-of-interface-ifacedo-dfd4ef","errorCode":null,"errorMessage":"Method  + method.name() +  of interface  + ifaceDotName +  is not a getter method since it returns void","messagePattern":"Method  \\+ method\\.name\\(\\) \\+  of interface  \\+ ifaceDotName \\+  is not a getter method since it returns void","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/spring-boot-properties/deployment/src/main/java/io/quarkus/spring/boot/properties/deployment/InterfaceConfigurationPropertiesUtil.java","lineNumber":165,"sourceCode":"                });\n            });\n\n            for (DotName ifaceDotName : allInterfaces) {\n                ClassInfo classInfo = index.getClassByName(ifaceDotName);\n                List<MethodInfo> methods = classInfo.methods();\n                for (MethodInfo method : methods) {\n                    Type returnType = method.returnType();\n                    short methodModifiers = method.flags();\n                    if (isDefault(methodModifiers) || Modifier.isStatic(methodModifiers)\n                            || Modifier.isPrivate(methodModifiers)) {\n                        continue;\n                    }\n                    if (!method.parameterTypes().isEmpty()) {\n                        throw new IllegalArgumentException(\"Method \" + method.name() + \" of interface \" + ifaceDotName\n                                + \" is not a getter method since it defined parameters\");\n                    }\n                    if (returnType.kind() == Type.Kind.VOID) {\n                        throw new IllegalArgumentException(\"Method \" + method.name() + \" of interface \" + ifaceDotName\n                                + \" is not a getter method since it returns void\");\n                    }\n\n                    NameAndDefaultValue nameAndDefaultValue = determinePropertyNameAndDefaultValue(method, namingStrategy);\n                    String fullConfigName = prefixStr + \".\" + nameAndDefaultValue.getName();\n\n                    cc.method(method.name(), mc -> {\n                        mc.returning(ClassDesc.of(method.returnType().name().toString()));\n                        mc.public_();\n\n                        mc.body(bc -> {\n                            if ((returnType.kind() == Type.Kind.CLASS)) {\n                                ClassInfo returnTypeClassInfo = index.getClassByName(returnType.name());\n                                if ((returnTypeClassInfo != null) && Modifier.isInterface(returnTypeClassInfo.flags())) {\n                                    String generatedSubInterfaceImp = generateImplementationForInterfaceConfigPropertiesRec(\n                                            originalInterface, returnTypeClassInfo,\n                                            fullConfigName, namingStrategy, interfaceToGeneratedClass);\n","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-boot-properties/deployment/src/main/java/io/quarkus/spring/boot/properties/deployment/InterfaceConfigurationPropertiesUtil.java#L147-L183","documentation":"Same interface-generation path: a non-default/static/private method on a @ConfigurationProperties interface that returns void cannot map to a config property, so IllegalArgumentException 'Method <name> of interface <iface> is not a getter method since it returns void' is thrown.","triggerScenarios":"Declaring a void-returning abstract method in an interface annotated with @ConfigurationProperties — e.g. a mutator-style method like setHost(String) or a command-style method; raised while generating the implementing class.","commonSituations":"Adding setters by habit from JavaBean style (config interfaces are read-only); porting interfaces that had write methods; leftover abstract methods after refactoring.","solutions":["Remove the void method — config property interfaces are read-only.","Give the method a body and mark it default if it is a helper.","Convert mutators into setters on a separate POJO-based config class if mutation is genuinely needed."],"exampleFix":"// before\npublic interface AppProps {\n    void setHost(String host);\n}\n\n// after\npublic interface AppProps {\n    String getHost();\n}","handlingStrategy":"validation","validationCode":"for (Method m : AppProps.class.getMethods()) {\n  if (!m.isDefault() && !Modifier.isStatic(m.getModifiers())\n      && m.getReturnType() == void.class) {\n    throw new IllegalStateException(\"Void method in config interface: \" + m.getName());\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Config interfaces are read-only: no setters or void methods","Use a POJO-based config class if mutable state is required","Remove or default-implement any non-getter methods after porting from JavaBeans"],"tags":["quarkus","build-time","config-interface","getter-method"],"backgroundTag":"invalid-config-getter-signature","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"}