From d1e5c0a57c5da220b8f7357550db84f1009dbe2e Mon Sep 17 00:00:00 2001 From: jhugunin Date: Thu, 6 Mar 2003 00:24:39 +0000 Subject: [PATCH] FIXED: Bugzilla Bug 32463 ajc reports error when encountering static declaration of nested classes --- tests/ajcTests.xml | 14 +++++++ tests/bugs/WeaveLocal.java | 37 +++++++++++++++++++ tests/jimTests.xml | 7 +--- .../src/org/aspectj/weaver/NameMangler.java | 9 +---- .../src/org/aspectj/weaver/ResolvedTypeX.java | 30 ++++++++++++--- weaver/src/org/aspectj/weaver/TypeX.java | 29 +++++++-------- .../weaver/patterns/WithinPointcut.java | 5 ++- .../org/aspectj/weaver/TypeXTestCase.java | 4 +- 8 files changed, 95 insertions(+), 40 deletions(-) create mode 100644 tests/bugs/WeaveLocal.java diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml index df307d751..a43286131 100644 --- a/tests/ajcTests.xml +++ b/tests/ajcTests.xml @@ -5585,5 +5585,19 @@ + + + + + + + + + + + + diff --git a/tests/bugs/WeaveLocal.java b/tests/bugs/WeaveLocal.java new file mode 100644 index 000000000..25c882afd --- /dev/null +++ b/tests/bugs/WeaveLocal.java @@ -0,0 +1,37 @@ +// for Bug#: 32463 +import org.aspectj.testing.Tester; + + +public class WeaveLocal +{ + // Commenting out the static declaration makes everything work OK + static + { + class StaticNestedClass + { + } + } + + public static void main(String[] args) + { + System.out.println(new WeaveLocal().handleOrder("test")); + } + + private String handleOrder(String t) + { + return t; + } + +} + +aspect A { + + pointcut withinTest(): within(WeaveLocal); + pointcut callToHandleOrder() : (withinTest() && + call(* handleOrder(..))); + + Object around(): callToHandleOrder() { + + return "DUMMY inserted by ASPECT" ; + } +} diff --git a/tests/jimTests.xml b/tests/jimTests.xml index 6306ec843..b8771ef2a 100644 --- a/tests/jimTests.xml +++ b/tests/jimTests.xml @@ -1,12 +1,7 @@ - - - - - +