diff options
author | aclement <aclement> | 2009-02-03 17:34:00 +0000 |
---|---|---|
committer | aclement <aclement> | 2009-02-03 17:34:00 +0000 |
commit | 542fa0dedcb8fe8b06c9fef48450bda262add60f (patch) | |
tree | cd9170a7ef3046c5dd25d621439c1d8e522c7720 /weaver | |
parent | 4343691ba5248e7dc221763203230c8244c568be (diff) | |
download | aspectj-542fa0dedcb8fe8b06c9fef48450bda262add60f.tar.gz aspectj-542fa0dedcb8fe8b06c9fef48450bda262add60f.zip |
263323: broken aspect weaving
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java b/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java index 62169bbea..1086bd452 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java @@ -36,6 +36,8 @@ import org.aspectj.weaver.BCException; import org.aspectj.weaver.IEclipseSourceContext; import org.aspectj.weaver.ISourceContext; import org.aspectj.weaver.Member; +import org.aspectj.weaver.ReferenceType; +import org.aspectj.weaver.ReferenceTypeDelegate; import org.aspectj.weaver.ResolvedMember; import org.aspectj.weaver.ResolvedMemberImpl; import org.aspectj.weaver.ResolvedType; @@ -212,13 +214,26 @@ class BcelAdvice extends Advice { if (concreteAspect.getWorld().isXnoInline()) return false; // System.err.println("isWoven? " + ((BcelObjectType)concreteAspect).getLazyClassGen().getWeaverState()); - return BcelWorld.getBcelObjectType(concreteAspect).getLazyClassGen().isWoven(); + BcelObjectType boType = BcelWorld.getBcelObjectType(concreteAspect); + if (boType == null) { + // Could be a symptom that the aspect failed to build last build... return the default answer of false + return false; + } + return boType.getLazyClassGen().isWoven(); } public boolean implementOn(Shadow s) { hasMatchedAtLeastOnce = true; BcelShadow shadow = (BcelShadow) s; + // pr263323 - if the aspect is broken then the delegate will not be usable for weaving + if (concreteAspect instanceof ReferenceType) { + ReferenceTypeDelegate rtDelegate = ((ReferenceType) concreteAspect).getDelegate(); + if (!(rtDelegate instanceof BcelObjectType)) { + return false; + } + } + // remove any unnecessary exceptions if the compiler option is set to // error or warning and if this piece of advice throws exceptions // (bug 129282). This may be expanded to include other compiler warnings |