diff options
-rw-r--r-- | org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembers.java | 9 | ||||
-rw-r--r-- | org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembersSet.java | 17 |
2 files changed, 26 insertions, 0 deletions
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembers.java b/org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembers.java index 14de71e79..af2fe22ce 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembers.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembers.java @@ -27,6 +27,7 @@ import org.aspectj.weaver.patterns.DeclareErrorOrWarning; import org.aspectj.weaver.patterns.DeclareParents; import org.aspectj.weaver.patterns.DeclarePrecedence; import org.aspectj.weaver.patterns.DeclareSoft; +import org.aspectj.weaver.patterns.DeclareTypeErrorOrWarning; import org.aspectj.weaver.patterns.PerClause; import org.aspectj.weaver.patterns.Pointcut; import org.aspectj.weaver.patterns.PointcutRewriter; @@ -62,6 +63,8 @@ public class CrosscuttingMembers { private Set<DeclareAnnotation> declareAnnotationsOnMethods = new HashSet<DeclareAnnotation>(); // declareAnnotationsOnMethods includes constructors too + private Set<DeclareTypeErrorOrWarning> declareTypeEow = new HashSet<DeclareTypeErrorOrWarning>(); + private boolean shouldConcretizeIfNeeded = true; public CrosscuttingMembers(ResolvedType inAspect, boolean shouldConcretizeIfNeeded) { @@ -156,6 +159,8 @@ public class CrosscuttingMembers { } else if (da.isDeclareAtMethod() || da.isDeclareAtConstuctor()) { declareAnnotationsOnMethods.add(da); } + } else if (declare instanceof DeclareTypeErrorOrWarning) { + declareTypeEow.add((DeclareTypeErrorOrWarning) declare); } else { throw new RuntimeException("unimplemented"); } @@ -538,6 +543,10 @@ public class CrosscuttingMembers { return declareAnnotationsOnMethods; } + public Collection<DeclareTypeErrorOrWarning> getDeclareTypeErrorOrWarning() { + return declareTypeEow; + } + public Map getCflowBelowFields() { return cflowBelowFields; } diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembersSet.java b/org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembersSet.java index d81ef0b2c..04d23488f 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembersSet.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembersSet.java @@ -26,6 +26,7 @@ import org.aspectj.weaver.patterns.Declare; import org.aspectj.weaver.patterns.DeclareAnnotation; import org.aspectj.weaver.patterns.DeclareParents; import org.aspectj.weaver.patterns.DeclareSoft; +import org.aspectj.weaver.patterns.DeclareTypeErrorOrWarning; import org.aspectj.weaver.patterns.IVerificationRequired; import org.aspectj.weaver.tools.Trace; import org.aspectj.weaver.tools.TraceFactory; @@ -56,6 +57,7 @@ public class CrosscuttingMembersSet { private List<DeclareAnnotation> declareAnnotationOnTypes = null; private List<DeclareAnnotation> declareAnnotationOnFields = null; private List<DeclareAnnotation> declareAnnotationOnMethods = null; // includes constructors + private List<DeclareTypeErrorOrWarning> declareTypeEows = null; private List<Declare> declareDominates = null; private boolean changedSinceLastReset = false; @@ -301,6 +303,21 @@ public class CrosscuttingMembersSet { return declareAnnotationOnMethods; } + /** + * Return an amalgamation of the declare type eow statements + */ + public List<DeclareTypeErrorOrWarning> getDeclareTypeEows() { + if (declareTypeEows == null) { + Set<DeclareTypeErrorOrWarning> ret = new HashSet<DeclareTypeErrorOrWarning>(); + for (Iterator<CrosscuttingMembers> i = members.values().iterator(); i.hasNext();) { + ret.addAll(i.next().getDeclareTypeErrorOrWarning()); + } + declareTypeEows = new ArrayList<DeclareTypeErrorOrWarning>(); + declareTypeEows.addAll(ret); + } + return declareTypeEows; + } + public List<Declare> getDeclareDominates() { if (declareDominates == null) { List<Declare> ret = new ArrayList<Declare>(); |