From: aclement Date: Tue, 5 May 2009 23:40:59 +0000 (+0000) Subject: 275032: test and fix: itd of no-arg constructor should overwrite a generated default... X-Git-Tag: V1_6_5~49 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=262cb6dd7fa047f97b9c76e7425964ae542b147c;p=aspectj.git 275032: test and fix: itd of no-arg constructor should overwrite a generated default constructor --- diff --git a/tests/bugs165/pr275032/A.java b/tests/bugs165/pr275032/A.java new file mode 100644 index 000000000..3b2db0089 --- /dev/null +++ b/tests/bugs165/pr275032/A.java @@ -0,0 +1,7 @@ +public class A { + int i = 5; + + public static void main(String[] argv) { + new A(); + } +} diff --git a/tests/bugs165/pr275032/X.java b/tests/bugs165/pr275032/X.java new file mode 100644 index 000000000..5556cf042 --- /dev/null +++ b/tests/bugs165/pr275032/X.java @@ -0,0 +1,6 @@ +import org.aspectj.lang.annotation.*; +aspect X { + @SuppressAjWarnings + public A.new() {System.out.println("itd ctor");} + +} diff --git a/tests/bugs165/pr275032/c2/A.java b/tests/bugs165/pr275032/c2/A.java new file mode 100644 index 000000000..8f7645bec --- /dev/null +++ b/tests/bugs165/pr275032/c2/A.java @@ -0,0 +1,9 @@ +public class A { + public A() { + System.out.println("real default ctor"); + } + + public static void main(String[] argv) { + new A(); + } +} diff --git a/tests/bugs165/pr275032/c2/X.java b/tests/bugs165/pr275032/c2/X.java new file mode 100644 index 000000000..0c560d6c0 --- /dev/null +++ b/tests/bugs165/pr275032/c2/X.java @@ -0,0 +1,4 @@ +aspect X { + public A.new() {System.out.println("itd");} + +} diff --git a/tests/src/org/aspectj/systemtest/ajc165/Ajc165Tests.java b/tests/src/org/aspectj/systemtest/ajc165/Ajc165Tests.java index dcb857f8d..ec98633a2 100644 --- a/tests/src/org/aspectj/systemtest/ajc165/Ajc165Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc165/Ajc165Tests.java @@ -20,6 +20,26 @@ import org.aspectj.weaver.LintMessage; public class Ajc165Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + // check ITD can replace a generated default constructor + public void testItdDefaultCtor_pr275032() { + runTest("itd default ctor"); + } + + // check ITD can't overwrite an existing constructor + public void testItdDefaultCtor_pr275032_2() { + runTest("itd default ctor - 2"); + } + + // binary weaving version of case 2 - check ITD can't overwrite an existing constructor + public void testItdDefaultCtor_pr275032_3() { + runTest("itd default ctor - 3"); + } + + // binary weaving version of case 4 - check ITD can replace a generated default constructor + public void testItdDefaultCtor_pr275032_4() { + runTest("itd default ctor - 4"); + } + public void testVerifyOnAnnoBind_pr273628() { runTest("verifyerror on anno bind"); } @@ -60,7 +80,7 @@ public class Ajc165Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testGenericITD_pr272825() { runTest("generic ITD"); } - + // --- public static Test suite() { diff --git a/tests/src/org/aspectj/systemtest/ajc165/ajc165.xml b/tests/src/org/aspectj/systemtest/ajc165/ajc165.xml index c15e75830..169b85755 100644 --- a/tests/src/org/aspectj/systemtest/ajc165/ajc165.xml +++ b/tests/src/org/aspectj/systemtest/ajc165/ajc165.xml @@ -2,6 +2,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +