diff options
author | acolyer <acolyer> | 2004-12-16 11:04:19 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2004-12-16 11:04:19 +0000 |
commit | ee0b12f950c0c24acf8df868e529385aec523c06 (patch) | |
tree | 846bd7e6e668e8608ca146586fca1cefa14ffa32 /tests | |
parent | ded1a744fc4a518275dbb4fcfa219939ae48ad11 (diff) | |
download | aspectj-ee0b12f950c0c24acf8df868e529385aec523c06.tar.gz aspectj-ee0b12f950c0c24acf8df868e529385aec523c06.zip |
it is now safe to short-circuit in and/or pc matching (all side-effects removed)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/java5/varargs/SimpleVarargs.java | 9 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/VarargsTests.java | 20 |
2 files changed, 14 insertions, 15 deletions
diff --git a/tests/java5/varargs/SimpleVarargs.java b/tests/java5/varargs/SimpleVarargs.java index bcd1e1bdf..c32047ab6 100644 --- a/tests/java5/varargs/SimpleVarargs.java +++ b/tests/java5/varargs/SimpleVarargs.java @@ -2,12 +2,17 @@ public class SimpleVarargs { public SimpleVarargs(Integer... strings) {} - public void foo(Integer... strings) { } + public void foo(Integer... strings) { + moo(); + } //public void bar(Integer[] array) { } - public void fooInt(int i,Integer... strings) {} + public void fooInt(int i,Integer... strings) { + moo(); + } + private void moo() {} //public void barInt(int i,Integer[] strings) {} public static void main(String[] argv) { diff --git a/tests/src/org/aspectj/systemtest/ajc150/VarargsTests.java b/tests/src/org/aspectj/systemtest/ajc150/VarargsTests.java index 178e82b18..14f4532c7 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/VarargsTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/VarargsTests.java @@ -56,15 +56,9 @@ public class VarargsTests extends TestUtils { } // check when signature is from an withincode PCD - // In this test, it can be tricky to understand the results!! The reason being that the shadow - // isn't included in the error message (it really should be, but thats a bit hard to do cleanly) public void test003_cantMatchVarargsWithObjectArray_withincodePCD() { - CompilationResult cR = binaryWeave("testcode.jar","VarargsAspect04.aj",0,6,true); + CompilationResult cR = binaryWeave("testcode.jar","VarargsAspect04.aj",0,1,true); - // There are 7. Each piece of the pointcut is matched against all the shadows, so both - // the 'withincode' PCD and the 'call' PCD are matched against every join point. - // AMC - there are now SIX. We detect early that a call(* *(..)) pcd cannot match - // constructor call shadows and never do the match. assertTrue("Did not get expected message about a varargs mismatch, instead got: "+cR.getWarningMessages(), ((IMessage)cR.getWarningMessages().get(0)).toString().indexOf("varargs declared method")!=-1); @@ -79,9 +73,9 @@ public class VarargsTests extends TestUtils { System.err.println(cR.getErrorMessages()); System.err.println(cR.getInfoMessages()); verifyWeavingMessagesOutput(cR,new String[]{ - "weaveinfo Type 'SimpleVarargs' (SimpleVarargs.java:15) advised by before advice from 'VarargsAspect05' (VarargsAspect05.aj:3)", - "weaveinfo Type 'SimpleVarargs' (SimpleVarargs.java:16) advised by before advice from 'VarargsAspect05' (VarargsAspect05.aj:3)", - "weaveinfo Type 'SimpleVarargs' (SimpleVarargs.java:17) advised by before advice from 'VarargsAspect05' (VarargsAspect05.aj:3)"}); + "weaveinfo Type 'SimpleVarargs' (SimpleVarargs.java:20) advised by before advice from 'VarargsAspect05' (VarargsAspect05.aj:3)", + "weaveinfo Type 'SimpleVarargs' (SimpleVarargs.java:21) advised by before advice from 'VarargsAspect05' (VarargsAspect05.aj:3)", + "weaveinfo Type 'SimpleVarargs' (SimpleVarargs.java:22) advised by before advice from 'VarargsAspect05' (VarargsAspect05.aj:3)"}); } // before(): call(* *(int,Integer...)) { } - slightly more complex pcut @@ -92,9 +86,9 @@ public class VarargsTests extends TestUtils { System.err.println(cR.getInfoMessages()); verifyWeavingMessagesOutput(cR,new String[]{ - "weaveinfo Type 'SimpleVarargs' (SimpleVarargs.java:20) advised by before advice from 'VarargsAspect06' (VarargsAspect06.aj:3)", - "weaveinfo Type 'SimpleVarargs' (SimpleVarargs.java:21) advised by before advice from 'VarargsAspect06' (VarargsAspect06.aj:3)", - "weaveinfo Type 'SimpleVarargs' (SimpleVarargs.java:22) advised by before advice from 'VarargsAspect06' (VarargsAspect06.aj:3)"}); + "weaveinfo Type 'SimpleVarargs' (SimpleVarargs.java:25) advised by before advice from 'VarargsAspect06' (VarargsAspect06.aj:3)", + "weaveinfo Type 'SimpleVarargs' (SimpleVarargs.java:26) advised by before advice from 'VarargsAspect06' (VarargsAspect06.aj:3)", + "weaveinfo Type 'SimpleVarargs' (SimpleVarargs.java:27) advised by before advice from 'VarargsAspect06' (VarargsAspect06.aj:3)"}); } }
\ No newline at end of file |