diff options
author | jhugunin <jhugunin> | 2003-09-12 16:49:58 +0000 |
---|---|---|
committer | jhugunin <jhugunin> | 2003-09-12 16:49:58 +0000 |
commit | b5127388a3b5a2403e8d8944766bbe1895e09530 (patch) | |
tree | 1bc69df69075a48d0180b21e080f4c9f7bcaf9da /weaver | |
parent | 3b79af95c2373158d6b4149476746e880866e385 (diff) | |
download | aspectj-b5127388a3b5a2403e8d8944766bbe1895e09530.tar.gz aspectj-b5127388a3b5a2403e8d8944766bbe1895e09530.zip |
fix and test for Bugzilla Bug 42993
Language regression, or possible language improvement?
The problem was caused by moving name binding in pointcut declarations to
happen before declare parents are evaluated. Because of this, the
compiler doesn't know that ContainerDescriptor isa Key when resolving
the ContainerLoader.containerLoads reference.
The change in ordering was made to fix a bug reported in declare error
and declare soft whose pcds where being evaluated before name binding
had happened in the pointcut declarations. Unfortunately, declare error
and declare soft are concretized at the same time as declare parents
(and all other declares ;-), so this move also led to the regression
noted above.
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/CrosscuttingMembersSet.java | 12 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/ResolvedTypeX.java | 7 |
2 files changed, 12 insertions, 7 deletions
diff --git a/weaver/src/org/aspectj/weaver/CrosscuttingMembersSet.java b/weaver/src/org/aspectj/weaver/CrosscuttingMembersSet.java index ec81a0cf2..2dcae923c 100644 --- a/weaver/src/org/aspectj/weaver/CrosscuttingMembersSet.java +++ b/weaver/src/org/aspectj/weaver/CrosscuttingMembersSet.java @@ -59,6 +59,11 @@ public class CrosscuttingMembersSet { } } } + + public void addAdviceLikeDeclares(ResolvedTypeX aspectType) { + CrosscuttingMembers xcut = (CrosscuttingMembers)members.get(aspectType); + xcut.addDeclares(aspectType.collectDeclares(true)); + } public boolean deleteAspect(TypeX aspectType) { boolean isAspect = members.remove(aspectType) != null; @@ -69,7 +74,7 @@ public class CrosscuttingMembersSet { public boolean containsAspect(TypeX aspectType) { return members.containsKey(aspectType); } - + //XXX only for testing public void addFixedCrosscuttingMembers(ResolvedTypeX aspectType) { members.put(aspectType, aspectType.crosscuttingMembers); @@ -139,8 +144,5 @@ public class CrosscuttingMembersSet { declareDominates = ret; } return declareDominates; - } - - - + } } diff --git a/weaver/src/org/aspectj/weaver/ResolvedTypeX.java b/weaver/src/org/aspectj/weaver/ResolvedTypeX.java index e3504fcbe..d4526ec9d 100644 --- a/weaver/src/org/aspectj/weaver/ResolvedTypeX.java +++ b/weaver/src/org/aspectj/weaver/ResolvedTypeX.java @@ -329,14 +329,14 @@ public abstract class ResolvedTypeX extends TypeX { crosscuttingMembers.setPerClause(getPerClause()); crosscuttingMembers.addShadowMungers(collectShadowMungers()); crosscuttingMembers.addTypeMungers(getTypeMungers()); - crosscuttingMembers.addDeclares(collectDeclares()); + crosscuttingMembers.addDeclares(collectDeclares(!this.doesNotExposeShadowMungers())); crosscuttingMembers.addPrivilegedAccesses(getPrivilegedAccesses()); //System.err.println("collected cc members: " + this + ", " + collectDeclares()); return crosscuttingMembers; } - private final Collection collectDeclares() { + public final Collection collectDeclares(boolean includeAdviceLike) { if (! this.isAspect() ) return Collections.EMPTY_LIST; ArrayList ret = new ArrayList(); @@ -345,6 +345,9 @@ public abstract class ResolvedTypeX extends TypeX { Declare dec = (Declare) i.next(); if (!dec.isAdviceLike()) ret.add(dec); } + + if (!includeAdviceLike) return ret; + if (!this.isAbstract()) { //ret.addAll(getDeclares()); final Iterators.Filter dupFilter = Iterators.dupFilter(); |