summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2006-09-11 16:59:56 +0000
committeraclement <aclement>2006-09-11 16:59:56 +0000
commit018b33eab8e607e54b65752cc65a25b66e1a0e91 (patch)
tree5a5ea9c35fc54d5ef6c4f9ff6ceeb4217f222d50 /tests
parente5b2cd7148abec67d52132a9cddb9aea91acc9a1 (diff)
downloadaspectj-018b33eab8e607e54b65752cc65a25b66e1a0e91.tar.gz
aspectj-018b33eab8e607e54b65752cc65a25b66e1a0e91.zip
test and fix for 155763 - incorrect codegen from compiler leads to NPE
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs153/pr155763/Test.java31
-rw-r--r--tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java4
-rw-r--r--tests/src/org/aspectj/systemtest/ajc153/ajc153.xml6
3 files changed, 41 insertions, 0 deletions
diff --git a/tests/bugs153/pr155763/Test.java b/tests/bugs153/pr155763/Test.java
new file mode 100644
index 000000000..2cc42f0cc
--- /dev/null
+++ b/tests/bugs153/pr155763/Test.java
@@ -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");
+ }
+
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
index 8f53af8fc..c5181da45 100644
--- a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
@@ -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);
diff --git a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
index 2dc4ec7e7..3df82bc33 100644
--- a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
+++ b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
@@ -383,4 +383,10 @@
</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