diff options
author | Lars Grefer <eclipse@larsgrefer.de> | 2020-08-13 01:01:58 +0200 |
---|---|---|
committer | Lars Grefer <eclipse@larsgrefer.de> | 2020-08-13 01:01:58 +0200 |
commit | e1bff9a5703baf17ec650b173bdfe776bf87125f (patch) | |
tree | 8b4443759c231a6c46cb70c755fe554a4b621e11 /org.aspectj.ajdt.core | |
parent | b6eee2e1052116aa22ebbd3c2baf05c2b709bee5 (diff) | |
download | aspectj-e1bff9a5703baf17ec650b173bdfe776bf87125f.tar.gz aspectj-e1bff9a5703baf17ec650b173bdfe776bf87125f.zip |
Use the diamond operator where possible
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'org.aspectj.ajdt.core')
34 files changed, 159 insertions, 159 deletions
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java index 57af301f2..07332990f 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java @@ -152,10 +152,10 @@ public class BuildArgParser extends Main { boolean incrementalMode = buildConfig.isIncrementalMode() || buildConfig.isIncrementalFileMode(); - List<File> xmlfileList = new ArrayList<File>(); + List<File> xmlfileList = new ArrayList<>(); xmlfileList.addAll(parser.getXmlFiles()); - List<File> fileList = new ArrayList<File>(); + List<File> fileList = new ArrayList<>(); List<File> files = parser.getFiles(); if (!LangUtil.isEmpty(files)) { if (incrementalMode) { @@ -165,7 +165,7 @@ public class BuildArgParser extends Main { } } - List<String> javaArgList = new ArrayList<String>(); + List<String> javaArgList = new ArrayList<>(); // disable all special eclipse warnings by default - why??? // ??? might want to instead override getDefaultOptions() javaArgList.add("-warn:none"); @@ -280,7 +280,7 @@ public class BuildArgParser extends Main { } private ArrayList<String> toArrayList(java.util.List<File> files) { - ArrayList<String> arrayList = new ArrayList<String>(); + ArrayList<String> arrayList = new ArrayList<>(); for (File file: files) { arrayList.add(file.getAbsolutePath()); } @@ -363,7 +363,7 @@ public class BuildArgParser extends Main { } public List<String> getBootclasspath(AjcConfigParser parser) { - List<String> ret = new ArrayList<String>(); + List<String> ret = new ArrayList<>(); if (parser.bootclasspath == null) { if (LangUtil.is19VMOrGreater()) { @@ -378,13 +378,13 @@ public class BuildArgParser extends Main { } public List<String> getModulepath(AjcConfigParser parser) { - List<String> ret = new ArrayList<String>(); + List<String> ret = new ArrayList<>(); addClasspath(parser.modulepath, ret); return ret; } public List<String> getModulesourcepath(AjcConfigParser parser) { - List<String> ret = new ArrayList<String>(); + List<String> ret = new ArrayList<>(); addClasspath(parser.modulesourcepath, ret); return ret; } @@ -565,7 +565,7 @@ public class BuildArgParser extends Main { buildConfig.setMakeReflectable(true); } else if (arg.equals("-sourceroots")) { if (args.size() > nextArgIndex) { - List<File> sourceRoots = new ArrayList<File>(); + List<File> sourceRoots = new ArrayList<>(); StringTokenizer st = new StringTokenizer(args.get(nextArgIndex).getValue(), File.pathSeparator); while (st.hasMoreTokens()) { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/ConfigParser.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/ConfigParser.java index bdb87cb2b..f290d910a 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/ConfigParser.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/ConfigParser.java @@ -26,8 +26,8 @@ import java.util.StringTokenizer; public class ConfigParser { Location location; protected File relativeDirectory = null; - protected List<File> files = new LinkedList<File>(); - protected List<File> xmlfiles = new ArrayList<File>(); + protected List<File> files = new LinkedList<>(); + protected List<File> xmlfiles = new ArrayList<>(); private boolean fileParsed = false; protected static String CONFIG_MSG = "build config error: "; @@ -41,7 +41,7 @@ public class ConfigParser { public void parseCommandLine(String[] argsArray) throws ParseException { location = new CommandLineLocation(); - LinkedList<Arg> args = new LinkedList<Arg>(); + LinkedList<Arg> args = new LinkedList<>(); for (String s : argsArray) { args.add(new Arg(s, location)); } @@ -80,7 +80,7 @@ public class ConfigParser { return; } - LinkedList<Arg> args = new LinkedList<Arg>(); + LinkedList<Arg> args = new LinkedList<>(); int lineNum = 0; try { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java index 6ea878265..5c2e4d2c7 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java @@ -108,7 +108,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter { private IOutputClassFileNameProvider outputFileNameProvider; private IBinarySourceProvider binarySourceProvider; private WeaverMessageHandler weaverMessageHandler; - private Map<String, List<UnwovenClassFile>> binarySourceSetForFullWeave = new HashMap<String, List<UnwovenClassFile>>(); + private Map<String, List<UnwovenClassFile>> binarySourceSetForFullWeave = new HashMap<>(); private ContextToken processingToken = null; private ContextToken resolvingToken = null; @@ -118,7 +118,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter { private AjState incrementalCompilationState; // Maintains a list of whats weaving - whilst the pipeline is stalled, this accumulates aspects. - List<InterimCompilationResult> resultsPendingWeave = new ArrayList<InterimCompilationResult>(); + List<InterimCompilationResult> resultsPendingWeave = new ArrayList<>(); // pipelining info private boolean pipelineStalled = true; @@ -200,8 +200,8 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter { } // Break the units into two lists... - List<CompilationUnitDeclaration> aspects = new ArrayList<CompilationUnitDeclaration>(); - List<CompilationUnitDeclaration> nonaspects = new ArrayList<CompilationUnitDeclaration>(); + List<CompilationUnitDeclaration> aspects = new ArrayList<>(); + List<CompilationUnitDeclaration> nonaspects = new ArrayList<>(); for (CompilationUnitDeclaration unit : units) { if (containsAnAspect(unit)) { aspects.add(unit); @@ -255,7 +255,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter { } public void beforeCompiling(ICompilationUnit[] sourceUnits) { - resultsPendingWeave = new ArrayList<InterimCompilationResult>(); + resultsPendingWeave = new ArrayList<>(); reportedErrors = false; droppingBackToFullBuild = false; } @@ -475,7 +475,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter { private List<InterimCompilationResult> getBinarySourcesFrom(Map<String, List<UnwovenClassFile>> binarySourceEntries) { // Map is fileName |-> List<UnwovenClassFile> - List<InterimCompilationResult> ret = new ArrayList<InterimCompilationResult>(); + List<InterimCompilationResult> ret = new ArrayList<>(); for (String sourceFileName : binarySourceEntries.keySet()) { List<UnwovenClassFile> unwovenClassFiles = binarySourceEntries.get(sourceFileName); // XXX - see bugs 57432,58679 - final parameter on next call should be "compiler.options.maxProblemsPerUnit" diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java index eb5ca53d9..364aea401 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java @@ -209,7 +209,7 @@ public class WeaverMessageHandler implements IMessageHandler { private IProblem[] buildSeeAlsoProblems(IProblem originalProblem, List sourceLocations, CompilationResult problemSource, boolean usedBinarySourceFileName) { - List<IProblem> ret = new ArrayList<IProblem>(); + List<IProblem> ret = new ArrayList<>(); for (Object sourceLocation : sourceLocations) { ISourceLocation loc = (ISourceLocation) sourceLocation; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java index 5bf9946da..68fc6f74f 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java @@ -66,7 +66,7 @@ public class AccessForInlineVisitor extends ASTVisitor { PrivilegedHandler handler; AspectDeclaration inAspect; EclipseFactory world; // alias for inAspect.world - private Map<TypeBinding, Map<FieldBinding, ResolvedMember>> alreadyProcessedReceivers = new HashMap<TypeBinding, Map<FieldBinding, ResolvedMember>>(); + private Map<TypeBinding, Map<FieldBinding, ResolvedMember>> alreadyProcessedReceivers = new HashMap<>(); // set to true for ClassLiteralAccess and AssertStatement // ??? A better answer would be to transform these into inlinable forms @@ -174,7 +174,7 @@ public class AccessForInlineVisitor extends ASTVisitor { // Avoid repeatedly building ResolvedMembers by using info on any done previously in this visitor Map<FieldBinding, ResolvedMember> alreadyResolvedMembers = alreadyProcessedReceivers.get(receiverType); if (alreadyResolvedMembers == null) { - alreadyResolvedMembers = new HashMap<FieldBinding, ResolvedMember>(); + alreadyResolvedMembers = new HashMap<>(); alreadyProcessedReceivers.put(receiverType, alreadyResolvedMembers); } ResolvedMember m = alreadyResolvedMembers.get(binding); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java index 91d998692..675f0656f 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java @@ -65,7 +65,7 @@ public class AdviceDeclaration extends AjMethodDeclaration { public int adviceSequenceNumberInType; public MethodBinding proceedMethodBinding; // set during this.resolveStaments, referenced by Proceed - public List<Proceed> proceedCalls = new ArrayList<Proceed>(2); // populated during Proceed.findEnclosingAround + public List<Proceed> proceedCalls = new ArrayList<>(2); // populated during Proceed.findEnclosingAround private boolean proceedInInners; private ResolvedMember[] proceedCallSignatures; @@ -80,7 +80,7 @@ public class AdviceDeclaration extends AjMethodDeclaration { // override protected int generateInfoAttributes(ClassFile classFile) { - List<EclipseAttributeAdapter> l = new ArrayList<EclipseAttributeAdapter>(1); + List<EclipseAttributeAdapter> l = new ArrayList<>(1); l.add(new EclipseAttributeAdapter(makeAttribute())); addDeclarationStartLineAttribute(l, classFile); return classFile.generateMethodInfoAttributes(binding, l); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java index 78cca38c0..777de27e4 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java @@ -84,8 +84,8 @@ public class AspectDeclaration extends TypeDeclaration { public ResolvedMember aspectOfMethod; public ResolvedMember ptwGetWithinTypeNameMethod; public ResolvedMember hasAspectMethod; - public Map<ResolvedMember, Binding> accessForInline = new LinkedHashMap<ResolvedMember, Binding>(); - public Map<ResolvedMember, AccessForInlineVisitor.SuperAccessMethodPair> superAccessForInline = new HashMap<ResolvedMember, AccessForInlineVisitor.SuperAccessMethodPair>(); + public Map<ResolvedMember, Binding> accessForInline = new LinkedHashMap<>(); + public Map<ResolvedMember, AccessForInlineVisitor.SuperAccessMethodPair> superAccessForInline = new HashMap<>(); public boolean isPrivileged; public EclipseSourceType concreteName; public ReferenceType typeX; @@ -418,7 +418,7 @@ public class AspectDeclaration extends TypeDeclaration { } protected List<EclipseAttributeAdapter> makeEffectiveSignatureAttribute(ResolvedMember sig, Shadow.Kind kind, boolean weaveBody) { - List<EclipseAttributeAdapter> l = new ArrayList<EclipseAttributeAdapter>(1); + List<EclipseAttributeAdapter> l = new ArrayList<>(1); l.add(new EclipseAttributeAdapter(new AjAttribute.EffectiveSignatureAttribute(sig, kind, weaveBody))); return l; } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java index 0384617f9..d79755dde 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java @@ -93,7 +93,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC public EclipseFactory factory = null; // private boolean builtInterTypesAndPerClauses = false; - private final List<SourceTypeBinding> pendingTypesToWeave = new ArrayList<SourceTypeBinding>(); + private final List<SourceTypeBinding> pendingTypesToWeave = new ArrayList<>(); // Q: What are dangerousInterfaces? // A: An interface is considered dangerous if an ITD has been made upon it @@ -190,8 +190,8 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC // need to build inter-type declarations for all AspectDeclarations at // this point // this MUST be done in order from super-types to subtypes - List<SourceTypeBinding> typesToProcess = new ArrayList<SourceTypeBinding>(); - List<SourceTypeBinding> aspectsToProcess = new ArrayList<SourceTypeBinding>(); + List<SourceTypeBinding> typesToProcess = new ArrayList<>(); + List<SourceTypeBinding> aspectsToProcess = new ArrayList<>(); for (int i = lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) { CompilationUnitScope cus = units[i].scope; SourceTypeBinding[] stbs = cus.topLevelTypes; @@ -250,7 +250,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC boolean typeProcessingOrderIsImportant = declareParents.size() > 0 || declareAnnotationOnTypes.size() > 0; // DECAT if (typeProcessingOrderIsImportant) { - typesToProcess = new ArrayList<SourceTypeBinding>(); + typesToProcess = new ArrayList<>(); for (int i = lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) { CompilationUnitScope cus = units[i].scope; SourceTypeBinding[] stbs = cus.topLevelTypes; @@ -259,7 +259,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC } } - List<SourceTypeBinding> stb2 = new ArrayList<SourceTypeBinding>(); + List<SourceTypeBinding> stb2 = new ArrayList<>(); stb2.addAll(typesToProcess); while (typesToProcess.size() > 0) { @@ -730,8 +730,8 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC // not-exposed to weaver // messages... - List<DeclareParents> decpToRepeat = new ArrayList<DeclareParents>(); - List<DeclareAnnotation> decaToRepeat = new ArrayList<DeclareAnnotation>(); + List<DeclareParents> decpToRepeat = new ArrayList<>(); + List<DeclareAnnotation> decaToRepeat = new ArrayList<>(); boolean anyNewParents = false; boolean anyNewAnnotations = false; @@ -768,7 +768,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC } } - List<Object> forRemoval = new ArrayList<Object>(); + List<Object> forRemoval = new ArrayList<>(); // now lets loop over and over until we have done all we can while ((anyNewAnnotations || anyNewParents) && (!decpToRepeat.isEmpty() || !decaToRepeat.isEmpty())) { anyNewParents = anyNewAnnotations = false; @@ -927,7 +927,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC if ((bits & TagBits.AnnotationTargetMASK) == 0) { return ""; } - Set<String> s = new HashSet<String>(); + Set<String> s = new HashSet<>(); if ((bits & TagBits.AnnotationForAnnotationType) != 0) { s.add("ANNOTATION_TYPE"); } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java index 6e9fafff9..a990767af 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java @@ -95,8 +95,8 @@ public class EclipseFactory { // We can get clashes if we don't treat raw types differently - we end up looking // up a raw and getting the generic type (pr115788) - private final Map<UnresolvedType, TypeBinding> typexToBinding = new HashMap<UnresolvedType, TypeBinding>(); - private final Map<UnresolvedType, TypeBinding> rawTypeXToBinding = new HashMap<UnresolvedType, TypeBinding>(); + private final Map<UnresolvedType, TypeBinding> typexToBinding = new HashMap<>(); + private final Map<UnresolvedType, TypeBinding> rawTypeXToBinding = new HashMap<>(); // XXX currently unused // private Map/*TypeBinding, ResolvedType*/ bindingToResolvedTypeX = new HashMap(); @@ -361,7 +361,7 @@ public class EclipseFactory { /** * Some type variables refer to themselves recursively, this enables us to avoid recursion problems. */ - private static Map<TypeVariableBinding,UnresolvedType> typeVariableBindingsInProgress = new HashMap<TypeVariableBinding,UnresolvedType>(); + private static Map<TypeVariableBinding,UnresolvedType> typeVariableBindingsInProgress = new HashMap<>(); /** * Convert from the eclipse form of type variable (TypeVariableBinding) to the AspectJ form (TypeVariable). @@ -462,7 +462,7 @@ public class EclipseFactory { public void finishTypeMungers() { // make sure that type mungers are - List<ConcreteTypeMunger> ret = new ArrayList<ConcreteTypeMunger>(); + List<ConcreteTypeMunger> ret = new ArrayList<>(); List<ConcreteTypeMunger> baseTypeMungers = getWorld().getCrosscuttingMembersSet().getTypeMungers(); // XXX by Andy: why do we mix up the mungers here? it means later we know about two sets @@ -533,7 +533,7 @@ public class EclipseFactory { * Before converting the parts of a methodbinding (params, return type) we store the type variables in this structure, then * should any component of the method binding refer to them, we grab them from the map. */ - private final Map<String,UnresolvedType> typeVariablesForThisMember = new HashMap<String, UnresolvedType>(); + private final Map<String,UnresolvedType> typeVariablesForThisMember = new HashMap<>(); /** * This is a map from typevariablebindings (eclipsey things) to the names the user originally specified in their ITD. For @@ -1003,7 +1003,7 @@ public class EclipseFactory { // map back to the same type binding - this is important later when Eclipse code is processing // a methodbinding trying to come up with possible bindings for the type variables. // key is currently the name of the type variable...is that ok? - private final Map<String,TypeVariableBinding> typeVariableToTypeBinding = new HashMap<String,TypeVariableBinding>(); + private final Map<String,TypeVariableBinding> typeVariableToTypeBinding = new HashMap<>(); // /** // * Converts from an TypeVariableReference to a TypeVariableBinding. A TypeVariableReference diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseScope.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseScope.java index 26c260628..06191629f 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseScope.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseScope.java @@ -157,8 +157,8 @@ public class EclipseScope implements IScope { if (importedNames != null) return; - List<String> importedNamesList = new ArrayList<String>(); - List<String> importedPrefixesList = new ArrayList<String>(); + List<String> importedNamesList = new ArrayList<>(); + List<String> importedPrefixesList = new ArrayList<>(); Scope currentScope = scope; // add any enclosing types to this list diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java index efd4fb0db..1941ad630 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java @@ -101,8 +101,8 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { protected ResolvedMember[] declaredMethods = null; protected ResolvedMember[] declaredFields = null; - public List<Declare> declares = new ArrayList<Declare>(); - public List<EclipseTypeMunger> typeMungers = new ArrayList<EclipseTypeMunger>(); + public List<Declare> declares = new ArrayList<>(); + public List<EclipseTypeMunger> typeMungers = new ArrayList<>(); private final EclipseFactory factory; @@ -258,9 +258,9 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { } protected void fillDeclaredMembers() { - List<ResolvedMember> declaredPointcuts = new ArrayList<ResolvedMember>(); - List<ResolvedMember> declaredMethods = new ArrayList<ResolvedMember>(); - List<ResolvedMember> declaredFields = new ArrayList<ResolvedMember>(); + List<ResolvedMember> declaredPointcuts = new ArrayList<>(); + List<ResolvedMember> declaredMethods = new ArrayList<>(); + List<ResolvedMember> declaredFields = new ArrayList<>(); MethodBinding[] ms = binding.methods(); // the important side-effect of this call is to make // sure bindings are completed @@ -610,7 +610,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { // } // return targetKind; if (isAnnotation()) { - List<AnnotationTargetKind> targetKinds = new ArrayList<AnnotationTargetKind>(); + List<AnnotationTargetKind> targetKinds = new ArrayList<>(); if ((binding.getAnnotationTagBits() & TagBits.AnnotationForAnnotationType) != 0) { targetKinds.add(AnnotationTargetKind.ANNOTATION_TYPE); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/HelperInterfaceBinding.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/HelperInterfaceBinding.java index a9c4bd532..e8423c2a4 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/HelperInterfaceBinding.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/HelperInterfaceBinding.java @@ -30,7 +30,7 @@ import org.aspectj.weaver.UnresolvedType; public class HelperInterfaceBinding extends SourceTypeBinding { private UnresolvedType typeX; SourceTypeBinding enclosingType; - List<MethodBinding> methods = new ArrayList<MethodBinding>(); + List<MethodBinding> methods = new ArrayList<>(); public HelperInterfaceBinding(SourceTypeBinding enclosingType, UnresolvedType typeX) { super(); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java index d3e449534..80ffe4222 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java @@ -39,8 +39,8 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding; * The member finder looks after intertype declared members on a type, there is one member finder per type that was hit by an ITD. */ public class InterTypeMemberFinder implements IMemberFinder { - private List<FieldBinding> interTypeFields = new ArrayList<FieldBinding>(); - private List<MethodBinding> interTypeMethods = new ArrayList<MethodBinding>(); + private List<FieldBinding> interTypeFields = new ArrayList<>(); + private List<MethodBinding> interTypeMethods = new ArrayList<>(); public SourceTypeBinding sourceTypeBinding; @@ -254,7 +254,7 @@ public class InterTypeMemberFinder implements IMemberFinder { MethodBinding[] orig = sourceTypeBinding.methodsBase(); // if (interTypeMethods.isEmpty()) return orig; - List<MethodBinding> ret = new ArrayList<MethodBinding>(Arrays.asList(orig)); + List<MethodBinding> ret = new ArrayList<>(Arrays.asList(orig)); for (MethodBinding method : interTypeMethods) { ret.add(method); } @@ -299,7 +299,7 @@ public class InterTypeMemberFinder implements IMemberFinder { return orig; } - Set<MethodBinding> ret = new HashSet<MethodBinding>(Arrays.asList(orig)); + Set<MethodBinding> ret = new HashSet<>(Arrays.asList(orig)); // System.err.println("declared method: " + ret + " inters = " + interTypeMethods); for (MethodBinding method : interTypeMethods) { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeScope.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeScope.java index 0f131c62e..7f78e0bea 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeScope.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeScope.java @@ -96,7 +96,7 @@ public class InterTypeScope extends ClassScope { TypeVariableBinding tvb = sourceType.typeVariables()[aliased]; tvb.fPackage = sourceType.fPackage; if (usedAliases == null) - usedAliases = new HashMap<TypeVariableBinding, String>(); + usedAliases = new HashMap<>(); usedAliases.put(tvb, variableName); return tvb; } else { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/IntertypeMemberTypeFinder.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/IntertypeMemberTypeFinder.java index 5ba0229dc..3ee6368e5 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/IntertypeMemberTypeFinder.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/IntertypeMemberTypeFinder.java @@ -32,7 +32,7 @@ public class IntertypeMemberTypeFinder implements ITypeFinder { public SourceTypeBinding targetTypeBinding; // The new types declared onto the target - private Set<ReferenceBinding> intertypeMemberTypes = new HashSet<ReferenceBinding>(); + private Set<ReferenceBinding> intertypeMemberTypes = new HashSet<>(); public void addInterTypeMemberType(ReferenceBinding binding) { intertypeMemberTypes.add(binding); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PushinCollector.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PushinCollector.java index e3d228e0b..894492bf3 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PushinCollector.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PushinCollector.java @@ -65,16 +65,16 @@ public class PushinCollector { private String suffix; // This first collection stores the 'text' for the declarations. - private Map<AbstractMethodDeclaration, RepresentationAndLocation> codeRepresentation = new HashMap<AbstractMethodDeclaration, RepresentationAndLocation>(); + private Map<AbstractMethodDeclaration, RepresentationAndLocation> codeRepresentation = new HashMap<>(); // This stores the new annotations - private Map<SourceTypeBinding, List<String>> additionalAnnotations = new HashMap<SourceTypeBinding, List<String>>(); + private Map<SourceTypeBinding, List<String>> additionalAnnotations = new HashMap<>(); // This stores the new parents - private Map<SourceTypeBinding, List<ExactTypePattern>> additionalParents = new HashMap<SourceTypeBinding, List<ExactTypePattern>>(); + private Map<SourceTypeBinding, List<ExactTypePattern>> additionalParents = new HashMap<>(); // This indicates which types are affected by which intertype declarations - private Map<SourceTypeBinding, List<AbstractMethodDeclaration>> newDeclarations = new HashMap<SourceTypeBinding, List<AbstractMethodDeclaration>>(); + private Map<SourceTypeBinding, List<AbstractMethodDeclaration>> newDeclarations = new HashMap<>(); private PushinCollector(World world, Properties configuration) { this.world = world; @@ -255,7 +255,7 @@ public class PushinCollector { } List<AbstractMethodDeclaration> amds = newDeclarations.get(sourceType); if (amds == null) { - amds = new ArrayList<AbstractMethodDeclaration>(); + amds = new ArrayList<>(); newDeclarations.put(sourceType, amds); } amds.add(sourceMethod); @@ -264,7 +264,7 @@ public class PushinCollector { public void tagAsMunged(SourceTypeBinding sourceType, String annotationString) { List<String> annos = additionalAnnotations.get(sourceType); if (annos == null) { - annos = new ArrayList<String>(); + annos = new ArrayList<>(); additionalAnnotations.put(sourceType, annos); } annos.add(annotationString); @@ -322,7 +322,7 @@ public class PushinCollector { if (typePattern instanceof ExactTypePattern) { List<ExactTypePattern> annos = additionalParents.get(sourceType); if (annos == null) { - annos = new ArrayList<ExactTypePattern>(); + annos = new ArrayList<>(); additionalParents.put(sourceType, annos); } annos.add((ExactTypePattern) typePattern); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java index 4cd844590..cfda72357 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java @@ -55,27 +55,27 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags { private File outputJar; private String outxmlName; private CompilationResultDestinationManager compilationResultDestinationManager = null; - private List<File> sourceRoots = new ArrayList<File>(); + private List<File> sourceRoots = new ArrayList<>(); private List<File> changedFiles; - private List<File> files = new ArrayList<File>(); - private List<File> xmlfiles = new ArrayList<File>(); + private List<File> files = new ArrayList<>(); + private List<File> xmlfiles = new ArrayList<>(); private String processor; private String processorPath; - private List<BinarySourceFile> binaryFiles = new ArrayList<BinarySourceFile>(); // .class files in indirs... - private List<File> inJars = new ArrayList<File>(); - private List<File> inPath = new ArrayList<File>(); - private Map<String, File> sourcePathResources = new HashMap<String, File>(); - private List<File> aspectpath = new ArrayList<File>(); - private List<String> classpath = new ArrayList<String>(); - private List<String> modulepath = new ArrayList<String>(); + private List<BinarySourceFile> binaryFiles = new ArrayList<>(); // .class files in indirs... + private List<File> inJars = new ArrayList<>(); + private List<File> inPath = new ArrayList<>(); + private Map<String, File> sourcePathResources = new HashMap<>(); + private List<File> aspectpath = new ArrayList<>(); + private List<String> classpath = new ArrayList<>(); + private List<String> modulepath = new ArrayList<>(); // Expensive to compute (searching modules, parsing module-info) private ArrayList<Classpath> modulepathClasspathEntries = null; - private List<String> modulesourcepath = new ArrayList<String>(); + private List<String> modulesourcepath = new ArrayList<>(); // Expensive to compute (searching modules, parsing module-info) private ArrayList<Classpath> modulesourcepathClasspathEntries = null; private Classpath[] checkedClasspaths = null; - private List<String> bootclasspath = new ArrayList<String>(); - private List<String> cpElementsWithModifiedContents = new ArrayList<String>(); + private List<String> bootclasspath = new ArrayList<>(); + private List<String> cpElementsWithModifiedContents = new ArrayList<>(); private IModule moduleDesc; private File configFile; @@ -251,7 +251,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags { } private List<Classpath> processFilePath(List<File> path, java.lang.String encoding) { - List<Classpath> entries = new ArrayList<Classpath>(); + List<Classpath> entries = new ArrayList<>(); for (File file: path) { entries.add(FileSystem.getClasspath(file.getAbsolutePath(), encoding, null, ClasspathLocation.BINARY, null)); } @@ -259,7 +259,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags { } private List<Classpath> processStringPath(List<String> path, java.lang.String encoding) { - List<Classpath> entries = new ArrayList<Classpath>(); + List<Classpath> entries = new ArrayList<>(); for (String file: path) { entries.add(FileSystem.getClasspath(file, encoding, null, ClasspathLocation.BINARY, null)); } @@ -317,7 +317,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags { public void processInPath() { // remember all the class files in directories on the inpath - binaryFiles = new ArrayList<BinarySourceFile>(); + binaryFiles = new ArrayList<>(); FileFilter filter = new FileFilter() { @Override public boolean accept(File pathname) { @@ -377,7 +377,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags { * classpath), and output dir or jar */ public List<String> getFullClasspath() { - List<String> full = new ArrayList<String>(); + List<String> full = new ArrayList<>(); full.addAll(getBootclasspath()); // XXX Is it OK that boot classpath overrides inpath/injars/aspectpath? for (File file: inJars) { full.add(file.getAbsolutePath()); @@ -581,7 +581,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags { // Possibly a name=value comma separated list of configurations if (lintMode.contains("=")) { this.lintMode = AJLINT_DEFAULT; - lintOptionsMap = new HashMap<String,String>(); + lintOptionsMap = new HashMap<>(); StringTokenizer tokenizer = new StringTokenizer(lintMode,","); while (tokenizer.hasMoreElements()) { String option = tokenizer.nextToken(); @@ -596,7 +596,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags { } if (lintValue != null || lintOptionsMap != null ) { - Map<String, String> lintOptions = new HashMap<String, String>(); + Map<String, String> lintOptions = new HashMap<>(); setOption(AjCompilerOptions.OPTION_ReportInvalidAbsoluteTypeName, lintValue, lintOptions); setOption(AjCompilerOptions.OPTION_ReportInvalidWildcardTypeName, lintValue, lintOptions); setOption(AjCompilerOptions.OPTION_ReportUnresolvableMember, lintValue, lintOptions); @@ -930,7 +930,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags { // What to do about bootclasspath on java 9? // ArrayList<Classpath> allPaths = handleBootclasspath(bootclasspaths, customEncoding); - ArrayList<FileSystem.Classpath> allPaths = new ArrayList<FileSystem.Classpath>(); + ArrayList<FileSystem.Classpath> allPaths = new ArrayList<>(); allPaths.addAll(processStringPath(bootclasspath, encoding)); allPaths.addAll(processFilePath(inJars, encoding)); allPaths.addAll(processFilePath(inPath, encoding)); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java index dfdcba12c..9510bec56 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java @@ -138,7 +138,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour private boolean batchCompile = true; private INameEnvironment environment; - private Map<String, List<UnwovenClassFile>> /* String -> List<UCF> */binarySourcesForTheNextCompile = new HashMap<String, List<UnwovenClassFile>>(); + private Map<String, List<UnwovenClassFile>> /* String -> List<UCF> */binarySourcesForTheNextCompile = new HashMap<>(); // FIXME asc should this really be in here? // private AsmManager structureModel; @@ -708,7 +708,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour * aspects which are sent to that ouptut directory */ private Map<File, List<String>> findOutputDirsForAspects() { - Map<File, List<String>> outputDirsToAspects = new HashMap<File, List<String>>(); + Map<File, List<String>> outputDirsToAspects = new HashMap<>(); Map<String, char[]> aspectNamesToFileNames = state.getAspectNamesToFileNameMap(); if (buildConfig.getCompilationResultDestinationManager() == null || buildConfig.getCompilationResultDestinationManager().getAllOutputLocations().size() == 1) { @@ -717,7 +717,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour if (buildConfig.getCompilationResultDestinationManager() != null) { outputDir = buildConfig.getCompilationResultDestinationManager().getDefaultOutputLocation(); } - List<String> aspectNames = new ArrayList<String>(); + List<String> aspectNames = new ArrayList<>(); if (aspectNamesToFileNames != null) { Set<String> keys = aspectNamesToFileNames.keySet(); for (String name : keys) { @@ -729,7 +729,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour List outputDirs = buildConfig.getCompilationResultDestinationManager().getAllOutputLocations(); for (Object dir : outputDirs) { File outputDir = (File) dir; - outputDirsToAspects.put(outputDir, new ArrayList<String>()); + outputDirsToAspects.put(outputDir, new ArrayList<>()); } if (aspectNamesToFileNames != null) { Set<Map.Entry<String, char[]>> entrySet = aspectNamesToFileNames.entrySet(); @@ -739,7 +739,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour File outputDir = buildConfig.getCompilationResultDestinationManager().getOutputLocationForClass( new File(new String(fileName))); if (!outputDirsToAspects.containsKey(outputDir)) { - outputDirsToAspects.put(outputDir, new ArrayList<String>()); + outputDirsToAspects.put(outputDir, new ArrayList<>()); } ((List) outputDirsToAspects.get(outputDir)).add(aspectName); } @@ -796,7 +796,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour } model.setRoot(new ProgramElement(structureModel, rootLabel, kind, new ArrayList())); - model.setFileMap(new HashMap<String, IProgramElement>()); + model.setFileMap(new HashMap<>()); // setStructureModel(model); state.setStructureModel(structureModel); // state.setRelationshipMap(AsmManager.getDefault().getRelationshipMap()); @@ -903,7 +903,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour File[] binSrcs = FileUtil.listFiles(inPathElement, binarySourceFilter); for (File binSrc : binSrcs) { UnwovenClassFile ucf = bcelWeaver.addClassFile(binSrc, inPathElement, outputDir); - List<UnwovenClassFile> ucfl = new ArrayList<UnwovenClassFile>(); + List<UnwovenClassFile> ucfl = new ArrayList<>(); ucfl.add(ucf); state.recordBinarySource(binSrc.getPath(), ucfl); } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java index f4518ead3..18fa2f96d 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java @@ -96,7 +96,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe * When looking at changes on the classpath, this set accumulates files in our state instance that affected by those changes. * Then if we can do an incremental build - these must be compiled. */ - private final Set<File> affectedFiles = new HashSet<File>(); + private final Set<File> affectedFiles = new HashSet<>(); // these are references created on a particular compile run - when looping round in // addAffectedSourceFiles(), if some have been created then we look at which source files @@ -110,7 +110,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe private Set<BinarySourceFile> addedBinaryFiles; private Set<BinarySourceFile> deletedBinaryFiles; // For a particular build run, this set records the changes to classesFromName - public final Set<String> deltaAddedClasses = new HashSet<String>(); + public final Set<String> deltaAddedClasses = new HashSet<>(); // now follows non static, but transient state - no need to write out, DOES need reinitializing when read AjState instance // reloaded @@ -125,7 +125,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe private boolean batchBuildRequiredThisTime = false; private AjBuildConfig buildConfig; private long lastSuccessfulFullBuildTime = -1; - private final Hashtable<String, Long> structuralChangesSinceLastFullBuild = new Hashtable<String, Long>(); + private final Hashtable<String, Long> structuralChangesSinceLastFullBuild = new Hashtable<>(); private long lastSuccessfulBuildTime = -1; private long currentBuildTime = -1; private AsmManager structureModel; @@ -134,18 +134,18 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe * For a given source file, records the ClassFiles (which contain a fully qualified name and a file name) that were created when * the source file was compiled. Populated in noteResult and used in addDependentsOf(File) */ - private final Map<File, List<ClassFile>> fullyQualifiedTypeNamesResultingFromCompilationUnit = new HashMap<File, List<ClassFile>>(); + private final Map<File, List<ClassFile>> fullyQualifiedTypeNamesResultingFromCompilationUnit = new HashMap<>(); /** * Source files defining aspects Populated in noteResult and used in processDeletedFiles */ - private final Set<File> sourceFilesDefiningAspects = new HashSet<File>(); + private final Set<File> sourceFilesDefiningAspects = new HashSet<>(); /** * Populated in noteResult to record the set of types that should be recompiled if the given file is modified or deleted. * Referred to during addAffectedSourceFiles when calculating incremental compilation set. */ - private final Map<File, ReferenceCollection> references = new HashMap<File, ReferenceCollection>(); + private final Map<File, ReferenceCollection> references = new HashMap<>(); /** * Holds UnwovenClassFiles (byte[]s) originating from the given file source. This could be a jar file, a directory, or an @@ -165,25 +165,25 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe * input file has changed. * */ - private Map<String, List<UnwovenClassFile>> binarySourceFiles = new HashMap<String, List<UnwovenClassFile>>(); + private Map<String, List<UnwovenClassFile>> binarySourceFiles = new HashMap<>(); /** * Initially a duplicate of the information held in binarySourceFiles, with the key difference that the values are ClassFiles * (type name, File) not UnwovenClassFiles (which also have all the byte code in them). After a batch build, binarySourceFiles * is cleared, leaving just this much lighter weight map to use in processing subsequent incremental builds. */ - private final Map<String, List<ClassFile>> inputClassFilesBySource = new HashMap<String, List<ClassFile>>(); + private final Map<String, List<ClassFile>> inputClassFilesBySource = new HashMap<>(); /** * A list of the .class files created by this state that contain aspects. */ - private final List<String> aspectClassFiles = new ArrayList<String>(); + private final List<String> aspectClassFiles = new ArrayList<>(); /** * Holds structure information on types as they were at the end of the last build. It would be nice to get rid of this too, but * can't see an easy way to do that right now. */ - private final Map<String, CompactTypeStructureRepresentation> resolvedTypeStructuresFromLastBuild = new HashMap<String, CompactTypeStructureRepresentation>(); + private final Map<String, CompactTypeStructureRepresentation> resolvedTypeStructuresFromLastBuild = new HashMap<>(); /** * Populated in noteResult to record the set of UnwovenClassFiles (intermediate results) that originated from compilation of the @@ -193,7 +193,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe * * Passed into StatefulNameEnvironment during incremental compilation to support findType lookups. */ - private final Map<String, File> classesFromName = new HashMap<String, File>(); + private final Map<String, File> classesFromName = new HashMap<>(); /** * Populated by AjBuildManager to record the aspects with the file name in which they're contained. This is later used when @@ -203,8 +203,8 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe */ private Map<String, char[]> aspectsFromFileNames; - private Set<File> compiledSourceFiles = new HashSet<File>(); - private final Map<String, File> resources = new HashMap<String, File>(); + private Set<File> compiledSourceFiles = new HashSet<>(); + private final Map<String, File> resources = new HashMap<>(); SoftHashMap/* <baseDir,SoftHashMap<theFile,className>> */fileToClassNameMap = new SoftHashMap(); @@ -313,21 +313,21 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe addedFiles = Collections.emptySet(); deletedFiles = Collections.emptySet(); } else { - Set<File> oldFiles = new HashSet<File>(buildConfig.getFiles()); - Set<File> newFiles = new HashSet<File>(newBuildConfig.getFiles()); + Set<File> oldFiles = new HashSet<>(buildConfig.getFiles()); + Set<File> newFiles = new HashSet<>(newBuildConfig.getFiles()); - addedFiles = new HashSet<File>(newFiles); + addedFiles = new HashSet<>(newFiles); addedFiles.removeAll(oldFiles); - deletedFiles = new HashSet<File>(oldFiles); + deletedFiles = new HashSet<>(oldFiles); deletedFiles.removeAll(newFiles); } - Set<BinarySourceFile> oldBinaryFiles = new HashSet<BinarySourceFile>(buildConfig.getBinaryFiles()); - Set<BinarySourceFile> newBinaryFiles = new HashSet<BinarySourceFile>(newBuildConfig.getBinaryFiles()); + Set<BinarySourceFile> oldBinaryFiles = new HashSet<>(buildConfig.getBinaryFiles()); + Set<BinarySourceFile> newBinaryFiles = new HashSet<>(newBuildConfig.getBinaryFiles()); - addedBinaryFiles = new HashSet<BinarySourceFile>(newBinaryFiles); + addedBinaryFiles = new HashSet<>(newBinaryFiles); addedBinaryFiles.removeAll(oldBinaryFiles); - deletedBinaryFiles = new HashSet<BinarySourceFile>(oldBinaryFiles); + deletedBinaryFiles = new HashSet<>(oldBinaryFiles); deletedBinaryFiles.removeAll(newBinaryFiles); boolean couldStillBeIncremental = processDeletedFiles(deletedFiles); @@ -376,7 +376,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe } Collection<File> getModifiedFiles(long lastBuildTime) { - Set<File> ret = new HashSet<File>(); + Set<File> ret = new HashSet<>(); // Check if the build configuration knows what files have changed... List<File> modifiedFiles = buildConfig.getModifiedFiles(); @@ -408,7 +408,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe } Collection<BinarySourceFile> getModifiedBinaryFiles(long lastBuildTime) { - List<BinarySourceFile> ret = new ArrayList<BinarySourceFile>(); + List<BinarySourceFile> ret = new ArrayList<>(); // not our job to account for new and deleted files for (BinarySourceFile bsfile : buildConfig.getBinaryFiles()) { File file = bsfile.binSrc; @@ -865,7 +865,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe if ((changes & (CLASSPATH_CHANGED | ASPECTPATH_CHANGED | INPATH_CHANGED | OUTPUTDESTINATIONS_CHANGED | INJARS_CHANGED)) != 0) { List<File> oldOutputLocs = getOutputLocations(previousConfig); - Set<String> alreadyAnalysedPaths = new HashSet<String>(); + Set<String> alreadyAnalysedPaths = new HashSet<>(); List<String> oldClasspath = previousConfig.getClasspath(); List<String> newClasspath = newConfig.getClasspath(); @@ -926,7 +926,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe * @return a list of file objects */ private List<File> getOutputLocations(AjBuildConfig config) { - List<File> outputLocs = new ArrayList<File>(); + List<File> outputLocs = new ArrayList<>(); // Is there a default location? if (config.getOutputDir() != null) { try { @@ -1074,9 +1074,9 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe } public Set<File> getFilesToCompile(boolean firstPass) { - Set<File> thisTime = new HashSet<File>(); + Set<File> thisTime = new HashSet<>(); if (firstPass) { - compiledSourceFiles = new HashSet<File>(); + compiledSourceFiles = new HashSet<>(); Collection<File> modifiedFiles = getModifiedFiles(); // System.out.println("modified: " + modifiedFiles); thisTime.addAll(modifiedFiles); @@ -1120,9 +1120,9 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe return binarySourceFiles; } // else incremental... - Map<String, List<UnwovenClassFile>> toWeave = new HashMap<String, List<UnwovenClassFile>>(); + Map<String, List<UnwovenClassFile>> toWeave = new HashMap<>(); if (firstTime) { - List<BinarySourceFile> addedOrModified = new ArrayList<BinarySourceFile>(); + List<BinarySourceFile> addedOrModified = new ArrayList<>(); addedOrModified.addAll(addedBinaryFiles); addedOrModified.addAll(getModifiedBinaryFiles()); for (BinarySourceFile bsf : addedOrModified) { @@ -1130,11 +1130,11 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe if (ucf == null) { continue; } - List<UnwovenClassFile> ucfs = new ArrayList<UnwovenClassFile>(); + List<UnwovenClassFile> ucfs = new ArrayList<>(); ucfs.add(ucf); recordTypeChanged(ucf.getClassName()); binarySourceFiles.put(bsf.binSrc.getPath(), ucfs); - List<ClassFile> cfs = new ArrayList<ClassFile>(1); + List<ClassFile> cfs = new ArrayList<>(1); cfs.add(getClassFileFor(ucf)); this.inputClassFilesBySource.put(bsf.binSrc.getPath(), cfs); toWeave.put(bsf.binSrc.getPath(), ucfs); @@ -1407,7 +1407,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe * @param icr, the CompilationResult from compiling it */ private void recordFQNsResultingFromCompilationUnit(File sourceFile, InterimCompilationResult icr) { - List<ClassFile> classFiles = new ArrayList<ClassFile>(); + List<ClassFile> classFiles = new ArrayList<>(); UnwovenClassFile[] types = icr.unwovenClassFiles(); for (UnwovenClassFile type : types) { classFiles.add(new ClassFile(type.getClassName(), new File(type.getFilename()))); @@ -2372,13 +2372,13 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe } public void clearBinarySourceFiles() { - this.binarySourceFiles = new HashMap<String, List<UnwovenClassFile>>(); + this.binarySourceFiles = new HashMap<>(); } public void recordBinarySource(String fromPathName, List<UnwovenClassFile> unwovenClassFiles) { this.binarySourceFiles.put(fromPathName, unwovenClassFiles); if (this.maybeIncremental()) { - List<ClassFile> simpleClassFiles = new LinkedList<ClassFile>(); + List<ClassFile> simpleClassFiles = new LinkedList<>(); for (UnwovenClassFile ucf : unwovenClassFiles) { ClassFile cf = getClassFileFor(ucf); simpleClassFiles.add(cf); @@ -2489,7 +2489,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe } public void initializeAspectNamesToFileNameMap() { - this.aspectsFromFileNames = new HashMap<String, char[]>(); + this.aspectsFromFileNames = new HashMap<>(); } // Will allow us to record decisions made during incremental processing, hopefully aid in debugging diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java index 776696aff..a89a6bd93 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java @@ -422,9 +422,9 @@ public class AsmElementFormatter { pe.setParameterNames(Collections.<String>emptyList()); pe.setParameterSignatures(Collections.<char[]>emptyList(), Collections.<String>emptyList()); } else { - List<String> names = new ArrayList<String>(); - List<char[]> paramSigs = new ArrayList<char[]>(); - List<String> paramSourceRefs = new ArrayList<String>(); + List<String> names = new ArrayList<>(); + List<char[]> paramSigs = new ArrayList<>(); + List<String> paramSourceRefs = new ArrayList<>(); boolean problemWithSourceRefs = false; for (Argument argument : argArray) { String argName = new String(argument.name); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java index 7ee6cf9e4..84319600c 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java @@ -541,7 +541,7 @@ public class AsmHierarchyBuilder extends ASTVisitor { Declare decl = dDeclaration.declareDecl; if (decl instanceof DeclareParents) { TypePatternList tpl = ((DeclareParents) decl).getParents(); - List<String> parents = new ArrayList<String>(); + List<String> parents = new ArrayList<>(); for (int i = 0; i < tpl.size(); i++) { parents.add(tpl.get(i).getExactType().getName().replaceAll("\\$", ".")); } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java index aeac71571..f81d1d937 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java @@ -39,7 +39,7 @@ public class IncrementalStateManager { // SECRETAPI will consume more memory, so turn on at your own risk ;) Set to 'true' when memory usage is understood public static boolean recordIncrementalStates = false; public static boolean debugIncrementalStates = false; - private static Hashtable<String, AjState> incrementalStates = new Hashtable<String, AjState>(); + private static Hashtable<String, AjState> incrementalStates = new Hashtable<>(); public static void recordSuccessfulBuild(String buildConfig, AjState state) { if (!recordIncrementalStates) { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/StatefulNameEnvironment.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/StatefulNameEnvironment.java index 97284639a..8d49c31d1 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/StatefulNameEnvironment.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/StatefulNameEnvironment.java @@ -39,10 +39,10 @@ public class StatefulNameEnvironment implements IModuleAwareNameEnvironment { public StatefulNameEnvironment(IModuleAwareNameEnvironment baseEnvironment, Map<String,File> classesFromName, AjState state) { this.classesFromName = classesFromName; - this.inflatedClassFilesCache = new HashMap<String,NameEnvironmentAnswer>(); + this.inflatedClassFilesCache = new HashMap<>(); this.baseEnvironment = baseEnvironment; this.state = state; - packageNames = new HashSet<String>(); + packageNames = new HashSet<>(); for (String className: classesFromName.keySet()) { addAllPackageNames(className); } diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CommandTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CommandTestCase.java index 53053d8b3..1a3cc12b2 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CommandTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CommandTestCase.java @@ -62,7 +62,7 @@ public abstract class CommandTestCase extends TestCase { } public static void checkCompile(String source, String[] extraArgs, int[] expectedErrors, String sandboxName) { - List<String> args = new ArrayList<String>(); + List<String> args = new ArrayList<>(); args.add("-verbose"); args.add("-d"); @@ -87,7 +87,7 @@ public abstract class CommandTestCase extends TestCase { } public void checkMultipleCompile(String source) throws InterruptedException { - List<String> args = new ArrayList<String>(); + List<String> args = new ArrayList<>(); args.add("-verbose"); args.add("-d"); diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java index 9f1162c9f..355267b0f 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java @@ -236,7 +236,7 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests? "-d", classesDir.getAbsolutePath()}; return Collections.unmodifiableList( - new ArrayList<String>(Arrays.asList(input))); + new ArrayList<>(Arrays.asList(input))); } protected File makeDir( diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/JavadocTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/JavadocTest.java index a9ee51fe9..bea58ff7b 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/JavadocTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/JavadocTest.java @@ -37,7 +37,7 @@ public class JavadocTest extends AjcTestCase { public void testMissingJavadoc() { String[] args = new String[] { "World.java", "-warn:allJavadoc", "-1.4" }; - List<Message> warningMessages = new ArrayList<Message>(); + List<Message> warningMessages = new ArrayList<>(); // These warnings are against public textX() methods declared in the World.java // type. These test methods are spread between AJ constructs, meaning // if someone messes up and the javadoc is not associated with the aspectj diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfigTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfigTest.java index 880d58f86..a8b2964c4 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfigTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfigTest.java @@ -166,7 +166,7 @@ public class AjBuildConfigTest extends TestCase { static class TestMessageHandler implements IMessageHandler { - List<IMessage> messages = new ArrayList<IMessage>(); + List<IMessage> messages = new ArrayList<>(); @Override public boolean isIgnoring(Kind kind) { diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjStateTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjStateTest.java index 101fdade1..1cd4ade77 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjStateTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjStateTest.java @@ -119,26 +119,26 @@ public class AjStateTest extends TestCase { }); oldConfig = new AjBuildConfig(parser); newConfig = new AjBuildConfig(parser); - List<String> cp = new ArrayList<String>(); + List<String> cp = new ArrayList<>(); cp.add("adir"); cp.add("ajar.jar"); oldConfig.setClasspath(cp); - newConfig.setClasspath(new ArrayList<String>(cp)); - List<File> ap = new ArrayList<File>(); + newConfig.setClasspath(new ArrayList<>(cp)); + List<File> ap = new ArrayList<>(); ap.add(new File("aLib.jar")); ap.add(new File("anotherLib.jar")); oldConfig.setAspectpath(ap); - newConfig.setAspectpath(new ArrayList<File>(ap)); - List<File> ip = new ArrayList<File>(); + newConfig.setAspectpath(new ArrayList<>(ap)); + List<File> ip = new ArrayList<>(); ip.add(new File("adir")); ip.add(new File("ajar.jar")); oldConfig.setInPath(ip); - newConfig.setInPath(new ArrayList<File>(ip)); - List<File> ij = new ArrayList<File>(); + newConfig.setInPath(new ArrayList<>(ip)); + List<File> ij = new ArrayList<>(); ij.add(new File("aLib.jar")); ij.add(new File("anotherLib.jar")); oldConfig.setInJars(ij); - newConfig.setInJars(new ArrayList<File>(ij)); + newConfig.setInJars(new ArrayList<>(ij)); aRightState.prepareForNextBuild(oldConfig); aRightState.successfulCompile(oldConfig, true); } diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/ASTVisitorTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/ASTVisitorTest.java index e63ecf15e..de8960e73 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/ASTVisitorTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/ASTVisitorTest.java @@ -421,7 +421,7 @@ public class ASTVisitorTest extends TestCase { private void checkJLS3(String source, String expectedOutput) { ASTParser parser = ASTParser.newParser(AST.JLS3); - HashMap<String,String> options = new HashMap<String,String>(); + HashMap<String,String> options = new HashMap<>(); options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5); parser.setCompilerOptions(options); parser.setSource(source.toCharArray()); diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjASTTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjASTTest.java index e4c49b48c..721cb3e22 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjASTTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjASTTest.java @@ -1848,7 +1848,7 @@ class TypeCategoryTypeVisitor extends AjASTVisitor { } class TypePatternSourceRangeVisitor extends AjASTVisitor { - private List<SourceRange> sourceRanges = new ArrayList<SourceRange>(); + private List<SourceRange> sourceRanges = new ArrayList<>(); public List<SourceRange> getVisitedSourceRanges() { return sourceRanges; diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjASTTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjASTTestCase.java index b3870c6e8..304a7996b 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjASTTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjASTTestCase.java @@ -86,7 +86,7 @@ public abstract class AjASTTestCase extends TestCase { protected List<SourceRange> getSourceRanges(int[][] sourceRanges) { - List<SourceRange> convertedRanges = new ArrayList<SourceRange>(); + List<SourceRange> convertedRanges = new ArrayList<>(); for (int[] sourceRange : sourceRanges) { convertedRanges.add(new SourceRange(sourceRange[0], diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java index 671b310cc..088ff78f9 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java @@ -209,11 +209,11 @@ public class Ajc { System.setOut(pout); System.setErr(perr); - List<IMessage> fails = new ArrayList<IMessage>(); - List<IMessage> errors = new ArrayList<IMessage>(); - List<IMessage> warnings = new ArrayList<IMessage>(); - List<IMessage> infos = new ArrayList<IMessage>(); - List<IMessage> weaves = new ArrayList<IMessage>(); + List<IMessage> fails = new ArrayList<>(); + List<IMessage> errors = new ArrayList<>(); + List<IMessage> warnings = new ArrayList<>(); + List<IMessage> infos = new ArrayList<>(); + List<IMessage> weaves = new ArrayList<>(); try { if (!isIncremental && shouldEmptySandbox) { diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java index 6bbc076b4..5488ab1b2 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java @@ -493,7 +493,7 @@ public abstract class AjcTestCase extends TestCase { * Helper method to build a new message list for passing to a MessageSpec. */ protected List<Message> newMessageList(Message m1) { - List<Message> ret = new ArrayList<Message>(); + List<Message> ret = new ArrayList<>(); ret.add(m1); return ret; } @@ -502,7 +502,7 @@ public abstract class AjcTestCase extends TestCase { * Helper method to build a new message list for passing to a MessageSpec. */ protected List<Message> newMessageList(Message m1, Message m2) { - List<Message> ret = new ArrayList<Message>(); + List<Message> ret = new ArrayList<>(); ret.add(m1); ret.add(m2); return ret; @@ -512,7 +512,7 @@ public abstract class AjcTestCase extends TestCase { * Helper method to build a new message list for passing to a MessageSpec. */ protected List<Message> newMessageList(Message m1, Message m2, Message m3) { - List<Message> ret = new ArrayList<Message>(); + List<Message> ret = new ArrayList<>(); ret.add(m1); ret.add(m2); ret.add(m3); @@ -785,7 +785,7 @@ public abstract class AjcTestCase extends TestCase { private List<String >tokenizeCommand(String command) { StringTokenizer st = new StringTokenizer(command," ", false); - ArrayList<String> arguments = new ArrayList<String>(); + ArrayList<String> arguments = new ArrayList<>(); while(st.hasMoreElements()){ String nextToken =st.nextToken(); arguments.add(nextToken); @@ -959,7 +959,7 @@ public abstract class AjcTestCase extends TestCase { if (in == Collections.EMPTY_LIST) return in; - List<T> out = new ArrayList<T>(); + List<T> out = new ArrayList<>(); for (T t : in) { out.add(t); } diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/MainTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/MainTest.java index 8d6f788d4..7da3aa647 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/MainTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/MainTest.java @@ -23,7 +23,7 @@ import org.aspectj.bridge.AbortException; public class MainTest extends AjcTestCase { public void testMainbare() { - ArrayList<String> list = new ArrayList<String>(); + ArrayList<String> list = new ArrayList<>(); // Usage now printed by Eclipse compiler so doesn't appear here in our message list // Main.bareMain(new String[] {"-help"}, false, list, null, null, null); // assertTrue(1 == list.size()); |