]> source.dussan.org Git - aspectj.git/commitdiff
255555: pattern parser allowing for parentheses around declare anno signatures; cope...
authoraclement <aclement>
Sat, 29 Nov 2008 20:46:42 +0000 (20:46 +0000)
committeraclement <aclement>
Sat, 29 Nov 2008 20:46:42 +0000 (20:46 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java

index 3dd1c501204d54c10865ceef1333d8b5a9fb2811..52ecf1336684cfe6795a133e535a498cd7ac3d03 100644 (file)
@@ -1582,8 +1582,12 @@ public class BcelWeaver {
        private boolean applyDeclareAtType(DeclareAnnotation decA, ResolvedType onType, boolean reportProblems) {
                boolean didSomething = false;
                if (decA.matches(onType)) {
-
-                       if (onType.hasAnnotation(decA.getAnnotationX().getType())) {
+                       AnnotationAJ theAnnotation = decA.getAnnotationX();
+                       // can be null for broken code!
+                       if (theAnnotation == null) {
+                               return false;
+                       }
+                       if (onType.hasAnnotation(theAnnotation.getType())) {
                                // Could put out a lint here for an already annotated type ...
                                // if (reportProblems) {
                                // world.getLint().elementAlreadyAnnotated.signal(