From: aclement Date: Thu, 15 Jul 2010 15:47:39 +0000 (+0000) Subject: generics X-Git-Tag: V1_6_10RC1~100 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c3c897ca5383602fae3248b6df6250324609b3b1;p=aspectj.git generics --- diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/Advice.java b/org.aspectj.matcher/src/org/aspectj/weaver/Advice.java index 5f3f915ca..e368fd3c3 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/Advice.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/Advice.java @@ -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 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 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 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; } } diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembers.java b/org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembers.java index 97d42e7fa..23662c002 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembers.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembers.java @@ -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 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 typesToExpose) { + for (UnresolvedType typeToExpose : typesToExpose) { + exposeType(typeToExpose); } } diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java b/org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java index 3d75c0bc3..595645030 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java @@ -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 derivativeTypes = new ArrayList(); /** * 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 implements SuperInterface {} * where * interface SuperInterface {} - * In that - * example, a use of the 'Foo' raw type should know that it implements the SuperInterface. + * In that example, a use of the 'Foo' raw type should know that it implements the SuperInterface. */ 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 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 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); } diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java index 0f898eec4..0bdb6953e 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java @@ -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 acc, List added, boolean isOverriding) { - for (Iterator i = added.iterator(); i.hasNext();) { + for (Iterator i = added.iterator(); i.hasNext();) { ResolvedPointcutDefinition toAdd = (ResolvedPointcutDefinition) i.next(); - for (Iterator j = acc.iterator(); j.hasNext();) { + for (Iterator 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 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)) { diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java b/org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java index 3453eb1eb..992e38548 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java @@ -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 typeBindings) { throw new UnsupportedOperationException("unable to parameterize unresolved type: " + signature); } } diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/AbstractPatternNodeVisitor.java b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/AbstractPatternNodeVisitor.java index 6558c3c21..34efee3ee 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/AbstractPatternNodeVisitor.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/AbstractPatternNodeVisitor.java @@ -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; } diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/CflowPointcut.java b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/CflowPointcut.java index 1aa58dec0..135c496b5 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/CflowPointcut.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/CflowPointcut.java @@ -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 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 innerCflowEntries = new ArrayList(xcut.getCflowEntries()); innerCflowEntries.removeAll(previousCflowEntries); // Four routes of interest through this code (did I hear someone say diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/PerCflow.java b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/PerCflow.java index 1d58260a6..c449eccfa 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/PerCflow.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/PerCflow.java @@ -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 previousCflowEntries = xcut.getCflowEntries(); Pointcut concreteEntry = entry.concretize(inAspect, inAspect, 0, null); // IntMap // . // EMPTY // ) // ; - List innerCflowEntries = new ArrayList(xcut.getCflowEntries()); + List innerCflowEntries = new ArrayList(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 diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/TypePatternList.java b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/TypePatternList.java index e388ba3b0..1551cdb40 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/TypePatternList.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/TypePatternList.java @@ -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 getExactTypes() { + List ret = new ArrayList(); for (int i = 0; i < typePatterns.length; i++) { UnresolvedType t = typePatterns[i].getExactType(); if (!ResolvedType.isMissing(t)) {