]> source.dussan.org Git - aspectj.git/commitdiff
generics
authoraclement <aclement>
Thu, 15 Jul 2010 15:47:39 +0000 (15:47 +0000)
committeraclement <aclement>
Thu, 15 Jul 2010 15:47:39 +0000 (15:47 +0000)
org.aspectj.matcher/src/org/aspectj/weaver/Advice.java
org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembers.java
org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/AbstractPatternNodeVisitor.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/CflowPointcut.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/PerCflow.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/TypePatternList.java

index 5f3f915ca946a9073090a9291e1563f2cc06b24b..e368fd3c372ad8cc94c0f744af45d3da7d8ed55e 100644 (file)
@@ -33,7 +33,7 @@ public abstract class Advice extends ShadowMunger {
        protected ResolvedType concreteAspect; // null until after concretize
 
        // Just for Cflow*entry kinds
-       protected List innerCflowEntries = Collections.EMPTY_LIST;
+       protected List<ShadowMunger> innerCflowEntries = Collections.emptyList();
        protected int nFreeVars;
 
        protected TypePattern exceptionType; // just for Softener kind
@@ -50,7 +50,7 @@ public abstract class Advice extends ShadowMunger {
        public ISourceLocation lastReportedMonitorExitJoinpointLocation = null;
 
        public static Advice makeCflowEntry(World world, Pointcut entry, boolean isBelow, Member stackField, int nFreeVars,
-                       List innerCflowEntries, ResolvedType inAspect) {
+                       List<ShadowMunger> innerCflowEntries, ResolvedType inAspect) {
                Advice ret = world.createAdviceMunger(isBelow ? AdviceKind.CflowBelowEntry : AdviceKind.CflowEntry, entry, stackField, 0,
                                entry, inAspect);
                ret.innerCflowEntries = innerCflowEntries;
@@ -60,7 +60,7 @@ public abstract class Advice extends ShadowMunger {
        }
 
        public static Advice makePerCflowEntry(World world, Pointcut entry, boolean isBelow, Member stackField, ResolvedType inAspect,
-                       List innerCflowEntries) {
+                       List<ShadowMunger> innerCflowEntries) {
                Advice ret = world.createAdviceMunger(isBelow ? AdviceKind.PerCflowBelowEntry : AdviceKind.PerCflowEntry, entry,
                                stackField, 0, entry, inAspect);
                ret.innerCflowEntries = innerCflowEntries;
@@ -192,16 +192,16 @@ public abstract class Advice extends ShadowMunger {
                                                        ResolvedType adviceReturnGenericType = adviceReturnType.getGenericType(); // Set
                                                        if (shadowReturnGenericType.isAssignableFrom(adviceReturnGenericType)
                                                                        && world.getLint().uncheckedAdviceConversion.isEnabled()) {
-                                                               world.getLint().uncheckedAdviceConversion.signal(new String[] { shadow.toString(),
-                                                                               shadowReturnType.getName(), adviceReturnType.getName() }, shadow.getSourceLocation(),
-                                                                               new ISourceLocation[] { getSourceLocation() });
+                                                               world.getLint().uncheckedAdviceConversion.signal(
+                                                                               new String[] { shadow.toString(), shadowReturnType.getName(), adviceReturnType.getName() },
+                                                                               shadow.getSourceLocation(), new ISourceLocation[] { getSourceLocation() });
                                                        }
                                                } else if (!shadowReturnType.isAssignableFrom(adviceReturnType)) {
                                                        // System.err.println(this + ", " + sourceContext +
                                                        // ", " + start);
-                                                       world.showMessage(IMessage.ERROR, WeaverMessages
-                                                                       .format(WeaverMessages.INCOMPATIBLE_RETURN_TYPE, shadow), getSourceLocation(), shadow
-                                                                       .getSourceLocation());
+                                                       world.showMessage(IMessage.ERROR,
+                                                                       WeaverMessages.format(WeaverMessages.INCOMPATIBLE_RETURN_TYPE, shadow), getSourceLocation(),
+                                                                       shadow.getSourceLocation());
                                                        return false;
                                                }
                                        }
index 97d42e7faf8e78f29d2d05acecb28cd190d8a4a3..23662c002f26e437f909b63febc9604df76b9922 100644 (file)
@@ -117,9 +117,9 @@ public class CrosscuttingMembers {
                lateTypeMungers.add(m);
        }
 
-       public void addDeclares(Collection c) {
-               for (Iterator i = c.iterator(); i.hasNext();) {
-                       addDeclare((Declare) i.next());
+       public void addDeclares(Collection<Declare> declares) {
+               for (Declare declare : declares) {
+                       addDeclare(declare);
                }
        }
 
@@ -166,9 +166,9 @@ public class CrosscuttingMembers {
                }
        }
 
-       public void exposeTypes(Collection typesToExpose) {
-               for (Iterator i = typesToExpose.iterator(); i.hasNext();) {
-                       exposeType((UnresolvedType) i.next());
+       public void exposeTypes(List<UnresolvedType> typesToExpose) {
+               for (UnresolvedType typeToExpose : typesToExpose) {
+                       exposeType(typeToExpose);
                }
        }
 
index 3d75c0bc378d5ece582e30f53cc881396e0b9ea9..595645030cdf1f513cccd0e3393950c9f705c4b1 100644 (file)
@@ -15,7 +15,6 @@ package org.aspectj.weaver;
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -37,7 +36,7 @@ public class ReferenceType extends ResolvedType {
         * For generic types, this list holds references to all the derived raw and parameterized versions. We need this so that if the
         * generic delegate is swapped during incremental compilation, the delegate of the derivatives is swapped also.
         */
-       private final List/* ReferenceType */derivativeTypes = new ArrayList();
+       private final List<ReferenceType> derivativeTypes = new ArrayList<ReferenceType>();
 
        /**
         * For parameterized types (or the raw type) - this field points to the actual reference type from which they are derived.
@@ -531,8 +530,8 @@ public class ReferenceType extends ResolvedType {
                if (other.isTypeVariableReference()) {
                        TypeVariableReferenceType otherType = (TypeVariableReferenceType) other;
                        if (this instanceof TypeVariableReference) {
-                               return ((TypeVariableReference) this).getTypeVariable().resolve(world).canBeBoundTo(
-                                               otherType.getTypeVariable().getFirstBound().resolve(world));// pr171952
+                               return ((TypeVariableReference) this).getTypeVariable().resolve(world)
+                                               .canBeBoundTo(otherType.getTypeVariable().getFirstBound().resolve(world));// pr171952
                                // return
                                // ((TypeVariableReference)this).getTypeVariable()==otherType
                                // .getTypeVariable();
@@ -672,15 +671,15 @@ public class ReferenceType extends ResolvedType {
                return delegateInterfaces;
        }
 
-       private String toString(ResolvedType[] delegateInterfaces) {
-               StringBuffer sb = new StringBuffer();
-               if (delegateInterfaces != null) {
-                       for (ResolvedType rt : delegateInterfaces) {
-                               sb.append(rt).append(" ");
-                       }
-               }
-               return sb.toString();
-       }
+       // private String toString(ResolvedType[] delegateInterfaces) {
+       // StringBuffer sb = new StringBuffer();
+       // if (delegateInterfaces != null) {
+       // for (ResolvedType rt : delegateInterfaces) {
+       // sb.append(rt).append(" ");
+       // }
+       // }
+       // return sb.toString();
+       // }
 
        /**
         * Locates the named type variable in the list of those on this generic type and returns the type parameter from the second list
@@ -703,8 +702,7 @@ public class ReferenceType extends ResolvedType {
         * class Foo<T extends String,E extends Number> implements SuperInterface<T> {}
         * </code> where <code>
         * interface SuperInterface<Z> {}
-        * </code> In that
-        * example, a use of the 'Foo' raw type should know that it implements the SuperInterface<String>.
+        * </code> In that example, a use of the 'Foo' raw type should know that it implements the SuperInterface<String>.
         */
        private UnresolvedType[] determineThoseTypesToUse(ResolvedType parameterizedInterface, UnresolvedType[] paramTypes) {
                // What are the type parameters for the supertype?
@@ -821,7 +819,7 @@ public class ReferenceType extends ResolvedType {
        public PerClause getPerClause() {
                PerClause pclause = getDelegate().getPerClause();
                if (isParameterizedType()) { // could cache the result here...
-                       Map parameterizationMap = getAjMemberParameterizationMap();
+                       Map<String, UnresolvedType> parameterizationMap = getAjMemberParameterizationMap();
                        pclause = (PerClause) pclause.parameterizeWith(parameterizationMap, world);
                }
                return pclause;
@@ -857,7 +855,7 @@ public class ReferenceType extends ResolvedType {
 
        // GENERICITDFIX
        // // Map parameterizationMap = getAjMemberParameterizationMap();
-       //              
+       //
        // // if (parameterizedTypeMungers != null) return parameterizedTypeMungers;
        // Collection ret = null;
        // if (ajMembersNeedParameterization()) {
@@ -877,7 +875,7 @@ public class ReferenceType extends ResolvedType {
        // }
 
        @Override
-       public Collection getPrivilegedAccesses() {
+       public Collection<ResolvedMember> getPrivilegedAccesses() {
                return getDelegate().getPrivilegedAccesses();
        }
 
@@ -891,9 +889,9 @@ public class ReferenceType extends ResolvedType {
        @Override
        public ResolvedType getSuperclass() {
                ResolvedType ret = null;// superclassReference.get();
-               if (ret != null) {
-                       return ret;
-               }
+               // if (ret != null) {
+               // return ret;
+               // }
                if (newSuperclass != null) {
                        if (this.isParameterizedType() && newSuperclass.isParameterizedType()) {
                                return newSuperclass.parameterize(getMemberParameterizationMap()).resolve(getWorld());
@@ -930,8 +928,7 @@ public class ReferenceType extends ResolvedType {
                        ((AbstractReferenceTypeDelegate) delegate).setSourceContext(this.delegate.getSourceContext());
                }
                this.delegate = delegate;
-               for (Iterator it = this.derivativeTypes.iterator(); it.hasNext();) {
-                       ReferenceType dependent = (ReferenceType) it.next();
+               for (ReferenceType dependent : derivativeTypes) {
                        dependent.setDelegate(delegate);
                }
 
index 0f898eec4f199cba8c0fd9bc8f6c22387538c94a..0bdb6953e1d774d7d8f58225fbde54432d4f50c5 100644 (file)
@@ -771,7 +771,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                // Declare dec = (Declare) i.next();
                // if (!dec.isAdviceLike()) ret.add(dec);
                // }
-               //        
+               //
                // if (!includeAdviceLike) return ret;
 
                if (!this.isAbstract()) {
@@ -1479,8 +1479,8 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                        ResolvedType onType = itdMember.getDeclaringType().resolve(world);
                        if (onType.isInterface() && itdMember.isAbstract() && !itdMember.isPublic()) {
                                world.getMessageHandler().handleMessage(
-                                               new Message(WeaverMessages.format(WeaverMessages.ITD_ABSTRACT_MUST_BE_PUBLIC_ON_INTERFACE, munger
-                                                               .getSignature(), onType), "", Message.ERROR, getSourceLocation(), null,
+                                               new Message(WeaverMessages.format(WeaverMessages.ITD_ABSTRACT_MUST_BE_PUBLIC_ON_INTERFACE,
+                                                               munger.getSignature(), onType), "", Message.ERROR, getSourceLocation(), null,
                                                                new ISourceLocation[] { getMungerLocation(munger) }));
                                return true;
                        }
@@ -1633,8 +1633,8 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                        if (onType == null) {
                                // The target is not generic
                                getWorld().getMessageHandler().handleMessage(
-                                               MessageUtil.error("The target type for the intertype declaration is not generic", munger
-                                                               .getSourceLocation()));
+                                               MessageUtil.error("The target type for the intertype declaration is not generic",
+                                                               munger.getSourceLocation()));
                                return munger;
                        }
                        member.resolve(world); // Ensure all parts of the member are resolved
@@ -1729,15 +1729,13 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                                                                        if (existing.getSignature().getName().equals(thisRealMungerSignatureName)
                                                                                        && existing.version == NewFieldTypeMunger.VersionTwo
                                                                                        // this check ensures no problem for a clash with an ITD on an interface
-                                                                                       && existing.getSignature().getDeclaringType().equals(
-                                                                                                       newFieldTypeMunger.getSignature().getDeclaringType())) {
+                                                                                       && existing.getSignature().getDeclaringType()
+                                                                                                       .equals(newFieldTypeMunger.getSignature().getDeclaringType())) {
 
                                                                                // report error on the aspect
                                                                                StringBuffer sb = new StringBuffer();
-                                                                               sb
-                                                                                               .append("Cannot handle two aspects both attempting to use new style ITDs for the same named field ");
-                                                                               sb
-                                                                                               .append("on the same target type.  Please recompile at least one aspect with '-Xset:itdVersion=1'.");
+                                                                               sb.append("Cannot handle two aspects both attempting to use new style ITDs for the same named field ");
+                                                                               sb.append("on the same target type.  Please recompile at least one aspect with '-Xset:itdVersion=1'.");
                                                                                sb.append(" Aspects involved: " + munger.getAspectType().getName() + " and "
                                                                                                + typeMunger.getAspectType().getName() + ".");
                                                                                sb.append(" Field is named '" + existing.getSignature().getName() + "'");
@@ -1991,8 +1989,8 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                                }
                        }
 
-                       world.showMessage(Message.ERROR, WeaverMessages.format(WeaverMessages.CANT_OVERRIDE_FINAL_MEMBER, parent), child
-                                       .getSourceLocation(), null);
+                       world.showMessage(Message.ERROR, WeaverMessages.format(WeaverMessages.CANT_OVERRIDE_FINAL_MEMBER, parent),
+                                       child.getSourceLocation(), null);
                        return false;
                }
 
@@ -2015,8 +2013,8 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                }
 
                if (incompatibleReturnTypes) {
-                       world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_RETURN_TYPE_MISMATCH, parent, child), child
-                                       .getSourceLocation(), parent.getSourceLocation());
+                       world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_RETURN_TYPE_MISMATCH, parent, child),
+                                       child.getSourceLocation(), parent.getSourceLocation());
                        return false;
                }
                if (parent.getKind() == Member.POINTCUT) {
@@ -2031,8 +2029,8 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                // System.err.println("check: " + child.getModifiers() +
                // " more visible " + parent.getModifiers());
                if (isMoreVisible(parent.getModifiers(), child.getModifiers())) {
-                       world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_VISIBILITY_REDUCTION, parent, child), child
-                                       .getSourceLocation(), parent.getSourceLocation());
+                       world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_VISIBILITY_REDUCTION, parent, child),
+                                       child.getSourceLocation(), parent.getSourceLocation());
                        return false;
                }
 
@@ -2068,12 +2066,12 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                boolean parentStatic = Modifier.isStatic(parent.getModifiers());
                boolean childStatic = Modifier.isStatic(child.getModifiers());
                if (parentStatic && !childStatic) {
-                       world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_OVERRIDDEN_STATIC, child, parent), child
-                                       .getSourceLocation(), null);
+                       world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_OVERRIDDEN_STATIC, child, parent),
+                                       child.getSourceLocation(), null);
                        return false;
                } else if (childStatic && !parentStatic) {
-                       world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_OVERIDDING_STATIC, child, parent), child
-                                       .getSourceLocation(), null);
+                       world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_OVERIDDING_STATIC, child, parent),
+                                       child.getSourceLocation(), null);
                        return false;
                }
                return true;
@@ -2337,9 +2335,9 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
        }
 
        private void addPointcutsResolvingConflicts(List<ResolvedMember> acc, List<ResolvedMember> added, boolean isOverriding) {
-               for (Iterator i = added.iterator(); i.hasNext();) {
+               for (Iterator<ResolvedMember> i = added.iterator(); i.hasNext();) {
                        ResolvedPointcutDefinition toAdd = (ResolvedPointcutDefinition) i.next();
-                       for (Iterator j = acc.iterator(); j.hasNext();) {
+                       for (Iterator<ResolvedMember> j = acc.iterator(); j.hasNext();) {
                                ResolvedPointcutDefinition existing = (ResolvedPointcutDefinition) j.next();
                                if (toAdd == null || existing == null || existing == toAdd) {
                                        continue;
@@ -2354,8 +2352,8 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                                                        getWorld().showMessage(
                                                                        IMessage.ERROR,
                                                                        WeaverMessages.format(WeaverMessages.POINTCUT_NOT_VISIBLE, existing.getDeclaringType()
-                                                                                       .getName()
-                                                                                       + "." + existing.getName() + "()", this.getName()), toAdd.getSourceLocation(), null);
+                                                                                       .getName() + "." + existing.getName() + "()", this.getName()),
+                                                                       toAdd.getSourceLocation(), null);
                                                        j.remove();
                                                }
                                                continue;
@@ -2368,8 +2366,9 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                                        } else {
                                                getWorld().showMessage(
                                                                IMessage.ERROR,
-                                                               WeaverMessages.format(WeaverMessages.CONFLICTING_INHERITED_POINTCUTS, this.getName()
-                                                                               + toAdd.getSignature()), existing.getSourceLocation(), toAdd.getSourceLocation());
+                                                               WeaverMessages.format(WeaverMessages.CONFLICTING_INHERITED_POINTCUTS,
+                                                                               this.getName() + toAdd.getSignature()), existing.getSourceLocation(),
+                                                               toAdd.getSourceLocation());
                                                j.remove();
                                        }
                                }
