quarkusio/quarkus · error · UnsupportedOperationException
Method ${method} not implemented
Error message
Method ${method} not implemented What it means
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.
Source
Thrown at core/deployment/src/main/java/io/quarkus/deployment/recording/AnnotationProxyProvider.java:172
case "getValues" -> values;
default -> {
MethodInfo member = annotationClass.firstMethod(name);
if (member != null) {
if (values.containsKey(name)) {
yield values.get(name);
}
if (annotationInstance.value(name) != null) {
yield annotationInstance.value(name).value();
}
if (defaultValues.containsKey(name)) {
yield defaultValues.get(name);
}
if (member.defaultValue() != null) {
yield member.defaultValue().value();
}
throw new UnsupportedOperationException("Unknown value of annotation member " + name);
}
throw new UnsupportedOperationException("Method " + method + " not implemented");
}
};
}
});
}
public A build(io.quarkus.gizmo2.ClassOutput classOutput) {
generatedLiterals.computeIfAbsent(annotationLiteral, generatedName -> {
Gizmo gizmo = Gizmo.create(classOutput)
.withDebugInfo(false)
.withParameters(false);
gizmo.class_(generatedName, cc -> {
ClassDesc annotationClassDesc = classDescOf(annotationInstance.name());
cc.extends_(GenericType.ofClass(AnnotationLiteral.class, TypeArgument.of(annotationClassDesc)));
cc.implements_(annotationClassDesc);
List<MethodInfo> members = annotationClass.methods()
.stream()View on GitHub (pinned to e1c734241f)
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
Example fix
// before
public @interface MyAnno {
String value();
default String upper() { return value().toUpperCase(); } // invoked on literal -> fails
}
// after
public @interface MyAnno {
String value();
}
// compute upper() at usage site, not on the annotation Defensive patterns
Strategy: type-guard
Validate before calling
for (Method m : MyAnno.class.getMethods()) {
if (!m.isDefault() && m.getDeclaringClass() != Annotation.class
&& m.getDeclaringClass() != Object.class && !m.isAbstract()) {
throw new IllegalStateException("unsupported on literal: " + m);
}
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: Custom annotations declaring default (defender) methods whose body is invoked on the literal; reflective code calling methods beyond value()/members on the recorded annotation.
Related errors
- Unknown value of annotation member ${name}
- Annotation instance ${annotationInstance} does not match ann
- The configuration ${clazz} is missing the @ConfigRoot annota
- Public method ${methodInfo} cannot be proxied as it is final
- Cannot use ${method} as a recorder method as the return type
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/7a71f3b5a1e8669a.
Report an issue: GitHub.