]> source.dussan.org Git - aspectj.git/commitdiff
test and fix for 155763 - incorrect codegen from compiler leads to NPE
authoraclement <aclement>
Mon, 11 Sep 2006 16:59:56 +0000 (16:59 +0000)
committeraclement <aclement>
Mon, 11 Sep 2006 16:59:56 +0000 (16:59 +0000)
tests/bugs153/pr155763/Test.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
tests/src/org/aspectj/systemtest/ajc153/ajc153.xml

diff --git a/tests/bugs153/pr155763/Test.java b/tests/bugs153/pr155763/Test.java
new file mode 100644 (file)
index 0000000..2cc42f0
--- /dev/null
@@ -0,0 +1,31 @@
+import java.util.List;
+
+public class Test {
+
+       public boolean method(final MyInterface iface) {
+               for(final String s:iface.listFile()) if(s.equals("blah")) {
+                       System.out.println("Test.method()");
+                       continue;
+               }
+               return false;   
+       }
+
+       public void notCalledMethod() {
+       }
+
+}
+
+interface MyInterface {
+
+       public abstract List<String> listFile();
+}
+
+aspect MyAspect {
+
+       pointcut p() : call(public * Test.notCalledMethod());
+
+       before() : p() {
+               System.out.println("calling method");
+       }
+
+}
index 8f53af8fca8df754262f1fecadcf8dc6cc181257..c5181da45ba8948dbe98a91f096b98d4e31051b4 100644 (file)
@@ -83,6 +83,10 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
          runTest("NPE in InitializerSignatureImpl");
   }
   
+  public void testLineNumberTableCorrectWithGenericsForEachAndContinue_pr155763() {
+         runTest("ensure LineNumberTable correct with generics, for each and continue");
+  }
+  
   /////////////////////////////////////////
   public static Test suite() {
     return XMLBasedAjcTestCase.loadSuite(Ajc153Tests.class);
index 2dc4ec7e7b679a6b3af68822f4558939b8521b3b..3df82bc33c90e4b1ee4e6db200da4a3c5d46d802 100644 (file)
       </run>
     </ajc-test>
     
+    <ajc-test dir="bugs153/pr155763" title="ensure LineNumberTable correct with generics, for each and continue">
+      <compile files="Test.java" options="-1.5">
+               <message kind="warning" line="27" text="adviceDidNotMatch"/>
+         </compile>    
+    </ajc-test>
+
 </suite>
\ No newline at end of file