summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-08-26 10:50:22 +0000
committeracolyer <acolyer>2005-08-26 10:50:22 +0000
commitefb3c54464efbcffdf82311e63b10eeeef4f349b (patch)
treeb732eda2d8f495e0d95b8a7f8a7cd97a5d424c38 /tests
parent100d9e056735e85610fe9072527a0369dc867ec5 (diff)
downloadaspectj-efb3c54464efbcffdf82311e63b10eeeef4f349b.tar.gz
aspectj-efb3c54464efbcffdf82311e63b10eeeef4f349b.zip
tests for pr108104
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs150/pr108104.aj31
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java4
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml5
3 files changed, 40 insertions, 0 deletions
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<T> 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<Boolean> first = new Bug_Checker<Boolean>() {
+ @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<Boolean> second = new Bug_Checker<Boolean>() {
+ @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 @@
<message kind="error" line="4" text="wildcard type pattern not allowed"></message>
</compile>
</ajc-test>
+
+ <ajc-test dir="bugs150" pr="108104" title="multiple anonymous inner classes 2">
+ <compile files="pr108104.aj" options="-1.5">
+ </compile>
+ </ajc-test>
<ajc-test dir="bugs150/pr106130" pr="106130" title="test weaving with > 256 locals">
<compile files="AroundLotsOfVars.java LotsOfVars.java" options="-preserveAllLocals"/>