diff options
-rw-r--r-- | tests/bugs152/pr145018/Broken.aj | 42 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java | 1 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc152/ajc152.xml | 11 |
3 files changed, 53 insertions, 1 deletions
diff --git a/tests/bugs152/pr145018/Broken.aj b/tests/bugs152/pr145018/Broken.aj new file mode 100644 index 000000000..373513776 --- /dev/null +++ b/tests/bugs152/pr145018/Broken.aj @@ -0,0 +1,42 @@ +import java.util.*; +import org.aspectj.lang.annotation.*; + +@Aspect +public class Broken { + + @Pointcut("call( * *.someMethod(..)) && args(arg1, arg2, arg3, status) ") + public void someMethod2( int arg1, int arg2, int arg3, Status status ) {} + + @Pointcut("someMethod2(arg1, arg2, arg3, status) && if()") + public static boolean someMethod2if(int arg1, int arg2, int arg3, Status status) { + return status.equals( Status.DELETED ); + } + + @Pointcut("cflow(execution( * *.doProcess(..) ) && args( context, *, args)) && this(SomeClass+) ") + public void inSomeClass2(Context context, Map args) {} + + @After( "inSomeClass2(context,args) && someMethod2if(arg1, arg2, arg3, status) ") + public void deleteManagerInSomeClass2( Context context, Map args, int arg1, int arg2, int arg3, Status status) { +// _log.write( DEBUG, "STATUS2: " + status ); + } +} + +class Status { + public final static int DELETED = 1; +} + +class Context {} + +class SomeClass { + + public void doProcess(Context c,Object o, Map m) { + + someMethod(1,2,3,new Status()); + someMethod(1,2,3,new Status()); + someMethod(1,2,3,new Status()); + } + + public void someMethod(int a, int b, int c, Status s) { + doProcess(null,null,null); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java index 78217bb52..e27efeffa 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java @@ -23,6 +23,7 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + //public void testBrokenIfArgsCflowAtAj_pr145018() { runTest("ataj crashing with cflow, if and args");} public void testNoUnnecessaryDeclarationOfThrownExcp_pr129282_1() {runTest("no unnecessary declaration of thrown exception warning - 1");} public void testNoUnnecessaryDeclarationOfThrownExcp_pr129282_2() {runTest("no unnecessary declaration of thrown exception warning - 2");} public void testNoUnnecessaryDeclarationOfThrownExcp_pr129282_3() {runTest("no unnecessary declaration of thrown exception warning - 3");} diff --git a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml index 6ab18c57e..dbdbdeda4 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml +++ b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml @@ -88,6 +88,15 @@ <compile files="Pair.java" options="-1.5"/> <compile files="Test.java" options="-1.5"/> </ajc-test> + + <ajc-test dir="bugs152/pr145018" title="ataj crashing with cflow, if and args"> + <compile files="Broken.aj" options="-1.5"/> + <run class="Broken"> + <stderr> + <line text="ahhh"/> + </stderr> + </run> + </ajc-test> <ajc-test dir="bugs152/pr132349" title="ITD on inner type of generic type"> <compile files="TopLevelType.java" options="-1.5"/> @@ -545,7 +554,7 @@ <run class="t.C" ltw="aop.xml"/> </ajc-test> - <ajc-test dir="bugs152/pr135068" title="ltw verifyerror - 4"> + <ajc-test dir="bugs152/pr135068" title="ltw verifyerror - 4"> <compile files="t/C2.java" options="-1.5"/> <compile files="t/Ajava2.java" options="-1.5"> <message kind="error" line="13" text="advice can not be declared static"/> |