From f04fa59934567c4a8772509886b2185d93381b5f Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 2 May 2011 18:42:34 +0000 Subject: [PATCH] 328099 --- .../aspectj/weaver/tools/WeavingAdaptor.java | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java b/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java index cb50796b9..63b748044 100644 --- a/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java +++ b/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java @@ -19,6 +19,7 @@ import java.io.IOException; import java.io.PrintWriter; import java.net.URL; import java.net.URLClassLoader; +import java.security.ProtectionDomain; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -82,9 +83,10 @@ public class WeavingAdaptor implements IMessageContext { private WeavingAdaptorMessageHolder messageHolder; private boolean abortOnError = false; protected GeneratedClassHandler generatedClassHandler; - protected Map generatedClasses = new HashMap(); /* String -> UnwovenClassFile */ + protected Map generatedClasses = new HashMap(); public BcelObjectType delegateForCurrentClass; // lazily initialized, should be used to prevent parsing bytecode multiple // times + protected ProtectionDomain activeProtectionDomain; private boolean haveWarnedOnJavax = false; @@ -127,7 +129,7 @@ public class WeavingAdaptor implements IMessageContext { } private List getFullClassPath(ClassLoader loader) { - List list = new LinkedList(); + List list = new LinkedList(); for (; loader != null; loader = loader.getParent()) { if (loader instanceof URLClassLoader) { URL[] urls = ((URLClassLoader) loader).getURLs(); @@ -143,7 +145,7 @@ public class WeavingAdaptor implements IMessageContext { } private List getFullAspectPath(ClassLoader loader) { - List list = new LinkedList(); + List list = new LinkedList(); for (; loader != null; loader = loader.getParent()) { if (loader instanceof WeavingClassLoader) { URL[] urls = ((WeavingClassLoader) loader).getAspectURLs(); @@ -517,8 +519,8 @@ public class WeavingAdaptor implements IMessageContext { } } - private static List makeClasspath(String cp) { - List ret = new ArrayList(); + private static List makeClasspath(String cp) { + List ret = new ArrayList(); if (cp != null) { StringTokenizer tok = new StringTokenizer(cp, File.pathSeparator); while (tok.hasMoreTokens()) { @@ -816,15 +818,12 @@ public class WeavingAdaptor implements IMessageContext { public void acceptResult(IUnwovenClassFile result) { if (wovenClass == null) { wovenClass = result; - String name = result.getClassName(); if (shouldDump(name.replace('/', '.'), false)) { dump(name, result.getBytes(), false); } - } - - /* Classes generated by weaver e.g. around closure advice */ - else { + } else { + // Classes generated by weaver e.g. around closure advice String className = result.getClassName(); generatedClasses.put(className, result); generatedClasses.put(wovenClass.getClassName(), result); @@ -855,4 +854,8 @@ public class WeavingAdaptor implements IMessageContext { }; } } + + public void setActiveProtectionDomain(ProtectionDomain protectionDomain) { + activeProtectionDomain = protectionDomain; + } } \ No newline at end of file -- 2.39.5