Yes I used it already in 3.0.x and it worked but iin the last days I tried to update to 3.0.1 and back to 3.0.0 and now I doesn't work any more. And I don't know why it worked before. It couldn't. I think spring beans have always been instances of Proxy, correct? So scanning the subclasses, only cannot work.
I did the following fix in order to scan Interfaces, too:
Code:
private <T extends Annotation> T getAnnotation(final Method method, Class<T> annotationClass) {
Method classmethod = method;
do {
if(classmethod.isAnnotationPresent(annotationClass)) {
return classmethod.getAnnotation(annotationClass);
}
}
while ((classmethod = getSuperMethod(classmethod)) != null);
/* scan interfaces */
Class<?>[] interfaces = method.getDeclaringClass().getInterfaces();
for (Class<?> class1 : interfaces) {
try {
Method interfacemethod = class1.getMethod(method.getName(), method.getParameterTypes());
if(interfacemethod.isAnnotationPresent(annotationClass)) {
return interfacemethod.getAnnotation(annotationClass);
}
} catch (NoSuchMethodException e) {
}
}
return null;
}
Cheers,
Jan