diff options
Diffstat (limited to 'bcel-builder')
6 files changed, 17 insertions, 27 deletions
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGenOrMethodGen.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGenOrMethodGen.java index c8e1fe2fb..5b4256685 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGenOrMethodGen.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGenOrMethodGen.java @@ -76,8 +76,8 @@ public abstract class FieldGenOrMethodGen extends Modifiers { protected String name; protected Type type; protected ConstantPool cp; - private ArrayList<Attribute> attributeList = new ArrayList<>(); - protected ArrayList<AnnotationGen> annotationList = new ArrayList<>(); + private List<Attribute> attributeList = new ArrayList<>(); + protected List<AnnotationGen> annotationList = new ArrayList<>(); protected FieldGenOrMethodGen() { } diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionList.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionList.java index 156adf0ad..7938218bc 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionList.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionList.java @@ -58,10 +58,7 @@ import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Set; +import java.util.*; import org.aspectj.apache.bcel.Constants; import org.aspectj.apache.bcel.classfile.Constant; @@ -690,7 +687,7 @@ public class InstructionList implements Serializable { return; } - ArrayList<InstructionHandle> target_vec = new ArrayList<>(); + List<InstructionHandle> target_vec = new ArrayList<>(); for (InstructionHandle ih = first; ih != null; ih = ih.next) { ih.getInstruction().dispose(); // e.g. BranchInstructions release their targets @@ -1003,7 +1000,7 @@ public class InstructionList implements Serializable { */ public Instruction[] getInstructions() { ByteSequence bytes = new ByteSequence(getByteCode()); - ArrayList<Instruction> instructions = new ArrayList<>(); + List<Instruction> instructions = new ArrayList<>(); try { while (bytes.available() > 0) { diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/MethodGen.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/MethodGen.java index cf8c06834..453fe7c1f 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/MethodGen.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/MethodGen.java @@ -54,11 +54,7 @@ package org.aspectj.apache.bcel.generic; * <http://www.apache.org/>. */ -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Stack; +import java.util.*; import org.aspectj.apache.bcel.Constants; import org.aspectj.apache.bcel.classfile.Attribute; @@ -103,11 +99,11 @@ public class MethodGen extends FieldGenOrMethodGen { private int highestLineNumber = 0; - private ArrayList<LocalVariableGen> localVariablesList = new ArrayList<>(); - private ArrayList<LineNumberGen> lineNumbersList = new ArrayList<>(); + private List<LocalVariableGen> localVariablesList = new ArrayList<>(); + private List<LineNumberGen> lineNumbersList = new ArrayList<>(); private ArrayList<CodeExceptionGen> exceptionsList = new ArrayList<>(); private ArrayList<String> exceptionsThrown = new ArrayList<>(); - private ArrayList<Attribute> codeAttributesList = new ArrayList<>(); + private List<Attribute> codeAttributesList = new ArrayList<>(); private List<AnnotationGen>[] param_annotations; // Array of lists containing AnnotationGen objects private boolean hasParameterAnnotations = false; private boolean haveUnpackedParameterAnnotations = false; @@ -934,7 +930,7 @@ public class MethodGen extends FieldGenOrMethodGen { static final class BranchStack { Stack<BranchTarget> branchTargets = new Stack<>(); - Hashtable<InstructionHandle, BranchTarget> visitedTargets = new Hashtable<>(); + Map<InstructionHandle, BranchTarget> visitedTargets = new Hashtable<>(); public void push(InstructionHandle target, int stackDepth) { if (visited(target)) { diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java index 179800540..678abb1dc 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java @@ -69,11 +69,7 @@ import java.nio.file.Path; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributeView; import java.nio.file.attribute.BasicFileAttributes; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.StringTokenizer; +import java.util.*; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -106,7 +102,7 @@ public class ClassPath implements Serializable { public ClassPath(String class_path) { this.class_path = class_path; - ArrayList<PathEntry> vec = new ArrayList<>(); + List<PathEntry> vec = new ArrayList<>(); for (StringTokenizer tok = new StringTokenizer(class_path, System.getProperty("path.separator")); tok .hasMoreTokens();) { @@ -167,7 +163,7 @@ public class ClassPath implements Serializable { return false; } - private static final void getPathComponents(String path, ArrayList<String> list) { + private static final void getPathComponents(String path, List<String> list) { if (path != null) { StringTokenizer tok = new StringTokenizer(path, File.pathSeparator); diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationGenTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationGenTest.java index d684144eb..84f9d9532 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationGenTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationGenTest.java @@ -97,7 +97,7 @@ public class AnnotationGenTest extends BcelTestCase { // Build a RV annotation of type 'SimpleAnnotation' with 'id=4' as the only value :) AnnotationGen a = new AnnotationGen(t, elements, true, cp); - Vector<AnnotationGen> v = new Vector<>(); + List<AnnotationGen> v = new Vector<>(); v.add(a); Collection<RuntimeAnnos> attributes = Utility.getAnnotationAttributes(cp, v); boolean foundRV = false; @@ -113,7 +113,7 @@ public class AnnotationGenTest extends BcelTestCase { // Build a RIV annotation of type 'SimpleAnnotation' with 'id=4' as the only value :) AnnotationGen a2 = new AnnotationGen(t, elements, false, cp); - Vector<AnnotationGen> v2 = new Vector<>(); + List<AnnotationGen> v2 = new Vector<>(); v2.add(a2); Collection<RuntimeAnnos> attributes2 = Utility.getAnnotationAttributes(cp, v2); boolean foundRIV = false; diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GenericSignatureParsingTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GenericSignatureParsingTest.java index 255dc77ff..c97e12678 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GenericSignatureParsingTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GenericSignatureParsingTest.java @@ -12,6 +12,7 @@ package org.aspectj.apache.bcel.classfile.tests; import java.util.ArrayList; +import java.util.List; import org.aspectj.apache.bcel.Constants; import org.aspectj.apache.bcel.classfile.Attribute; @@ -415,7 +416,7 @@ public class GenericSignatureParsingTest extends BcelTestCase { * @return Array of argument types */ public static final String[] methodSignatureArgumentTypes(String signature,boolean chopit) throws ClassFormatException { - ArrayList<String> vec = new ArrayList<>(); + List<String> vec = new ArrayList<>(); int index; String[] types; |