]> source.dussan.org Git - aspectj.git/commitdiff
From The Branch: Alex's changes in the weaver module to avoid use of the default...
authoraclement <aclement>
Wed, 13 Apr 2005 15:45:12 +0000 (15:45 +0000)
committeraclement <aclement>
Wed, 13 Apr 2005 15:45:12 +0000 (15:45 +0000)
22 files changed:
weaver/testsrc/Aspect.java [deleted file]
weaver/testsrc/BcweaverModuleTests.java
weaver/testsrc/DynamicHelloWorld.java [deleted file]
weaver/testsrc/FancyHelloWorld.java [deleted file]
weaver/testsrc/FieldyHelloWorld.java [deleted file]
weaver/testsrc/HelloWorld.java [deleted file]
weaver/testsrc/LocaleTest.java [deleted file]
weaver/testsrc/MultiArgHelloWorld.java [deleted file]
weaver/testsrc/Test.java [deleted file]
weaver/testsrc/TestSwitchy.java [deleted file]
weaver/testsrc/org/aspectj/weaver/LocaleTest.java [new file with mode: 0644]
weaver/testsrc/org/aspectj/weaver/bcel/AroundWeaveTestCase.java
weaver/testsrc/org/aspectj/weaver/bcel/UtilityTestCase.java
weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java
weaver/testsrc/org/aspectj/weaver/test/Aspect.java [new file with mode: 0644]
weaver/testsrc/org/aspectj/weaver/test/DynamicHelloWorld.java [new file with mode: 0644]
weaver/testsrc/org/aspectj/weaver/test/FancyHelloWorld.java [new file with mode: 0644]
weaver/testsrc/org/aspectj/weaver/test/FieldyHelloWorld.java [new file with mode: 0644]
weaver/testsrc/org/aspectj/weaver/test/HelloWorld.java [new file with mode: 0644]
weaver/testsrc/org/aspectj/weaver/test/MultiArgHelloWorld.java [new file with mode: 0644]
weaver/testsrc/org/aspectj/weaver/test/Test.java [new file with mode: 0644]
weaver/testsrc/org/aspectj/weaver/test/TestSwitchy.java [new file with mode: 0644]

