diff --git a/core/deployment/src/main/java/io/quarkus/deployment/recording/AnnotationProxyProvider.java b/core/deployment/src/main/java/io/quarkus/deployment/recording/AnnotationProxyProvider.java index 205001029f4df1..823f94fc8ade44 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/recording/AnnotationProxyProvider.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/recording/AnnotationProxyProvider.java @@ -186,21 +186,33 @@ public A build(ClassOutput classOutput) { new InvocationHandler() { @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - switch (method.getName()) { - case "getAnnotationLiteralType": - return annotationLiteral; - case "getAnnotationClass": - return annotationClass; - case "getAnnotationInstance": - return annotationInstance; - case "getDefaultValues": - return defaultValues; - case "getValues": - return values; - default: - break; - } - throw new UnsupportedOperationException("Method " + method + " not implemented"); + String name = method.getName(); + return switch (name) { + case "getAnnotationLiteralType" -> annotationLiteral; + case "getAnnotationClass" -> annotationClass; + case "getAnnotationInstance" -> annotationInstance; + case "getDefaultValues" -> defaultValues; + 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"); + } + }; } }); }