diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2023-01-15 14:16:04 +0100 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2023-01-15 14:41:51 +0100 |
commit | 43cb1e2fc4dc127c39e550bdcd2efaf84c4b7a0f (patch) | |
tree | 689a0354e7f6a439688d16a17f2fefac19fab83e | |
parent | a3523e3aaee535e59bc437514d6b3c8e038e65b2 (diff) | |
download | aspectj-43cb1e2fc4dc127c39e550bdcd2efaf84c4b7a0f.tar.gz aspectj-43cb1e2fc4dc127c39e550bdcd2efaf84c4b7a0f.zip |
Fix failing tests after previous commit
After the changes, the weaver's behaviour is now slightly different, but
not actually buggy. Actually, in one case there is now a weaver warning
for a non-matching pointcut which should have been there before, but was
not. I.e., things have improved and the tests are even a bit better now.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
4 files changed, 35 insertions, 23 deletions
diff --git a/tests/bugs165/pr272233/Iffy2.java b/tests/bugs165/pr272233/Iffy2.java index 15a5d79fd..99dd10935 100644 --- a/tests/bugs165/pr272233/Iffy2.java +++ b/tests/bugs165/pr272233/Iffy2.java @@ -1,15 +1,24 @@ import java.util.*; import org.aspectj.lang.annotation.*; -@Aspect +@Aspect class Iffy2 { - @Before("execution(!void[] *(..))") + @Before("execution(!void *(..))") public void advice1() {} - @Before("execution(!void[] *(..))") + @Before("execution(!void[] *(..))") public void advice2() {} + @Before("execution(!void *(..))") + public void advice3() {} + + @Before("execution(*..Collection[] *(..))") + public void advice4() {} + + @Before("execution(java.util.Collection<?>[] *(..))") + public void advice5() {} + public Collection<?>[] getCollectionArray() { return null; } diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc162/ajc162.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc162/ajc162.xml index e45a21509..d63e5002f 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc162/ajc162.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc162/ajc162.xml @@ -252,6 +252,7 @@ <ajc-test dir="bugs162/pr240693" title="privileged generics"> <compile files="PayloadClass.java SomeInterface.java GenericClassInAdvice.java" options="-1.5"> + <message kind="warning" text="advice defined in GenericClassInAdvice has not been applied [Xlint:adviceDidNotMatch]"/> </compile> </ajc-test> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc165/ajc165.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc165/ajc165.xml index 6c3b74d71..e1258bdfb 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc165/ajc165.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc165/ajc165.xml @@ -1,12 +1,12 @@ <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> <suite> - + <ajc-test dir="bugs165/pr277959" title="verifyerror"> <compile files="AOPTest.java CodeAspect.java" options="-1.5"/> <run class="example.AOPTest"/> </ajc-test> - + <ajc-test dir="bugs165/pr277508" title="if method names"> <compile files="Basic.java" options="-1.5"/> <run class="Basic"> @@ -17,7 +17,7 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs165/pr277508" title="if method names - 2"> <compile files="Basic2.java" options="-1.5"/> <run class="Basic2"> @@ -28,15 +28,15 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs165/pr275625" title="dec anno method"> <compile files="A.java" options="-1.5"/> </ajc-test> - + <ajc-test dir="bugs165/pr275625" title="dec anno field"> <compile files="F.java" options="-1.5"/> </ajc-test> - + <ajc-test dir="bugs165/pr275032" title="itd default ctor"> <compile files="A.java X.java" options="-1.5 -Xlint:ignore"/> <run class="A"> @@ -45,20 +45,20 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs165/pr275032/c2" title="itd default ctor - 2"> <compile files="A.java X.java" options="-1.5 -Xlint:ignore"> <message kind="error" text="inter-type declaration from X conflicts with existing"/> </compile> </ajc-test> - + <ajc-test dir="bugs165/pr275032/c2" title="itd default ctor - 3"> <compile files="A.java" options="-outjar foo.jar"/> <compile files="X.java" options="-1.5 -Xlint:ignore" inpath="foo.jar"> <message kind="error" text="inter-type declaration from X conflicts with existing"/> </compile> </ajc-test> - + <ajc-test dir="bugs165/pr275032" title="itd default ctor - 4"> <compile files="A.java" options="-outjar foo.jar"/> <compile files="X.java" options="-1.5" inpath="foo.jar"> @@ -69,20 +69,23 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs165/pr272233" title="funky pointcut"> <compile files="Iffy.java" options="-1.5"> <message kind="warning" text="void is not a generic type"/> </compile> </ajc-test> - + <ajc-test dir="bugs165/pr272233" title="funky pointcut 2"> <compile files="Iffy2.java" options="-1.5 -showWeaveInfo"> - <message kind="weave" text="advised by before advice from 'Iffy2' (Iffy2.java:11)"/> <message kind="weave" text="advised by before advice from 'Iffy2' (Iffy2.java:8)"/> + <message kind="weave" text="advised by before advice from 'Iffy2' (Iffy2.java:11)"/> + <message kind="weave" text="advised by before advice from 'Iffy2' (Iffy2.java:14)"/> + <message kind="weave" text="advised by before advice from 'Iffy2' (Iffy2.java:17)"/> + <message kind="weave" text="advised by before advice from 'Iffy2' (Iffy2.java:20)"/> </compile> </ajc-test> - + <ajc-test dir="bugs165/pr265356" title="annotation style message positions"> <compile files="Main.java" options="-1.5"> <message kind="warning" line="11"/> @@ -94,7 +97,7 @@ <ajc-test dir="bugs165/pr271169" title="around call npe"> <compile files="HypChecksums.java" options="-1.5"/> </ajc-test> - + <ajc-test dir="bugs165/pr273628" title="verifyerror on anno bind"> <compile files="AnnotationAspect.java ApiDescriptor.java AspectTargetClass.java MonitorableMethod.java TestPointcutAnnotationAspect.java" options="-1.5"/> <run class="p.TestPointcutAnnotationAspect"/> @@ -114,4 +117,4 @@ </run> </ajc-test> -</suite>
\ No newline at end of file +</suite> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc193/ajc193.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc193/ajc193.xml index 10b6a8350..81f3222c5 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc193/ajc193.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc193/ajc193.xml @@ -139,9 +139,9 @@ Method call </compile> <run class="Basic3b"> <stdout> - <!-- BUG: one of these should be YImpl --> - <line text="X.IImpl.m2() ran"/> - <line text="X.IImpl.m2() ran"/> + <!-- BUG: There should be one of each X.IImpl and Y.IImpl, just like for @decm. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=543657#c5. --> + <line text="Y.IImpl.m2() ran"/> + <line text="Y.IImpl.m2() ran"/> <line text="Basic3b.main ran"/> </stdout> </run> @@ -161,7 +161,6 @@ Method call <message kind="weave" text="Join point 'method-call(void java.io.PrintStream.println(java.lang.String))' in Type 'Basic3b' (Basic3b.java:11) advised by before advice from 'X' (Basic3b.java:33)"/> </compile> <compile files="Y.java" inpath="ow1.jar" options="-showWeaveInfo -1.8 -Xset:overWeaving=true"> - <message kind="weave" text="Join point 'method-call(void java.io.PrintStream.println(java.lang.String))' in Type 'Y$IIimpl' (Y.java:10) advised by before advice from 'Y' (Y.java:17)"/> <message kind="weave" text="Join point 'method-call(void java.io.PrintStream.println(java.lang.String))' in Type 'Y$IIimpl' (Y.java:10) advised by before advice from 'X' (ow1.jar!X.class(from Basic3b.java))"/> <message kind="weave" text="Join point 'method-call(void X.advice1())' in Type 'X$IIimpl' (Basic3b.java:23) advised by before advice from 'Y' (Y.java:17)"/> @@ -183,7 +182,7 @@ Method call </compile> <run class="Basic3b"> <stdout> - <!-- BUG: one of these should be YImpl --> + <!-- BUG: There should be one of each X.IImpl and Y.IImpl, just like for @decm. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=543657#c5. --> <line text="X.IImpl.m2() ran"/> <line text="X.IImpl.m2() ran"/> <line text="Basic3b.main ran"/> |