]> source.dussan.org Git - aspectj.git/commitdiff
debug diagnostics for spring bug http://jira.springframework.org/browse/SPR-4390
authoraclement <aclement>
Tue, 19 Feb 2008 22:41:26 +0000 (22:41 +0000)
committeraclement <aclement>
Tue, 19 Feb 2008 22:41:26 +0000 (22:41 +0000)
weaver5/java5-src/org/aspectj/weaver/reflect/Java15AnnotationFinder.java

index e87a89c43a831a143637ad70211f78aade555dc8..cecf1c461f2164b141c09b66e7301844bb43df98 100644 (file)
@@ -106,7 +106,11 @@ public class Java15AnnotationFinder implements AnnotationFinder, ArgNameFinder {
                        org.aspectj.apache.bcel.classfile.annotation.Annotation[] anns = new org.aspectj.apache.bcel.classfile.annotation.Annotation[0];
                        if (onMember instanceof Method) {
                                org.aspectj.apache.bcel.classfile.Method bcelMethod = jc.getMethod((Method)onMember);
-                               anns = bcelMethod.getAnnotations();
+                               if (bcelMethod == null) {
+                                       System.err.println("Unexpected problem in Java15AnnotationFinder: cannot retrieve annotations on method '"+onMember.getName()+"' in class '"+jc.getClassName()+"'");
+                               } else {
+                                       anns = bcelMethod.getAnnotations();
+                               }
                        } else if (onMember instanceof Constructor) {
                                org.aspectj.apache.bcel.classfile.Method bcelCons = jc.getMethod((Constructor)onMember);
                                anns = bcelCons.getAnnotations();