From: aclement Date: Tue, 15 Aug 2006 09:58:18 +0000 (+0000) Subject: 133770 'call and ltw': now attempts to grab a delegate for a non-locally defined... X-Git-Tag: post_pr_153572~15 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=efb2dd01da7b56b929fdd23c25448ded27182b5e;p=aspectj.git 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. --- 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(); + } + } + +} diff --git a/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java b/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java index afb9aeb5e..38346279e 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java @@ -130,8 +130,8 @@ public class LTWTests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("aggressive ltw - decp - 2"); } - public void testWeavingTargetOfCallAggressivelyInLTW_DeclareAnnotation_pr133770() { - runTest("aggressive ltw - deca"); + public void testWeavingTargetOfCallAggressivelyInLTW_DeclareParents_Hierarchy_pr133770() { + runTest("aggressive ltw - hierarchy"); } public void testSeparateCompilationDeclareParentsCall_pr133770() { diff --git a/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml b/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml index abd117964..1866789ef 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml @@ -156,6 +156,21 @@ + + + + + + + + + + + + + + +