aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/test')
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java12
-rw-r--r--tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml11
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java
index 574f1b7aa..e1f3fa1ca 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java
@@ -67,6 +67,18 @@ public class Bugs1920Tests extends XMLBasedAjcTestCase {
runTest("correctly handle overloaded private methods in aspects");
}
+ /**
+ * If one generic method overrides another one with a narrower return type, avoid matching bridge methods.
+ * <p>
+ * See <a href="https://github.com/spring-projects/spring-framework/issues/27761">Spring GitHub issue 27761</a>.
+ * <p>
+ * This test uses an ASM-modified class file reproducing the problem seen in Spring in plain AspectJ. Before the
+ * bugfix, it fails with <b>"advice defined in RepositoryAspect has not been applied [Xlint:adviceDidNotMatch]".</b>
+ */
+ public void test_Spring_GitHub_27761() {
+ runTest("do not match bridge methods");
+ }
+
public static Test suite() {
return XMLBasedAjcTestCase.loadSuite(Bugs1920Tests.class);
}
diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml
index 402f50a2f..db47e073d 100644
--- a/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml
+++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml
@@ -418,4 +418,15 @@
</run>
</ajc-test>
+ <!-- https://github.com/spring-projects/spring-framework/issues/27761 -->
+ <ajc-test dir="bugs1921/gh_spring_27761" vm="8" title="do not match bridge methods">
+ <compile files="RepositoryAspect.aj" inpath="JpaRepository_bridge_first.jar" options="-8"/>
+ <run class="RepositoryAspect">
+ <stdout>
+ <line text="execution(List RepositoryImpl.saveAll(Iterable))"/>
+ <line text="Saving [One, Two, Three]"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
</suite>