From 2ceebd05710ae727890cf99ca8a4eec43c41a587 Mon Sep 17 00:00:00 2001 From: aclement Date: Sat, 29 Nov 2008 20:46:42 +0000 Subject: [PATCH] 255555: pattern parser allowing for parentheses around declare anno signatures; cope with weaving broken code. --- weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java index 3dd1c5012..52ecf1336 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java @@ -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( -- 2.39.5