From 018b33eab8e607e54b65752cc65a25b66e1a0e91 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 11 Sep 2006 16:59:56 +0000 Subject: [PATCH] test and fix for 155763 - incorrect codegen from compiler leads to NPE --- tests/bugs153/pr155763/Test.java | 31 +++++++++++++++++++ .../systemtest/ajc153/Ajc153Tests.java | 4 +++ .../org/aspectj/systemtest/ajc153/ajc153.xml | 6 ++++ 3 files changed, 41 insertions(+) create mode 100644 tests/bugs153/pr155763/Test.java 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 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 @@ + + + + + + \ No newline at end of file -- 2.39.5