From 9abfc4044b23629af408459a3a5c638d7978e443 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 15 Dec 2005 15:57:36 +0000 Subject: [PATCH] fixes for 120909 (ibmvm failures) --- .../org/aspectj/weaver/loadtime/DefaultWeavingContext.java | 4 ---- tests/bugs150/pr119749.aj | 6 +++--- tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 2 +- weaver/src/org/aspectj/weaver/reflect/ReflectionWorld.java | 2 +- .../reflect/ReflectionBasedReferenceTypeDelegateTest.java | 5 +++-- .../org/aspectj/weaver/reflect/ReflectionWorldTest.java | 6 +++--- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java b/loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java index 092eddb7e..f54d917b0 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java @@ -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 diff --git a/tests/bugs150/pr119749.aj b/tests/bugs150/pr119749.aj index dc3cc4bb5..81dffa54d 100644 --- a/tests/bugs150/pr119749.aj +++ b/tests/bugs150/pr119749.aj @@ -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 +} diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index fb69bba97..16368f7e6 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -19,7 +19,7 @@ - + diff --git a/weaver/src/org/aspectj/weaver/reflect/ReflectionWorld.java b/weaver/src/org/aspectj/weaver/reflect/ReflectionWorld.java index 03aca9ac8..04ad8ed40 100644 --- a/weaver/src/org/aspectj/weaver/reflect/ReflectionWorld.java +++ b/weaver/src/org/aspectj/weaver/reflect/ReflectionWorld.java @@ -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()); diff --git a/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java b/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java index fe5aaec0a..e5b830b25 100644 --- a/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java +++ b/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java @@ -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"); } } diff --git a/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionWorldTest.java b/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionWorldTest.java index a38f7936b..d4729e9bf 100644 --- a/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionWorldTest.java +++ b/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionWorldTest.java @@ -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)); } -- 2.39.5