aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/CrosscuttingMembersSet.java12
-rw-r--r--weaver/src/org/aspectj/weaver/ResolvedTypeX.java7
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();