]> source.dussan.org Git - aspectj.git/commitdiff
test and fix for 226201 - convert return type of generic advice to parameterized...
authoraclement <aclement>
Sun, 8 Jun 2008 21:36:29 +0000 (21:36 +0000)
committeraclement <aclement>
Sun, 8 Jun 2008 21:36:29 +0000 (21:36 +0000)
tests/bugs161/pr226201/IntAspTest.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java
tests/src/org/aspectj/systemtest/ajc161/ajc161.xml

diff --git a/tests/bugs161/pr226201/IntAspTest.java b/tests/bugs161/pr226201/IntAspTest.java
new file mode 100644 (file)
index 0000000..8c7cb28
--- /dev/null
@@ -0,0 +1,23 @@
+
+abstract aspect GenAsp<T> {
+    public abstract T transform(T x);
+    T around() : execution(T *(*)) {return transform(proceed());}
+}
+
+aspect IntAsp extends GenAsp<Integer> {
+       
+    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) {
+               
+       }
+    }
+}
+
index c138dc1b4a97d0a3d8ac52ba921c85b0ccdbfd4b..7b15ef994201c2b8b944135335e96c577b4d3cee 100644 (file)
@@ -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() {
index 792560cffd74928547aaf5bfd982c26c311112a3..8e7e714cdbf12c27b232594d6c7a8ee8e54d2edd 100644 (file)
@@ -3,6 +3,13 @@
 <!-- AspectJ v1.6.1 Tests -->
 <suite>
 
+       <ajc-test dir="bugs161/pr226201" title="generic aspect around advice">
+       <compile files="IntAspTest.java" options="-1.5"/>
+       <run class="IntAspTest">
+       </run>
+    </ajc-test>
+    
+
        <ajc-test dir="bugs161/pr235829" title="crazy generics and inner types">
        <compile files="Main.java a/Adapter.java a/b/Adapter.java" options="-1.5"/>
        <run class="Main"/>