diff options
-rw-r--r-- | tests/ltw/HelloWorld.java | 7 | ||||
-rw-r--r-- | tests/ltw/ant.xml | 26 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java | 4 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml | 7 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java | 10 |
5 files changed, 51 insertions, 3 deletions
diff --git a/tests/ltw/HelloWorld.java b/tests/ltw/HelloWorld.java new file mode 100644 index 000000000..8e5a1fdd7 --- /dev/null +++ b/tests/ltw/HelloWorld.java @@ -0,0 +1,7 @@ +public class HelloWorld { + + public static void main (String[] args) throws Exception { + System.out.println("Hello World!"); + } + +}
\ No newline at end of file diff --git a/tests/ltw/ant.xml b/tests/ltw/ant.xml new file mode 100644 index 000000000..6f7971d96 --- /dev/null +++ b/tests/ltw/ant.xml @@ -0,0 +1,26 @@ +<!-- ajc-ant script, not to be used from Ant commant line - see AntSpec --> +<project name="ltw"> + + <!-- using this we can debug the forked VM --> + <property + name="jdwp" + value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"/> + + <target name="JDK14 LTW"> + <java fork="yes" classname="HelloWorld" failonerror="yes"> + <classpath refid="aj.path"/> + <classpath> + <pathelement path="${aj.sandbox}/hello.jar"/> + </classpath> + <jvmarg value="-Djava.system.class.loader=org.aspectj.weaver.loadtime.WeavingURLClassLoader"/> + <!-- +--> + <jvmarg value="-Daj.class.path=${aj.sandbox}/hello.jar"/> + <jvmarg value="-Dorg.aspectj.tracing.debug=true"/> + <!-- use META-INF/aop.xml style --> +<!-- <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>--> +<!-- <jvmarg line="${jdwp}"/>--> + </java> + </target> + +</project> diff --git a/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java b/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java index 6516af53d..4a5a7e0ee 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java @@ -97,6 +97,10 @@ public class LTWTests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("Odd zip on classpath"); } + public void testJDK14LTW() { + runTest("JDK14 LTW"); + } + // separate bugzilla patch has this one... commented out // public void testSeparateCompilationDeclareParentsCall() { // runTest("Separate compilation with ltw: declare parents and call"); 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 82fe498e0..57946c186 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml @@ -470,4 +470,11 @@ commented out: reported in another bugzilla bug... </run> </ajc-test> --> + <ajc-test dir="ltw" title="JDK14 LTW" keywords="ltw"> + <compile + files="HelloWorld.java" + options="-outjar hello.jar" + /> + <ant file="ant.xml" target="JDK14 LTW" verbose="true"/> + </ajc-test> diff --git a/weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java b/weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java index 5f06c0e6f..6f9025e20 100644 --- a/weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java +++ b/weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java @@ -46,7 +46,11 @@ public class ClassPathManager { private static int maxOpenArchives = -1; private static final int MAXOPEN_DEFAULT = 1000; - private static Trace trace = TraceFactory.getTraceFactory().getTrace(ClassPathManager.class); + /* + * FIXME maw Tracing ClassPathManager can cause recursion for JDK 1.4 + * LTW i.e. -Djava.system.class.loader + */ +// private static Trace trace = TraceFactory.getTraceFactory().getTrace(ClassPathManager.class); static { String openzipsString = getSystemPropertyWithoutSecurityException("org.aspectj.weaver.openarchives",Integer.toString(MAXOPEN_DEFAULT)); @@ -57,13 +61,13 @@ public class ClassPathManager { public ClassPathManager(List classpath, IMessageHandler handler) { - if (trace.isTraceEnabled()) trace.enter("<init>",this,new Object[] { classpath, handler }); +// if (trace.isTraceEnabled()) trace.enter("<init>",this,new Object[] { classpath, handler }); entries = new ArrayList(); for (Iterator i = classpath.iterator(); i.hasNext();) { String name = (String) i.next(); addPath(name, handler); } - if (trace.isTraceEnabled()) trace.exit("<init>"); +// if (trace.isTraceEnabled()) trace.exit("<init>"); } protected ClassPathManager() {}; |