]> source.dussan.org Git - aspectj.git/commitdiff
with the change in LTW to default to the same version as the runtime VM (ie java...
authoracolyer <acolyer>
Fri, 4 Nov 2005 13:15:09 +0000 (13:15 +0000)
committeracolyer <acolyer>
Fri, 4 Nov 2005 13:15:09 +0000 (13:15 +0000)
tests/java5/ataspectj/ataspectj/AroundInlineMungerTestAspects.java
tests/java5/ataspectj/ataspectj/AroundInlineMungerTestAspects2.aj
tests/java5/ataspectj/ataspectj/BindingTest.java
tests/java5/ataspectj/ataspectj/CflowTest.java
tests/java5/ataspectj/ataspectj/PerClauseInheritanceTest.java
tests/java5/ataspectj/ataspectj/PerClauseTestAspects.java
tests/java5/ataspectj/ataspectj/PointcutReferenceTest.java
tests/java5/ataspectj/ataspectj/PrecedenceTest.java
tests/java5/ataspectj/ataspectj/SingletonInheritanceTest.java
tests/java5/ataspectj/ataspectj/XXJoinPointTest.java

index 109f29666d65f56c8847f4044e52ab3536e62763..5a93d37c33d1fb01037194c6cdde977b73477262 100644 (file)
@@ -14,6 +14,7 @@ package ataspectj;
 import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.annotation.Around;
 import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.SuppressAjWarnings;
 import org.aspectj.lang.ProceedingJoinPoint;
 
 /**
@@ -38,6 +39,7 @@ public class AroundInlineMungerTestAspects {
         private static int I;
 
         @Around("execution(* ataspectj.AroundInlineMungerTest.target())")
+        @SuppressAjWarnings
         public Object around1(ProceedingJoinPoint jp) throws Throwable {
             aroundCount++;
             priv(1, 2L, 3);
@@ -53,11 +55,13 @@ public class AroundInlineMungerTestAspects {
                 "  || get(int ataspectj.AroundInlineMungerTestAspects.Open.I)" +
                 "  || set(int ataspectj.AroundInlineMungerTestAspects.Open.I)" +
                 " )&& this(ataspectj.AroundInlineMungerTestAspects.Open)")
+        @SuppressAjWarnings
         public void before1() {
             beforeCount++;
         }
 
         @Around("execution(* ataspectj.AroundInlineMungerTest.target())")
+        @SuppressAjWarnings
         public Object around2(ProceedingJoinPoint jp) throws Throwable {
             aroundCount++;
             super.superMethod();
@@ -67,6 +71,7 @@ public class AroundInlineMungerTestAspects {
         }
 
         @Around("execution(* ataspectj.AroundInlineMungerTest.target())")
+        @SuppressAjWarnings
         public Object around3(ProceedingJoinPoint jp) throws Throwable {
             aroundCount++;
             // all those field access will be wrapped
index 28d7f05afcd85cdaf1198d714b0cd4ed288a2407..59c2b96df2f54a8bb4e15b2fcc617a78719b393f 100644 (file)
@@ -14,6 +14,7 @@ package ataspectj;
 import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.annotation.Around;
 import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.SuppressAjWarnings;
 import org.aspectj.lang.ProceedingJoinPoint;
 
 /**
@@ -36,6 +37,7 @@ public class AroundInlineMungerTestAspects2 {
         private int i;
         private static int I;
 
+        @SuppressAjWarnings
         Object around() : execution(* ataspectj.AroundInlineMungerTest2.target()) {
             aroundCount++;
             priv(1, 2L, 3);
@@ -45,6 +47,7 @@ public class AroundInlineMungerTestAspects2 {
         }
 
         // this advice to test around advice body call/get/set advising
+        @SuppressAjWarnings
         before() : (call(* ataspectj.AroundInlineMungerTestAspects2.Open.priv(..))
                   || get(int ataspectj.AroundInlineMungerTestAspects2.Open.i)
                   || set(int ataspectj.AroundInlineMungerTestAspects2.Open.i)
@@ -54,6 +57,7 @@ public class AroundInlineMungerTestAspects2 {
             beforeCount++;
         }
 
+        @SuppressAjWarnings
         Object around() : execution(* ataspectj.AroundInlineMungerTest2.target()) {
             aroundCount++;
             super.superMethod();
@@ -62,6 +66,7 @@ public class AroundInlineMungerTestAspects2 {
             return proceed();
         }
 
+        @SuppressAjWarnings
         Object around() : execution(* ataspectj.AroundInlineMungerTest2.target()) {
             aroundCount++;
             // all those field access will be wrapped
index 62e1dfe136ecfbf51245f828759571baa36921e0..3c30ff101491bae335305587ccf950449607aa3f 100644 (file)
@@ -21,6 +21,7 @@ import org.aspectj.lang.Aspects;
 import org.aspectj.lang.annotation.Around;
 import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.annotation.SuppressAjWarnings;
 
 import java.security.PrivilegedAction;
 
@@ -108,6 +109,7 @@ public class BindingTest extends TestCase {
         void pc(int arg2, int arg1) {}// see rather fancy ordering here..
 
         // see return int here.
+        @SuppressAjWarnings
         @Around("pc(argAdvice2, argAdvice1) && target(t)")//see here ordering remade consistent
         public int aaround(ProceedingJoinPoint jp, BindingTest t, int argAdvice1, int argAdvice2) throws Throwable {
             int res = ((Integer)jp.proceed()).intValue();
@@ -117,12 +119,14 @@ public class BindingTest extends TestCase {
         @Pointcut("call(int dup(int)) && within(ataspectj.BindingTest) && args(arg1)")
         void pc2(int arg1) {}
 
+        @SuppressAjWarnings
         @Around("pc2(argAdvice1)")
         public Object aaround2(int argAdvice1, ProceedingJoinPoint jp) throws Throwable {
             int res = ((Integer)jp.proceed(new Object[]{new Integer(argAdvice1-1)})).intValue();
             return new Integer(res/3*2);
         }
 
+        @SuppressAjWarnings
         @Around("call(int echo(int)) && withincode(void ataspectj.BindingTest.testProceedInInner()) && args(i)")
         public int aaround3(int i, final ProceedingJoinPoint jp) throws Throwable {
             final StringBuffer sb = new StringBuffer();
@@ -143,12 +147,14 @@ public class BindingTest extends TestCase {
             return Integer.parseInt(sb.toString())*2;
         }
 
-        @Around("call(int echo(int)) && withincode(void ataspectj.BindingTest.testNoProceed()) && args(i)")
+       @SuppressAjWarnings
+       @Around("call(int echo(int)) && withincode(void ataspectj.BindingTest.testNoProceed()) && args(i)")
         public int aaround4(int i, final ProceedingJoinPoint jp) throws Throwable {
             // since no proceed() is call, this advice won't be inlined
             return 0;
         }
 
+        @SuppressAjWarnings
         @Around("call(int echo(int)) && withincode(void ataspectj.BindingTest.testDoubleProceed()) && args(i)")
         public int aaround5(int i, final ProceedingJoinPoint jp) throws Throwable {
             int i1 = ((Integer)jp.proceed()).intValue();
@@ -156,7 +162,8 @@ public class BindingTest extends TestCase {
             return i1 + i2;
         }
 
-        @Around("call(int echo(int)) && withincode(void ataspectj.BindingTest.testDoubleProceedOneInner()) && args(i)")
+       @SuppressAjWarnings
+       @Around("call(int echo(int)) && withincode(void ataspectj.BindingTest.testDoubleProceedOneInner()) && args(i)")
         public int aaround6(int i, final ProceedingJoinPoint jp) throws Throwable {
             int i1 = ((Integer)jp.proceed()).intValue();
             Object io2 = new PrivilegedAction() {
@@ -179,13 +186,15 @@ public class BindingTest extends TestCase {
             }
         }
 
+        @SuppressAjWarnings
         @Around("call(int echo(int)) && withincode(void ataspectj.BindingTest.testAccessAspectState()) && args(i)")
         public Object aaround7(int i, final ProceedingJoinPoint jp) throws Throwable {
             m_count++;// will be wrapped for inlining support
             return jp.proceed();
         }
 
-        @Around("call(int echo(int)) && withincode(void ataspectj.BindingTest.testTryCatch()) && args(i)")
+       @SuppressAjWarnings
+       @Around("call(int echo(int)) && withincode(void ataspectj.BindingTest.testTryCatch()) && args(i)")
         public Object aaround8(int i, final ProceedingJoinPoint jp) throws Throwable {
             try {
                 return 2*((Integer)jp.proceed()).intValue();
index 781e3acad3804267cc0687c32e433daa25b66b89..1dc243b2af9752b13f2e05755027e156c59b7ef1 100644 (file)
@@ -14,6 +14,7 @@ package ataspectj;
 import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.annotation.Before;
 import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.SuppressAjWarnings;
 import org.aspectj.lang.JoinPoint;
 import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.runtime.internal.CFlowCounter;
@@ -63,7 +64,7 @@ public class CflowTest extends TestCase {
 
         //LTW will add:
         //public static final CFlowCounter ajc$cflowCounter$0 = new CFlowCounter();
-
+           @SuppressAjWarnings
         @Before("execution(* ataspectj.CflowTest.hello(..)) && this(t) && cflow(execution(* ataspectj.CflowTest.startCflow(..)))")
         public void before(Object t, JoinPoint jp) {
             assertEquals(CflowTest.class.getName(), t.getClass().getName());
index 7438dc4095c88735545df3636ecb4525e80e2c9b..fe1d6456b961dee7e7fcc489cbbaf7422744d714 100644 (file)
@@ -14,6 +14,7 @@ package ataspectj;
 import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.annotation.Pointcut;
 import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.SuppressAjWarnings;
 import junit.framework.TestCase;
 
 /**
@@ -69,6 +70,7 @@ public class PerClauseInheritanceTest extends TestCase {
             COUNT++;
         }
 
+        @SuppressAjWarnings
         @Before("pc()")
         public void abefore() {
             log("aop");
index 414e525737b59c39210655f4c00d3345a112c83a..5c0f27cde42e52eccd35d7996acde5f6c6c21b60 100644 (file)
@@ -13,6 +13,7 @@ package ataspectj;
 
 import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.SuppressAjWarnings;
 import org.aspectj.lang.JoinPoint;
 import org.aspectj.lang.Aspects;
 import junit.framework.Assert;
@@ -29,6 +30,7 @@ public class PerClauseTestAspects {
             s_count++;
         }
 
+        @SuppressAjWarnings
         @Before("execution(* ataspectj.PerClauseTest.perSingleton()) && target(t)")
         public void before(JoinPoint jp, Object t) {
             PerClauseTest.log("AOP."+jp.getSignature().getName());
@@ -44,6 +46,7 @@ public class PerClauseTestAspects {
             s_count++;
         }
 
+        @SuppressAjWarnings
         @Before("execution(* ataspectj.PerClauseTest.perTarget()) && target(t)")
         public void before(JoinPoint jp, Object t) {
             PerClauseTest.log("AOP."+jp.getSignature().getName());
@@ -59,6 +62,7 @@ public class PerClauseTestAspects {
             s_count++;
         }
 
+        @SuppressAjWarnings
         @Before("execution(* ataspectj.PerClauseTest.perCflow())")
         public void before(JoinPoint jp) {
             PerClauseTest.log("AOP."+jp.getSignature().getName());
@@ -74,6 +78,7 @@ public class PerClauseTestAspects {
             s_count++;
         }
 
+        @SuppressAjWarnings
         @Before("execution(* ataspectj.PerClauseTest.PTW*.foo())")
         public void before(JoinPoint jp) {
             ;
@@ -89,6 +94,7 @@ public class PerClauseTestAspects {
             s_count++;
         }
 
+        @SuppressAjWarnings
         @Before("execution(* ataspectj.PerClauseTest.PerThis.foo())")
         public void before(JoinPoint jp) {
             a_count++;
index 10eb24c2e4e126b27de842b12d45eb86eaf42741..895765cd2a078bcfcb1599aad3700a7f559671cd 100644 (file)
@@ -18,6 +18,7 @@ import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.annotation.Before;
 import org.aspectj.lang.annotation.Before;
 import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.annotation.SuppressAjWarnings;
 import org.aspectj.lang.JoinPoint;
 import org.aspectj.runtime.internal.CFlowCounter;
 import junit.framework.TestCase;
@@ -75,6 +76,7 @@ public class PointcutReferenceTest extends TestCase {
         @Pointcut("pcRef()")
         void pcRef2() {}
 
+        @SuppressAjWarnings
         @Before("pcRef2()")
         public void before(JoinPoint jp) {
             log("before");
@@ -86,6 +88,7 @@ public class PointcutReferenceTest extends TestCase {
                 " && ataspectj.PointcutReferenceTest.RefAspect.pcRefObjectBinding(t)")
         void pcRefBinding(Object t) {}
 
+        @SuppressAjWarnings
         @Before("pcRefBinding(ttt)")
         public void before(Object ttt, JoinPoint jp) {
             log("beforeWithRef");
index fe96161f82c377d64a9622835057aba080ec1a4b..0a2b2cd37c08e9bc6e22cfee01045a44ff3c743a 100644 (file)
@@ -17,6 +17,7 @@ import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.annotation.DeclarePrecedence;
 import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.SuppressAjWarnings;
 
 import java.lang.annotation.Annotation;
 
@@ -56,6 +57,7 @@ public class PrecedenceTest extends TestCase {
 
     @Aspect()
     public static class TestAspect_1 {
+               @SuppressAjWarnings
         @Before("execution(* ataspectj.PrecedenceTest.hello())")
         public void before() {
             log("TestAspect_1");
@@ -65,6 +67,7 @@ public class PrecedenceTest extends TestCase {
     @Aspect()
     @DeclarePrecedence("ataspectj.PrecedenceTest.TestAspect_3, ataspectj.PrecedenceTest.TestAspect_1")
     public static class TestAspect_2 {
+               @SuppressAjWarnings
         @Before("execution(* ataspectj.PrecedenceTest.hello())")
         public void before() {
             log("TestAspect_2");
@@ -73,6 +76,7 @@ public class PrecedenceTest extends TestCase {
 
     @Aspect()
     public static class TestAspect_3 {
+               @SuppressAjWarnings
         @Before("execution(* ataspectj.PrecedenceTest.hello())")
         public void before() {
             log("TestAspect_3");
index 9393afaae4cf2fa1de47c293bcab9eb1b3f290b4..660d9d5eaa81326fc7d5041d82543c4b94813437 100644 (file)
@@ -14,6 +14,7 @@ package ataspectj;
 import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.annotation.Pointcut;
 import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.SuppressAjWarnings;
 import junit.framework.TestCase;
 
 /**
@@ -69,11 +70,13 @@ public class SingletonInheritanceTest extends TestCase {
 
     @Aspect
     static class ChildAspect extends ParentAspect {
+           @SuppressAjWarnings
         @Before("pc()")
         public void abefore() {
             log("aop");
         }
 
+           @SuppressAjWarnings
         @Before("ataspectj.SingletonInheritanceTest.AbstractAspect.pc2()")
         public void abefore2() {
             log("aop2");
index d14eb8a035cfdd1081ec0ff689c3c41861f3b93c..1bbd4e87fcfcfacdad1ba955783d1cae2185c071 100644 (file)
@@ -18,6 +18,7 @@ import org.aspectj.lang.annotation.Before;
 import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.annotation.Before;
 import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.SuppressAjWarnings;
 import org.aspectj.lang.annotation.Pointcut;
 import org.aspectj.lang.JoinPoint;
 
@@ -56,18 +57,21 @@ public class XXJoinPointTest extends TestCase {
         @Pointcut("call(* ataspectj.XXJoinPointTest.hello()) && within(ataspectj.XXJoinPointTest)")
         void pc() {}
 
+        @SuppressAjWarnings
         @Before("pc()")
         public void before(JoinPoint jp) {
             assertEquals("hello", jp.getSignature().getName());
             log("jp");
         }
 
+        @SuppressAjWarnings
         @Before("pc()")
         public void before(JoinPoint.StaticPart sjp) {
             assertEquals("hello", sjp.getSignature().getName());
             log("sjp");
         }
 
+        @SuppressAjWarnings
         @Before("pc()")
         public void beforeEnclosing(JoinPoint.EnclosingStaticPart esjp) {
             assertEquals("testJoinPointsInAdviceSignature", esjp.getSignature().getName());
@@ -75,6 +79,7 @@ public class XXJoinPointTest extends TestCase {
         }
 
         //weird order
+        @SuppressAjWarnings
         @Before("pc()")
         public void beforeWEIRD1(JoinPoint jp, JoinPoint.StaticPart sjp) {
             assertEquals("hello", jp.getSignature().getName());
@@ -82,6 +87,7 @@ public class XXJoinPointTest extends TestCase {
             log("jp-sjp");
         }
 
+        @SuppressAjWarnings
         @Before("pc()")
         public void before(JoinPoint.StaticPart sjp, JoinPoint.EnclosingStaticPart esjp) {
             assertEquals("hello", sjp.getSignature().getName());
@@ -90,6 +96,7 @@ public class XXJoinPointTest extends TestCase {
         }
 
         // conventional order
+        @SuppressAjWarnings
         @Before("pc()")
         public void before(JoinPoint.StaticPart sjp, JoinPoint jp, JoinPoint.EnclosingStaticPart esjp) {
             assertEquals("hello", sjp.getSignature().getName());
@@ -99,6 +106,7 @@ public class XXJoinPointTest extends TestCase {
         }
 
         // weird order
+        @SuppressAjWarnings
         @Before("pc()")
         public void beforeWEIRD2(JoinPoint.EnclosingStaticPart esjp, JoinPoint jp, JoinPoint.StaticPart sjp) {
             assertEquals("testJoinPointsInAdviceSignature", esjp.getSignature().getName());