]> source.dussan.org Git - aspectj.git/commitdiff
fixes for 120909 (ibmvm failures) Root_RB_V1_5_0
authoraclement <aclement>
Thu, 15 Dec 2005 15:57:36 +0000 (15:57 +0000)
committeraclement <aclement>
Thu, 15 Dec 2005 15:57:36 +0000 (15:57 +0000)
loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java
tests/bugs150/pr119749.aj
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
weaver/src/org/aspectj/weaver/reflect/ReflectionWorld.java
weaver/testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java
weaver/testsrc/org/aspectj/weaver/reflect/ReflectionWorldTest.java

index 092eddb7e317f4c4996c65f6cc854c1c13934227..f54d917b077a2205da7fc7e6b1e796e635d102e3 100644 (file)
@@ -23,10 +23,6 @@ import java.util.Enumeration;
 public class DefaultWeavingContext implements IWeavingContext {
        
        protected ClassLoader loader;
-       
-       public DefaultWeavingContext(){
-               loader = getClass().getClassLoader();
-       }
 
        /**
         * Construct a new WeavingContext to use the specifed ClassLoader
index dc3cc4bb5333b07a77c1b46f1d2b7c511f4de670..81dffa54d6f43049257c1fa3e9bd9e3f1f51fd8d 100644 (file)
@@ -10,7 +10,7 @@ public aspect pr119749 {
         // not inherited
         @Retention(RetentionPolicy.RUNTIME)
         @Target(ElementType.METHOD)     
-        @interface Me{}
+        @interface Me { String value() default "Me"; }
 
         static class C {
                 @Me()
@@ -53,10 +53,10 @@ public aspect pr119749 {
                 declare warning : execAnyEx() : "aa * *(..) throws Exception";
                 declare warning : callEx() : "aa call void m() throws Exception";
                 before(Me me) : @annotation(me) && execMe() {
-                        log(thisJoinPoint, "execMe[" + me + "]");
+                    log(thisJoinPoint, "execMe[" + me.value() + "]");
                 }
                 before() : execEx() {
                         log(thisJoinPoint, "execEx");
                 }
         }
-}
\ No newline at end of file
+}
index fb69bba974903b2bd3fe31fa0e43651467f8fc84..16368f7e667d80833e0212e2b4e33bd540c34ded 100644 (file)
@@ -19,7 +19,7 @@
         </compile>
         <run class="pr119749">
             <stdout>
-             <line text="execution(void pr119749.C.m()): execMe[@pr119749$Me()]"/>
+             <line text="execution(void pr119749.C.m()): execMe[Me]"/>
              <line text="execution(void pr119749.C.m()): execEx"/>
             </stdout>
         </run>
index 03aca9ac823822013df54f37faf177a88779427b..04ad8ed4068de73026b82cc9d4a37ca7fefa4b69 100644 (file)
@@ -41,7 +41,7 @@ public class ReflectionWorld extends World {
        private ClassLoader classLoader;
        private AnnotationFinder annotationFinder;
        
-       public ReflectionWorld() {
+       private ReflectionWorld() {
                super();
                this.setMessageHandler(new ExceptionBasedMessageHandler());
                setBehaveInJava5Way(LangUtil.is15VMOrGreater());
index fe5aaec0a7f89ce707b51bac336eb2eac1227335..e5b830b2526ce3139b590453b1ed8698bb689cde 100644 (file)
@@ -17,6 +17,7 @@ import java.util.Set;
 
 import junit.framework.TestCase;
 
+import org.aspectj.bridge.IMessageHandler;
 import org.aspectj.weaver.ReferenceType;
 import org.aspectj.weaver.ResolvedMember;
 import org.aspectj.weaver.ResolvedType;
@@ -247,7 +248,7 @@ public class ReflectionBasedReferenceTypeDelegateTest extends TestCase {
        boolean barfIfClinitMissing = false;
         world.setBehaveInJava5Way(true);
         
-        BcelWorld bcelWorld = new BcelWorld();
+        BcelWorld bcelWorld = new BcelWorld(getClass().getClassLoader(),IMessageHandler.THROW,null);
         bcelWorld.setBehaveInJava5Way(true);
         UnresolvedType javaUtilHashMap = UnresolvedType.forName("java.util.HashMap");
         ReferenceType rawType =(ReferenceType)bcelWorld.resolve(javaUtilHashMap );
@@ -289,7 +290,7 @@ public class ReflectionBasedReferenceTypeDelegateTest extends TestCase {
        // todo: array of int   
 
        protected void setUp() throws Exception {
-               world = new ReflectionWorld();
+               world = new ReflectionWorld(getClass().getClassLoader());
                objectType = world.resolve("java.lang.Object");
        }
 }
index a38f7936b6b0c33e97b30e99c258f5392e166f9f..d4729e9bf0cf268ad19b12b056cbac29f7b024ce 100644 (file)
@@ -19,21 +19,21 @@ import org.aspectj.weaver.World;
 public class ReflectionWorldTest extends TestCase {
 
        public void testDelegateCreation() {
-               World world = new ReflectionWorld();
+               World world = new ReflectionWorld(getClass().getClassLoader());
                ResolvedType rt = world.resolve("java.lang.Object");
                assertNotNull(rt);
                assertEquals("Ljava/lang/Object;",rt.getSignature());
        }
        
        public void testArrayTypes() {
-               ReflectionWorld world = new ReflectionWorld();
+               ReflectionWorld world = new ReflectionWorld(getClass().getClassLoader());
                String[] strArray = new String[1];
                ResolvedType rt = world.resolve(strArray.getClass());
                assertTrue(rt.isArray());
        }
        
        public void testPrimitiveTypes() {
-               ReflectionWorld world = new ReflectionWorld();
+               ReflectionWorld world = new ReflectionWorld(getClass().getClassLoader());
                assertEquals("int",ResolvedType.INT,world.resolve(int.class));
                assertEquals("void",ResolvedType.VOID,world.resolve(void.class));
        }