]> source.dussan.org Git - aspectj.git/commitdiff
223226: test and fix for NPE and duplicate signature
authoraclement <aclement>
Wed, 11 Jun 2008 20:54:26 +0000 (20:54 +0000)
committeraclement <aclement>
Wed, 11 Jun 2008 20:54:26 +0000 (20:54 +0000)
tests/bugs161/pr223226/AspectX.java [new file with mode: 0644]
tests/bugs161/pr223226/AspectXMarker.java [new file with mode: 0644]
tests/bugs161/pr223226/BInterface.java [new file with mode: 0644]
tests/bugs161/pr223226/Foo.java [new file with mode: 0644]
tests/bugs161/pr223226/FooInterface.java [new file with mode: 0644]
tests/bugs161/pr223226/Test.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/pr223226/AspectX.java b/tests/bugs161/pr223226/AspectX.java
new file mode 100644 (file)
index 0000000..76fa159
--- /dev/null
@@ -0,0 +1,4 @@
+public aspect AspectX
+{
+        public A AspectXMarker<A,B>.doSomething(B b) { return null; }
+}
diff --git a/tests/bugs161/pr223226/AspectXMarker.java b/tests/bugs161/pr223226/AspectXMarker.java
new file mode 100644 (file)
index 0000000..f880df4
--- /dev/null
@@ -0,0 +1,3 @@
+public interface AspectXMarker <A, B extends BInterface<?> > extends   
+FooInterface<A, B>
+{ }
diff --git a/tests/bugs161/pr223226/BInterface.java b/tests/bugs161/pr223226/BInterface.java
new file mode 100644 (file)
index 0000000..790d496
--- /dev/null
@@ -0,0 +1,2 @@
+public interface BInterface<S> { }
+
diff --git a/tests/bugs161/pr223226/Foo.java b/tests/bugs161/pr223226/Foo.java
new file mode 100644 (file)
index 0000000..4aaa0fb
--- /dev/null
@@ -0,0 +1,3 @@
+public class Foo<B extends BInterface<?>> implements AspectXMarker<Integer, B>
+{}
+
diff --git a/tests/bugs161/pr223226/FooInterface.java b/tests/bugs161/pr223226/FooInterface.java
new file mode 100644 (file)
index 0000000..e4884ba
--- /dev/null
@@ -0,0 +1,5 @@
+public interface FooInterface<A,B>
+{
+        public A doSomething(B transition);
+}
+
diff --git a/tests/bugs161/pr223226/Test.java b/tests/bugs161/pr223226/Test.java
new file mode 100644 (file)
index 0000000..354916d
--- /dev/null
@@ -0,0 +1,9 @@
+public class Test 
+{
+        public static void main(String[] args)
+        {
+                Foo<BInterface<Integer>> foo = new Foo<BInterface<Integer>>();
+
+                foo.doSomething(null);
+        }
+}
index 04551984b977edaa0eaf12a4d734aaa711e024a0..94c28eaabf90330c75caab17dfc153723a06cd0f 100644 (file)
@@ -23,6 +23,8 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        
        // AspectJ1.6.1
+       public void testDuplicateMethodSignature_pr223226_2() { runTest("duplicate method signature - 2"); }
+       public void testDuplicateMethodSignature_pr223226() { runTest("duplicate method signature"); }
        public void testProtectedMethodsAroundAdvice_pr197719_2() { runTest("protected methods and around advice - again - 2");}
        public void testProtectedMethodsAroundAdvice_pr197719() { runTest("protected methods and around advice - again");}
        public void testProtectedMethodsAroundAdvice_pr230075() { runTest("protected methods and around advice");}
index 59838531e3a67548e2bdb2640c4be7ee1beb5619..5ecf573707b62fc75bdc352ae9fc03a72dd73644 100644 (file)
@@ -3,6 +3,20 @@
 <!-- AspectJ v1.6.1 Tests -->
 <suite>
 
+       <ajc-test dir="bugs161/pr223226" title="duplicate method signature - 2">
+       <compile files="AspectX.java BInterface.java FooInterface.java AspectXMarker.java Foo.java Test.java" options="-1.5"/>
+       <run class="Test"/>
+    </ajc-test>
+    
+       <ajc-test dir="bugs161/pr223226" title="duplicate method signature">
+       <compile files="AspectX.java BInterface.java FooInterface.java AspectXMarker.java Foo.java Test.java" options="">
+         <message kind="error" line="1"/>
+         <message kind="error" line="2"/>
+         <message kind="error" line="3"/>
+         <message kind="error" line="5"/>
+       </compile>
+    </ajc-test>
+
        <ajc-test dir="bugs161/pr197719" title="protected methods and around advice - again - 2">
        <compile files="test/aspects/C1.java test/aspects/C3.java test/aspects/MyAnn.java test/aspects/MyAnnAspect.java test/aspects2/C2.java" options="-1.5 -showWeaveInfo">
          <message kind="weave" text="Join point 'method-call(void test.aspects.C1.aMethod())' in Type 'test.aspects.C1' (C1.java:12) "/>