From 808bae83b3d5f37de4b39a2380db2782919a5f8a Mon Sep 17 00:00:00 2001 From: jhugunin Date: Thu, 10 Apr 2003 22:20:14 +0000 Subject: [PATCH] test and fix for Bugzilla Bug 36046 inter-type declaration bug with abstract classes --- tests/ajcTests.xml | 7 ++++ tests/bugs/interAbstract/Driver.java | 35 +++++++++++++++++++ tests/jimTests.xml | 6 +--- .../aspectj/weaver/bcel/BcelClassWeaver.java | 7 +++- .../org/aspectj/weaver/bcel/LazyClassGen.java | 2 +- .../aspectj/weaver/bcel/LazyMethodGen.java | 10 ++++-- 6 files changed, 57 insertions(+), 10 deletions(-) create mode 100644 tests/bugs/interAbstract/Driver.java diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml index 2d00cf805..55014305b 100644 --- a/tests/ajcTests.xml +++ b/tests/ajcTests.xml @@ -5768,4 +5768,11 @@ + + + + + diff --git a/tests/bugs/interAbstract/Driver.java b/tests/bugs/interAbstract/Driver.java new file mode 100644 index 000000000..1f2f37cd9 --- /dev/null +++ b/tests/bugs/interAbstract/Driver.java @@ -0,0 +1,35 @@ +//Bugzilla Bug 36046 +// inter-type declaration bug with abstract classes + +public class Driver { + public static void main(String args[]) { + Derived generator = new Derived(); + System.out.println(generator.getExecutions("processEvents")); + } + static aspect MonitorBase { + declare parents: Base implements ExecutionMonitor.MonitoredItem; + } +} + +class Derived extends Base { + public String getName() { + return null; + } +} + +abstract class Base { + abstract public String getName(); +} + +aspect ExecutionMonitor { + /** marker interface to indicate the execution monitor should track calls +and executions on this class. */ + public interface MonitoredItem { + int getExecutions(String methodName); + } + + /** a Map of events to mutable integers */ + public int MonitoredItem.getExecutions(String methodName) { + return 0; + } +} \ No newline at end of file diff --git a/tests/jimTests.xml b/tests/jimTests.xml index ea5a82516..cc3257d9f 100644 --- a/tests/jimTests.xml +++ b/tests/jimTests.xml @@ -1,10 +1,6 @@ - - - - +