diff --git a/weaver/testsrc/Aspect.java b/weaver/testsrc/Aspect.java
deleted file mode 100644 (file)
index 1447c53..0000000
+++ /dev/null
@@ -1,349 +0,0 @@
-/* This file is part of the compiler and core tools for the AspectJ(tm)
- * programming language; see http://aspectj.org
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.1 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/.
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is AspectJ.
- *
- * The Initial Developer of the Original Code is Palo Alto Research Center,
- * Incorporated (PARC). Portions created by PARC are are
- * Copyright (C) 2002 Palo Alto Research Center, Incorporated.
- * All Rights Reserved.
- *
- * Contributor(s):
- */
-
-import java.util.*;
-
-import org.aspectj.runtime.internal.*;
-import org.aspectj.runtime.internal.AroundClosure;
-import org.aspectj.lang.JoinPoint;
-
-public class Aspect {
-
-       public static void ajc_before_0() {
-               System.out.println("before_0");         
-       }
-       public static void ajc_before_0(String s) {
-               System.out.println("before_0: " + s);           
-       }
-    public static boolean ajc_around_0(ArrayList s, AroundClosure c) throws Throwable {
-        System.out.println("doing around, got " + s);
-        Object ret = c.run(new Object[] {s}); // proceed(s)
-        return ((Boolean) ret).booleanValue();   
-    }
-
-       public static void ajc_before_0(java.util.ArrayList list) {
-               System.out.println("before_0: " + list);                
-       }
-
-       public static void ajc_before_method_execution() {
-
-       }       
-       public static void ajc_before_method_execution(Object o) {
-               System.out.println("before_method_execution: " + o);
-       }
-
-    public static void ajc_after_method_execution() {
-        System.out.println("after_method_execution");
-    }    
-    public static void ajc_after_method_execution(Object o) {
-        System.out.println("after_method_execution: " + o);
-    }
-    
-    public static void ajc_afterReturning_method_execution() {
-        System.out.println("ajc_afterReturning_method_execution");
-    }                  
-       public static void ajc_afterReturning_method_execution(Object o) {
-               System.out.println("afterReturning_method_execution: " + o);
-       }
-
-    public static void ajc_afterThrowing_method_execution() {
-        System.out.println("ajc_afterThrowing_method_execution");
-    }               
-    public static void ajc_afterThrowing_method_execution(Object o) {
-        System.out.println("afterThrowing_method_execution: " + o);
-    }    
-
-
-
-
-        
-    public static Object ajc_around(AroundClosure closure) throws Throwable {
-        Object ret = closure.run(new Object[] {});
-        return ret;
-    }   
-    
-    public static Object ajc_around(AroundClosure closure, JoinPoint tjp) throws Throwable {
-        System.out.println("thisJoinPoint: " + tjp);
-        Object ret = closure.run(new Object[] {});
-        return ret;
-    }   
-    
-    // ---    
-    
-    
-    public static void ajc_before_method_call() {
-        System.out.println("before_method_call");
-    }    
-    public static void ajc_before_method_call(Object o) {
-        System.out.println("before_method_call: " + o);
-    }
-        
-    public static void ajc_after_method_call() {
-        System.out.println("after_method_call");
-    }    
-    public static void ajc_after_method_call(Object o) {
-        System.out.println("after_method_call: " + o);
-    }       
-       
-    public static void ajc_afterReturning_method_call() {
-        System.out.println("ajc_afterReturning_method_call");
-    }
-       public static void ajc_afterReturning_method_call(Object o) {
-               System.out.println("afterReturning_method_call: " + o);
-       }
-       
-    public static void ajc_afterThrowing_method_call() {
-        System.out.println("ajc_afterThrowing_method_call");
-    }
-    public static void ajc_afterThrowing_method_call(Object o) {
-        System.out.println("afterThrowing_method_call: " + o);
-    }    
-    
-    public static Object ajc_around_method_call(AroundClosure closure) throws Throwable {
-        Object ret = null;
-        for (int i=0; i<3; i++) {
-            System.out.println("enter: " + i);
-            ret = closure.run(new Object[] {});
-        }
-        return ret;
-    }
-    
-    // ----
-
-    public static void ajc_before_constructor_call() {
-        System.out.println("before_constructor_call");
-    }    
-    public static void ajc_before_constructor_call(Object o) {
-        System.out.println("before_constructor_call: " + o);
-    }
-        
-    public static void ajc_after_constructor_call() {
-        System.out.println("after_constructor_call");
-    }    
-    public static void ajc_after_constructor_call(Object o) {
-        System.out.println("after_constructor_call: " + o);
-    }       
-       
-    public static void ajc_afterReturning_constructor_call() {
-        System.out.println("ajc_afterReturning_constructor_call");
-    }
-       public static void ajc_afterReturning_constructor_call(Object o) {
-               System.out.println("afterReturning_constructor_call: " + o);
-       }
-       
-    public static void ajc_afterThrowing_constructor_call() {
-        System.out.println("ajc_afterThrowing_constructor_call");
-    }
-    public static void ajc_afterThrowing_constructor_call(Object o) {
-        System.out.println("afterThrowing_constructor_call: " + o);
-    }    
-    
-    public static Object ajc_around_constructor_call(AroundClosure closure) throws Throwable {
-        Object ret = null;
-        for (int i=0; i<3; i++) {
-            System.out.println("enter: " + i);
-            ret = closure.run(new Object[] {});
-        }
-        return ret;
-    }    
-    // ----
-
-    public static void ajc_before_constructor_execution() {
-        System.out.println("before_constructor_execution");
-    }    
-    public static void ajc_before_constructor_execution(Object o) {
-        System.out.println("before_constructor_execution: " + o);
-    }
-        
-    public static void ajc_after_constructor_execution() {
-        System.out.println("after_constructor_execution");
-    }    
-    public static void ajc_after_constructor_execution(Object o) {
-        System.out.println("after_constructor_execution: " + o);
-    }       
-       
-    public static void ajc_afterReturning_constructor_execution() {
-        System.out.println("ajc_afterReturning_constructor_execution");
-    }
-       public static void ajc_afterReturning_constructor_execution(Object o) {
-               System.out.println("afterReturning_constructor_execution: " + o);
-       }
-       
-    public static void ajc_afterThrowing_constructor_execution() {
-        System.out.println("ajc_afterThrowing_constructor_execution");
-    }
-    public static void ajc_afterThrowing_constructor_execution(Object o) {
-        System.out.println("afterThrowing_constructor_execution: " + o);
-    }    
-    
-    public static Object ajc_around_constructor_execution(AroundClosure closure) throws Throwable {
-        Object ret = null;
-        for (int i=0; i<3; i++) {
-            System.out.println("enter: " + i);
-            ret = closure.run(new Object[] {});
-        }
-        return ret;
-    }    
-    
-    
-    // ---
-
-       
-       public static void ajc_before_field_get() {
-               System.out.println("before_field_get");
-       }   
-    public static void ajc_before_field_get(Object o) {
-        System.out.println("before_field_get: " + o);
-    }
-    
-    public static void ajc_after_field_get() {
-        System.out.println("after_field_get");
-    }    
-    public static void ajc_after_field_get(Object o) {
-        System.out.println("after_field_get: " + o);
-    }
-    
-    public static void ajc_afterReturning_field_get() {
-        System.out.println("afterReturning_field_get");
-    }    
-    public static void ajc_afterReturning_field_get(Object o) {
-        System.out.println("afterReturning_field_get: " + o);
-    }
-
-    public static void ajc_afterThrowing_field_get() {
-        System.out.println("afterThrowing_field_get");
-    }    
-    public static void ajc_afterThrowing_field_get(Object o) {
-        System.out.println("afterThrowing_field_get: " + o);
-    }
-    public static void ajc_afterThrowing_field_get(Throwable t) {
-        System.out.println("afterThrowing_field_get: " + t);
-    }
-
-       public static Object ajc_around_field_get(AroundClosure closure) throws Throwable {
-               Object ret = closure.run(new Object[] {});
-               return ret;
-       }
-       
-   
-    // ---
-
-       
-       public static void ajc_before_field_set() {
-               System.out.println("before_field_set");
-       }   
-    public static void ajc_before_field_set(Object o) {
-        System.out.println("before_field_set: " + o);
-    }
-    
-    public static void ajc_after_field_set() {
-        System.out.println("after_field_set");
-    }    
-    public static void ajc_after_field_set(Object o) {
-        System.out.println("after_field_set: " + o);
-    }
-    
-    public static void ajc_afterReturning_field_set() {
-        System.out.println("afterReturning_field_set");
-    }    
-    public static void ajc_afterReturning_field_set(Object o) {
-        System.out.println("afterReturning_field_set: " + o);
-    }
-
-    public static void ajc_afterThrowing_field_set() {
-        System.out.println("afterThrowing_field_set");
-    }    
-    public static void ajc_afterThrowing_field_set(Object o) {
-        System.out.println("afterThrowing_field_set: " + o);
-    }
-    public static void ajc_afterThrowing_field_set(Throwable t) {
-        System.out.println("afterThrowing_field_set: " + t);
-    }
-
-       public static Object ajc_around_field_set(AroundClosure closure) throws Throwable {
-               Object ret = closure.run(new Object[] {});
-               return ret;
-       }       
-       
-       // don't call this method for callee-side call join points
-       public static void ajc_before(JoinPoint.StaticPart tjp) {
-               System.out.println("before: " + tjp);
-               if (tjp.getSourceLocation() == null) {
-                       throw new RuntimeException("didn't want null");
-               }
-               System.out.println("   loc: " + tjp.getSourceLocation());
-       }
-       
-       public static void ajc_before(JoinPoint tjp) {
-               System.out.println("before: " + tjp + " this = " + tjp.getThis() + 
-                               " target = " + tjp.getTarget() +
-                               " args = " + Arrays.asList(tjp.getArgs()));
-       }
-       
-       // per object stuff
-       
-       private static Map objects = new HashMap();
-       
-       public static void ajc$perObjectBind(Object o) {
-               if (objects.containsKey(o)) return;
-               objects.put(o, new Aspect());
-       }
-       
-       public static boolean hasAspect(Object o) {
-               return objects.containsKey(o);
-       }
-       
-       public static Aspect aspectOf(Object o) {
-               return (Aspect) objects.get(o);
-       }       
-       
-       
-       // per cflow stuff
-       
-       public static void ajc$perCflowPush() {
-               ajc$perCflowStack.pushInstance(new Aspect());
-       }
-       
-       public static boolean hasAspect() {
-               return ajc$perCflowStack.isValid();
-       }
-       
-       public static Aspect aspectOf() {
-               if (ajc$perSingletonInstance != null) return ajc$perSingletonInstance;
-               
-               return (Aspect) ajc$perCflowStack.peekInstance();
-       }
-       
-       public static CFlowStack ajc$perCflowStack = new CFlowStack();
-       
-       // non-static methods
-       
-       public static Aspect ajc$perSingletonInstance = new Aspect();
-       public void ajc_before() {
-               System.out.println("before in: " + this);
-       }
-       
-    public static CFlowStack ajc$cflowStack$0 = new CFlowStack();
-       
-       
-}
index 86f70c5f7d992ca61ebf3bf05fa053989e4c7d20..de2eeceac6ec66400f8ba615aaa49929b738da7d 100644 (file)
@@ -12,6 +12,7 @@
 
 // default package
 
