diff options
author | aclement <aclement> | 2007-12-04 09:40:27 +0000 |
---|---|---|
committer | aclement <aclement> | 2007-12-04 09:40:27 +0000 |
commit | d32f09ff0dafcc36a7655dc6fbda35f5b4feff62 (patch) | |
tree | f5151f165371ba68e8a6b2a8acb0042a49fae063 /weaver | |
parent | f07ca5ac11808f354f7f4daffcd035300128e7d6 (diff) | |
download | aspectj-d32f09ff0dafcc36a7655dc6fbda35f5b4feff62.tar.gz aspectj-d32f09ff0dafcc36a7655dc6fbda35f5b4feff62.zip |
166647 fixes: produces a suitable error if XML defined aspects are excluded from weaving
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java b/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java index d532b8d94..74654136b 100644 --- a/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java +++ b/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java @@ -52,6 +52,7 @@ import org.aspectj.weaver.bcel.BcelWorld; import org.aspectj.weaver.bcel.UnwovenClassFile; import org.aspectj.weaver.bcel.Utility; +// OPTIMIZE add guards for all the debug/info/etc /** * This adaptor allows the AspectJ compiler to be embedded in an existing * system to facilitate load-time weaving. It provides an interface for a @@ -235,10 +236,11 @@ public class WeavingAdaptor implements IMessageContext { * Weave a class using aspects previously supplied to the adaptor. * @param name the name of the class * @param bytes the class bytes + * @param mustWeave if true then this class *must* get woven (used for concrete aspects generated from XML) * @return the woven bytes * @exception IOException weave failed */ - public byte[] weaveClass (String name, byte[] bytes) throws IOException { + public byte[] weaveClass (String name, byte[] bytes,boolean mustWeave) throws IOException { if (trace.isTraceEnabled()) trace.enter("weaveClass",this,new Object[] {name, bytes}); if (!enabled) { @@ -259,6 +261,9 @@ public class WeavingAdaptor implements IMessageContext { debug("weaving '" + name + "'"); bytes = getWovenBytes(name, bytes); } else if (shouldWeaveAnnotationStyleAspect(name, bytes)) { + if (mustWeave) { + error("XML Defined aspects must be woven in cases where cflow pointcuts are involved. Currently the include/exclude patterns exclude '"+name+"'"); + } // an @AspectJ aspect needs to be at least munged by the aspectOf munger debug("weaving '" + name + "'"); bytes = getAtAspectJAspectBytes(name, bytes); |