aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-07-29 20:47:53 +0000
committerjhugunin <jhugunin>2003-07-29 20:47:53 +0000
commitaab8f36a22d0ac267dee63f4137dccdbe83d3559 (patch)
tree3b73010729e95017a5dc98a0a34f1d303283ab26
parentee03a3e557204184380193807326d1131c1f2777 (diff)
downloadaspectj-aab8f36a22d0ac267dee63f4137dccdbe83d3559.tar.gz
aspectj-aab8f36a22d0ac267dee63f4137dccdbe83d3559.zip
fix for Bugzilla Bug 40876
ClassFormatError on external subtype-qualified ref to supertype pointcut This was an important bug that was caused by the static fields used in the implementation of cflow being placed on the wrong class. This broke the rules used for name mangling and could occasionally result in name collisions as shown here.
-rw-r--r--tests/ajcTests.xml7
-rw-r--r--tests/ajcTestsFailing.xml7
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/CflowPointcut.java11
3 files changed, 14 insertions, 11 deletions
diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml
index 788451035..0058ddf2c 100644
--- a/tests/ajcTests.xml
+++ b/tests/ajcTests.xml
@@ -6470,5 +6470,12 @@
<message kind="error" line="10"/>
</compile>
</ajc-test>
+
+ <ajc-test dir="bugs"
+ pr="40876"
+ title="subtype-qualified pointcut reference">
+ <compile files="PointcutLibraryTest.java"/>
+ <run class="PointcutLibraryTest"/>
+ </ajc-test>
</suite>
diff --git a/tests/ajcTestsFailing.xml b/tests/ajcTestsFailing.xml
index 0f5af6454..2ac4c8bbe 100644
--- a/tests/ajcTestsFailing.xml
+++ b/tests/ajcTestsFailing.xml
@@ -5,13 +5,6 @@
<suite>
<ajc-test dir="bugs"
- pr="40876"
- title="subtype-qualified pointcut reference">
- <compile files="PointcutLibraryTest.java"/>
- <run class="PointcutLibraryTest"/>
- </ajc-test>
-
- <ajc-test dir="bugs"
pr="40858"
comment="shouldn't super ref be permitted?"
title="weaver trace on mis-qualified pointcut reference">
diff --git a/weaver/src/org/aspectj/weaver/patterns/CflowPointcut.java b/weaver/src/org/aspectj/weaver/patterns/CflowPointcut.java
index 7345ecffa..3a0a8acf2 100644
--- a/weaver/src/org/aspectj/weaver/patterns/CflowPointcut.java
+++ b/weaver/src/org/aspectj/weaver/patterns/CflowPointcut.java
@@ -135,7 +135,9 @@ public class CflowPointcut extends Pointcut {
Pointcut concreteEntry;
- CrosscuttingMembers xcut = bindings.getConcreteAspect().crosscuttingMembers;
+ ResolvedTypeX concreteAspect = bindings.getConcreteAspect();
+
+ CrosscuttingMembers xcut = concreteAspect.crosscuttingMembers;
Collection previousCflowEntries = xcut.getCflowEntries();
entryBindings.pushEnclosingDefinition(CFLOW_MARKER);
@@ -150,17 +152,18 @@ public class CflowPointcut extends Pointcut {
ResolvedMember cflowField = new ResolvedMember(
- Member.FIELD, inAspect, Modifier.STATIC | Modifier.PUBLIC | Modifier.FINAL,
+ Member.FIELD, concreteAspect, Modifier.STATIC | Modifier.PUBLIC | Modifier.FINAL,
NameMangler.cflowStack(xcut),
TypeX.forName(NameMangler.CFLOW_STACK_TYPE).getSignature());
+ //System.out.println("adding field to: " + inAspect + " field " + cflowField);
// add field and initializer to inAspect
//XXX and then that info above needs to be mapped down here to help with
//XXX getting the exposed state right
- bindings.getConcreteAspect().crosscuttingMembers.addConcreteShadowMunger(
+ concreteAspect.crosscuttingMembers.addConcreteShadowMunger(
Advice.makeCflowEntry(world, concreteEntry, isBelow, cflowField, freeVars.length, innerCflowEntries));
- bindings.getConcreteAspect().crosscuttingMembers.addTypeMunger(
+ concreteAspect.crosscuttingMembers.addTypeMunger(
world.makeCflowStackFieldAdder(cflowField));