]> source.dussan.org Git - aspectj.git/commitdiff
Use generics
authorAndy Clement <aclement@gopivotal.com>
Wed, 8 Oct 2014 16:07:52 +0000 (09:07 -0700)
committerAndy Clement <aclement@gopivotal.com>
Wed, 8 Oct 2014 16:07:52 +0000 (09:07 -0700)
36 files changed:
bcel-builder/src/org/aspectj/apache/bcel/ExceptionConstants.java
bcel-builder/src/org/aspectj/apache/bcel/generic/Type.java
lib/bcel/bcel-src.zip
lib/bcel/bcel-verifier.jar
lib/bcel/bcel.jar
loadtime/src/org/aspectj/weaver/loadtime/Aj.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/AndAnnotationTypePattern.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/AnnotationPatternList.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/AnnotationPointcut.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/AnnotationTypePattern.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/AnyWithAnnotationTypePattern.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/ArgsPointcut.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/BindingTypePattern.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/CflowPointcut.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/ConcreteCflowPointcut.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/DeclareErrorOrWarning.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/NameBindingPointcut.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/NotAnnotationTypePattern.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/OrAnnotationTypePattern.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/PerCflow.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/PerFromSuper.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/PerObject.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/PerSingleton.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/PerTypeWithin.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/ThisOrTargetAnnotationPointcut.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/ThisOrTargetPointcut.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/ThrowsPattern.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/TypeCategoryTypePattern.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/TypePatternList.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/TypePatternQuestions.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/WithinAnnotationPointcut.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/WithinCodeAnnotationPointcut.java
taskdefs/.isJava5 [new file with mode: 0644]
taskdefs/src/org/aspectj/tools/ant/taskdefs/Ajdoc.java
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java

index 0c918c8ea155dc54714cbc84cc30d3fe07102a7f..cf3d813086f499dfdbb4ffc65c1fea26babfd37a 100644 (file)
@@ -60,6 +60,7 @@ package org.aspectj.apache.bcel;
  * @version $Id: ExceptionConstants.java,v 1.5 2009/09/14 20:29:10 aclement Exp $
  * @author <A HREF="http://www.inf.fu-berlin.de/~ehaase">E. Haase</A>
  */
