From: aclement Date: Fri, 18 Nov 2005 10:09:32 +0000 (+0000) Subject: fix for 115204, 116890 NPE in WildAnnotationTypePattern X-Git-Tag: V1_5_0RC1~166 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=557f5b4676f6484dc9b43e2d1a5a8172ef76d5cf;p=aspectj.git fix for 115204, 116890 NPE in WildAnnotationTypePattern --- diff --git a/weaver/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java b/weaver/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java index 3b317cbf7..74deb96b1 100644 --- a/weaver/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java +++ b/weaver/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java @@ -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;