From 1d771cda423bb19f1d0b57137a9507af178e440b Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 15 Dec 2008 17:44:07 +0000 Subject: [PATCH] 255643: test and fix --- .../aspectj/weaver/tools/WeavingAdaptor.java | 38 ++++++++++++++++--- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java b/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java index eed696682..88ef7f746 100644 --- a/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java +++ b/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java @@ -87,6 +87,8 @@ public class WeavingAdaptor implements IMessageContext { protected BcelObjectType delegateForCurrentClass; // lazily initialized, should be used to prevent parsing bytecode multiple // times + private boolean haveWarnedOnJavax = false; + private int weavingSpecialTypes = 0; private static final int INITIALIZED = 0x1; private static final int WEAVE_JAVA_PACKAGE = 0x2; @@ -339,12 +341,36 @@ public class WeavingAdaptor implements IMessageContext { } } } - boolean should = !(name.startsWith("org.aspectj.") - || (name.startsWith("java.") && (weavingSpecialTypes & WEAVE_JAVA_PACKAGE) == 0) - || (name.startsWith("javax.") && (weavingSpecialTypes & WEAVE_JAVAX_PACKAGE) == 0) - // || name.startsWith("$Proxy")//JDK proxies//FIXME AV is that 1.3 proxy ? fe. ataspect.$Proxy0 is a java5 proxy... - || name.startsWith("sun.reflect."));// JDK reflect - return should; + if (name.startsWith("org.aspectj.")) { + return false; + } + if (name.startsWith("sun.reflect.")) {// JDK reflect + return false; + } + if (name.startsWith("javax.")) { + if ((weavingSpecialTypes & WEAVE_JAVAX_PACKAGE) != 0) { + return true; + } else { + if (!haveWarnedOnJavax) { + haveWarnedOnJavax = true; + warn("javax.* types are not being woven because the weaver option '-Xset:weaveJavaxPackages=true' has not been specified"); + } + return false; + } + } + if (name.startsWith("java.")) { + if ((weavingSpecialTypes & WEAVE_JAVA_PACKAGE) != 0) { + return true; + } else { + return false; + } + } + // boolean should = !(name.startsWith("org.aspectj.") + // || (name.startsWith("java.") && (weavingSpecialTypes & WEAVE_JAVA_PACKAGE) == 0) + // || (name.startsWith("javax.") && (weavingSpecialTypes & WEAVE_JAVAX_PACKAGE) == 0) + // // || name.startsWith("$Proxy")//JDK proxies//FIXME AV is that 1.3 proxy ? fe. ataspect.$Proxy0 is a java5 proxy... + // || name.startsWith("sun.reflect.")); + return true; } /** -- 2.39.5