aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/test
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2023-01-21 11:25:49 +0100
committerAlexander Kriegisch <Alexander@Kriegisch.name>2023-01-21 11:25:49 +0100
commit782cd415e2ae2c314ffbeec05ee303dd7bdf6a81 (patch)
tree09005410dbb257563049dd2114c9e037c83bf152 /tests/src/test
parent53837367b0f04a20aab530741ea7a24a42e309e5 (diff)
downloadaspectj-782cd415e2ae2c314ffbeec05ee303dd7bdf6a81.tar.gz
aspectj-782cd415e2ae2c314ffbeec05ee303dd7bdf6a81.zip
Add regression test reproducing GitHub #214
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'tests/src/test')
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java4
-rw-r--r--tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml28
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java
index c20f9f2cf..ba4f99ade 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java
@@ -47,6 +47,10 @@ public class Bugs1919Tests extends XMLBasedAjcTestCase {
runTest("fuzzy array type matching, aspect compiled separately from target class");
}
+ public void test_GitHub_214() {
+ runTest("ArrayIndexOutOfBoundsException with Xlint unorderedAdviceAtShadow=warning");
+ }
+
public static Test suite() {
return XMLBasedAjcTestCase.loadSuite(Bugs1919Tests.class);
}
diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml
index 15f5d18d6..5ff07be04 100644
--- a/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml
+++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml
@@ -357,4 +357,32 @@
</run>
</ajc-test>
+ <!--
+ https://github.com/eclipse/org.aspectj/issues/214
+ https://github.com/mojohaus/aspectj-maven-plugin/issues/164
+ Problem with multiple, subsequent weaving steps and '-Xlint:warning' or '-Xlint:unorderedAdviceAtShadow=warning'
+ java.lang.ArrayIndexOutOfBoundsException: 1
+ [ERROR] at org.aspectj.weaver.bcel.BcelShadow.prepareForMungers(BcelShadow.java:379)
+ [ERROR] at org.aspectj.weaver.Shadow.implement(Shadow.java:546)
+ -->
+ <ajc-test dir="bugs1919/github_214" vm="1.5" title="ArrayIndexOutOfBoundsException with Xlint unorderedAdviceAtShadow=warning">
+ <compile files="FirstAspect.java MarkerOne.java" options="-1.8 -showWeaveInfo -Xlint:warning" outjar="first-aspect.jar">
+ <message kind="warning" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]"/>
+ <message kind="warning" text="advice defined in FirstAspect has not been applied [Xlint:adviceDidNotMatch]"/>
+ </compile>
+ <compile files="Application.java MarkerTwo.java" options="-1.5 -showWeaveInfo -Xlint:warning" classpath="first-aspect.jar" outjar="application.jar"/>
+ <compile files="SecondAspect.java" options="-1.5 -showWeaveInfo -Xlint:warning" aspectpath="first-aspect.jar" inpath="application.jar" outjar="second-aspect.jar">
+ <message kind="warning" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]"/>
+ <message kind="warning" text="at this shadow method-execution(void Application.greet(java.lang.String)) no precedence is specified between advice applying from aspect FirstAspect and aspect SecondAspect [Xlint:unorderedAdviceAtShadow]"/>
+ <message kind="warning" text="can not implement lazyTjp at joinpoint method-execution(void Application.greet(java.lang.String)) because of advice conflicts, see secondary locations to find conflicting advice [Xlint:multipleAdviceStoppingLazyTjp]"/>
+ <message kind="weave" text="method-execution(void Application.greet(java.lang.String))' in Type 'Application' (Application.java:4) advised by around advice from 'SecondAspect'"/>
+ <message kind="weave" text="method-execution(void Application.greet(java.lang.String))' in Type 'Application' (Application.java:4) advised by before advice from 'FirstAspect'"/>
+ </compile>
+ <run class="Application" classpath="second-aspect.jar first-aspect.jar">
+ <stdout>
+ <line text="Hello world!"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
</suite>