{"record":{"id":"155018f061a52f40","repo":"quarkusio/quarkus","slug":"abstract-decorator-decoratorclass-name-declar","errorCode":null,"errorMessage":"Abstract decorator ${decoratorClass.name()} declares abstract method(s) not present on decorated interface(s):\n${badAbstractMethods}","messagePattern":"Abstract decorator (.+?) declares abstract method\\(s\\) not present on decorated interface\\(s\\):\n(.+?)","errorType":"exception","errorClass":"DefinitionException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Decorators.java","lineNumber":149,"sourceCode":"            for (Type superclassType : ts.typeWithSuperTypes(Types.getProviderType(decoratorClass), true)) {\n                // 3. verify that it is also present on at least one decorated type\n                for (JandexTypeSystem.MethodKey method : ts.methods(superclassType, MethodInfo::isAbstract)) {\n                    if (!abstractMethodsOnDecoratedTypes.contains(method)) {\n                        badAbstractMethods.add(method);\n                    }\n                }\n            }\n\n            if (!badAbstractMethods.isEmpty()) {\n                StringBuilder message = new StringBuilder(\"Abstract decorator \")\n                        .append(decoratorClass.name())\n                        .append(\" declares abstract method(s) not present on decorated interface(s):\\n\");\n                for (JandexTypeSystem.MethodKey method : badAbstractMethods) {\n                    message.append(\"\\t- \");\n                    method.appendTo(message);\n                    message.append(\"\\n\");\n                }\n                throw new DefinitionException(message.toString());\n            }\n        }\n\n        checkDecoratorFieldsAndMethods(decoratorClass, beanDeployment);\n\n        return new DecoratorInfo(decoratorClass, beanDeployment, delegateInjectionPoint,\n                decoratedTypes, injections, priority);\n    }\n\n    private static void checkDecoratorFieldsAndMethods(ClassInfo decoratorClass, BeanDeployment beanDeployment) {\n        ClassInfo aClass = decoratorClass;\n        while (aClass != null) {\n            for (MethodInfo method : aClass.methods()) {\n                if (beanDeployment.hasAnnotation(method, DotNames.PRODUCES)) {\n                    throw new DefinitionException(\"Decorator declares a producer method: \" + decoratorClass);\n                }\n                // the following 3 checks rely on the annotation store returning parameter annotations for methods\n                if (beanDeployment.hasAnnotation(method, DotNames.DISPOSES)) {","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Decorators.java#L131-L167","documentation":"If a decorator is declared abstract, every abstract method it declares must exist on the interfaces it decorates. Arc builds the list of abstract methods not present on any decorated interface and rejects deployment with this DefinitionException.","triggerScenarios":"Abstract @Decorator class declares an abstract method that none of its decorated interfaces define; usually after removing/renaming a method on the interface or adding an extra abstract method to the decorator.","commonSituations":"Interface refactored to remove a method while the abstract decorator still declares it; decorator implements multiple interfaces and the abstract method belongs to none; typo in method signature.","solutions":["Add the missing method (with matching signature) to the appropriate decorated interface.","Make the method concrete in the abstract decorator (implement it).","Remove the stray abstract method from the decorator.","Synchronize decorator signatures with the current interface after refactoring."],"exampleFix":"// before\n@Decorator\npublic abstract class Base implements Greeter {\n    abstract void extra(); // not on Greeter\n}\n\n// after\n@Decorator\npublic abstract class Base implements Greeter {\n    void extra() { /* concrete */ }\n}","handlingStrategy":"validation","validationCode":"if (Modifier.isAbstract(decoratorClass.getModifiers())) {\n    for (Method m : decoratorClass.getDeclaredMethods())\n        if (Modifier.isAbstract(m.getModifiers())) {\n            boolean onInterface = Stream.of(decoratorClass.getInterfaces())\n                .flatMap(i -> Stream.of(i.getMethods()))\n                .anyMatch(im -> im.getName().equals(m.getName()) && Arrays.equals(im.getParameterTypes(), m.getParameterTypes()));\n            if (!onInterface) throw new IllegalStateException(\"Abstract method not on decorated interface: \" + m);\n        }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid abstract decorators unless necessary; prefer concrete decorators.","After changing an interface, recompile and check all abstract decorators.","Keep decorator method signatures generated from the interface (IDE implement-methods)."],"tags":["cdi","decorator","abstract-class","quarkus-arc"],"backgroundTag":"abstract-decorator-method-mismatch","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"}