+import org.aspectj.weaver.LocaleTest;
 import org.aspectj.weaver.tools.ToolsTests;
 
 import junit.framework.*;
diff --git a/weaver/testsrc/DynamicHelloWorld.java b/weaver/testsrc/DynamicHelloWorld.java
deleted file mode 100644 (file)
index f381805..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-import java.io.*;
-import java.util.*;
-
-/**
- * @version    1.0
- * @author
- */
-public class DynamicHelloWorld implements Serializable {
-
-    public static void main(String[] args) {
-       try {
-                       new DynamicHelloWorld().doit("hello", Collections.EMPTY_LIST);
-               } catch (UnsupportedOperationException t) {
-                       System.out.println("expected and caught: " + t);
-                       return;
-               }
-               throw new RuntimeException("should have caught exception");
-    }
-    
-    String doit(String s, List l) {
-       l.add(s);   // this will throw an exception
-       return l.toString();
-    }
-}
diff --git a/weaver/testsrc/FancyHelloWorld.java b/weaver/testsrc/FancyHelloWorld.java
deleted file mode 100644 (file)
index 96bd4a0..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-import java.io.PrintStream;
-
-/**
- * @version    1.0
- * @author
- */
-public abstract class FancyHelloWorld {
-    public static void main(String[] args) {
-       PrintStream out = System.out;
-       try {
-               out.println("bye");
-       } catch (Exception e) {
-               out.println(e);
-       } finally {
-               out.println("finally");
-       }
-    }
-    
-    public static String getName() {
-       int x = 0;
-       x += "name".hashCode();
-       return "name" + x;
-    }
-}
diff --git a/weaver/testsrc/FieldyHelloWorld.java b/weaver/testsrc/FieldyHelloWorld.java
deleted file mode 100644 (file)
index b5502ab..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-public class FieldyHelloWorld {
-
-       public static String str = "Hello";
-
-    public static void main(String[] args) {
-        str += " World";
-        
-        System.out.println(str);  
-    }
-}
diff --git a/weaver/testsrc/HelloWorld.java b/weaver/testsrc/HelloWorld.java
deleted file mode 100644 (file)
index b296ba7..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * @version    1.0
- * @author
- */
-public class HelloWorld {
-
-    public static void main(String[] args) {
-        System.out
-        .println("hello world");  
-        //System.out.println("hello world");
-    }
-}
diff --git a/weaver/testsrc/LocaleTest.java b/weaver/testsrc/LocaleTest.java
deleted file mode 100644 (file)
index 2ed013a..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-import java.io.IOException;
-import java.util.Locale;
-
-import junit.framework.TestCase;
-
-import org.aspectj.apache.bcel.generic.Instruction;
-import org.aspectj.apache.bcel.util.ByteSequence;
-
-public class LocaleTest extends TestCase {
-
-       public LocaleTest(String name) {
-               super(name);
-       }
-
-       public void testNormalLocale() {
-               doBipush();             
-       }
-
-       public void testTurkishLocale() {
-               Locale def = Locale.getDefault();
-               Locale.setDefault(new Locale("tr", ""));
-               try {
-                       doBipush();
-               } finally {
-                       Locale.setDefault(def);
-               }
-       }
-       
-       private static void doBipush() {
-               try {
-                       Instruction.readInstruction(
-                                               new ByteSequence(new byte[] { 
-                                                       (byte)16, // bipush 
-                                                       (byte) 3  // data for bipush
-                                                       }));
-               } catch (IOException e) {
-                       throw new RuntimeException(e.getMessage());
-               }
-       }
-}
-
diff --git a/weaver/testsrc/MultiArgHelloWorld.java b/weaver/testsrc/MultiArgHelloWorld.java
deleted file mode 100644 (file)
index 9fccf0e..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-public class MultiArgHelloWorld {
-
-    public static void main(String[] args) {
-       foo("Hello", "World");
-    }
-    
-    static void foo(Object s, Object t) {
-       System.out.println(s + " " + t);
-    }
-}
diff --git a/weaver/testsrc/Test.java b/weaver/testsrc/Test.java
deleted file mode 100644 (file)
index 97f37d9..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-public class Test {
-    public static void main(String[] args) {
-        foo()
-        .
-        foo();
-    }
-    public static Test foo() {
-        new Exception().printStackTrace();
-        return new Test();
-    }
-}
diff --git a/weaver/testsrc/TestSwitchy.java b/weaver/testsrc/TestSwitchy.java
deleted file mode 100644 (file)
index 1f65a12..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * @author hilsdale
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
- * To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
- */
-public abstract class TestSwitchy {
-
-
-    public int i = 3;
-    
-    public static final int j = 4;
-    
-    
-    public static void main(String[] args) {
-        switch (args.length) {
-            case 0: System.err.println("hi");
-            case 1: System.err.println("bye"); break;
-            case 2: System.err.println("two");
-            default: System.err.println("ning");
-        }
-        System.err.println("done");
-    }
-    
-    
-    abstract int goo();
-    
-    void nimbo() {}   
-}
diff --git a/weaver/testsrc/org/aspectj/weaver/LocaleTest.java b/weaver/testsrc/org/aspectj/weaver/LocaleTest.java
new file mode 100644 (file)
index 0000000..fc65182
--- /dev/null
@@ -0,0 +1,43 @@
+package org.aspectj.weaver;
+
+import java.io.IOException;
+import java.util.Locale;
+
+import junit.framework.TestCase;
+
+import org.aspectj.apache.bcel.generic.Instruction;
+import org.aspectj.apache.bcel.util.ByteSequence;
+
+public class LocaleTest extends TestCase {
+
+       public LocaleTest(String name) {
+               super(name);
+       }
+
+       public void testNormalLocale() {
+               doBipush();             
+       }
+
+       public void testTurkishLocale() {
+               Locale def = Locale.getDefault();
+               Locale.setDefault(new Locale("tr", ""));
+               try {
+                       doBipush();
+               } finally {
+                       Locale.setDefault(def);
+               }
+       }
+       
+       private static void doBipush() {
+               try {
+                       Instruction.readInstruction(
+                                               new ByteSequence(new byte[] { 
+                                                       (byte)16, // bipush 
+                                                       (byte) 3  // data for bipush
+                                                       }));
+               } catch (IOException e) {
+                       throw new RuntimeException(e.getMessage());
+               }
+       }
+}
+
index 543f1dfe87937f10e22fe0dd44396eb4c329dbc0..983acc4a95f08c3b171da86b52f11ca5229fbea3 100644 (file)
@@ -46,8 +46,8 @@ public class AroundWeaveTestCase extends WeaveTestCase {
 
 
     private BcelAdvice makeAroundMunger(final boolean matchOnlyPrintln) {
-        BcelWorld world = new BcelWorld();
-        final Member sig = 
+        BcelWorld world = super.world;
+        final Member sig =
             Member.method(
                 TypeX.forName("Aspect"),
                 Modifier.STATIC,
index be97540e63ba911835fa966581ffc1dd9ae1fc4e..05f5610aebdc03dee60efcca8ef7e3dbecb4d808 100644 (file)
@@ -24,7 +24,8 @@ public class UtilityTestCase extends TestCase {
 
     public void disassembleTest(String name) throws IOException {
         BcelWorld world = new BcelWorld("../weaver/bin");
-        
+        world.addPath(WeaveTestCase.classDir);
+
         LazyClassGen clazz = new LazyClassGen(BcelWorld.getBcelObjectType(world.resolve(name)));
         clazz.print();
         System.out.println();
index d14176891648de973ff9700cfd85bb412f27ab15..5a78845cc99d3ca51ad5593e114d19f644bc1925 100644 (file)
@@ -33,6 +33,9 @@ public abstract class WeaveTestCase extends TestCase {
     String outDirPath;
        
        public BcelWorld world = new BcelWorld();
+    {
+        world.addPath(classDir);
+    }
 
     public WeaveTestCase(String name) {
         super(name);
@@ -118,6 +121,8 @@ public abstract class WeaveTestCase extends TestCase {
                        + File.pathSeparator
                        + getTraceJar() 
                        + File.pathSeparator
+            + classDir
+            + File.pathSeparator
                        + System.getProperty("java.class.path");
        }
        
diff --git a/weaver/testsrc/org/aspectj/weaver/test/Aspect.java b/weaver/testsrc/org/aspectj/weaver/test/Aspect.java
new file mode 100644 (file)
index 0000000..cd44302
--- /dev/null
@@ -0,0 +1,349 @@
+/* This file is part of the compiler and core tools for the AspectJ(tm)
+ * programming language; see http://aspectj.org
+ *
+ * The contents of this file are subject to the Mozilla Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is AspectJ.
+ *
+ * The Initial Developer of the Original Code is Palo Alto Research Center,
+ * Incorporated (PARC). Portions created by PARC are are
+ * Copyright (C) 2002 Palo Alto Research Center, Incorporated.
+ * All Rights Reserved.
+ *
+ * Contributor(s):
+ */
+package org.aspectj.weaver.test;
+import java.util.*;
+
+import org.aspectj.runtime.internal.*;
+import org.aspectj.runtime.internal.AroundClosure;
+import org.aspectj.lang.JoinPoint;
+
+public class Aspect {
+
+       public static void ajc_before_0() {
+               System.out.println("before_0");         
+       }
+       public static void ajc_before_0(String s) {
+               System.out.println("before_0: " + s);           
+       }
+    public static boolean ajc_around_0(ArrayList s, AroundClosure c) throws Throwable {
+        System.out.println("doing around, got " + s);
+        Object ret = c.run(new Object[] {s}); // proceed(s)
+        return ((Boolean) ret).booleanValue();   
+    }
+
+       public static void ajc_before_0(java.util.ArrayList list) {
+               System.out.println("before_0: " + list);                
+       }
+
+       public static void ajc_before_method_execution() {
+
+       }       
+       public static void ajc_before_method_execution(Object o) {
+               System.out.println("before_method_execution: " + o);
+       }
+
+    public static void ajc_after_method_execution() {
+        System.out.println("after_method_execution");
+    }    
+    public static void ajc_after_method_execution(Object o) {
+        System.out.println("after_method_execution: " + o);
+    }
+    
+    public static void ajc_afterReturning_method_execution() {
+        System.out.println("ajc_afterReturning_method_execution");
+    }                  
+       public static void ajc_afterReturning_method_execution(Object o) {
+               System.out.println("afterReturning_method_execution: " + o);
+       }
+
+    public static void ajc_afterThrowing_method_execution() {
+        System.out.println("ajc_afterThrowing_method_execution");
+    }               
+    public static void ajc_afterThrowing_method_execution(Object o) {
+        System.out.println("afterThrowing_method_execution: " + o);
+    }    
+
+
+
+
+        
+    public static Object ajc_around(AroundClosure closure) throws Throwable {
+        Object ret = closure.run(new Object[] {});
+        return ret;
+    }   
+    
+    public static Object ajc_around(AroundClosure closure, JoinPoint tjp) throws Throwable {
+        System.out.println("thisJoinPoint: " + tjp);
+        Object ret = closure.run(new Object[] {});
+        return ret;
+    }   
+    
+    // ---    
+    
+    
+    public static void ajc_before_method_call() {
+        System.out.println("before_method_call");
+    }    
+    public static void ajc_before_method_call(Object o) {
+        System.out.println("before_method_call: " + o);
+    }
+        
+    public static void ajc_after_method_call() {
+        System.out.println("after_method_call");
+    }    
+    public static void ajc_after_method_call(Object o) {
+        System.out.println("after_method_call: " + o);
+    }       
+       
+    public static void ajc_afterReturning_method_call() {
+        System.out.println("ajc_afterReturning_method_call");
+    }
+       public static void ajc_afterReturning_method_call(Object o) {
+               System.out.println("afterReturning_method_call: " + o);
+       }
+       
+    public static void ajc_afterThrowing_method_call() {
+        System.out.println("ajc_afterThrowing_method_call");
+    }
+    public static void ajc_afterThrowing_method_call(Object o) {
+        System.out.println("afterThrowing_method_call: " + o);
+    }    
+    
+    public static Object ajc_around_method_call(AroundClosure closure) throws Throwable {
+        Object ret = null;
+        for (int i=0; i<3; i++) {
+            System.out.println("enter: " + i);
+            ret = closure.run(new Object[] {});
+        }
+        return ret;
+    }
+    
+    // ----
+
+    public static void ajc_before_constructor_call() {
+        System.out.println("before_constructor_call");
+    }    
+    public static void ajc_before_constructor_call(Object o) {
+        System.out.println("before_constructor_call: " + o);
+    }
+        
+    public static void ajc_after_constructor_call() {
+        System.out.println("after_constructor_call");
+    }    
+    public static void ajc_after_constructor_call(Object o) {
+        System.out.println("after_constructor_call: " + o);
+    }       
+       
+    public static void ajc_afterReturning_constructor_call() {
+        System.out.println("ajc_afterReturning_constructor_call");
+    }
+       public static void ajc_afterReturning_constructor_call(Object o) {
+               System.out.println("afterReturning_constructor_call: " + o);
+       }
+       
+    public static void ajc_afterThrowing_constructor_call() {
+        System.out.println("ajc_afterThrowing_constructor_call");
+    }
+    public static void ajc_afterThrowing_constructor_call(Object o) {
+        System.out.println("afterThrowing_constructor_call: " + o);
+    }    
+    
+    public static Object ajc_around_constructor_call(AroundClosure closure) throws Throwable {
+        Object ret = null;
+        for (int i=0; i<3; i++) {
+            System.out.println("enter: " + i);
+            ret = closure.run(new Object[] {});
+        }
+        return ret;
+    }    
+    // ----
+
+    public static void ajc_before_constructor_execution() {
+        System.out.println("before_constructor_execution");
+    }    
+    public static void ajc_before_constructor_execution(Object o) {
+        System.out.println("before_constructor_execution: " + o);
+    }
+        
+    public static void ajc_after_constructor_execution() {
+        System.out.println("after_constructor_execution");
+    }    
+    public static void ajc_after_constructor_execution(Object o) {
+        System.out.println("after_constructor_execution: " + o);
+    }       
+       
+    public static void ajc_afterReturning_constructor_execution() {
+        System.out.println("ajc_afterReturning_constructor_execution");
+    }
+       public static void ajc_afterReturning_constructor_execution(Object o) {
+               System.out.println("afterReturning_constructor_execution: " + o);
+       }
+       
+    public static void ajc_afterThrowing_constructor_execution() {
+        System.out.println("ajc_afterThrowing_constructor_execution");
+    }
+    public static void ajc_afterThrowing_constructor_execution(Object o) {
+        System.out.println("afterThrowing_constructor_execution: " + o);
+    }    
+    
+    public static Object ajc_around_constructor_execution(AroundClosure closure) throws Throwable {
+        Object ret = null;
+        for (int i=0; i<3; i++) {
+            System.out.println("enter: " + i);
+            ret = closure.run(new Object[] {});
+        }
+        return ret;
+    }    
+    
+    
+    // ---
+
+       
+       public static void ajc_before_field_get() {
+               System.out.println("before_field_get");
+       }   
+    public static void ajc_before_field_get(Object o) {
+        System.out.println("before_field_get: " + o);
+    }
+    
+    public static void ajc_after_field_get() {
+        System.out.println("after_field_get");
+    }    
+    public static void ajc_after_field_get(Object o) {
+        System.out.println("after_field_get: " + o);
+    }
+    
+    public static void ajc_afterReturning_field_get() {
+        System.out.println("afterReturning_field_get");
+    }    
+    public static void ajc_afterReturning_field_get(Object o) {
+        System.out.println("afterReturning_field_get: " + o);
+    }
+
+    public static void ajc_afterThrowing_field_get() {
+        System.out.println("afterThrowing_field_get");
+    }    
+    public static void ajc_afterThrowing_field_get(Object o) {
+        System.out.println("afterThrowing_field_get: " + o);
+    }
+    public static void ajc_afterThrowing_field_get(Throwable t) {
+        System.out.println("afterThrowing_field_get: " + t);
+    }
+
+       public static Object ajc_around_field_get(AroundClosure closure) throws Throwable {
+               Object ret = closure.run(new Object[] {});
+               return ret;
+       }
+       
+   
+    // ---
+
+       
+       public static void ajc_before_field_set() {
+               System.out.println("before_field_set");
+       }   
+    public static void ajc_before_field_set(Object o) {
+        System.out.println("before_field_set: " + o);
+    }
+    
+    public static void ajc_after_field_set() {
+        System.out.println("after_field_set");
+    }    
+    public static void ajc_after_field_set(Object o) {
+        System.out.println("after_field_set: " + o);
+    }
+    
+    public static void ajc_afterReturning_field_set() {
+        System.out.println("afterReturning_field_set");
+    }    
+    public static void ajc_afterReturning_field_set(Object o) {
+        System.out.println("afterReturning_field_set: " + o);
+    }
+
+    public static void ajc_afterThrowing_field_set() {
+        System.out.println("afterThrowing_field_set");
+    }    
+    public static void ajc_afterThrowing_field_set(Object o) {
+        System.out.println("afterThrowing_field_set: " + o);
+    }
+    public static void ajc_afterThrowing_field_set(Throwable t) {
+        System.out.println("afterThrowing_field_set: " + t);
+    }
+
+       public static Object ajc_around_field_set(AroundClosure closure) throws Throwable {
+               Object ret = closure.run(new Object[] {});
+               return ret;
+       }       
+       
+       // don't call this method for callee-side call join points
+       public static void ajc_before(JoinPoint.StaticPart tjp) {
+               System.out.println("before: " + tjp);
+               if (tjp.getSourceLocation() == null) {
+                       throw new RuntimeException("didn't want null");
+               }
+               System.out.println("   loc: " + tjp.getSourceLocation());
+       }
+       
+       public static void ajc_before(JoinPoint tjp) {
+               System.out.println("before: " + tjp + " this = " + tjp.getThis() + 
+                               " target = " + tjp.getTarget() +
+                               " args = " + Arrays.asList(tjp.getArgs()));
+       }
+       
+       // per object stuff
+       
+       private static Map objects = new HashMap();
+       
+       public static void ajc$perObjectBind(Object o) {
+               if (objects.containsKey(o)) return;
+               objects.put(o, new Aspect());
+       }
+       
+       public static boolean hasAspect(Object o) {
+               return objects.containsKey(o);
+       }
+       
+       public static Aspect aspectOf(Object o) {
+               return (Aspect) objects.get(o);
+       }       
+       
+       
+       // per cflow stuff
+       
+       public static void ajc$perCflowPush() {
+               ajc$perCflowStack.pushInstance(new Aspect());
+       }
+       
+       public static boolean hasAspect() {
+               return ajc$perCflowStack.isValid();
+       }
+       
+       public static Aspect aspectOf() {
+               if (ajc$perSingletonInstance != null) return ajc$perSingletonInstance;
+               
+               return (Aspect) ajc$perCflowStack.peekInstance();
+       }
+       
+       public static CFlowStack ajc$perCflowStack = new CFlowStack();
+       
+       // non-static methods
+       
+       public static Aspect ajc$perSingletonInstance = new Aspect();
+       public void ajc_before() {
+               System.out.println("before in: " + this);
+       }
+       
+    public static CFlowStack ajc$cflowStack$0 = new CFlowStack();
+       
+       
+}
diff --git a/weaver/testsrc/org/aspectj/weaver/test/DynamicHelloWorld.java b/weaver/testsrc/org/aspectj/weaver/test/DynamicHelloWorld.java
new file mode 100644 (file)
index 0000000..0e10e64
--- /dev/null
@@ -0,0 +1,30 @@
+package org.aspectj.weaver.test;
+
+import java.io.*;
+import java.util.*;
+
+/**
+ * FIXME regen with an Eclipse 2.1 the testdata/bin with this new package
+ * same for all classes in that package
+ * and update tests then (pointcuts etc)
+ *
+ * @version    1.0
+ * @author
+ */
+public class DynamicHelloWorld implements Serializable {
+
+    public static void main(String[] args) {
+       try {
+                       new DynamicHelloWorld().doit("hello", Collections.EMPTY_LIST);
+               } catch (UnsupportedOperationException t) {
+                       System.out.println("expected and caught: " + t);
+                       return;
+               }
+               throw new RuntimeException("should have caught exception");
+    }
+    
+    String doit(String s, List l) {
+       l.add(s);   // this will throw an exception
+       return l.toString();
+    }
+}
diff --git a/weaver/testsrc/org/aspectj/weaver/test/FancyHelloWorld.java b/weaver/testsrc/org/aspectj/weaver/test/FancyHelloWorld.java
new file mode 100644 (file)
index 0000000..5fb2577
--- /dev/null
@@ -0,0 +1,26 @@
+package org.aspectj.weaver.test;
+
+import java.io.PrintStream;
+
+/**
+ * @version    1.0
+ * @author
+ */
+public abstract class FancyHelloWorld {
+    public static void main(String[] args) {
+       PrintStream out = System.out;
+       try {
+               out.println("bye");
+       } catch (Exception e) {
+               out.println(e);
+       } finally {
+               out.println("finally");
+       }
+    }
+    
+    public static String getName() {
+       int x = 0;
+       x += "name".hashCode();
+       return "name" + x;
+    }
+}
diff --git a/weaver/testsrc/org/aspectj/weaver/test/FieldyHelloWorld.java b/weaver/testsrc/org/aspectj/weaver/test/FieldyHelloWorld.java
new file mode 100644 (file)
index 0000000..0ddd5e3
--- /dev/null
@@ -0,0 +1,12 @@
+package org.aspectj.weaver.test;
+
+public class FieldyHelloWorld {
+
+       public static String str = "Hello";
+
+    public static void main(String[] args) {
+        str += " World";
+        
+        System.out.println(str);  
+    }
+}
diff --git a/weaver/testsrc/org/aspectj/weaver/test/HelloWorld.java b/weaver/testsrc/org/aspectj/weaver/test/HelloWorld.java
new file mode 100644 (file)
index 0000000..f8da9b0
--- /dev/null
@@ -0,0 +1,14 @@
+package org.aspectj.weaver.test;
+
+/**
+ * @version    1.0
+ * @author
+ */
+public class HelloWorld {
+
+    public static void main(String[] args) {
+        System.out
+        .println("hello world");  
+        //System.out.println("hello world");
+    }
+}
diff --git a/weaver/testsrc/org/aspectj/weaver/test/MultiArgHelloWorld.java b/weaver/testsrc/org/aspectj/weaver/test/MultiArgHelloWorld.java
new file mode 100644 (file)
index 0000000..d47fd4b
--- /dev/null
@@ -0,0 +1,12 @@
+package org.aspectj.weaver.test;
+
+public class MultiArgHelloWorld {
+
+    public static void main(String[] args) {
+       foo("Hello", "World");
+    }
+    
+    static void foo(Object s, Object t) {
+       System.out.println(s + " " + t);
+    }
+}
diff --git a/weaver/testsrc/org/aspectj/weaver/test/Test.java b/weaver/testsrc/org/aspectj/weaver/test/Test.java
new file mode 100644 (file)
index 0000000..74ad97e
--- /dev/null
@@ -0,0 +1,13 @@
+package org.aspectj.weaver.test;
+
+public class Test {
+    public static void main(String[] args) {
+        foo()
+        .
+        foo();
+    }
+    public static Test foo() {
+        new Exception().printStackTrace();
+        return new Test();
+    }
+}
diff --git a/weaver/testsrc/org/aspectj/weaver/test/TestSwitchy.java b/weaver/testsrc/org/aspectj/weaver/test/TestSwitchy.java
new file mode 100644 (file)
index 0000000..9339b77
--- /dev/null
@@ -0,0 +1,33 @@
+package org.aspectj.weaver.test;
+
+/**
+ * @author hilsdale
+ *
+ * To change this generated comment edit the template variable "typecomment":
+ * Window>Preferences>Java>Templates.
+ * To enable and disable the creation of type comments go to
+ * Window>Preferences>Java>Code Generation.
+ */
+public abstract class TestSwitchy {
+
+
+    public int i = 3;
+    
+    public static final int j = 4;
+    
+    
+    public static void main(String[] args) {
+        switch (args.length) {
+            case 0: System.err.println("hi");
+            case 1: System.err.println("bye"); break;
+            case 2: System.err.println("two");
+            default: System.err.println("ning");
+        }
+        System.err.println("done");
+    }
+    
+    
+    abstract int goo();
+    
+    void nimbo() {}   
+}