diff options
author | aclement <aclement> | 2006-08-15 09:58:18 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-08-15 09:58:18 +0000 |
commit | efb2dd01da7b56b929fdd23c25448ded27182b5e (patch) | |
tree | d72b643b5160e8c64a0e4bc534b56853d26e5320 /tests/ltw | |
parent | 58a3e87818ffaba69df25e4c0601b99f2931a31f (diff) | |
download | aspectj-efb2dd01da7b56b929fdd23c25448ded27182b5e.tar.gz aspectj-efb2dd01da7b56b929fdd23c25448ded27182b5e.zip |
133770 'call and ltw': now attempts to grab a delegate for a non-locally defined type, giving the super-loader chance to weave a type with ITDs.
Diffstat (limited to 'tests/ltw')
-rw-r--r-- | tests/ltw/callMunging/case1/HierMain.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/ltw/callMunging/case1/HierMain.java b/tests/ltw/callMunging/case1/HierMain.java new file mode 100644 index 000000000..8fdb1c570 --- /dev/null +++ b/tests/ltw/callMunging/case1/HierMain.java @@ -0,0 +1,28 @@ +import java.lang.reflect.Method; +import java.net.URLClassLoader; +import java.net.URL; +import java.io.File; +import org.aspectj.weaver.loadtime.WeavingURLClassLoader; + +public class HierMain { + + public static void main(String []argv) { + try { + System.out.println("into:main"); + ClassLoader baseLoader = HierMain.class.getClassLoader(); + URL base = baseLoader.getResource("HierMain.class"); + String urlstr = base.toExternalForm(); + int idx = urlstr.indexOf("classes.jar!"); + String sub = urlstr.substring("jar:".length(), idx)+"/sub.hiddenjar"; + URL subUrls[] = new URL[] { new URL(sub) }; + WeavingURLClassLoader loader = new WeavingURLClassLoader(subUrls, baseLoader); + Class clazzA = Class.forName("A", false, loader); + Method clazzAMethod = clazzA.getMethod("method",null); + clazzAMethod.invoke(clazzA.newInstance(),null); + System.out.println("leave:main"); + } catch (Throwable t) { + t.printStackTrace(); + } + } + +} |