From 358beefe5e1e0ee7fd2da5b025fd419fcd0a71c1 Mon Sep 17 00:00:00 2001 From: aclement Date: Sun, 8 Jun 2008 21:36:29 +0000 Subject: [PATCH] test and fix for 226201 - convert return type of generic advice to parameterized type --- tests/bugs161/pr226201/IntAspTest.java | 23 +++++++++++++++++++ .../systemtest/ajc161/Ajc161Tests.java | 1 + .../org/aspectj/systemtest/ajc161/ajc161.xml | 7 ++++++ 3 files changed, 31 insertions(+) create mode 100644 tests/bugs161/pr226201/IntAspTest.java diff --git a/tests/bugs161/pr226201/IntAspTest.java b/tests/bugs161/pr226201/IntAspTest.java new file mode 100644 index 000000000..8c7cb28bb --- /dev/null +++ b/tests/bugs161/pr226201/IntAspTest.java @@ -0,0 +1,23 @@ + +abstract aspect GenAsp { + public abstract T transform(T x); + T around() : execution(T *(*)) {return transform(proceed());} +} + +aspect IntAsp extends GenAsp { + + public Integer transform(Integer x) {return x;} // identity transformation +} + +public class IntAspTest { + static Integer mylength(String x) {return x.length();} + + public static void main(String[] args) { + try { + System.out.println(mylength("")); + } catch (StackOverflowError soe) { + + } + } +} + diff --git a/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java b/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java index c138dc1b4..7b15ef994 100644 --- a/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java @@ -23,6 +23,7 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // AspectJ1.6.1 + public void testGenericAspectAroundAdvice_pr226201() { runTest("generic aspect around advice");} public void testCrazyGenericsInnerTypes_pr235829() { runTest("crazy generics and inner types");} public void testAnnotationExposureGenerics_pr235597() { runTest("annotation exposure and generics");} public void testIncorrectRelationship_pr235204() { diff --git a/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml b/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml index 792560cff..8e7e714cd 100644 --- a/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml +++ b/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml @@ -3,6 +3,13 @@ + + + + + + + -- 2.39.5