Bridge/synthetic methods may not have the parameter annotations, search for the actual method to use
@@ -189,6 +189,11 @@ public final class AnnotationUtils {
private static Method doGetAnnotatedMethod(Class<?> serviceClass, Method m) {
if (m != null) {
+ if (!m.isBridge() && !m.isSynthetic()) {
+ //the bridge/synthetic methods may not have the parameter annotations
+ //thus we will need to search the super classes/interfaces to make
+ //sure we get the proper method that would also have the parameters annotated
+ //properly
for (Annotation a : m.getAnnotations()) {
if (AnnotationUtils.isMethodAnnotation(a)) {
return m;
@@ -201,7 +206,7 @@ public final class AnnotationUtils {
return m;
}
}
-
+ }
Class<?> declaringClass = m.getDeclaringClass();
Class<?> superC = declaringClass.getSuperclass();
if (superC != null && Object.class != superC) {
