summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2004-10-19 10:37:31 +0000
committeraclement <aclement>2004-10-19 10:37:31 +0000
commit6beb43faeecff249a33e7d7e2489c6a92a4700fd (patch)
treeb31102f64c9d7a5df4eaea1dfbbcde01f207c8e9 /tests
parentae186f2bb93f3a7c3834dfd0e6712d10af5fd6c7 (diff)
downloadaspectj-6beb43faeecff249a33e7d7e2489c6a92a4700fd.tar.gz
aspectj-6beb43faeecff249a33e7d7e2489c6a92a4700fd.zip
Fix for Bugzilla Bug 76096: Anonymous classes unaware of introductions into abstract classes (error can't find type $Local$)
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/pr76096/ConcreteClassA.java50
-rw-r--r--tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java4
-rw-r--r--tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml5
3 files changed, 59 insertions, 0 deletions
diff --git a/tests/bugs/pr76096/ConcreteClassA.java b/tests/bugs/pr76096/ConcreteClassA.java
new file mode 100644
index 000000000..77bbb9ee6
--- /dev/null
+++ b/tests/bugs/pr76096/ConcreteClassA.java
@@ -0,0 +1,50 @@
+// In the ConcreteClassA.someMethod() method, the creation of the anonymous class should
+// be ok as the ITD ensures that InterfaceA.a2() is implemented.
+
+interface InterfaceA {
+ public void a1();
+ public void a2();
+}
+
+abstract class AbstractClassA implements InterfaceA {
+ public void a1() {
+ System.out.println("AbstractClassA.a()");
+ }
+}
+
+public class ConcreteClassA extends AbstractClassA {
+ public void someMethod() {
+ InterfaceA a = new AbstractClassA() { };
+ a.a2();
+ }
+
+ public static void main(String[]argv) {
+ new ConcreteClassA().someMethod();
+ new concCB().someMethod();
+ }
+}
+
+aspect IntroAspectA {
+ public void AbstractClassA.a2() {
+ System.out.println("AbstractClassA.a2() from IntroAspectA");
+ }
+}
+
+interface IB {
+ public void m2();
+}
+
+abstract class absCB implements IB {
+ public void m1() { }
+}
+
+class concCB extends absCB {
+ public void someMethod() {
+ IB b = new IB() {};
+ b.m2();
+ }
+}
+
+aspect introAspectB {
+ public void IB.m2() {System.err.println("absCB.m1() from IB");}
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java b/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java
index 4e0cca88e..6e86caacc 100644
--- a/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java
@@ -334,4 +334,8 @@ public class Ajc121Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
runTest("Optimization of cflow - counters with abstract pointcuts (5)");
}
+ public void test064() {
+ runTest("Anonymous classes unaware of introductions into abstract classes");
+ }
+
} \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml b/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml
index a2684804d..2ec496b35 100644
--- a/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml
+++ b/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml
@@ -490,3 +490,8 @@
<compile files="CounterTest05.java"/>
<run class="CounterTest05"/>
</ajc-test>
+
+ <ajc-test dir="bugs/pr76096" pr="76096" title="Anonymous classes unaware of introductions into abstract classes">
+ <compile files="ConcreteClassA.java"/>
+ <run class="ConcreteClassA"/>
+ </ajc-test>