]> source.dussan.org Git - aspectj.git/commitdiff
refactoring
authoraclement <aclement>
Tue, 19 Jan 2010 18:47:37 +0000 (18:47 +0000)
committeraclement <aclement>
Tue, 19 Jan 2010 18:47:37 +0000 (18:47 +0000)
org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembers.java

index 2bf8f0f48b1d4be940e9db3a77f372bb5aac6983..3ff22daa01af318532817186f7fe68f15aa77c6b 100644 (file)
@@ -145,8 +145,9 @@ public class CrosscuttingMembers {
                        // FIXME asc perf Possible Improvement. Investigate why this is
                        // called twice in a weave ?
                        DeclareAnnotation da = (DeclareAnnotation) declare;
-                       if (da.getAspect() == null)
+                       if (da.getAspect() == null) {
                                da.setAspect(inAspect);
+                       }
                        if (da.isDeclareAtType()) {
                                declareAnnotationsOnType.add(da);
                        } else if (da.isDeclareAtField()) {
@@ -166,8 +167,9 @@ public class CrosscuttingMembers {
        }
 
        public void exposeType(UnresolvedType typeToExpose) {
-               if (ResolvedType.isMissing(typeToExpose))
+               if (ResolvedType.isMissing(typeToExpose)) {
                        return;
+               }
                if (typeToExpose.isParameterizedType() || typeToExpose.isRawType()) {
                        if (typeToExpose instanceof ResolvedType) {
                                typeToExpose = ((ResolvedType) typeToExpose).getGenericType();
@@ -182,8 +184,9 @@ public class CrosscuttingMembers {
                        ResolvedTypeMunger rTM = cTM.getMunger();
                        if (rTM != null && rTM instanceof ExposeTypeMunger) {
                                String exposedType = ((ExposeTypeMunger) rTM).getExposedTypeSignature();
-                               if (exposedType.equals(signatureToLookFor))
+                               if (exposedType.equals(signatureToLookFor)) {
                                        return; // dont need to bother
+                               }
                        }
                }
                addTypeMunger(world.getWeavingSupport().concreteTypeMunger(new ExposeTypeMunger(typeToExpose), inAspect));
@@ -194,17 +197,12 @@ public class CrosscuttingMembers {
                // new PrivilegedAccessMunger(member), inAspect));
        }
 
-       public void addPrivilegedAccesses(Collection accessedMembers) {
-               for (Iterator i = accessedMembers.iterator(); i.hasNext();) {
-                       addPrivilegedAccess((ResolvedMember) i.next());
+       public void addPrivilegedAccesses(Collection<ResolvedMember> accessedMembers) {
+               for (ResolvedMember member : accessedMembers) {
+                       addTypeMunger(world.getWeavingSupport().concreteTypeMunger(new PrivilegedAccessMunger(member), inAspect));
                }
        }
 
-       private void addPrivilegedAccess(ResolvedMember member) {
-               // System.err.println("add priv access: " + member);
-               addTypeMunger(world.getWeavingSupport().concreteTypeMunger(new PrivilegedAccessMunger(member), inAspect));
-       }
-
        public Collection<ShadowMunger> getCflowEntries() {
                List<ShadowMunger> ret = new ArrayList<ShadowMunger>();
                for (ShadowMunger m : shadowMungers) {
@@ -370,8 +368,9 @@ public class CrosscuttingMembers {
                                                }
                                        }
                                }
-                               if (!foundInOtherSet)
+                               if (!foundInOtherSet) {
                                        foundInequality = true;
+                               }
                        }
                        if (foundInequality) {
                                // System.out.println("type munger change");