{"record":{"id":"7a71f3b5a1e8669a","repo":"quarkusio/quarkus","slug":"method-method-not-implemented","errorCode":null,"errorMessage":"Method ${method} not implemented","messagePattern":"Method (.+?) not implemented","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/recording/AnnotationProxyProvider.java","lineNumber":172,"sourceCode":"                                case \"getValues\" -> values;\n                                default -> {\n                                    MethodInfo member = annotationClass.firstMethod(name);\n                                    if (member != null) {\n                                        if (values.containsKey(name)) {\n                                            yield values.get(name);\n                                        }\n                                        if (annotationInstance.value(name) != null) {\n                                            yield annotationInstance.value(name).value();\n                                        }\n                                        if (defaultValues.containsKey(name)) {\n                                            yield defaultValues.get(name);\n                                        }\n                                        if (member.defaultValue() != null) {\n                                            yield member.defaultValue().value();\n                                        }\n                                        throw new UnsupportedOperationException(\"Unknown value of annotation member \" + name);\n                                    }\n                                    throw new UnsupportedOperationException(\"Method \" + method + \" not implemented\");\n                                }\n                            };\n                        }\n                    });\n        }\n\n        public A build(io.quarkus.gizmo2.ClassOutput classOutput) {\n            generatedLiterals.computeIfAbsent(annotationLiteral, generatedName -> {\n                Gizmo gizmo = Gizmo.create(classOutput)\n                        .withDebugInfo(false)\n                        .withParameters(false);\n                gizmo.class_(generatedName, cc -> {\n                    ClassDesc annotationClassDesc = classDescOf(annotationInstance.name());\n                    cc.extends_(GenericType.ofClass(AnnotationLiteral.class, TypeArgument.of(annotationClassDesc)));\n                    cc.implements_(annotationClassDesc);\n\n                    List<MethodInfo> members = annotationClass.methods()\n                            .stream()","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/recording/AnnotationProxyProvider.java#L154-L190","documentation":"The annotation literal proxy's InvocationHandler implements only annotation member accessors and object/annotationType methods; any other method call on the proxy is rejected with this UnsupportedOperationException, because a recorded annotation literal cannot implement arbitrary behavior.","triggerScenarios":"Invoking a method on the generated annotation proxy that invoke() does not handle — e.g. extra default methods on the annotation interface, or framework code calling unexpected methods (toString variants, private accessors) on the recorded instance.","commonSituations":"Custom annotations declaring default (defender) methods whose body is invoked on the literal; reflective code calling methods beyond value()/members on the recorded annotation.","solutions":["Remove default (non-abstract) methods from the annotation interface or avoid invoking them on recorded literals","Restrict code operating on the annotation to its declared abstract members","File/update a Quarkus issue if a standard method (e.g. annotationType) is being missed"],"exampleFix":"// before\npublic @interface MyAnno {\n    String value();\n    default String upper() { return value().toUpperCase(); } // invoked on literal -> fails\n}\n// after\npublic @interface MyAnno {\n    String value();\n}\n// compute upper() at usage site, not on the annotation","handlingStrategy":"type-guard","validationCode":"for (Method m : MyAnno.class.getMethods()) {\n    if (!m.isDefault() && m.getDeclaringClass() != Annotation.class\n            && m.getDeclaringClass() != Object.class && !m.isAbstract()) {\n        throw new IllegalStateException(\"unsupported on literal: \" + m);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid default methods on annotation interfaces used with recorders","Call only abstract member accessors on annotation literals","Test annotation literals produced by recording in a build-time test"],"tags":["annotation","proxy","recording","build-time"],"backgroundTag":"unsupported-proxy-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"}