From 557f5b4676f6484dc9b43e2d1a5a8172ef76d5cf Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 18 Nov 2005 10:09:32 +0000 Subject: [PATCH] fix for 115204, 116890 NPE in WildAnnotationTypePattern --- .../weaver/patterns/WildAnnotationTypePattern.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; -- 2.39.5