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;
/**
private static int I;
@Around("execution(* ataspectj.AroundInlineMungerTest.target())")
+ @SuppressAjWarnings
public Object around1(ProceedingJoinPoint jp) throws Throwable {
aroundCount++;
priv(1, 2L, 3);
" || 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();
}
@Around("execution(* ataspectj.AroundInlineMungerTest.target())")
+ @SuppressAjWarnings
public Object around3(ProceedingJoinPoint jp) throws Throwable {
aroundCount++;
// all those field access will be wrapped
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;
/**
private int i;
private static int I;
+ @SuppressAjWarnings
Object around() : execution(* ataspectj.AroundInlineMungerTest2.target()) {
aroundCount++;
priv(1, 2L, 3);
}
// 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)
beforeCount++;
}
+ @SuppressAjWarnings
Object around() : execution(* ataspectj.AroundInlineMungerTest2.target()) {
aroundCount++;
super.superMethod();
return proceed();
}
+ @SuppressAjWarnings
Object around() : execution(* ataspectj.AroundInlineMungerTest2.target()) {
aroundCount++;
// all those field access will be wrapped
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;
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();
@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();
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();
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() {
}
}
+ @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();
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;
//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());
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;
/**
COUNT++;
}
+ @SuppressAjWarnings
@Before("pc()")
public void abefore() {
log("aop");
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;
s_count++;
}
+ @SuppressAjWarnings
@Before("execution(* ataspectj.PerClauseTest.perSingleton()) && target(t)")
public void before(JoinPoint jp, Object t) {
PerClauseTest.log("AOP."+jp.getSignature().getName());
s_count++;
}
+ @SuppressAjWarnings
@Before("execution(* ataspectj.PerClauseTest.perTarget()) && target(t)")
public void before(JoinPoint jp, Object t) {
PerClauseTest.log("AOP."+jp.getSignature().getName());
s_count++;
}
+ @SuppressAjWarnings
@Before("execution(* ataspectj.PerClauseTest.perCflow())")
public void before(JoinPoint jp) {
PerClauseTest.log("AOP."+jp.getSignature().getName());
s_count++;
}
+ @SuppressAjWarnings
@Before("execution(* ataspectj.PerClauseTest.PTW*.foo())")
public void before(JoinPoint jp) {
;
s_count++;
}
+ @SuppressAjWarnings
@Before("execution(* ataspectj.PerClauseTest.PerThis.foo())")
public void before(JoinPoint jp) {
a_count++;
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;
@Pointcut("pcRef()")
void pcRef2() {}
+ @SuppressAjWarnings
@Before("pcRef2()")
public void before(JoinPoint jp) {
log("before");
" && ataspectj.PointcutReferenceTest.RefAspect.pcRefObjectBinding(t)")
void pcRefBinding(Object t) {}
+ @SuppressAjWarnings
@Before("pcRefBinding(ttt)")
public void before(Object ttt, JoinPoint jp) {
log("beforeWithRef");
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;
@Aspect()
public static class TestAspect_1 {
+ @SuppressAjWarnings
@Before("execution(* ataspectj.PrecedenceTest.hello())")
public void before() {
log("TestAspect_1");
@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");
@Aspect()
public static class TestAspect_3 {
+ @SuppressAjWarnings
@Before("execution(* ataspectj.PrecedenceTest.hello())")
public void before() {
log("TestAspect_3");
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;
/**
@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");
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;
@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());
}
//weird order
+ @SuppressAjWarnings
@Before("pc()")
public void beforeWEIRD1(JoinPoint jp, JoinPoint.StaticPart sjp) {
assertEquals("hello", jp.getSignature().getName());
log("jp-sjp");
}
+ @SuppressAjWarnings
@Before("pc()")
public void before(JoinPoint.StaticPart sjp, JoinPoint.EnclosingStaticPart esjp) {
assertEquals("hello", sjp.getSignature().getName());
}
// conventional order
+ @SuppressAjWarnings
@Before("pc()")
public void before(JoinPoint.StaticPart sjp, JoinPoint jp, JoinPoint.EnclosingStaticPart esjp) {
assertEquals("hello", sjp.getSignature().getName());
}
// weird order
+ @SuppressAjWarnings
@Before("pc()")
public void beforeWEIRD2(JoinPoint.EnclosingStaticPart esjp, JoinPoint jp, JoinPoint.StaticPart sjp) {
assertEquals("testJoinPointsInAdviceSignature", esjp.getSignature().getName());