]> source.dussan.org Git - aspectj.git/commitdiff
Bug 150487 "Tracing and Logging Framework" (remove tracing from ClassPathManager...
authormwebster <mwebster>
Mon, 31 Jul 2006 15:28:31 +0000 (15:28 +0000)
committermwebster <mwebster>
Mon, 31 Jul 2006 15:28:31 +0000 (15:28 +0000)
tests/ltw/HelloWorld.java [new file with mode: 0644]
tests/ltw/ant.xml [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java
tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml
weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java

diff --git a/tests/ltw/HelloWorld.java b/tests/ltw/HelloWorld.java
new file mode 100644 (file)
index 0000000..8e5a1fd
--- /dev/null
@@ -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 (file)
index 0000000..6f7971d
--- /dev/null
@@ -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>
index 6516af53dd321e7dc569ccdb3d55dcb6f0f08827..4a5a7e0ee6d482e0f42bc4765a1046e193acb780 100644 (file)
@@ -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");
index 82fe498e0f521a84d8544e87810a128e2565bc32..57946c186d590c304ee87fe40544a8f06293c16b 100644 (file)
@@ -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>
     
index 5f06c0e6f17a4477f86d49a486b928b19f6feb68..6f9025e20caf67154f01d6c3d97cc3b0e0c09e40 100644 (file)
@@ -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() {};