From efb3c54464efbcffdf82311e63b10eeeef4f349b Mon Sep 17 00:00:00 2001 From: acolyer Date: Fri, 26 Aug 2005 10:50:22 +0000 Subject: tests for pr108104 --- tests/bugs150/pr108104.aj | 31 ++++++++++++++++++++++ .../org/aspectj/systemtest/ajc150/Ajc150Tests.java | 4 +++ tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 5 ++++ 3 files changed, 40 insertions(+) create mode 100644 tests/bugs150/pr108104.aj (limited to 'tests') diff --git a/tests/bugs150/pr108104.aj b/tests/bugs150/pr108104.aj new file mode 100644 index 000000000..e4929c6d1 --- /dev/null +++ b/tests/bugs150/pr108104.aj @@ -0,0 +1,31 @@ +class Bug_Provider { + public void enable_bug(Object argument) {} +} + +class Bug_Checker extends Bug_Provider { + public T is_bug_enabled() { + return (T) new Boolean(true); + } +} + +public class pr108104 { + public static void main(String[] args) throws InterruptedException { + final Bug_Checker first = new Bug_Checker() { + @Override // compiler agrees, this is an override + public Boolean is_bug_enabled() { + return new Boolean(false); + } + }; + System.out.println("is bug enabled? " + first.is_bug_enabled()); // false + + first.enable_bug(null); + + final Bug_Checker second = new Bug_Checker() { + @Override + public Boolean is_bug_enabled() { + return new Boolean(false); + } + }; + System.out.println("is bug enabled? " +second.is_bug_enabled()); // true! + } +} \ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index f3fb8cb6f..d82a6b9ce 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -282,6 +282,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("matching against Object[]"); } + public void testMultipleAnonymousInnerClasses_pr108104() { + runTest("multiple anonymous inner classes 2"); + } + // helper methods..... public SyntheticRepository createRepos(File cpentry) { diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index a78887390..99182a7e1 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -132,6 +132,11 @@ + + + + + -- cgit v1.2.3