diff options
author | aclement <aclement> | 2004-12-03 15:49:36 +0000 |
---|---|---|
committer | aclement <aclement> | 2004-12-03 15:49:36 +0000 |
commit | a4487864aa8269432dedf200708d1455d0019e48 (patch) | |
tree | 600efcda79c2ceba6973714b2c7b91e81675a92c | |
parent | da4981ea929f0503a3995435456de0a963f206db (diff) | |
download | aspectj-a4487864aa8269432dedf200708d1455d0019e48.tar.gz aspectj-a4487864aa8269432dedf200708d1455d0019e48.zip |
72766 - avoided another problem to do with asking unresolvable members for their modifiers.
-rw-r--r-- | weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java b/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java index 5b30dac43..5fdac5a2d 100644 --- a/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java @@ -24,6 +24,7 @@ import org.aspectj.weaver.Checker; import org.aspectj.weaver.ISourceContext; import org.aspectj.weaver.IntMap; import org.aspectj.weaver.Member; +import org.aspectj.weaver.ResolvedMember; import org.aspectj.weaver.ResolvedTypeX; import org.aspectj.weaver.Shadow; import org.aspectj.weaver.ShadowMunger; @@ -69,11 +70,7 @@ public class KindedPointcut extends Pointcut { if(kind == Shadow.MethodCall) { warnOnConfusingSig(shadow); - int shadowModifiers = shadow.getSignature().getModifiers(shadow.getIWorld()); - if (ResolvedTypeX.hasBridgeModifier(shadowModifiers)) { - shadow.getIWorld().getLint().noJoinpointsForBridgeMethods.signal(new String[]{},getSourceLocation(), - new ISourceLocation[]{shadow.getSourceLocation()}); - } + warnOnBridgeMethod(shadow); } return FuzzyBoolean.NO; } @@ -81,6 +78,20 @@ public class KindedPointcut extends Pointcut { return FuzzyBoolean.YES; } + + private void warnOnBridgeMethod(Shadow shadow) { + if (shadow.getIWorld().getLint().noJoinpointsForBridgeMethods.isEnabled()) { + ResolvedMember rm = shadow.getSignature().resolve(shadow.getIWorld()); + if (rm!=null) { + int shadowModifiers = shadow.getSignature().getModifiers(shadow.getIWorld()); + if (ResolvedTypeX.hasBridgeModifier(shadowModifiers)) { + shadow.getIWorld().getLint().noJoinpointsForBridgeMethods.signal(new String[]{},getSourceLocation(), + new ISourceLocation[]{shadow.getSourceLocation()}); + } + } + } + } + public FuzzyBoolean match(JoinPoint.StaticPart jpsp) { if (jpsp.getKind().equals(kind.getName())) { if (signature.matches(jpsp)) { @@ -111,6 +122,9 @@ public class KindedPointcut extends Pointcut { } private void warnOnConfusingSig(Shadow shadow) { + // Don't do all this processing if we don't need to ! + if (!shadow.getIWorld().getLint().unmatchedSuperTypeInCall.isEnabled()) return; + // no warnings for declare error/warning if (munger instanceof Checker) return; |