aboutsummaryrefslogtreecommitdiffstats
path: root/bcel-builder/src/main
diff options
context:
space:
mode:
authorLars Grefer <eclipse@larsgrefer.de>2020-08-13 01:01:58 +0200
committerLars Grefer <eclipse@larsgrefer.de>2020-08-13 01:01:58 +0200
commite1bff9a5703baf17ec650b173bdfe776bf87125f (patch)
tree8b4443759c231a6c46cb70c755fe554a4b621e11 /bcel-builder/src/main
parentb6eee2e1052116aa22ebbd3c2baf05c2b709bee5 (diff)
downloadaspectj-e1bff9a5703baf17ec650b173bdfe776bf87125f.tar.gz
aspectj-e1bff9a5703baf17ec650b173bdfe776bf87125f.zip
Use the diamond operator where possible
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'bcel-builder/src/main')
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java6
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/FieldOrMethod.java2
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/JavaClass.java8
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Method.java2
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Utility.java4
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/AnnotationGen.java4
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeAnnos.java6
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeParamAnnos.java6
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ClassGen.java18
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGenOrMethodGen.java4
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionHandle.java4
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionList.java6
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/MethodGen.java20
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Type.java4
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassLoaderRepository.java6
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java6
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/util/NonCachingClassLoaderRepository.java2
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/util/SyntheticRepository.java4
18 files changed, 56 insertions, 56 deletions
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java
index de8f9c650..4609a3e09 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java
@@ -71,9 +71,9 @@ public class ConstantPool implements Node {
private Constant[] pool;
private int poolSize; // number of entries in the pool (could be < pool.length as the array is resized in 'chunks')
- private Map<String, Integer> utf8Cache = new HashMap<String, Integer>();
- private Map<String, Integer> methodCache = new HashMap<String, Integer>();
- private Map<String, Integer> fieldCache = new HashMap<String, Integer>();
+ private Map<String, Integer> utf8Cache = new HashMap<>();
+ private Map<String, Integer> methodCache = new HashMap<>();
+ private Map<String, Integer> fieldCache = new HashMap<>();
public int getSize() {
return poolSize;
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/FieldOrMethod.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/FieldOrMethod.java
index 8689e31b9..f0fc8c5a7 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/FieldOrMethod.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/FieldOrMethod.java
@@ -167,7 +167,7 @@ public abstract class FieldOrMethod extends Modifiers implements Node {
// remain there.
if (annotations == null) {
// Find attributes that contain annotation data
- List<AnnotationGen> accumulatedAnnotations = new ArrayList<AnnotationGen>();
+ List<AnnotationGen> accumulatedAnnotations = new ArrayList<>();
for (Attribute attribute : attributes) {
if (attribute instanceof RuntimeAnnos) {
RuntimeAnnos runtimeAnnotations = (RuntimeAnnos) attribute;
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/JavaClass.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/JavaClass.java
index 59c092239..dd1097ff0 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/JavaClass.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/JavaClass.java
@@ -286,7 +286,7 @@ public class JavaClass extends Modifiers implements Cloneable, Node {
public AnnotationGen[] getAnnotations() {
if (annotationsOutOfDate) {
// Find attributes that contain annotation data
- List<AnnotationGen> accumulatedAnnotations = new ArrayList<AnnotationGen>();
+ List<AnnotationGen> accumulatedAnnotations = new ArrayList<>();
for (Attribute attribute : attributes) {
if (attribute instanceof RuntimeAnnos) {
RuntimeAnnos runtimeAnnotations = (RuntimeAnnos) attribute;
@@ -742,7 +742,7 @@ public class JavaClass extends Modifiers implements Cloneable, Node {
*/
public JavaClass[] getSuperClasses() {
JavaClass clazz = this;
- List<JavaClass> vec = new ArrayList<JavaClass>();
+ List<JavaClass> vec = new ArrayList<>();
for (clazz = clazz.getSuperClass(); clazz != null; clazz = clazz.getSuperClass()) {
vec.add(clazz);
}
@@ -772,8 +772,8 @@ public class JavaClass extends Modifiers implements Cloneable, Node {
* Get all interfaces implemented by this JavaClass (transitively).
*/
public Collection<JavaClass> getAllInterfaces() {
- Queue<JavaClass> queue = new LinkedList<JavaClass>();
- List<JavaClass> interfaceList = new ArrayList<JavaClass>();
+ Queue<JavaClass> queue = new LinkedList<>();
+ List<JavaClass> interfaceList = new ArrayList<>();
queue.add(this);
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Method.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Method.java
index baa0629c6..12608940a 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Method.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Method.java
@@ -223,7 +223,7 @@ public final class Method extends FieldOrMethod {
boolean foundSome = false;
// Build a list of annotation arrays, one per argument
if (parameterAnnotationsInvis != null || parameterAnnotationsVis != null) {
- List<AnnotationGen[]> annotationsForEachParameter = new ArrayList<AnnotationGen[]>();
+ List<AnnotationGen[]> annotationsForEachParameter = new ArrayList<>();
AnnotationGen[] visibleOnes = null;
AnnotationGen[] invisibleOnes = null;
for (int i = 0; i < parameterCount; i++) {
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Utility.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Utility.java
index 9168847b0..71573a311 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Utility.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Utility.java
@@ -606,7 +606,7 @@ public abstract class Utility {
riaIndex = cp.addUtf8("RuntimeInvisibleAnnotations");
}
- List<RuntimeAnnos> newAttributes = new ArrayList<RuntimeAnnos>();
+ List<RuntimeAnnos> newAttributes = new ArrayList<>();
if (rvaData.length > 2) {
newAttributes.add(new RuntimeVisAnnos(rvaIndex, rvaData.length, rvaData, cp));
}
@@ -699,7 +699,7 @@ public abstract class Utility {
riaIndex = cp.addUtf8("RuntimeInvisibleParameterAnnotations");
}
- List<RuntimeParamAnnos> newAttributes = new ArrayList<RuntimeParamAnnos>();
+ List<RuntimeParamAnnos> newAttributes = new ArrayList<>();
if (totalVisCount > 0) {
newAttributes.add(new RuntimeVisParamAnnos(rvaIndex, rvaData.length, rvaData, cp));
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/AnnotationGen.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/AnnotationGen.java
index 8074e383e..8418abdb8 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/AnnotationGen.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/AnnotationGen.java
@@ -44,7 +44,7 @@ public class AnnotationGen {
}
private List<NameValuePair> copyValues(List<NameValuePair> in, ConstantPool cpool, boolean copyPoolEntries) {
- List<NameValuePair> out = new ArrayList<NameValuePair>();
+ List<NameValuePair> out = new ArrayList<>();
for (NameValuePair nvp : in) {
out.add(new NameValuePair(nvp, cpool, copyPoolEntries));
}
@@ -89,7 +89,7 @@ public class AnnotationGen {
public void addElementNameValuePair(NameValuePair evp) {
if (pairs == Collections.EMPTY_LIST) {
- pairs = new ArrayList<NameValuePair>();
+ pairs = new ArrayList<>();
}
pairs.add(evp);
}
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeAnnos.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeAnnos.java
index ecb1d539d..e18174410 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeAnnos.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeAnnos.java
@@ -34,13 +34,13 @@ public abstract class RuntimeAnnos extends Attribute {
public RuntimeAnnos(byte attrid, boolean visible, int nameIdx, int len, ConstantPool cpool) {
super(attrid, nameIdx, len, cpool);
this.visible = visible;
- annotations = new ArrayList<AnnotationGen>();
+ annotations = new ArrayList<>();
}
public RuntimeAnnos(byte attrid, boolean visible, int nameIdx, int len, byte[] data, ConstantPool cpool) {
super(attrid, nameIdx, len, cpool);
this.visible = visible;
- annotations = new ArrayList<AnnotationGen>();
+ annotations = new ArrayList<>();
annotation_data = data;
}
@@ -76,7 +76,7 @@ public abstract class RuntimeAnnos extends Attribute {
DataInputStream dis = new DataInputStream(new ByteArrayInputStream(annotation_data));
int numberOfAnnotations = dis.readUnsignedShort();
if (numberOfAnnotations > 0) {
- List<AnnotationGen> inflatedAnnotations = new ArrayList<AnnotationGen>();
+ List<AnnotationGen> inflatedAnnotations = new ArrayList<>();
for (int i = 0; i < numberOfAnnotations; i++) {
inflatedAnnotations.add(AnnotationGen.read(dis, getConstantPool(), visible));
}
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeParamAnnos.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeParamAnnos.java
index 42bf903a1..5b1dcafff 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeParamAnnos.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeParamAnnos.java
@@ -36,13 +36,13 @@ public abstract class RuntimeParamAnnos extends Attribute {
int nameIdx, int len, ConstantPool cpool) {
super(attrid,nameIdx,len,cpool);
this.visible = visible;
- parameterAnnotations = new ArrayList<AnnotationGen[]>();
+ parameterAnnotations = new ArrayList<>();
}
public RuntimeParamAnnos(byte attrid,boolean visible,int nameIdx,int len,byte[] data,ConstantPool cpool) {
super(attrid,nameIdx,len,cpool);
this.visible = visible;
- parameterAnnotations = new ArrayList<AnnotationGen[]>();
+ parameterAnnotations = new ArrayList<>();
annotation_data = data;
}
@@ -88,7 +88,7 @@ public abstract class RuntimeParamAnnos extends Attribute {
DataInputStream dis = new DataInputStream(new ByteArrayInputStream(annotation_data));
int numParameters = dis.readUnsignedByte();
if (numParameters > 0) {
- List<AnnotationGen[]> inflatedParameterAnnotations = new ArrayList<AnnotationGen[]>();
+ List<AnnotationGen[]> inflatedParameterAnnotations = new ArrayList<>();
for (int i=0; i<numParameters; i++) {
int numAnnotations = dis.readUnsignedShort();
if (numAnnotations == 0 ) {
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ClassGen.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ClassGen.java
index 8b7f0dd3f..943b77f6e 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ClassGen.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ClassGen.java
@@ -97,11 +97,11 @@ public class ClassGen extends Modifiers implements Cloneable {
private int major = Constants.MAJOR_1_1;
private int minor = Constants.MINOR_1_1;
private ConstantPool cpool;
- private List<Field> fieldsList = new ArrayList<Field>();
- private List<Method> methodsList = new ArrayList<Method>();
- private List<Attribute> attributesList = new ArrayList<Attribute>();
- private List<String> interfaceList = new ArrayList<String>();
- private List<AnnotationGen> annotationsList = new ArrayList<AnnotationGen>();
+ private List<Field> fieldsList = new ArrayList<>();
+ private List<Method> methodsList = new ArrayList<>();
+ private List<Attribute> attributesList = new ArrayList<>();
+ private List<String> interfaceList = new ArrayList<>();
+ private List<AnnotationGen> annotationsList = new ArrayList<>();
public ClassGen(String classname, String superclassname, String filename, int modifiers, String[] interfacenames,
ConstantPool cpool) {
@@ -187,7 +187,7 @@ public class ClassGen extends Modifiers implements Cloneable {
attributes = attributesList;
} else {
// TODO: Sometime later, trash any attributes called 'RuntimeVisibleAnnotations' or 'RuntimeInvisibleAnnotations'
- attributes = new ArrayList<Attribute>();
+ attributes = new ArrayList<>();
attributes.addAll(Utility.getAnnotationAttributes(cpool, annotationsList));
attributes.addAll(attributesList);
}
@@ -503,7 +503,7 @@ public class ClassGen extends Modifiers implements Cloneable {
// (relevant modifiers are ACC_PUBLIC, ACC_PRIVATE,
// ACC_PROTECTED, ACC_STATIC, ACC_FINAL, ACC_VOLATILE,
// ACC_TRANSIENT)
- List<Field> relevantFields = new ArrayList<Field>();
+ List<Field> relevantFields = new ArrayList<>();
for (Field field : fieldsList) {
if (!(field.isPrivate() && field.isStatic()) && !(field.isPrivate() && field.isTransient())) {
relevantFields.add(field);
@@ -519,8 +519,8 @@ public class ClassGen extends Modifiers implements Cloneable {
}
// some up front method processing: discover clinit, init and ordinary methods of interest:
- List<Method> relevantMethods = new ArrayList<Method>();
- List<Method> relevantCtors = new ArrayList<Method>();
+ List<Method> relevantMethods = new ArrayList<>();
+ List<Method> relevantCtors = new ArrayList<>();
boolean hasClinit = false;
for (Method m : methodsList) {
boolean couldBeInitializer = m.getName().charAt(0) == '<';
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 ff8b6f42c..c8e1fe2fb 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<Attribute>();
- protected ArrayList<AnnotationGen> annotationList = new ArrayList<AnnotationGen>();
+ private ArrayList<Attribute> attributeList = new ArrayList<>();
+ protected ArrayList<AnnotationGen> annotationList = new ArrayList<>();
protected FieldGenOrMethodGen() {
}
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionHandle.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionHandle.java
index 2f2691df1..c5c244869 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionHandle.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionHandle.java
@@ -156,7 +156,7 @@ public class InstructionHandle implements java.io.Serializable {
*/
public void addTargeter(InstructionTargeter t) {
if (targeters == Collections.EMPTY_SET) {
- targeters = new HashSet<InstructionTargeter>();
+ targeters = new HashSet<>();
}
targeters.add(t);
}
@@ -170,7 +170,7 @@ public class InstructionHandle implements java.io.Serializable {
}
public Set<InstructionTargeter> getTargetersCopy() {
- Set<InstructionTargeter> copy = new HashSet<InstructionTargeter>();
+ Set<InstructionTargeter> copy = new HashSet<>();
copy.addAll(targeters);
return copy;
}
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 dd010b758..156adf0ad 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
@@ -690,7 +690,7 @@ public class InstructionList implements Serializable {
return;
}
- ArrayList<InstructionHandle> target_vec = new ArrayList<InstructionHandle>();
+ ArrayList<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 +1003,7 @@ public class InstructionList implements Serializable {
*/
public Instruction[] getInstructions() {
ByteSequence bytes = new ByteSequence(getByteCode());
- ArrayList<Instruction> instructions = new ArrayList<Instruction>();
+ ArrayList<Instruction> instructions = new ArrayList<>();
try {
while (bytes.available() > 0) {
@@ -1089,7 +1089,7 @@ public class InstructionList implements Serializable {
* @return complete, i.e., deep copy of this list
*/
public InstructionList copy() {
- HashMap<InstructionHandle, InstructionHandle> map = new HashMap<InstructionHandle, InstructionHandle>();
+ HashMap<InstructionHandle, InstructionHandle> map = new HashMap<>();
InstructionList il = new InstructionList();
/*
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 46b558146..cf8c06834 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
@@ -103,11 +103,11 @@ public class MethodGen extends FieldGenOrMethodGen {
private int highestLineNumber = 0;
- private ArrayList<LocalVariableGen> localVariablesList = new ArrayList<LocalVariableGen>();
- private ArrayList<LineNumberGen> lineNumbersList = new ArrayList<LineNumberGen>();
- private ArrayList<CodeExceptionGen> exceptionsList = new ArrayList<CodeExceptionGen>();
- private ArrayList<String> exceptionsThrown = new ArrayList<String>();
- private ArrayList<Attribute> codeAttributesList = new ArrayList<Attribute>();
+ private ArrayList<LocalVariableGen> localVariablesList = new ArrayList<>();
+ private ArrayList<LineNumberGen> lineNumbersList = new ArrayList<>();
+ private ArrayList<CodeExceptionGen> exceptionsList = new ArrayList<>();
+ private ArrayList<String> exceptionsThrown = new ArrayList<>();
+ private ArrayList<Attribute> codeAttributesList = new ArrayList<>();
private List<AnnotationGen>[] param_annotations; // Array of lists containing AnnotationGen objects
private boolean hasParameterAnnotations = false;
private boolean haveUnpackedParameterAnnotations = false;
@@ -933,8 +933,8 @@ public class MethodGen extends FieldGenOrMethodGen {
}
static final class BranchStack {
- Stack<BranchTarget> branchTargets = new Stack<BranchTarget>();
- Hashtable<InstructionHandle, BranchTarget> visitedTargets = new Hashtable<InstructionHandle, BranchTarget>();
+ Stack<BranchTarget> branchTargets = new Stack<>();
+ Hashtable<InstructionHandle, BranchTarget> visitedTargets = new Hashtable<>();
public void push(InstructionHandle target, int stackDepth) {
if (visited(target)) {
@@ -1106,7 +1106,7 @@ public class MethodGen extends FieldGenOrMethodGen {
if (!hasParameterAnnotations) {
param_annotations = new List[parameterTypes.length];
for (int j = 0; j < parameterTypes.length; j++) {
- param_annotations[j] = new ArrayList<AnnotationGen>();
+ param_annotations[j] = new ArrayList<>();
}
}
@@ -1139,7 +1139,7 @@ public class MethodGen extends FieldGenOrMethodGen {
}
private List /* AnnotationGen */<AnnotationGen> makeMutableVersion(AnnotationGen[] mutableArray) {
- List<AnnotationGen> result = new ArrayList<AnnotationGen>();
+ List<AnnotationGen> result = new ArrayList<>();
for (AnnotationGen annotationGen : mutableArray) {
result.add(new AnnotationGen(annotationGen, getConstantPool(), false));
}
@@ -1156,7 +1156,7 @@ public class MethodGen extends FieldGenOrMethodGen {
if (existingAnnotations != null) {
existingAnnotations.add(annotation);
} else {
- List<AnnotationGen> l = new ArrayList<AnnotationGen>();
+ List<AnnotationGen> l = new ArrayList<>();
l.add(annotation);
param_annotations[parameterIndex] = l;
}
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Type.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Type.java
index 68b68f3d6..ed8995ef0 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Type.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Type.java
@@ -113,7 +113,7 @@ public abstract class Type {
public static final Type[] STRINGARRAY6 = new Type[] { STRING, STRING, STRING, STRING, STRING, STRING };
public static final Type[] STRINGARRAY7 = new Type[] { STRING, STRING, STRING, STRING, STRING, STRING, STRING };
- private static Map<String, Type> commonTypes = new HashMap<String, Type>();
+ private static Map<String, Type> commonTypes = new HashMap<>();
static {
commonTypes.put(STRING.getSignature(), STRING);
@@ -314,7 +314,7 @@ public abstract class Type {
*/
// OPTIMIZE crap impl
public static Type[] getArgumentTypes(String signature) {
- List<Type> argumentTypes = new ArrayList<Type>();
+ List<Type> argumentTypes = new ArrayList<>();
int index;
Type[] types;
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassLoaderRepository.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassLoaderRepository.java
index e3c59556b..4f18bd70f 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassLoaderRepository.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassLoaderRepository.java
@@ -88,8 +88,8 @@ public class ClassLoaderRepository implements Repository {
private ClassLoaderReference loaderRef;
// Choice of cache...
- private WeakHashMap<URL, SoftReference<JavaClass>> localCache = new WeakHashMap<URL, SoftReference<JavaClass>>();
- private static SoftHashMap /* <URL,JavaClass> */sharedCache = new SoftHashMap(Collections.synchronizedMap(new HashMap<Object, SpecialValue>()));
+ private WeakHashMap<URL, SoftReference<JavaClass>> localCache = new WeakHashMap<>();
+ private static SoftHashMap /* <URL,JavaClass> */sharedCache = new SoftHashMap(Collections.synchronizedMap(new HashMap<>()));
// For fast translation of the classname *intentionally not static*
private SoftHashMap /* <String,URL> */nameMap = new SoftHashMap(new HashMap(), false);
@@ -216,7 +216,7 @@ public class ClassLoaderRepository implements Repository {
sharedCache.put(url, clazz);
} else {
clazz.setRepository(this);
- localCache.put(url, new SoftReference<JavaClass>(clazz));
+ localCache.put(url, new SoftReference<>(clazz));
}
}
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 95552dd6a..179800540 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
@@ -106,7 +106,7 @@ public class ClassPath implements Serializable {
public ClassPath(String class_path) {
this.class_path = class_path;
- ArrayList<PathEntry> vec = new ArrayList<PathEntry>();
+ ArrayList<PathEntry> vec = new ArrayList<>();
for (StringTokenizer tok = new StringTokenizer(class_path, System.getProperty("path.separator")); tok
.hasMoreTokens();) {
@@ -193,12 +193,12 @@ public class ClassPath implements Serializable {
String ext_path = System.getProperty("java.ext.dirs");
String vm_version = System.getProperty("java.version");
- ArrayList<String> list = new ArrayList<String>();
+ ArrayList<String> list = new ArrayList<>();
getPathComponents(class_path, list);
getPathComponents(boot_path, list);
- ArrayList<String> dirs = new ArrayList<String>();
+ ArrayList<String> dirs = new ArrayList<>();
getPathComponents(ext_path, dirs);
for (String string : dirs) {
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/NonCachingClassLoaderRepository.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/NonCachingClassLoaderRepository.java
index fe43a7bef..a7689b108 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/NonCachingClassLoaderRepository.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/NonCachingClassLoaderRepository.java
@@ -96,7 +96,7 @@ public class NonCachingClassLoaderRepository implements Repository {
}
public SoftHashMap() {
- this(new HashMap<Object,SpecialValue>());
+ this(new HashMap<>());
}
public SoftHashMap(Map<Object,SpecialValue> map, boolean b) {
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/SyntheticRepository.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/SyntheticRepository.java
index ea0e49216..baf3b75cd 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/SyntheticRepository.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/SyntheticRepository.java
@@ -80,12 +80,12 @@ import org.aspectj.apache.bcel.classfile.JavaClass;
public class SyntheticRepository implements Repository {
private static final String DEFAULT_PATH = ClassPath.getClassPath();
- private static HashMap<ClassPath, SyntheticRepository> _instances = new HashMap<ClassPath, SyntheticRepository>(); // CLASSPATH
+ private static HashMap<ClassPath, SyntheticRepository> _instances = new HashMap<>(); // CLASSPATH
// X
// REPOSITORY
private ClassPath _path = null;
- private WeakHashMap<String, JavaClass> _loadedClasses = new WeakHashMap<String, JavaClass>(); // CLASSNAME X JAVACLASS
+ private WeakHashMap<String, JavaClass> _loadedClasses = new WeakHashMap<>(); // CLASSNAME X JAVACLASS
private SyntheticRepository(ClassPath path) {
_path = path;