]> source.dussan.org Git - aspectj.git/commitdiff
fix for 115204, 116890 NPE in WildAnnotationTypePattern
authoraclement <aclement>
Fri, 18 Nov 2005 10:09:32 +0000 (10:09 +0000)
committeraclement <aclement>
Fri, 18 Nov 2005 10:09:32 +0000 (10:09 +0000)
weaver/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java

index 3b317cbf7432fbe095a748a7f8df8d403cfa5118..74deb96b194e75d199cb02c02db75186fd8c33b7 100644 (file)
@@ -58,9 +58,11 @@ public class WildAnnotationTypePattern extends AnnotationTypePattern {
                // matches if the type of any of the annotations on the AnnotatedElement is
                // matched by the typePattern.
                ResolvedType[] annTypes = annotated.getAnnotationTypes();
-               for (int i = 0; i < annTypes.length; i++) {
-                       if (typePattern.matches(annTypes[i],TypePattern.STATIC).alwaysTrue()) {
-                               return FuzzyBoolean.YES;
+               if (annTypes.length!=0) {
+                       for (int i = 0; i < annTypes.length; i++) {
+                               if (typePattern.matches(annTypes[i],TypePattern.STATIC).alwaysTrue()) {
+                                       return FuzzyBoolean.YES;
+                               }
                        }
                }
                return FuzzyBoolean.NO;