From b666bd033fd9df5b73ab8e20cfa34d4f68b53f9b Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 11 Jun 2010 19:13:54 +0000 Subject: [PATCH] itd inners: new helper --- .../weaver/CrosscuttingMembersSet.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembersSet.java b/org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembersSet.java index 06c1c6fa2..e321e222d 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembersSet.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembersSet.java @@ -14,6 +14,7 @@ package org.aspectj.weaver; import java.io.IOException; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -213,6 +214,29 @@ public class CrosscuttingMembersSet { return typeMungers; } + /** + * Retrieve a subset of all known mungers, those of a specific kind. + * + * @param kind the kind of munger requested + * @return a list of those mungers (list is empty if none found) + */ + public List getTypeMungersOfKind(ResolvedTypeMunger.Kind kind) { + List collected = null; + for (ConcreteTypeMunger typeMunger : typeMungers) { + if (typeMunger.getMunger() != null && typeMunger.getMunger().getKind() == kind) { + if (collected == null) { + collected = new ArrayList(); + } + collected.add(typeMunger); + } + } + if (collected == null) { + return Collections.emptyList(); + } else { + return collected; + } + } + /** * Determine if the type munger is: (1) for privileged access (2) for a normally non visible field (3) is from an aspect wanting * 'old style' (ie. long) accessor names @@ -298,7 +322,7 @@ public class CrosscuttingMembersSet { } declareAnnotationOnMethods = new ArrayList(); declareAnnotationOnMethods.addAll(ret); - //world.sortDeclareAnnotations(declareAnnotationOnMethods); + // world.sortDeclareAnnotations(declareAnnotationOnMethods); } return declareAnnotationOnMethods; } -- 2.39.5