]> source.dussan.org Git - aspectj.git/commitdiff
more aop.xml compile time config stuff
authoraclement <aclement>
Tue, 15 Sep 2009 16:39:40 +0000 (16:39 +0000)
committeraclement <aclement>
Tue, 15 Sep 2009 16:39:40 +0000 (16:39 +0000)
org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembersSet.java
org.aspectj.matcher/src/org/aspectj/weaver/World.java

index 40e4576cf13873d91769f8e81792e6c0c1ecd70b..aef04dd9883f19ba3a7b385b8266a81213934794 100644 (file)
@@ -22,8 +22,10 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+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.IVerificationRequired;
 import org.aspectj.weaver.tools.Trace;
 import org.aspectj.weaver.tools.TraceFactory;
@@ -47,14 +49,14 @@ public class CrosscuttingMembersSet {
        private transient List /* IVerificationRequired */<IVerificationRequired> verificationList = null;
 
        private List<ShadowMunger> shadowMungers = null;
-       private List typeMungers = null;
+       private List<ConcreteTypeMunger> typeMungers = null;
        private List<ConcreteTypeMunger> lateTypeMungers = null;
-       private List declareSofts = null;
+       private List<DeclareSoft> declareSofts = null;
        private List<DeclareParents> declareParents = null;
        private List<DeclareAnnotation> declareAnnotationOnTypes = null;
        private List<DeclareAnnotation> declareAnnotationOnFields = null;
        private List<DeclareAnnotation> declareAnnotationOnMethods = null; // includes constructors
-       private List declareDominates = null;
+       private List<Declare> declareDominates = null;
        private boolean changedSinceLastReset = false;
 
        public CrosscuttingMembersSet(World world) {
@@ -159,9 +161,9 @@ public class CrosscuttingMembersSet {
                declareDominates = null;
        }
 
-       public List getShadowMungers() {
+       public List<ShadowMunger> getShadowMungers() {
                if (shadowMungers == null) {
-                       ArrayList ret = new ArrayList();
+                       List<ShadowMunger> ret = new ArrayList<ShadowMunger>();
                        for (Iterator<CrosscuttingMembers> i = members.values().iterator(); i.hasNext();) {
                                ret.addAll(i.next().getShadowMungers());
                        }
@@ -170,9 +172,9 @@ public class CrosscuttingMembersSet {
                return shadowMungers;
        }
 
-       public List getTypeMungers() {
+       public List<ConcreteTypeMunger> getTypeMungers() {
                if (typeMungers == null) {
-                       ArrayList ret = new ArrayList();
+                       List<ConcreteTypeMunger> ret = new ArrayList<ConcreteTypeMunger>();
                        for (Iterator<CrosscuttingMembers> i = members.values().iterator(); i.hasNext();) {
                                ret.addAll(i.next().getTypeMungers());
                        }
@@ -192,13 +194,13 @@ public class CrosscuttingMembersSet {
                return lateTypeMungers;
        }
 
-       public List getDeclareSofts() {
+       public List<DeclareSoft> getDeclareSofts() {
                if (declareSofts == null) {
-                       Set ret = new HashSet();
+                       Set<DeclareSoft> ret = new HashSet<DeclareSoft>();
                        for (Iterator<CrosscuttingMembers> i = members.values().iterator(); i.hasNext();) {
                                ret.addAll(i.next().getDeclareSofts());
                        }
-                       declareSofts = new ArrayList();
+                       declareSofts = new ArrayList<DeclareSoft>();
                        declareSofts.addAll(ret);
                }
                return declareSofts;
@@ -256,9 +258,9 @@ public class CrosscuttingMembersSet {
                return declareAnnotationOnMethods;
        }
 
-       public List getDeclareDominates() {
+       public List<Declare> getDeclareDominates() {
                if (declareDominates == null) {
-                       ArrayList ret = new ArrayList();
+                       List<Declare> ret = new ArrayList<Declare>();
                        for (Iterator<CrosscuttingMembers> i = members.values().iterator(); i.hasNext();) {
                                ret.addAll(i.next().getDeclareDominates());
                        }
index 178ff97228162f86f31d7c79c9ddcc0bb8bd74ee..cdb01a1c8739f5d16432cb127b2397e2a0bbb9ad 100644 (file)
@@ -867,12 +867,12 @@ public abstract class World implements Dump.INode {
                public final static int USE_WEAK_REFS = 1; // Collected asap
                public final static int USE_SOFT_REFS = 2; // Collected when short on
                // memory
-               List addedSinceLastDemote;
+               List<String> addedSinceLastDemote;
 
                public int policy = USE_SOFT_REFS;
 
                // Map of types that never get thrown away
-               final Map /* String -> ResolvedType */tMap = new HashMap();
+               final Map<String, ResolvedType> tMap = new HashMap<String, ResolvedType>();
 
                // Map of types that may be ejected from the cache if we need space
                final Map expendableMap = Collections.synchronizedMap(new WeakHashMap());
@@ -888,7 +888,7 @@ public abstract class World implements Dump.INode {
                private static Trace trace = TraceFactory.getTraceFactory().getTrace(World.TypeMap.class);
 
                TypeMap(World w) {
-                       addedSinceLastDemote = new ArrayList();
+                       addedSinceLastDemote = new ArrayList<String>();
                        this.w = w;
                        memoryProfiling = false;// !w.getMessageHandler().isIgnoring(Message.
                        // INFO);
@@ -907,15 +907,10 @@ public abstract class World implements Dump.INode {
                                return 0;
                        }
                        int demotionCounter = 0;
-                       Iterator iter = addedSinceLastDemote.iterator();
-                       do {
-                               if (!iter.hasNext()) {
-                                       break;
-                               }
-                               String key = (String) iter.next();
-                               ResolvedType type = (ResolvedType) tMap.get(key);
+                       for (String key : addedSinceLastDemote) {
+                               ResolvedType type = tMap.get(key);
                                if (type != null && !type.isAspect() && !type.equals(UnresolvedType.OBJECT) && !type.isPrimitiveType()) {
-                                       List typeMungers = type.getInterTypeMungers();
+                                       List<ConcreteTypeMunger> typeMungers = type.getInterTypeMungers();
                                        if (typeMungers == null || typeMungers.size() == 0) {
                                                tMap.remove(key);
                                                if (!expendableMap.containsKey(key)) {
@@ -928,7 +923,7 @@ public abstract class World implements Dump.INode {
                                                demotionCounter++;
                                        }
                                }
-                       } while (true);
+                       }
                        if (debugDemotion) {
                                System.out.println("Demoted " + demotionCounter + " types.  Types remaining in fixed set #" + tMap.keySet().size());
                        }
@@ -1008,7 +1003,7 @@ public abstract class World implements Dump.INode {
                                        addedSinceLastDemote.add(key);
                                }
 
-                               return (ResolvedType) tMap.put(key, type);
+                               return tMap.put(key, type);
                        }
                }
 
@@ -1035,7 +1030,7 @@ public abstract class World implements Dump.INode {
                 */
                public ResolvedType get(String key) {
                        checkq();
-                       ResolvedType ret = (ResolvedType) tMap.get(key);
+                       ResolvedType ret = tMap.get(key);
                        if (ret == null) {
                                if (policy == USE_WEAK_REFS) {
                                        WeakReference ref = (WeakReference) expendableMap.get(key);
@@ -1043,9 +1038,9 @@ public abstract class World implements Dump.INode {
                                                ret = (ResolvedType) ref.get();
                                        }
                                } else if (policy == USE_SOFT_REFS) {
-                                       SoftReference ref = (SoftReference) expendableMap.get(key);
+                                       SoftReference<ResolvedType> ref = (SoftReference) expendableMap.get(key);
                                        if (ref != null) {
-                                               ret = (ResolvedType) ref.get();
+                                               ret = ref.get();
                                        }
                                } else {
                                        return (ResolvedType) expendableMap.get(key);
@@ -1056,7 +1051,7 @@ public abstract class World implements Dump.INode {
 
                /** Remove a type from the map */
                public ResolvedType remove(String key) {
-                       ResolvedType ret = (ResolvedType) tMap.remove(key);
+                       ResolvedType ret = tMap.remove(key);
                        if (ret == null) {
                                if (policy == USE_WEAK_REFS) {
                                        WeakReference wref = (WeakReference) expendableMap.remove(key);