@@ -2418,7 +2417,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
         * parameters replaced in accordance with the passed bindings.
         */
        @Override
-       public UnresolvedType parameterize(Map typeBindings) {
+       public UnresolvedType parameterize(Map<String, UnresolvedType> typeBindings) {
                if (!isParameterizedType()) {
                        return this;// throw new IllegalStateException(
                }
@@ -2438,7 +2437,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                                newTypeParams[i] = typeParameters[i];
                                if (newTypeParams[i].isTypeVariableReference()) {
                                        TypeVariableReferenceType tvrt = (TypeVariableReferenceType) newTypeParams[i];
-                                       UnresolvedType binding = (UnresolvedType) typeBindings.get(tvrt.getTypeVariable().getName());
+                                       UnresolvedType binding = typeBindings.get(tvrt.getTypeVariable().getName());
                                        if (binding != null) {
                                                newTypeParams[i] = binding;
                                        }
@@ -2533,7 +2532,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                // if (this.isPrimitiveType() || other.isPrimitiveType()) return
                // this.isAssignableFrom(other);
                // return this.isCoerceableFrom(other);
-               //       
+               //
 
                // version from ResolvedTypeX
                if (this.equals(OBJECT)) {
index 3453eb1eb894529377ed13e0ce926c5b3b2c7053..992e38548146ac7b6bc46e71a83d490313fb811b 100644 (file)
@@ -19,8 +19,8 @@ import java.io.IOException;
 import java.util.Map;
 
 import org.aspectj.util.GenericSignature;
-import org.aspectj.util.GenericSignatureParser;
 import org.aspectj.util.GenericSignature.ClassSignature;
+import org.aspectj.util.GenericSignatureParser;
 import org.aspectj.weaver.tools.Traceable;
 
 /**
@@ -970,7 +970,7 @@ public class UnresolvedType implements Traceable, TypeVariableDeclaringElement {
         * their matching type variable binding.
         */
        // OPTIMIZE methods like this just allow callers to be lazy and not ensure they are working with the right (resolved) subtype
-       public UnresolvedType parameterize(Map typeBindings) {
+       public UnresolvedType parameterize(Map<String, UnresolvedType> typeBindings) {
                throw new UnsupportedOperationException("unable to parameterize unresolved type: " + signature);
        }
 }
index 6558c3c21bd3edacef211931487454442f15ca20..34efee3ee0ca709a7e87b39681e8f1e111ab6925 100644 (file)
@@ -67,388 +67,170 @@ public abstract class AbstractPatternNodeVisitor implements PatternNodeVisitor {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.ArgsPointcut, java.lang.Object)
-        */
        public Object visit(ArgsPointcut node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.BindingAnnotationTypePattern,
-        * java.lang.Object)
-        */
        public Object visit(BindingAnnotationTypePattern node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.BindingTypePattern, java.lang.Object)
-        */
        public Object visit(BindingTypePattern node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.CflowPointcut, java.lang.Object)
-        */
        public Object visit(CflowPointcut node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.ConcreteCflowPointcut, java.lang.Object)
-        */
        public Object visit(ConcreteCflowPointcut node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.DeclareAnnotation, java.lang.Object)
-        */
        public Object visit(DeclareAnnotation node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.DeclareErrorOrWarning, java.lang.Object)
-        */
        public Object visit(DeclareErrorOrWarning node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.DeclareParents, java.lang.Object)
-        */
        public Object visit(DeclareParents node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.DeclarePrecedence, java.lang.Object)
-        */
        public Object visit(DeclarePrecedence node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.DeclareSoft, java.lang.Object)
-        */
        public Object visit(DeclareSoft node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.ExactAnnotationTypePattern,
-        * java.lang.Object)
-        */
        public Object visit(ExactAnnotationTypePattern node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.ExactTypePattern, java.lang.Object)
-        */
        public Object visit(ExactTypePattern node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.HandlerPointcut, java.lang.Object)
-        */
        public Object visit(HandlerPointcut node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.IfPointcut, java.lang.Object)
-        */
        public Object visit(IfPointcut node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.KindedPointcut, java.lang.Object)
-        */
        public Object visit(KindedPointcut node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.ModifiersPattern, java.lang.Object)
-        */
        public Object visit(ModifiersPattern node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.NamePattern, java.lang.Object)
-        */
        public Object visit(NamePattern node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.NotAnnotationTypePattern,
-        * java.lang.Object)
-        */
        public Object visit(NotAnnotationTypePattern node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.NotPointcut, java.lang.Object)
-        */
        public Object visit(NotPointcut node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.NotTypePattern, java.lang.Object)
-        */
        public Object visit(NotTypePattern node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.OrAnnotationTypePattern, java.lang.Object)
-        */
        public Object visit(OrAnnotationTypePattern node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.OrPointcut, java.lang.Object)
-        */
        public Object visit(OrPointcut node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.OrTypePattern, java.lang.Object)
-        */
        public Object visit(OrTypePattern node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.PerCflow, java.lang.Object)
-        */
        public Object visit(PerCflow node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.PerFromSuper, java.lang.Object)
-        */
        public Object visit(PerFromSuper node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.PerObject, java.lang.Object)
-        */
        public Object visit(PerObject node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.PerSingleton, java.lang.Object)
-        */
        public Object visit(PerSingleton node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.PerTypeWithin, java.lang.Object)
-        */
        public Object visit(PerTypeWithin node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.PatternNode, java.lang.Object)
-        */
        public Object visit(PatternNode node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.ReferencePointcut, java.lang.Object)
-        */
        public Object visit(ReferencePointcut node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.SignaturePattern, java.lang.Object)
-        */
        public Object visit(SignaturePattern node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.ThisOrTargetAnnotationPointcut,
-        * java.lang.Object)
-        */
        public Object visit(ThisOrTargetAnnotationPointcut node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.ThisOrTargetPointcut, java.lang.Object)
-        */
        public Object visit(ThisOrTargetPointcut node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.ThrowsPattern, java.lang.Object)
-        */
        public Object visit(ThrowsPattern node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.TypePatternList, java.lang.Object)
-        */
        public Object visit(TypePatternList node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.WildAnnotationTypePattern,
-        * java.lang.Object)
-        */
        public Object visit(WildAnnotationTypePattern node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.WildTypePattern, java.lang.Object)
-        */
        public Object visit(WildTypePattern node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.WithinAnnotationPointcut,
-        * java.lang.Object)
-        */
        public Object visit(WithinAnnotationPointcut node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.WithinCodeAnnotationPointcut,
-        * java.lang.Object)
-        */
        public Object visit(WithinCodeAnnotationPointcut node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.WithinPointcut, java.lang.Object)
-        */
        public Object visit(WithinPointcut node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.WithincodePointcut, java.lang.Object)
-        */
        public Object visit(WithincodePointcut node, Object data) {
                return node;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PointcutVisitor#visit(org.aspectj.weaver.patterns.Pointcut.MatchesNothingPointcut,
-        * java.lang.Object)
-        */
        public Object visit(MatchesNothingPointcut node, Object data) {
                return node;
        }
index 1aa58dec049ad11ca289dac804c68c92edb06f96..135c496b5737d0d623773a7bcba835d684e1142d 100644 (file)
@@ -34,6 +34,7 @@ import org.aspectj.weaver.ResolvedMemberImpl;
 import org.aspectj.weaver.ResolvedPointcutDefinition;
 import org.aspectj.weaver.ResolvedType;
 import org.aspectj.weaver.Shadow;
+import org.aspectj.weaver.ShadowMunger;
 import org.aspectj.weaver.UnresolvedType;
 import org.aspectj.weaver.VersionedDataInputStream;
 import org.aspectj.weaver.WeaverMessages;
@@ -185,7 +186,7 @@ public class CflowPointcut extends Pointcut {
                ResolvedType concreteAspect = bindings.getConcreteAspect();
 
                CrosscuttingMembers xcut = concreteAspect.crosscuttingMembers;
-               Collection previousCflowEntries = xcut.getCflowEntries();
+               Collection<ShadowMunger> previousCflowEntries = xcut.getCflowEntries();
 
                entryBindings.pushEnclosingDefinition(CFLOW_MARKER);
                // This block concretizes the pointcut within the cflow pointcut
@@ -195,7 +196,7 @@ public class CflowPointcut extends Pointcut {
                        entryBindings.popEnclosingDefinitition();
                }
 
-               List innerCflowEntries = new ArrayList(xcut.getCflowEntries());
+               List<ShadowMunger> innerCflowEntries = new ArrayList<ShadowMunger>(xcut.getCflowEntries());
                innerCflowEntries.removeAll(previousCflowEntries);
 
                // Four routes of interest through this code (did I hear someone say
index 1d58260a6cd11be06d70d2d4f542404198377f41..c449eccfa4a249c0c8d2cf5e1f61735508e28851 100644 (file)
@@ -30,6 +30,7 @@ import org.aspectj.weaver.NameMangler;
 import org.aspectj.weaver.ResolvedMemberImpl;
 import org.aspectj.weaver.ResolvedType;
 import org.aspectj.weaver.Shadow;
+import org.aspectj.weaver.ShadowMunger;
 import org.aspectj.weaver.UnresolvedType;
 import org.aspectj.weaver.VersionedDataInputStream;
 import org.aspectj.weaver.World;
@@ -94,13 +95,13 @@ public class PerCflow extends PerClause {
 
                CrosscuttingMembers xcut = inAspect.crosscuttingMembers;
 
-               Collection previousCflowEntries = xcut.getCflowEntries();
+               Collection<ShadowMunger> previousCflowEntries = xcut.getCflowEntries();
                Pointcut concreteEntry = entry.concretize(inAspect, inAspect, 0, null); // IntMap
                // .
                // EMPTY
                // )
                // ;
-               List innerCflowEntries = new ArrayList(xcut.getCflowEntries());
+               List<ShadowMunger> innerCflowEntries = new ArrayList<ShadowMunger>(xcut.getCflowEntries());
                innerCflowEntries.removeAll(previousCflowEntries);
 
                xcut.addConcreteShadowMunger(Advice.makePerCflowEntry(world, concreteEntry, isBelow, cflowStackField, inAspect,
@@ -108,8 +109,8 @@ public class PerCflow extends PerClause {
 
                // ATAJ: add a munger to add the aspectOf(..) to the @AJ aspects
                if (inAspect.isAnnotationStyleAspect() && !inAspect.isAbstract()) {
-                       inAspect.crosscuttingMembers.addLateTypeMunger(inAspect.getWorld().getWeavingSupport().makePerClauseAspect(inAspect,
-                                       getKind()));
+                       inAspect.crosscuttingMembers.addLateTypeMunger(inAspect.getWorld().getWeavingSupport()
+                                       .makePerClauseAspect(inAspect, getKind()));
                }
 
                // ATAJ inline around advice support - don't use a late munger to allow
index e388ba3b0319bb7445325b96402f73673219d096..1551cdb401bd81e3ceed6dcd924f0db395fc5065 100644 (file)
@@ -14,7 +14,6 @@ package org.aspectj.weaver.patterns;
 
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 
@@ -532,8 +531,8 @@ public class TypePatternList extends PatternNode {
                return typePatterns;
        }
 
-       public Collection getExactTypes() {
-               ArrayList ret = new ArrayList();
+       public List<UnresolvedType> getExactTypes() {
+               List<UnresolvedType> ret = new ArrayList<UnresolvedType>();
                for (int i = 0; i < typePatterns.length; i++) {
                        UnresolvedType t = typePatterns[i].getExactType();
                        if (!ResolvedType.isMissing(t)) {