+@SuppressWarnings("rawtypes")
 public interface ExceptionConstants {
        /**
         * The mother of all exceptions
@@ -84,7 +85,7 @@ public interface ExceptionConstants {
        public static final Class<ExceptionInInitializerError> EXCEPTION_IN_INITIALIZER_ERROR = ExceptionInInitializerError.class;
        public static final Class<IncompatibleClassChangeError> INCOMPATIBLE_CLASS_CHANGE_ERROR = IncompatibleClassChangeError.class;
        public static final Class<AbstractMethodError> ABSTRACT_METHOD_ERROR = AbstractMethodError.class;
-       public static final Class ILLEGAL_ACCESS_ERROR = IllegalAccessError.class;
+       public static final Class<IllegalAccessError> ILLEGAL_ACCESS_ERROR = IllegalAccessError.class;
        public static final Class<InstantiationError> INSTANTIATION_ERROR = InstantiationError.class;
        public static final Class<NoSuchFieldError> NO_SUCH_FIELD_ERROR = NoSuchFieldError.class;
        public static final Class<NoSuchMethodError> NO_SUCH_METHOD_ERROR = NoSuchMethodError.class;
@@ -100,7 +101,7 @@ public interface ExceptionConstants {
        public static final Class<NullPointerException> NULL_POINTER_EXCEPTION = NullPointerException.class;
        public static final Class<ArrayIndexOutOfBoundsException> ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION = ArrayIndexOutOfBoundsException.class;
        public static final Class<ArithmeticException> ARITHMETIC_EXCEPTION = ArithmeticException.class;
-       public static final Class NEGATIVE_ARRAY_SIZE_EXCEPTION = NegativeArraySizeException.class;
+       public static final Class<NegativeArraySizeException> NEGATIVE_ARRAY_SIZE_EXCEPTION = NegativeArraySizeException.class;
        public static final Class<ClassCastException> CLASS_CAST_EXCEPTION = ClassCastException.class;
        public static final Class<IllegalMonitorStateException> ILLEGAL_MONITOR_STATE = IllegalMonitorStateException.class;
 
index 7662250db71dc6f5e6a7ae4cf26295eb6b6d7840..36d6d7d72e6e9ee1683d18802bcf828fa602642e 100644 (file)
@@ -473,9 +473,9 @@ public abstract class Type {
                return sb.toString();
        }
 
-       public static String getSignature(java.lang.reflect.Constructor cons) {
+       public static String getSignature(java.lang.reflect.Constructor<?> cons) {
                StringBuffer sb = new StringBuffer("(");
-               Class[] params = cons.getParameterTypes(); // avoid clone
+               Class<?>[] params = cons.getParameterTypes(); // avoid clone
 
                for (int j = 0; j < params.length; j++) {
                        sb.append(getType(params[j]).getSignature());
index 2d0a3b5f3e75d624073f36a670421789e8edff27..14f9c2f0aa12b49869bfd6d74822a0ed7b9c6b5d 100644 (file)
Binary files a/lib/bcel/bcel-src.zip and b/lib/bcel/bcel-src.zip differ
index 46a5a0c442dc89983ad90a614b5e6438e8c95d5c..ffeb0791fc2853e78bf29c889eaa97b8993492bc 100644 (file)
Binary files a/lib/bcel/bcel-verifier.jar and b/lib/bcel/bcel-verifier.jar differ
index 097532e75ca362ad3953ef6416d14889dfaf6238..9b0bce336aee5748bba2d02c077e2cde42033edd 100644 (file)
Binary files a/lib/bcel/bcel.jar and b/lib/bcel/bcel.jar differ
index 03715b6a3410f7e7b147e8ec7bb431927d676f9a..0654e4cba920647bd1e7e95d28e16ae117a78ffa 100644 (file)
@@ -200,9 +200,9 @@ public class Aj implements ClassPreProcessor {
                synchronized (WeaverContainer.weavingAdaptors) {
                        if (displayProgress) {
                                System.err.println("Weaver adaptors before queue processing:");
-                               Map m = WeaverContainer.weavingAdaptors;
-                               Set keys = m.keySet();
-                               for (Iterator iterator = keys.iterator(); iterator.hasNext();) {
+                               Map<AdaptorKey,ExplicitlyInitializedClassLoaderWeavingAdaptor> m = WeaverContainer.weavingAdaptors;
+                               Set<AdaptorKey> keys = m.keySet();
+                               for (Iterator<AdaptorKey> iterator = keys.iterator(); iterator.hasNext();) {
                                        Object object = iterator.next();
                                        System.err.println(object + " = " + WeaverContainer.weavingAdaptors.get(object));
                                }
@@ -224,9 +224,9 @@ public class Aj implements ClassPreProcessor {
                        }
                        if (displayProgress) {
                                System.err.println("Weaver adaptors after queue processing:");
-                               Map m = WeaverContainer.weavingAdaptors;
-                               Set keys = m.keySet();
-                               for (Iterator iterator = keys.iterator(); iterator.hasNext();) {
+                               Map<AdaptorKey,ExplicitlyInitializedClassLoaderWeavingAdaptor> m = WeaverContainer.weavingAdaptors;
+                               Set<AdaptorKey> keys = m.keySet();
+                               for (Iterator<AdaptorKey> iterator = keys.iterator(); iterator.hasNext();) {
                                        Object object = iterator.next();
                                        System.err.println(object + " = " + WeaverContainer.weavingAdaptors.get(object));
                                }
@@ -287,7 +287,8 @@ public class Aj implements ClassPreProcessor {
         */
        static class WeaverContainer {
 
-               final static Map weavingAdaptors = Collections.synchronizedMap(new HashMap());
+               final static Map<AdaptorKey,ExplicitlyInitializedClassLoaderWeavingAdaptor> weavingAdaptors = 
+                               Collections.synchronizedMap(new HashMap<AdaptorKey,ExplicitlyInitializedClassLoaderWeavingAdaptor>());
 
                static WeavingAdaptor getWeaver(ClassLoader loader, IWeavingContext weavingContext) {
                        ExplicitlyInitializedClassLoaderWeavingAdaptor adaptor = null;
index 4889d0f9af60353537804780b655856c05b1d3e3..c14f3602502bc91625eef8659c3564b338e36b8f 100644 (file)
@@ -17,6 +17,7 @@ import org.aspectj.weaver.AnnotatedElement;
 import org.aspectj.weaver.CompressingDataOutputStream;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.ResolvedType;
+import org.aspectj.weaver.UnresolvedType;
 import org.aspectj.weaver.VersionedDataInputStream;
 import org.aspectj.weaver.World;
 import org.aspectj.weaver.AjAttribute.WeaverVersionInfo;
@@ -63,7 +64,7 @@ public class AndAnnotationTypePattern extends AnnotationTypePattern {
                return this;
        }
 
-       public AnnotationTypePattern parameterizeWith(Map typeVariableMap, World w) {
+       public AnnotationTypePattern parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                AnnotationTypePattern newLeft = left.parameterizeWith(typeVariableMap, w);
                AnnotationTypePattern newRight = right.parameterizeWith(typeVariableMap, w);
                AndAnnotationTypePattern ret = new AndAnnotationTypePattern(newLeft, newRight);
index 6b6d820b708047987dc23d7922d9e79f022148e2..0b93b48d1763dc09ecff29b620bb76058c528476 100644 (file)
@@ -18,14 +18,12 @@ import org.aspectj.weaver.CompressingDataOutputStream;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.IntMap;
 import org.aspectj.weaver.ResolvedType;
+import org.aspectj.weaver.UnresolvedType;
 import org.aspectj.weaver.VersionedDataInputStream;
 import org.aspectj.weaver.World;
 
 /**
- * @author colyer
- * 
- *         TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code
- *         Templates
+ * @author Adrian Colyer
  */
 public class AnnotationPatternList extends PatternNode {
 
@@ -38,7 +36,7 @@ public class AnnotationPatternList extends PatternNode {
                        new AnnotationTypePattern[] { AnnotationTypePattern.ELLIPSIS });
 
        public AnnotationPatternList() {
-               typePatterns = new AnnotationTypePattern[0];
+               typePatterns = new AnnotationTypePattern[0]; 
                ellipsisCount = 0;
        }
 
@@ -51,7 +49,7 @@ public class AnnotationPatternList extends PatternNode {
                }
        }
 
-       public AnnotationPatternList(List l) {
+       public AnnotationPatternList(List<AnnotationTypePattern> l) {
                this((AnnotationTypePattern[]) l.toArray(new AnnotationTypePattern[l.size()]));
        }
 
@@ -59,7 +57,7 @@ public class AnnotationPatternList extends PatternNode {
                return typePatterns;
        }
 
-       public AnnotationPatternList parameterizeWith(Map typeVariableMap, World w) {
+       public AnnotationPatternList parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                AnnotationTypePattern[] parameterizedPatterns = new AnnotationTypePattern[this.typePatterns.length];
                for (int i = 0; i < parameterizedPatterns.length; i++) {
                        parameterizedPatterns[i] = this.typePatterns[i].parameterizeWith(typeVariableMap, w);
index 44b346e60e8ccc89a5c1c01a865427c14a8ad94a..0a197254a65713ffeefb3ebf49033e06957d3d87 100644 (file)
@@ -254,13 +254,13 @@ public class AnnotationPointcut extends NameBindingPointcut {
         * 
         * @see org.aspectj.weaver.patterns.NameBindingPointcut#getBindingAnnotationTypePatterns()
         */
-       public List getBindingAnnotationTypePatterns() {
+       public List<BindingPattern> getBindingAnnotationTypePatterns() {
                if (annotationTypePattern instanceof BindingPattern) { // BindingAnnotationTypePattern) {
-                       List l = new ArrayList();
-                       l.add(annotationTypePattern);
+                       List<BindingPattern> l = new ArrayList<BindingPattern>();
+                       l.add((BindingPattern)annotationTypePattern);
                        return l;
                } else {
-                       return Collections.EMPTY_LIST;
+                       return Collections.emptyList();
                }
        }
 
@@ -269,8 +269,8 @@ public class AnnotationPointcut extends NameBindingPointcut {
         * 
         * @see org.aspectj.weaver.patterns.NameBindingPointcut#getBindingTypePatterns()
         */
-       public List getBindingTypePatterns() {
-               return Collections.EMPTY_LIST;
+       public List<BindingTypePattern> getBindingTypePatterns() {
+               return Collections.emptyList();
        }
 
        /*
index 0f610fc49625efad6ecdd829cfdad3eb85702502..82fb33854615a26ad444b7799e2796345dc669e6 100644 (file)
@@ -19,6 +19,7 @@ import org.aspectj.weaver.CompressingDataOutputStream;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.IntMap;
 import org.aspectj.weaver.ResolvedType;
+import org.aspectj.weaver.UnresolvedType;
 import org.aspectj.weaver.VersionedDataInputStream;
 import org.aspectj.weaver.World;
 
@@ -50,7 +51,7 @@ public abstract class AnnotationTypePattern extends PatternNode {
 
        public abstract void resolve(World world);
 
-       public abstract AnnotationTypePattern parameterizeWith(Map/* name -> ResolvedType */typeVariableMap, World w);
+       public abstract AnnotationTypePattern parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w);
 
        public boolean isAny() {
                return false;
index fa154f38cd8aff1e58f8cfc96deabb8e5845d8e9..8306ff6d0f82e633322d5f9c140f962338de5bac 100644 (file)
@@ -20,6 +20,7 @@ import org.aspectj.util.FuzzyBoolean;
 import org.aspectj.weaver.CompressingDataOutputStream;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.ResolvedType;
+import org.aspectj.weaver.UnresolvedType;
 import org.aspectj.weaver.VersionedDataInputStream;
 import org.aspectj.weaver.WeaverMessages;
 import org.aspectj.weaver.World;
@@ -82,7 +83,7 @@ public class AnyWithAnnotationTypePattern extends TypePattern {
        }
 
        @Override
-       public TypePattern parameterizeWith(Map typeVariableMap, World w) {
+       public TypePattern parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                AnyWithAnnotationTypePattern ret = new AnyWithAnnotationTypePattern(this.annotationPattern.parameterizeWith(
                                typeVariableMap, w));
                ret.copyLocationFrom(this);
index 4339088138274634c25b8176405c9fed1efcd229..db612b8cd2a7263ab9f3174ca60c63cb63bfb3ae 100644 (file)
@@ -179,36 +179,21 @@ public class ArgsAnnotationPointcut extends NameBindingPointcut {
                return ret;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.NameBindingPointcut#getBindingAnnotationTypePatterns()
-        */
-       public List getBindingAnnotationTypePatterns() {
-               List l = new ArrayList();
+       public List<BindingPattern> getBindingAnnotationTypePatterns() {
+               List<BindingPattern> l = new ArrayList<BindingPattern>();
                AnnotationTypePattern[] pats = arguments.getAnnotationPatterns();
                for (int i = 0; i < pats.length; i++) {
                        if (pats[i] instanceof BindingAnnotationTypePattern) {
-                               l.add(pats[i]);
+                               l.add((BindingPattern)pats[i]);
                        }
                }
                return l;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.NameBindingPointcut#getBindingTypePatterns()
-        */
-       public List getBindingTypePatterns() {
-               return Collections.EMPTY_LIST;
+       public List<BindingTypePattern> getBindingTypePatterns() {
+               return Collections.emptyList();
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PatternNode#write(java.io.DataOutputStream)
-        */
        public void write(CompressingDataOutputStream s) throws IOException {
                s.writeByte(Pointcut.ATARGS);
                arguments.write(s);
index a5d3569c268fd6740ffc5d879cc5253015e6d52a..4898a92b5214c1c01bdd0b136b2ca34673d92d7d 100644 (file)
@@ -118,21 +118,11 @@ public class ArgsPointcut extends NameBindingPointcut {
                return argumentsToMatchAgainst;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.NameBindingPointcut#getBindingAnnotationTypePatterns()
-        */
-       public List getBindingAnnotationTypePatterns() {
-               return Collections.EMPTY_LIST;
+       public List<BindingPattern> getBindingAnnotationTypePatterns() {
+               return Collections.emptyList();
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.NameBindingPointcut#getBindingTypePatterns()
-        */
-       public List getBindingTypePatterns() {
+       public List<BindingTypePattern> getBindingTypePatterns() {
                List<BindingTypePattern> l = new ArrayList<BindingTypePattern>();
                TypePattern[] pats = arguments.getTypePatterns();
                for (int i = 0; i < pats.length; i++) {
index c0d5434ef0146687fe126d73c0df7d01f53c9811..90028503875ddf3a89d005ae4b8df2b0673f0076 100644 (file)
@@ -96,7 +96,7 @@ public class BindingTypePattern extends ExactTypePattern implements BindingPatte
                }
        }
 
-       public TypePattern parameterizeWith(Map typeVariableMap, World w) {
+       public TypePattern parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                ExactTypePattern superParameterized = (ExactTypePattern) super.parameterizeWith(typeVariableMap, w);
                BindingTypePattern ret = new BindingTypePattern(superParameterized.getExactType(), this.formalIndex, this.isVarArgs);
                ret.copyLocationFrom(this);
index 135c496b5737d0d623773a7bcba835d684e1142d..ed66dc0d535c1f4b7acdb805d630965a634158f1 100644 (file)
@@ -40,6 +40,7 @@ import org.aspectj.weaver.VersionedDataInputStream;
 import org.aspectj.weaver.WeaverMessages;
 import org.aspectj.weaver.World;
 import org.aspectj.weaver.ast.Test;
+import org.aspectj.weaver.patterns.ConcreteCflowPointcut.Slot;
 
 public class CflowPointcut extends Pointcut {
        private final Pointcut entry; // The pointcut inside the cflow() that
@@ -103,7 +104,7 @@ public class CflowPointcut extends Pointcut {
                return ret;
        }
 
-       public Pointcut parameterizeWith(Map typeVariableMap, World w) {
+       public Pointcut parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                CflowPointcut ret = new CflowPointcut(entry.parameterizeWith(typeVariableMap, w), isBelow, freeVars);
                ret.copyLocationFrom(this);
                return ret;
@@ -250,7 +251,7 @@ public class CflowPointcut extends Pointcut {
                        return ret;
                } else {
 
-                       List slots = new ArrayList();
+                       List<Slot> slots = new ArrayList<Slot>();
 
                        for (int i = 0, len = freeVars.length; i < len; i++) {
                                int freeVar = freeVars[i];
index 8a553632b1fcfcfa717ae4bf4fc177a712c16332..09208f9c28ad3894032c3ea864bb34effdc12157 100644 (file)
@@ -13,7 +13,6 @@
 package org.aspectj.weaver.patterns;
 
 import java.io.IOException;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -35,12 +34,12 @@ import org.aspectj.weaver.ast.Test;
 
 public class ConcreteCflowPointcut extends Pointcut {
        private final Member cflowField;
-       List/* Slot */slots; // exposed for testing
+       List<Slot> slots; // exposed for testing
        boolean usesCounter;
        ResolvedType aspect;
 
        // Can either use a counter or a stack to implement cflow.
-       public ConcreteCflowPointcut(ResolvedType aspect, Member cflowField, List slots, boolean usesCounter) {
+       public ConcreteCflowPointcut(ResolvedType aspect, Member cflowField, List<Slot> slots, boolean usesCounter) {
                this.aspect = aspect;
                this.cflowField = cflowField;
                this.slots = slots;
@@ -63,8 +62,7 @@ public class ConcreteCflowPointcut extends Pointcut {
                // this bit is for pr145693 - we cannot match at all if one of the types is missing, we will be unable
                // to create the residue
                if (slots != null) {
-                       for (Iterator i = slots.iterator(); i.hasNext();) {
-                               Slot slot = (Slot) i.next();
+                       for (Slot slot: slots) {
                                ResolvedType rt = slot.formalType;
                                if (rt.isMissing()) {
                                        ISourceLocation[] locs = new ISourceLocation[] { getSourceLocation() };
@@ -98,7 +96,7 @@ public class ConcreteCflowPointcut extends Pointcut {
                throw new RuntimeException("unimplemented");
        }
 
-       public Pointcut parameterizeWith(Map typeVariableMap, World w) {
+       public Pointcut parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                throw new RuntimeException("unimplemented");
        }
 
@@ -126,8 +124,7 @@ public class ConcreteCflowPointcut extends Pointcut {
                        return Test.makeFieldGetCall(cflowField, cflowCounterIsValidMethod, Expr.NONE);
                } else {
                        if (slots != null) { // null for cflows managed by counters
-                               for (Iterator i = slots.iterator(); i.hasNext();) {
-                                       Slot slot = (Slot) i.next();
+                               for (Slot slot: slots) {
                                        // System.out.println("slot: " + slot.formalIndex);
                                        state.set(slot.formalIndex,
                                                        aspect.getWorld().getWeavingSupport().makeCflowAccessVar(slot.formalType, cflowField, slot.arrayIndex));
index c3a698967fea50279003fe744b7afb55a84cdbce..0a46fa1e9e3ee70ca66622b7ebf61f8ebdf53ceb 100644 (file)
@@ -17,6 +17,7 @@ import java.util.Map;
 
 import org.aspectj.weaver.CompressingDataOutputStream;
 import org.aspectj.weaver.ISourceContext;
+import org.aspectj.weaver.UnresolvedType;
 import org.aspectj.weaver.VersionedDataInputStream;
 import org.aspectj.weaver.World;
 
@@ -99,7 +100,7 @@ public class DeclareErrorOrWarning extends Declare {
                pointcut = pointcut.resolve(scope);
        }
 
-       public Declare parameterizeWith(Map typeVariableBindingMap, World w) {
+       public Declare parameterizeWith(Map<String,UnresolvedType> typeVariableBindingMap, World w) {
                Declare ret = new DeclareErrorOrWarning(isError, pointcut.parameterizeWith(typeVariableBindingMap, w), message);
                ret.copyLocationFrom(this);
                return ret;
index 511ff6859345f31d84dc0da4a403a925acfc97d9..34b25e2073be76538c0ebcffd419c7a4e9ca1e8a 100644 (file)
@@ -45,8 +45,8 @@ public abstract class NameBindingPointcut extends Pointcut {
                return Test.makeInstanceof(var, myType.resolve(world));
        }
        
-       public abstract List/*<BindingTypePattern>*/ getBindingTypePatterns();
-       public abstract List/*<BindingAnnotationTypePattern>*/ getBindingAnnotationTypePatterns();
+       public abstract List<BindingTypePattern> getBindingTypePatterns();
+       public abstract List<BindingPattern> getBindingAnnotationTypePatterns();
 
 
 }
index 76acc110ab7b515542f1aeff50fa31073c3af44b..0317b85a56b4fe411c3f48332b7d7ef3a22f9307 100644 (file)
@@ -17,6 +17,7 @@ import org.aspectj.weaver.AnnotatedElement;
 import org.aspectj.weaver.CompressingDataOutputStream;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.ResolvedType;
+import org.aspectj.weaver.UnresolvedType;
 import org.aspectj.weaver.VersionedDataInputStream;
 import org.aspectj.weaver.World;
 import org.aspectj.weaver.AjAttribute.WeaverVersionInfo;
@@ -63,7 +64,7 @@ public class NotAnnotationTypePattern extends AnnotationTypePattern {
                return this;
        }
 
-       public AnnotationTypePattern parameterizeWith(Map typeVariableMap, World w) {
+       public AnnotationTypePattern parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                AnnotationTypePattern newNegatedPattern = negatedPattern.parameterizeWith(typeVariableMap, w);
                NotAnnotationTypePattern ret = new NotAnnotationTypePattern(newNegatedPattern);
                ret.copyLocationFrom(this);
index 559b0046a6882204e9fb9a3e67b19a16b5324ba4..3cfe1de8b2f1a72b9befefdcf666ddc8b5714c6b 100644 (file)
@@ -17,6 +17,7 @@ import org.aspectj.weaver.AnnotatedElement;
 import org.aspectj.weaver.CompressingDataOutputStream;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.ResolvedType;
+import org.aspectj.weaver.UnresolvedType;
 import org.aspectj.weaver.VersionedDataInputStream;
 import org.aspectj.weaver.World;
 import org.aspectj.weaver.AjAttribute.WeaverVersionInfo;
@@ -45,19 +46,13 @@ public class OrAnnotationTypePattern extends AnnotationTypePattern {
                right.resolve(world);
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.AnnotationTypePattern#resolveBindings(org.aspectj.weaver.patterns.IScope,
-        * org.aspectj.weaver.patterns.Bindings, boolean)
-        */
        public AnnotationTypePattern resolveBindings(IScope scope, Bindings bindings, boolean allowBinding) {
                left = left.resolveBindings(scope, bindings, allowBinding);
                right = right.resolveBindings(scope, bindings, allowBinding);
                return this;
        }
 
-       public AnnotationTypePattern parameterizeWith(Map typeVariableMap, World w) {
+       public AnnotationTypePattern parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                AnnotationTypePattern newLeft = left.parameterizeWith(typeVariableMap, w);
                AnnotationTypePattern newRight = right.parameterizeWith(typeVariableMap, w);
                OrAnnotationTypePattern ret = new OrAnnotationTypePattern(newLeft, newRight);
index c449eccfa4a249c0c8d2cf5e1f61735508e28851..901c494a6d0cba721528b2598cbdcfac782fa554 100644 (file)
@@ -69,7 +69,7 @@ public class PerCflow extends PerClause {
                entry.resolve(scope);
        }
 
-       public Pointcut parameterizeWith(Map typeVariableMap, World w) {
+       public Pointcut parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                PerCflow ret = new PerCflow(entry.parameterizeWith(typeVariableMap, w), isBelow);
                ret.copyLocationFrom(this);
                return ret;
index d513d65f7ce633671a123cd817a72afb19fd51d6..9875291f3794f12e37d5036802950c98c590b0e8 100644 (file)
@@ -21,6 +21,7 @@ import org.aspectj.weaver.CompressingDataOutputStream;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.ResolvedType;
 import org.aspectj.weaver.Shadow;
+import org.aspectj.weaver.UnresolvedType;
 import org.aspectj.weaver.VersionedDataInputStream;
 import org.aspectj.weaver.WeaverMessages;
 import org.aspectj.weaver.World;
@@ -74,7 +75,7 @@ public class PerFromSuper extends PerClause {
                }
        }
 
-       public Pointcut parameterizeWith(Map typeVariableMap, World w) {
+       public Pointcut parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                return this;
        }
 
index 3a799f78ecf5b4569130e80e4dc0d972a0831854..237a64a8e0f7ea0b892f0adbb7687efb17a26a99 100644 (file)
@@ -24,6 +24,7 @@ import org.aspectj.weaver.PerObjectInterfaceTypeMunger;
 import org.aspectj.weaver.ResolvedType;
 import org.aspectj.weaver.ResolvedTypeMunger;
 import org.aspectj.weaver.Shadow;
+import org.aspectj.weaver.UnresolvedType;
 import org.aspectj.weaver.VersionedDataInputStream;
 import org.aspectj.weaver.World;
 import org.aspectj.weaver.ast.Expr;
@@ -87,7 +88,7 @@ public class PerObject extends PerClause {
                entry.resolve(scope);
        }
 
-       public Pointcut parameterizeWith(Map typeVariableMap, World w) {
+       public Pointcut parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                PerObject ret = new PerObject(entry.parameterizeWith(typeVariableMap, w), isThis);
                ret.copyLocationFrom(this);
                return ret;
index 798b1ba55402a90bf2dadc88e3a9b557eafd33b4..f53c3a4a57d6791becd173a0fba12723406c8b6b 100644 (file)
@@ -22,6 +22,7 @@ import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.ResolvedMember;
 import org.aspectj.weaver.ResolvedType;
 import org.aspectj.weaver.Shadow;
+import org.aspectj.weaver.UnresolvedType;
 import org.aspectj.weaver.VersionedDataInputStream;
 import org.aspectj.weaver.World;
 import org.aspectj.weaver.ast.Expr;
@@ -55,7 +56,7 @@ public class PerSingleton extends PerClause {
                // this method intentionally left blank
        }
 
-       public Pointcut parameterizeWith(Map typeVariableMap, World w) {
+       public Pointcut parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                return this;
        }
 
index 0bcc858706c704fd638b5f846a9b6761ee40b85a..e8b92ac5a4c99e3fae563da154c30bbd1f8a86d4 100644 (file)
@@ -28,6 +28,7 @@ import org.aspectj.weaver.PerTypeWithinTargetTypeMunger;
 import org.aspectj.weaver.ResolvedType;
 import org.aspectj.weaver.ResolvedTypeMunger;
 import org.aspectj.weaver.Shadow;
+import org.aspectj.weaver.UnresolvedType;
 import org.aspectj.weaver.VersionedDataInputStream;
 import org.aspectj.weaver.World;
 import org.aspectj.weaver.ast.Expr;
@@ -58,7 +59,7 @@ public class PerTypeWithin extends PerClause {
                return kindSet;
        }
 
-       public Pointcut parameterizeWith(Map typeVariableMap, World w) {
+       public Pointcut parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                PerTypeWithin ret = new PerTypeWithin(typePattern.parameterizeWith(typeVariableMap, w));
                ret.copyLocationFrom(this);
                return ret;
index 7656a08e065ebbfd525def840db603fe25b2bcdf..dfb5091954e6773b18afb940defd3fb9d2adb0aa 100644 (file)
@@ -89,7 +89,7 @@ public class ThisOrTargetAnnotationPointcut extends NameBindingPointcut {
        }
 
        @Override
-       public Pointcut parameterizeWith(Map typeVariableMap, World w) {
+       public Pointcut parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                ExactAnnotationTypePattern newPattern = (ExactAnnotationTypePattern) this.annotationTypePattern.parameterizeWith(
                                typeVariableMap, w);
                if (newPattern.getAnnotationType() instanceof ResolvedType) {
@@ -246,13 +246,13 @@ public class ThisOrTargetAnnotationPointcut extends NameBindingPointcut {
         * @see org.aspectj.weaver.patterns.NameBindingPointcut#getBindingAnnotationTypePatterns()
         */
        @Override
-       public List getBindingAnnotationTypePatterns() {
+       public List<BindingPattern> getBindingAnnotationTypePatterns() {
                if (annotationTypePattern instanceof BindingAnnotationTypePattern) {
-                       List l = new ArrayList();
-                       l.add(annotationTypePattern);
+                       List<BindingPattern> l = new ArrayList<BindingPattern>();
+                       l.add((BindingPattern)annotationTypePattern);
                        return l;
                } else {
-                       return Collections.EMPTY_LIST;
+                       return Collections.emptyList();
                }
        }
 
@@ -262,8 +262,8 @@ public class ThisOrTargetAnnotationPointcut extends NameBindingPointcut {
         * @see org.aspectj.weaver.patterns.NameBindingPointcut#getBindingTypePatterns()
         */
        @Override
-       public List getBindingTypePatterns() {
-               return Collections.EMPTY_LIST;
+       public List<BindingTypePattern> getBindingTypePatterns() {
+               return Collections.emptyList();
        }
 
        /*
index f2e77440bc5cb77d1df18f3e2f120a8fa04ccdb0..a278e76c677ce8e13798b0ce80b6c2f3ea1afa24 100644 (file)
@@ -34,8 +34,6 @@ import org.aspectj.weaver.ast.Literal;
 import org.aspectj.weaver.ast.Test;
 import org.aspectj.weaver.ast.Var;
 
-// 
-
 /**
  * Corresponds to target or this pcd.
  * 
@@ -90,7 +88,7 @@ public class ThisOrTargetPointcut extends NameBindingPointcut {
        }
 
        @Override
-       public Pointcut parameterizeWith(Map typeVariableMap, World w) {
+       public Pointcut parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                ThisOrTargetPointcut ret = new ThisOrTargetPointcut(isThis, typePattern.parameterizeWith(typeVariableMap, w));
                ret.copyLocationFrom(this);
                return ret;
@@ -159,29 +157,19 @@ public class ThisOrTargetPointcut extends NameBindingPointcut {
                typePattern.postRead(enclosingType);
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.NameBindingPointcut#getBindingAnnotationTypePatterns()
-        */
        @Override
-       public List getBindingAnnotationTypePatterns() {
-               return Collections.EMPTY_LIST;
+       public List<BindingPattern> getBindingAnnotationTypePatterns() {
+               return Collections.emptyList();
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.NameBindingPointcut#getBindingTypePatterns()
-        */
        @Override
-       public List getBindingTypePatterns() {
+       public List<BindingTypePattern> getBindingTypePatterns() {
                if (typePattern instanceof BindingTypePattern) {
-                       List l = new ArrayList();
-                       l.add(typePattern);
+                       List<BindingTypePattern> l = new ArrayList<BindingTypePattern>();
+                       l.add((BindingTypePattern)typePattern);
                        return l;
                } else {
-                       return Collections.EMPTY_LIST;
+                       return Collections.emptyList();
                }
        }
 
index d3e0afce25764acb4bddcff98833149ce01194fc..93557d8c116e4e74d9f9a00c77e38fd247f7415e 100644 (file)
@@ -78,7 +78,7 @@ public class ThrowsPattern extends PatternNode {
                return this;
        }
 
-       public ThrowsPattern parameterizeWith(Map/* name -> resolved type */typeVariableMap, World w) {
+       public ThrowsPattern parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                ThrowsPattern ret = new ThrowsPattern(required.parameterizeWith(typeVariableMap, w), forbidden.parameterizeWith(
                                typeVariableMap, w));
                ret.copyLocationFrom(this);
index 3e0934fe8a5ea4d654da837b007fe8647e2029f1..9f565b20d5e7f1d66cce046d613c70d9cb86c37f 100644 (file)
@@ -20,6 +20,7 @@ import org.aspectj.util.FuzzyBoolean;
 import org.aspectj.weaver.CompressingDataOutputStream;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.ResolvedType;
+import org.aspectj.weaver.UnresolvedType;
 import org.aspectj.weaver.VersionedDataInputStream;
 import org.aspectj.weaver.World;
 
@@ -69,7 +70,7 @@ public class TypeCategoryTypePattern extends TypePattern {
        }
 
        @Override
-       public TypePattern parameterizeWith(Map typeVariableMap, World w) {
+       public TypePattern parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                return this;
        }
 
index 1551cdb401bd81e3ceed6dcd924f0db395fc5065..da9d6e15afec28481e3a41fe7793b2d54cca5166 100644 (file)
@@ -58,7 +58,7 @@ public class TypePatternList extends PatternNode {
                }
        }
 
-       public TypePatternList(List l) {
+       public TypePatternList(List<TypePattern> l) {
                this((TypePattern[]) l.toArray(new TypePattern[l.size()]));
        }
 
@@ -424,7 +424,7 @@ public class TypePatternList extends PatternNode {
         * @param typeVariableMap
         * @return
         */
-       public TypePatternList parameterizeWith(Map typeVariableMap, World w) {
+       public TypePatternList parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                TypePattern[] parameterizedPatterns = new TypePattern[typePatterns.length];
                for (int i = 0; i < parameterizedPatterns.length; i++) {
                        parameterizedPatterns[i] = typePatterns[i].parameterizeWith(typeVariableMap, w);
index 41aaf4bcfcf0af4d6188b78f8524ebba11e23517..d4bdf2e585e61779b49133a5026774c9f1bad0a0 100644 (file)
@@ -22,7 +22,7 @@ import org.aspectj.weaver.ResolvedType;
 
 
 public class TypePatternQuestions {
-       private Map questionsAndAnswers = new HashMap();
+       private Map<Question,FuzzyBoolean> questionsAndAnswers = new HashMap<Question,FuzzyBoolean>();
        
        public FuzzyBoolean askQuestion(TypePattern pattern, ResolvedType type,
                                                                        TypePattern.MatchKind kind)
@@ -37,8 +37,8 @@ public class TypePatternQuestions {
        }
        
        public Question anyChanges() {
-               for (Iterator i = questionsAndAnswers.entrySet().iterator(); i.hasNext(); ) {
-                       Map.Entry entry = (Map.Entry)i.next();
+               for (Iterator<Map.Entry<Question,FuzzyBoolean>> i = questionsAndAnswers.entrySet().iterator(); i.hasNext(); ) {
+                       Map.Entry<Question,FuzzyBoolean> entry = i.next();
                        Question question = (Question)entry.getKey();
                        FuzzyBoolean expectedAnswer = (FuzzyBoolean)entry.getValue();
                        
@@ -55,8 +55,7 @@ public class TypePatternQuestions {
        public String toString() {
                StringBuffer buf = new StringBuffer();
                buf.append("TypePatternQuestions{");
-               for (Iterator i = questionsAndAnswers.entrySet().iterator(); i.hasNext(); ) {
-                       Map.Entry entry = (Map.Entry)i.next();
+               for (Map.Entry<Question,FuzzyBoolean> entry: questionsAndAnswers.entrySet()) {
                        Question question = (Question)entry.getKey();
                        FuzzyBoolean expectedAnswer = (FuzzyBoolean)entry.getValue();
                        buf.append(question);
index 87966f0172bd0cb8cfb4b54106d8c6a41a439cac..42ec11dc23c6740299a4da55f8c24b563890705b 100644 (file)
@@ -69,7 +69,7 @@ public class WithinAnnotationPointcut extends NameBindingPointcut {
        }
 
        @Override
-       public Pointcut parameterizeWith(Map typeVariableMap, World w) {
+       public Pointcut parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                WithinAnnotationPointcut ret = new WithinAnnotationPointcut(this.annotationTypePattern.parameterizeWith(typeVariableMap, w));
                ret.copyLocationFrom(this);
                return ret;
@@ -161,37 +161,22 @@ public class WithinAnnotationPointcut extends NameBindingPointcut {
                return match(shadow).alwaysTrue() ? Literal.TRUE : Literal.FALSE;
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.NameBindingPointcut#getBindingAnnotationTypePatterns()
-        */
        @Override
-       public List getBindingAnnotationTypePatterns() {
+       public List<BindingPattern> getBindingAnnotationTypePatterns() {
                if (annotationTypePattern instanceof BindingAnnotationTypePattern) {
-                       List l = new ArrayList();
-                       l.add(annotationTypePattern);
+                       List<BindingPattern> l = new ArrayList<BindingPattern>();
+                       l.add((BindingPattern)annotationTypePattern);
                        return l;
                } else {
-                       return Collections.EMPTY_LIST;
+                       return Collections.emptyList();
                }
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.NameBindingPointcut#getBindingTypePatterns()
-        */
        @Override
-       public List getBindingTypePatterns() {
-               return Collections.EMPTY_LIST;
+       public List<BindingTypePattern> getBindingTypePatterns() {
+               return Collections.emptyList();
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PatternNode#write(java.io.DataOutputStream)
-        */
        @Override
        public void write(CompressingDataOutputStream s) throws IOException {
                s.writeByte(Pointcut.ATWITHIN);
index 0b574c4d4f6f0e8166360c47882aacd217f30235..408c829f5e90f6f93d941918d94d040122a83e00 100644 (file)
@@ -77,7 +77,7 @@ public class WithinCodeAnnotationPointcut extends NameBindingPointcut {
                return matchedShadowKinds;
        }
 
-       public Pointcut parameterizeWith(Map typeVariableMap, World w) {
+       public Pointcut parameterizeWith(Map<String,UnresolvedType> typeVariableMap, World w) {
                WithinCodeAnnotationPointcut ret = new WithinCodeAnnotationPointcut((ExactAnnotationTypePattern) this.annotationTypePattern
                                .parameterizeWith(typeVariableMap, w));
                ret.copyLocationFrom(this);
@@ -170,35 +170,20 @@ public class WithinCodeAnnotationPointcut extends NameBindingPointcut {
                }
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.NameBindingPointcut#getBindingAnnotationTypePatterns()
-        */
-       public List getBindingAnnotationTypePatterns() {
+       public List<BindingPattern> getBindingAnnotationTypePatterns() {
                if (annotationTypePattern instanceof BindingAnnotationTypePattern) {
-                       List l = new ArrayList();
-                       l.add(annotationTypePattern);
+                       List<BindingPattern> l = new ArrayList<BindingPattern>();
+                       l.add((BindingPattern)annotationTypePattern);
                        return l;
                } else {
-                       return Collections.EMPTY_LIST;
+                       return Collections.emptyList();
                }
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.NameBindingPointcut#getBindingTypePatterns()
-        */
-       public List getBindingTypePatterns() {
-               return Collections.EMPTY_LIST;
+       public List<BindingTypePattern> getBindingTypePatterns() {
+               return Collections.emptyList();
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.aspectj.weaver.patterns.PatternNode#write(java.io.DataOutputStream)
-        */
        public void write(CompressingDataOutputStream s) throws IOException {
                s.writeByte(Pointcut.ATWITHINCODE);
                annotationTypePattern.write(s);
diff --git a/taskdefs/.isJava5 b/taskdefs/.isJava5
new file mode 100644 (file)
index 0000000..136d063
--- /dev/null
@@ -0,0 +1 @@
+  
\ No newline at end of file
index 0957ce1e991edc7a124e2d66e96936c783cde0ff..b787a2f89e8c87477ba14d417b4d8ec8e6a95739 100644 (file)
@@ -58,23 +58,23 @@ public class Ajdoc extends MatchingTask {
     protected Commandline vmcmd;
     private Path sourcepath;
     private File destdir;
-    private Collection sourcefiles;
-    private Collection packagenames;
+    private Collection<String> sourcefiles;
+    private Collection<String> packagenames;
     private File packageList;
     private Path bootclasspath;
     private Path extdirs;
     private Path classpath;
     private Path internalclasspath;
-    private List argfiles;
+    private List<File> argfiles;
     private Path docletpath;
-    private Collection links;
-    private Collection groups;
+    private Collection<Link> links;
+    private Collection<Group> groups;
     private Doclet doclet;
     private boolean failonerror;
     private boolean fork;
        private String source;
        private Html bottom;
-    private Vector fileSets = new Vector();
+    private Vector<FileSet> fileSets = new Vector<FileSet>();
     /** reset all to initial values - permit gc if Ajdoc is held */
     public Ajdoc() {
         reset();
@@ -94,8 +94,8 @@ public class Ajdoc extends MatchingTask {
         internalclasspath  = null;
         argfiles  = null;
         docletpath  = null;
-        links = new ArrayList();
-        groups = new ArrayList();
+        links = new ArrayList<Link>();
+        groups = new ArrayList<Group>();
         doclet  = null;
         failonerror  = false;
         fork = false;
@@ -165,9 +165,9 @@ public class Ajdoc extends MatchingTask {
     
     private void addFileSets() {
        if(sourcefiles == null)
-               sourcefiles = new ArrayList();
+               sourcefiles = new ArrayList<String>();
        
-        Enumeration e = fileSets.elements();
+        Enumeration<FileSet> e = fileSets.elements();
         while (e.hasMoreElements()) {
             FileSet fs = (FileSet) e.nextElement();
             if (!fs.hasPatterns() && !fs.hasSelectors()) {
@@ -186,7 +186,7 @@ public class Ajdoc extends MatchingTask {
     
     public void setPackagenames(String list) {
         (packagenames == null ?
-         packagenames = new ArrayList() :
+         packagenames = new ArrayList<String>() :
          packagenames).addAll(strings(list, true));
     }
     
@@ -262,9 +262,9 @@ public class Ajdoc extends MatchingTask {
         }
     }
 
-    public List createArgfiles() {
+    public List<File> createArgfiles() {
         return (argfiles == null ?
-                argfiles = new ArrayList() :
+                argfiles = new ArrayList<File>() :
                 argfiles);
     }
 
@@ -388,7 +388,7 @@ public class Ajdoc extends MatchingTask {
 
     public class Group {
         private String title;
-        private List packages;
+        private List<String> packages;
         public Group() {}
         public void setTitle(String title) {
             this.title = title;
@@ -480,7 +480,7 @@ public class Ajdoc extends MatchingTask {
     public class Doclet {
         protected String name;
         protected Path path;
-        protected List params = new ArrayList();
+        protected List<Param> params = new ArrayList<Param>();
         public Doclet() {}
         public void setName(String name) {
             this.name = name;
@@ -583,8 +583,7 @@ public class Ajdoc extends MatchingTask {
                cmd.createArgument().setValue(getProject().replaceProperties(bottom.getText()));
         }
         
-        for (Iterator i = links.iterator(); i.hasNext();) {
-            Link link = (Link)i.next();
+        for (Link link: links) {
             if (link.href == null) {
                 throw new BuildException("Link href cannot be null!", getLocation());
             }
@@ -619,9 +618,8 @@ public class Ajdoc extends MatchingTask {
                 }
             }
         }
-        Map groupMap = new HashMap();
-        for (Iterator i = groups.iterator(); i.hasNext();) {
-            Group group = (Group)i.next();
+        Map<String,List<String>> groupMap = new HashMap<String,List<String>>();
+        for (Group group: groups) {
             if (group.title == null) {
                 throw new BuildException("Group names cannot be null!",
                                          getLocation());
@@ -630,18 +628,17 @@ public class Ajdoc extends MatchingTask {
                 throw new BuildException("Group packages cannot be null!",
                                          getLocation());
             }
-            List packages = (List)groupMap.get(group.title);
+            List<String> packages = groupMap.get(group.title);
             if (packages == null) {
-                packages = new ArrayList();
+                packages = new ArrayList<String>();
             }
             packages.addAll(group.packages);
             groupMap.put(group.title, packages);
         }
-        for (Iterator i = groupMap.keySet().iterator(); i.hasNext();) {
-            String title = (String)i.next();
-            List packages = (List)groupMap.get(title);
+        for (String title: groupMap.keySet()) {
+            List<String> packages = groupMap.get(title);
             String pkgstr = "";
-            for (Iterator j = packages.iterator(); j.hasNext();) {
+            for (Iterator<String> j = packages.iterator(); j.hasNext();) {
                 pkgstr += j.next();
                 if (j.hasNext()) pkgstr += ",";
             }
@@ -663,7 +660,7 @@ public class Ajdoc extends MatchingTask {
             cmd.createArgument().setValue("@" + packageList);
         }
         if (null != packagenames) {
-            for (Iterator i = packagenames.iterator(); i.hasNext();) {
+            for (Iterator<String> i = packagenames.iterator(); i.hasNext();) {
                 cmd.createArgument().setValue((String)i.next());
             }
         }
@@ -688,9 +685,9 @@ public class Ajdoc extends MatchingTask {
 
        addFileSets();
         if (sourcefiles != null) {
-            for (Iterator i = sourcefiles.iterator(); i.hasNext();) {
+            for (Iterator<String> i = sourcefiles.iterator(); i.hasNext();) {
                 // let ajdoc resolve sourcefiles relative to sourcepath,
-                cmd.createArgument().setValue((String)i.next());
+                cmd.createArgument().setValue(i.next());
             }
         }
         // XXX PR682 weak way to report errors - need to refactor
@@ -717,13 +714,13 @@ public class Ajdoc extends MatchingTask {
         }
     }
 
-    protected interface Mapper {
-        public Object map(String str);
+    protected interface Mapper<T> {
+        public T map(String str);
     }
 
-    protected final List list(String str, Mapper mapper) {
-        if (str == null) return Collections.EMPTY_LIST;
-        List list = new ArrayList();
+    protected final <T> List<T> list(String str, Mapper<T> mapper) {
+        if (str == null) return Collections.emptyList();
+        List<T> list = new ArrayList<T>();
         for (StringTokenizer t = new StringTokenizer(str, ",", false);
              t.hasMoreTokens();) {
             list.add(mapper.map(t.nextToken().trim()));
@@ -731,21 +728,21 @@ public class Ajdoc extends MatchingTask {
         return list;
     }
 
-    protected final List files(String str) {
-        return list(str, new Mapper() {
-                public Object map(String s) {
+    protected final List<File> files(String str) {
+        return list(str, new Mapper<File>() {
+                public File map(String s) {
                     return getProject().resolveFile(s);
                 }
             });
     }
 
-    protected final List strings(String str) {
+    protected final List<String> strings(String str) {
         return strings(str, false);
     }
 
-    protected final List strings(String str, final boolean filterSlashes) {
-        return list(str, new Mapper() {
-                public Object map(String s) {
+    protected final List<String> strings(String str, final boolean filterSlashes) {
+        return list(str, new Mapper<String>() {
+                public String map(String s) {
                     return filterSlashes ? filterSlashes(s) : s;
                 }
             });
index a7b35a203d59e859bb165ccc71e2e58c0b2021d0..3163e7f371838ab7c51ea3463c65680d8c6cfdd5 100644 (file)
@@ -14,7 +14,6 @@ package org.aspectj.weaver.bcel;
 
 import java.lang.reflect.Modifier;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
@@ -27,11 +26,7 @@ import java.util.Properties;
 import java.util.Set;
 
 import org.aspectj.apache.bcel.Constants;
-import org.aspectj.apache.bcel.classfile.Attribute;
 import org.aspectj.apache.bcel.classfile.BootstrapMethods;
-import org.aspectj.apache.bcel.classfile.ConstantInvokeDynamic;
-import org.aspectj.apache.bcel.classfile.ConstantMethodHandle;
-import org.aspectj.apache.bcel.classfile.ConstantMethodref;
 import org.aspectj.apache.bcel.classfile.ConstantPool;
 import org.aspectj.apache.bcel.classfile.Method;
 import org.aspectj.apache.bcel.classfile.annotation.AnnotationGen;
@@ -47,7 +42,6 @@ import org.aspectj.apache.bcel.generic.InstructionLV;
 import org.aspectj.apache.bcel.generic.InstructionList;
 import org.aspectj.apache.bcel.generic.InstructionSelect;
 import org.aspectj.apache.bcel.generic.InstructionTargeter;
-import org.aspectj.apache.bcel.generic.InvokeDynamic;
 import org.aspectj.apache.bcel.generic.InvokeInstruction;
 import org.aspectj.apache.bcel.generic.LineNumberTag;
 import org.aspectj.apache.bcel.generic.LocalVariableTag;
@@ -74,7 +68,6 @@ import org.aspectj.weaver.ConcreteTypeMunger;
 import org.aspectj.weaver.IClassWeaver;
 import org.aspectj.weaver.IntMap;
 import org.aspectj.weaver.Member;
-import org.aspectj.weaver.MemberKind;
 import org.aspectj.weaver.MissingResolvedTypeWithKnownSignature;
 import org.aspectj.weaver.NameMangler;
 import org.aspectj.weaver.NewConstructorTypeMunger;