RESOLVED - issue BATCH-1255: Proxy with no target cannot be analysed for listener interfaces

http://jira.springframework.org/browse/BATCH-1255
This commit is contained in:
dsyer
2009-05-30 09:34:18 +00:00
parent a7f8988422
commit db1f7fc35b
4 changed files with 40 additions and 10 deletions

View File

@@ -157,6 +157,10 @@ public class MethodInvokerUtils {
ElementType.METHOD), "Annotation [" + annotationType + "] is not a Method-level annotation.");
final Class<?> targetClass = (target instanceof Advised) ? ((Advised) target).getTargetSource()
.getTargetClass() : target.getClass();
if (targetClass == null) {
// Proxy with no target cannot have annotations
return null;
}
final AtomicReference<Method> annotatedMethod = new AtomicReference<Method>();
ReflectionUtils.doWithMethods(targetClass, new ReflectionUtils.MethodCallback() {
public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {