diff --git a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/TestScannerInfoCollector.java b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/TestScannerInfoCollector.java index 475721ecdcd..9e6d56178d7 100644 --- a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/TestScannerInfoCollector.java +++ b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/TestScannerInfoCollector.java @@ -28,8 +28,8 @@ import org.eclipse.cdt.make.internal.core.scannerconfig.util.CCommandDSC; @SuppressWarnings({ "rawtypes", "unchecked" }) final class TestScannerInfoCollector implements IScannerInfoCollector { - private HashMap fInfoMap = new HashMap(); - private HashMap> fResourceToInfoMap = new HashMap>(); + private HashMap fInfoMap = new HashMap<>(); + private HashMap> fResourceToInfoMap = new HashMap<>(); @Override public void contributeToScannerConfig(Object resource, Map scannerInfo0) { @@ -57,7 +57,7 @@ final class TestScannerInfoCollector implements IScannerInfoCollector { private void addTo(ScannerInfoTypes type, List col) { List target = fInfoMap.get(type); if (target == null) { - target = new ArrayList(); + target = new ArrayList<>(); fInfoMap.put(type, target); } target.addAll(col); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java index d991fe80078..c39621de9ef 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java @@ -199,7 +199,7 @@ public class MakeBuilder extends ACBuilder { String[] errorParsers = info.getErrorParsers(); ErrorParserManager epm = new ErrorParserManager(getProject(), workingDirectoryURI, this, errorParsers); - List parsers = new ArrayList(); + List parsers = new ArrayList<>(); if (!isOnlyClean) { ICProjectDescription prjDescription = CoreModel.getDefault().getProjectDescription(project); if (prjDescription != null) { @@ -249,7 +249,7 @@ public class MakeBuilder extends ACBuilder { private HashMap getEnvironment(ICommandLauncher launcher, IMakeBuilderInfo info) throws CoreException { - HashMap envMap = new HashMap(); + HashMap envMap = new HashMap<>(); if (info.appendEnvironment()) { @SuppressWarnings({ "unchecked", "rawtypes" }) Map env = (Map) launcher.getEnvironment(); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java index 80d4ede4d3c..26ffe7a00af 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java @@ -183,7 +183,7 @@ public class MakeCorePlugin extends Plugin { public String[] getMakefileDirs() { String stringList = getPluginPreferences().getString(MAKEFILE_DIRS); StringTokenizer st = new StringTokenizer(stringList, File.pathSeparator + "\n\r");//$NON-NLS-1$ - ArrayList v = new ArrayList(); + ArrayList v = new ArrayList<>(); while (st.hasMoreElements()) { v.add(st.nextToken()); } @@ -198,7 +198,7 @@ public class MakeCorePlugin extends Plugin { IMakefile makefile; if (isGnuStyle) { GNUMakefile gnu = new GNUMakefile(); - ArrayList includeList = new ArrayList(); + ArrayList includeList = new ArrayList<>(); includeList.add(new Path(file.getAbsolutePath()).removeLastSegments(1).toOSString()); includeList.addAll(Arrays.asList(gnu.getIncludeDirectories())); includeList.addAll(Arrays.asList(makefileDirs)); @@ -246,7 +246,7 @@ public class MakeCorePlugin extends Plugin { IMakefile makefile; if (isGnuStyle) { GNUMakefile gnu = new GNUMakefile(); - ArrayList includeList = new ArrayList(); + ArrayList includeList = new ArrayList<>(); includeList.add(new Path(fileURI.getPath()).removeLastSegments(1).toString()); includeList.addAll(Arrays.asList(gnu.getIncludeDirectories())); includeList.addAll(Arrays.asList(makefileDirs)); @@ -372,7 +372,7 @@ public class MakeCorePlugin extends Plugin { SI_CONSOLE_PARSER_SIMPLE_ID); if (extension != null) { IExtension[] extensions = extension.getExtensions(); - List parserIds = new ArrayList(extensions.length); + List parserIds = new ArrayList<>(extensions.length); for (int i = 0; i < extensions.length; i++) { String parserId = extensions[i].getUniqueIdentifier(); if (parserId != null) { diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerInfo.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerInfo.java index e863373c994..aed84fdf987 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerInfo.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerInfo.java @@ -89,7 +89,7 @@ public class MakeScannerInfo implements IScannerInfo { @Override public synchronized Map getDefinedSymbols() { // Return the defined symbols for the default configuration - HashMap symbols = new HashMap(); + HashMap symbols = new HashMap<>(); String[] symbolList = getPreprocessorSymbols(); for (int i = 0; i < symbolList.length; ++i) { String symbol = symbolList[i]; @@ -112,7 +112,7 @@ public class MakeScannerInfo implements IScannerInfo { protected List getPathList() { if (pathList == null) { - pathList = new ArrayList(); + pathList = new ArrayList<>(); } return pathList; } @@ -123,7 +123,7 @@ public class MakeScannerInfo implements IScannerInfo { protected List getSymbolList() { if (symbolList == null) { - symbolList = new ArrayList(); + symbolList = new ArrayList<>(); } return symbolList; } diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerProvider.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerProvider.java index b398e6f089c..b6066916059 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerProvider.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerProvider.java @@ -123,8 +123,8 @@ public class MakeScannerProvider extends ScannerProvider { ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(project); ICStorageElement storage = descriptor.getProjectStorageElement(CDESCRIPTOR_ID); - ArrayList includes = new ArrayList(); - ArrayList symbols = new ArrayList(); + ArrayList includes = new ArrayList<>(); + ArrayList symbols = new ArrayList<>(); for (ICStorageElement child : storage.getChildren()) { if (child.getName().equals(INCLUDE_PATH)) { // Add the path to the property list @@ -145,7 +145,7 @@ public class MakeScannerProvider extends ScannerProvider { String[] includes = info.getIncludePaths(); ICProject cProject = CoreModel.getDefault().create(info.getProject()); IPathEntry[] entries = cProject.getRawPathEntries(); - List cPaths = new ArrayList(Arrays.asList(entries)); + List cPaths = new ArrayList<>(Arrays.asList(entries)); Iterator cpIter = cPaths.iterator(); while (cpIter.hasNext()) { diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/DiscoveredScannerInfo.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/DiscoveredScannerInfo.java index e28c031c2b2..1528b4d77b0 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/DiscoveredScannerInfo.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/DiscoveredScannerInfo.java @@ -87,13 +87,13 @@ public class DiscoveredScannerInfo implements IScannerInfo { public LinkedHashMap getDiscoveredIncludePaths() { if (discoveredPaths == null) { - return new LinkedHashMap(); + return new LinkedHashMap<>(); } - return new LinkedHashMap(discoveredPaths); + return new LinkedHashMap<>(discoveredPaths); } public synchronized void setDiscoveredIncludePaths(LinkedHashMap paths) { - discoveredPaths = new LinkedHashMap(paths); + discoveredPaths = new LinkedHashMap<>(paths); createPathLists(); } @@ -119,13 +119,13 @@ public class DiscoveredScannerInfo implements IScannerInfo { public LinkedHashMap getDiscoveredSymbolDefinitions() { if (discoveredSymbols == null) { - return new LinkedHashMap(); + return new LinkedHashMap<>(); } - return new LinkedHashMap(discoveredSymbols); + return new LinkedHashMap<>(discoveredSymbols); } public synchronized void setDiscoveredSymbolDefinitions(LinkedHashMap symbols) { - discoveredSymbols = new LinkedHashMap(symbols); + discoveredSymbols = new LinkedHashMap<>(symbols); createSymbolsLists(); } @@ -184,28 +184,28 @@ public class DiscoveredScannerInfo implements IScannerInfo { private List getActivePathList() { if (activePaths == null) { - activePaths = new ArrayList(); + activePaths = new ArrayList<>(); } return activePaths; } private List getRemovedPathList() { if (removedPaths == null) { - removedPaths = new ArrayList(); + removedPaths = new ArrayList<>(); } return removedPaths; } private List getActiveSymbolsList() { if (activeSymbols == null) { - activeSymbols = new ArrayList(); + activeSymbols = new ArrayList<>(); } return activeSymbols; } private List getRemovedSymbolsList() { if (removedSymbols == null) { - removedSymbols = new ArrayList(); + removedSymbols = new ArrayList<>(); } return removedSymbols; } diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/DiscoveredScannerInfoProvider.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/DiscoveredScannerInfoProvider.java index 6b0a8d642ac..d97f7a58e83 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/DiscoveredScannerInfoProvider.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/DiscoveredScannerInfoProvider.java @@ -117,7 +117,7 @@ public class DiscoveredScannerInfoProvider extends ScannerProvider { ICProject cProject = CoreModel.getDefault().create(project); if (cProject != null) { IPathEntry[] entries = cProject.getRawPathEntries(); - List newEntries = new ArrayList(Arrays.asList(entries)); + List newEntries = new ArrayList<>(Arrays.asList(entries)); if (!newEntries.contains(container)) { newEntries.add(container); cProject.setRawPathEntries(newEntries.toArray(new IPathEntry[newEntries.size()]), null); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/PathInfo.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/PathInfo.java index 920947af762..762dc371828 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/PathInfo.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/PathInfo.java @@ -46,7 +46,7 @@ public final class PathInfo { ? (IPath[]) quoteIncludePaths.clone() : EMPTY_PATH_ARRAY; fSymbols = symbols != null && symbols.size() != 0 ? getInternedHashMap(symbols) - : new HashMap(0); + : new HashMap<>(0); fIncludeFiles = includeFiles != null && includeFiles.length != 0 ? (IPath[]) includeFiles.clone() : EMPTY_PATH_ARRAY; fMacroFiles = macroFiles != null && macroFiles.length != 0 ? (IPath[]) macroFiles.clone() : EMPTY_PATH_ARRAY; @@ -63,9 +63,9 @@ public final class PathInfo { return null; if (oldMap.isEmpty()) - return new HashMap(oldMap); + return new HashMap<>(oldMap); - HashMap newMap = new HashMap(oldMap.size()); + HashMap newMap = new HashMap<>(oldMap.size()); for (String key : oldMap.keySet()) { newMap.put(SafeStringInterner.safeIntern(key), SafeStringInterner.safeIntern(oldMap.get(key))); } diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java index 50507fe40a3..162cdeb1229 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java @@ -114,7 +114,7 @@ public class BuildInfoFactory { @Override public Map getExpandedEnvironment() { Map env = getEnvironment(); - HashMap envMap = new HashMap(env.entrySet().size()); + HashMap envMap = new HashMap<>(env.entrySet().size()); boolean win32 = Platform.getOS().equals(Constants.OS_WIN32); for (Map.Entry entry : env.entrySet()) { String key = entry.getKey(); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeProject.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeProject.java index aff4b2830a5..8c445273798 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeProject.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeProject.java @@ -73,7 +73,7 @@ public class MakeProject implements ICOwner { private String[] parseStringToArray(String syms) { if (syms != null && syms.length() > 0) { StringTokenizer tok = new StringTokenizer(syms, ";"); //$NON-NLS-1$ - ArrayList list = new ArrayList(tok.countTokens()); + ArrayList list = new ArrayList<>(tok.countTokens()); while (tok.hasMoreElements()) { list.add(tok.nextToken()); } diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java index ef8a33ccb67..bff6029ada5 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java @@ -51,9 +51,9 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis private static String TARGETS_EXT = "targets"; //$NON-NLS-1$ private final ListenerList listeners = new ListenerList(); - private final Map projectMap = new HashMap(); + private final Map projectMap = new HashMap<>(); private HashMap builderMap; - protected Vector fProjects = new Vector(); + protected Vector fProjects = new Vector<>(); public MakeTargetManager() { } @@ -181,7 +181,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis public String[] getTargetBuilders(IProject project) { if (fProjects.contains(project) || hasTargetBuilder(project)) { try { - Vector ids = new Vector(); + Vector ids = new Vector<>(); IProjectDescription description = project.getDescription(); ICommand commands[] = description.getBuildSpec(); for (ICommand command : commands) { @@ -334,7 +334,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis } protected void initializeBuilders() { - builderMap = new HashMap(); + builderMap = new HashMap<>(); IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(MakeCorePlugin.PLUGIN_ID, MakeTargetManager.TARGET_BUILD_EXT); IExtension[] extensions = point.getExtensions(); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java index 47258024a0c..1a53a4004bc 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java @@ -59,7 +59,7 @@ public class ProjectTargets { private static final String BAD_TARGET = "buidlTarget"; //$NON-NLS-1$ private static final String TARGET = "buildTarget"; //$NON-NLS-1$ - private HashMap> targetMap = new HashMap>(); + private HashMap> targetMap = new HashMap<>(); private IProject project; @@ -111,7 +111,7 @@ public class ProjectTargets { } public void set(IContainer container, IMakeTarget[] targets) throws CoreException { - List newList = new ArrayList(); + List newList = new ArrayList<>(); for (IMakeTarget target : targets) { target.setContainer(container); if (newList.contains(target)) { @@ -142,7 +142,7 @@ public class ProjectTargets { MakeMessages.getString("MakeTargetManager.target_exists"), null)); //$NON-NLS-1$ } if (list == null) { - list = new ArrayList(); + list = new ArrayList<>(); targetMap.put(target.getContainer(), list); } list.add(target); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/AbstractMakefile.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/AbstractMakefile.java index d61d5947e53..4dfc52dece6 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/AbstractMakefile.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/AbstractMakefile.java @@ -61,7 +61,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile { @Override public IRule[] getRules() { IDirective[] stmts = getDirectives(true); - List array = new ArrayList(stmts.length); + List array = new ArrayList<>(stmts.length); for (IDirective stmt : stmts) { if (stmt instanceof IRule) { array.add(stmt); @@ -73,7 +73,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile { @Override public IRule[] getRules(String target) { IRule[] rules = getRules(); - List array = new ArrayList(rules.length); + List array = new ArrayList<>(rules.length); for (IRule rule : rules) { if (rule.getTarget().equals(target)) { array.add(rule); @@ -85,7 +85,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile { @Override public IInferenceRule[] getInferenceRules() { IRule[] rules = getRules(); - List array = new ArrayList(rules.length); + List array = new ArrayList<>(rules.length); for (IRule rule : rules) { if (rule instanceof IInferenceRule) { array.add(rule); @@ -97,7 +97,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile { @Override public IInferenceRule[] getInferenceRules(String target) { IInferenceRule[] irules = getInferenceRules(); - List array = new ArrayList(irules.length); + List array = new ArrayList<>(irules.length); for (IInferenceRule irule : irules) { if (irule.getTarget().equals(target)) { array.add(irule); @@ -109,7 +109,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile { @Override public ITargetRule[] getTargetRules() { IRule[] trules = getRules(); - List array = new ArrayList(trules.length); + List array = new ArrayList<>(trules.length); for (IRule trule : trules) { if (trule instanceof ITargetRule) { array.add(trule); @@ -121,7 +121,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile { @Override public ITargetRule[] getTargetRules(String target) { ITargetRule[] trules = getTargetRules(); - List array = new ArrayList(trules.length); + List array = new ArrayList<>(trules.length); for (ITargetRule trule : trules) { if (trule.getTarget().equals(target)) { array.add(trule); @@ -133,7 +133,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile { @Override public IMacroDefinition[] getMacroDefinitions() { IDirective[] stmts = getDirectives(true); - List array = new ArrayList(stmts.length); + List array = new ArrayList<>(stmts.length); for (IDirective stmt : stmts) { if (stmt instanceof IMacroDefinition) { array.add(stmt); @@ -145,7 +145,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile { @Override public IMacroDefinition[] getMacroDefinitions(String name) { IMacroDefinition[] variables = getMacroDefinitions(); - List array = new ArrayList(variables.length); + List array = new ArrayList<>(variables.length); for (IMacroDefinition variable : variables) { if (variable.getName().equals(name)) { array.add(variable); @@ -157,7 +157,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile { @Override public IMacroDefinition[] getBuiltinMacroDefinitions() { IDirective[] stmts = getBuiltins(); - List array = new ArrayList(stmts.length); + List array = new ArrayList<>(stmts.length); for (IDirective stmt : stmts) { if (stmt instanceof IMacroDefinition) { array.add(stmt); @@ -169,7 +169,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile { @Override public IMacroDefinition[] getBuiltinMacroDefinitions(String name) { IMacroDefinition[] variables = getBuiltinMacroDefinitions(); - List array = new ArrayList(variables.length); + List array = new ArrayList<>(variables.length); for (IMacroDefinition variable : variables) { if (variable.getName().equals(name)) { array.add(variable); @@ -180,7 +180,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile { public IInferenceRule[] getBuiltinInferenceRules() { IDirective[] stmts = getBuiltins(); - List array = new ArrayList(stmts.length); + List array = new ArrayList<>(stmts.length); for (IDirective stmt : stmts) { if (stmt instanceof IInferenceRule) { array.add(stmt); @@ -191,7 +191,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile { public IInferenceRule[] getBuiltinInferenceRules(String target) { IInferenceRule[] irules = getBuiltinInferenceRules(); - List array = new ArrayList(irules.length); + List array = new ArrayList<>(irules.length); for (IInferenceRule irule : irules) { if (irule.getTarget().equals(target)) { array.add(irule); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Parent.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Parent.java index daec5744e09..83e9b5f69f0 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Parent.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Parent.java @@ -26,7 +26,7 @@ import org.eclipse.cdt.make.core.makefile.IParent; public abstract class Parent extends Directive implements IParent { - ArrayList children = new ArrayList(); + ArrayList children = new ArrayList<>(); public Parent(Directive parent) { super(parent); @@ -34,7 +34,7 @@ public abstract class Parent extends Directive implements IParent { public IDirective[] getDirectives(boolean expand) { if (expand) { - List directives = new ArrayList(); + List directives = new ArrayList<>(); getDirectives(); // populates children for class Include for (IDirective directive : children) { directives.add(directive); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Rule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Rule.java index 92fd011472d..74955e027fc 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Rule.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Rule.java @@ -37,7 +37,7 @@ public abstract class Rule extends Parent implements IRule { @Override public ICommand[] getCommands() { IDirective[] directives = getDirectives(); - ArrayList cmds = new ArrayList(directives.length); + ArrayList cmds = new ArrayList<>(directives.length); for (int i = 0; i < directives.length; i++) { if (directives[i] instanceof ICommand) { cmds.add(directives[i]); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefile.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefile.java index c173fe8aee2..198f2ce6f60 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefile.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefile.java @@ -169,8 +169,8 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile { protected void parse(URI fileURI, MakefileReader reader) throws IOException { String line; Rule[] rules = null; - Stack conditions = new Stack(); - Stack defines = new Stack(); + Stack conditions = new Stack<>(); + Stack defines = new Stack<>(); int startLine = 0; int endLine = 0; @@ -585,7 +585,7 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile { String[] directories; StringTokenizer st = new StringTokenizer(line); int count = st.countTokens(); - List dirs = new ArrayList(count); + List dirs = new ArrayList<>(count); if (count > 0) { for (int i = 0; i < count; i++) { if (count == 0) { diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileChecker.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileChecker.java index c22fa966e3a..8390bd2bce6 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileChecker.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileChecker.java @@ -61,7 +61,7 @@ public class GNUMakefileChecker extends ACBuilder { } } - protected Map validatorMap = new HashMap(); + protected Map validatorMap = new HashMap<>(); public GNUMakefileChecker() { } diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefileUtil.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefileUtil.java index 9e73295b697..ee010717af4 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefileUtil.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefileUtil.java @@ -28,7 +28,7 @@ public class PosixMakefileUtil { } public static String[] findTargets(String line) { - List aList = new ArrayList(); + List aList = new ArrayList<>(); int space; // Trim away trailing and prepending spaces. line = line.trim(); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/CDataDiscoveredInfoCalculator.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/CDataDiscoveredInfoCalculator.java index 68e7bbfb379..5700e094e00 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/CDataDiscoveredInfoCalculator.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/CDataDiscoveredInfoCalculator.java @@ -100,7 +100,7 @@ public class CDataDiscoveredInfoCalculator { void add(ILangSettingInfo info) { if (fLangInfoList == null) - fLangInfoList = new ArrayList(); + fLangInfoList = new ArrayList<>(); fLangInfoList.add(info); } } @@ -140,9 +140,9 @@ public class CDataDiscoveredInfoCalculator { } public void add(int index, PathFilePathInfo value) { - List list = checkResize(index) ? new ArrayList() : fStore[index]; + List list = checkResize(index) ? new ArrayList<>() : fStore[index]; if (list == null) { - list = new ArrayList(); + list = new ArrayList<>(); fStore[index] = list; } @@ -168,7 +168,7 @@ public class CDataDiscoveredInfoCalculator { public List[] getLists() { int size = fMaxIndex + 1; - List> list = new ArrayList>(size); + List> list = new ArrayList<>(size); List l; for (int i = 0; i < size; i++) { l = fStore[i]; @@ -222,13 +222,13 @@ public class CDataDiscoveredInfoCalculator { public void add(PathFilePathInfo pInfo) { if (fPathFilePathInfoMap == null) - fPathFilePathInfoMap = new HashMap>(3); + fPathFilePathInfoMap = new HashMap<>(3); PathInfo fileInfo = pInfo.fInfo; List list = fileInfo == fMaxMatchInfo ? fMaxMatchInfoList : fPathFilePathInfoMap.get(fileInfo); if (list == null) { - list = new ArrayList(); + list = new ArrayList<>(); fPathFilePathInfoMap.put(fileInfo, list); if (fMaxMatchInfo == null) { fMaxMatchInfo = fileInfo; @@ -342,7 +342,7 @@ public class CDataDiscoveredInfoCalculator { private HashSet calcExtsSet() { if (fExtsSet == null) - fExtsSet = new HashSet(Arrays.asList(fExts)); + fExtsSet = new HashSet<>(Arrays.asList(fExts)); return fExtsSet; } @@ -468,7 +468,7 @@ public class CDataDiscoveredInfoCalculator { void internalAdd(ExtsSetSettings setting) { if (fExtsSetToExtsSetSettingsMap == null) { - fExtsSetToExtsSetSettingsMap = new HashMap(); + fExtsSetToExtsSetSettingsMap = new HashMap<>(); } ExtsSetSettings cur = fExtsSetToExtsSetSettingsMap.get(setting.fExtsSet); @@ -497,7 +497,7 @@ public class CDataDiscoveredInfoCalculator { } public RcSetSettings[] getChildren(final boolean includeCurrent) { - final List list = new ArrayList(); + final List list = new ArrayList<>(); fContainer.accept(new IPathSettingsContainerVisitor() { @Override @@ -561,7 +561,7 @@ public class CDataDiscoveredInfoCalculator { String[] exts = setting.fExtsSet.fExts; String ext; if (map == null) { - map = new HashMap(); + map = new HashMap<>(); forceAdd = true; } @@ -600,7 +600,7 @@ public class CDataDiscoveredInfoCalculator { path = rcData.getPath(); curRcSet = rcSet.createChild(path, rcData, false); if (rcData.getType() == ICSettingBase.SETTING_FILE) { - fileMap = new HashMap(1); + fileMap = new HashMap<>(1); fileSetting = createExtsSetSettings(path, (CFileData) rcData); fileMap.put(fileSetting.fExtsSet, fileSetting); curRcSet.internalSetSettingsMap(fileMap); @@ -672,7 +672,7 @@ public class CDataDiscoveredInfoCalculator { private static void addLanguageInfos(RcSettingInfo rcInfo, CLanguageData[] lDatas, PathInfo info) { ArrayList list = rcInfo.fLangInfoList; if (list == null) { - list = new ArrayList(lDatas.length); + list = new ArrayList<>(lDatas.length); rcInfo.fLangInfoList = list; } else { list.ensureCapacity(lDatas.length); @@ -690,7 +690,7 @@ public class CDataDiscoveredInfoCalculator { IPath projRelPath; CResourceData rcData; // RcSetSettings dataSetting; - List list = new ArrayList(pfpis.length); + List list = new ArrayList<>(pfpis.length); RcSettingInfo rcInfo; ILangSettingInfo lInfo; CLanguageData lData; @@ -731,7 +731,7 @@ public class CDataDiscoveredInfoCalculator { if (rcInfo == null) { rcInfo = new RcSettingInfo(rootData); - tmpList = new ArrayList(lDatas.length - k); + tmpList = new ArrayList<>(lDatas.length - k); rcInfo.fLangInfoList = tmpList; } @@ -785,7 +785,7 @@ public class CDataDiscoveredInfoCalculator { if (lData != null) { rcInfo = new RcSettingInfo(rcData); lInfo = new LangSettingInfo(lData, pInfo); - tmpList = new ArrayList(1); + tmpList = new ArrayList<>(1); tmpList.add(lInfo); rcInfo.fLangInfoList = tmpList; list.add(rcInfo); @@ -814,7 +814,7 @@ public class CDataDiscoveredInfoCalculator { RcSetSettings settings[] = rootSetting.getChildren(true); RcSetSettings setting; CResourceData rcData; - List resultList = new ArrayList(); + List resultList = new ArrayList<>(); LangSettingInfo langInfo; RcSettingInfo rcInfo; PathInfo pathInfo; @@ -846,7 +846,7 @@ public class CDataDiscoveredInfoCalculator { if (pathInfo != null) { langInfo = new LangSettingInfo(extSetting.fBaseLangData, pathInfo); rcInfo = new RcSettingInfo(rcData); - rcInfo.fLangInfoList = new ArrayList(1); + rcInfo.fLangInfoList = new ArrayList<>(1); rcInfo.fLangInfoList.add(langInfo); resultList.add(rcInfo); } @@ -854,7 +854,7 @@ public class CDataDiscoveredInfoCalculator { } else { if (setting.fExtsSetToExtsSetSettingsMap.size() != 0) { rcInfo = new RcSettingInfo(rcData); - rcInfo.fLangInfoList = new ArrayList(setting.fExtsSetToExtsSetSettingsMap.size()); + rcInfo.fLangInfoList = new ArrayList<>(setting.fExtsSetToExtsSetSettingsMap.size()); resultList.add(rcInfo); Collection extSettings = setting.fExtsSetToExtsSetSettingsMap.values(); @@ -1015,7 +1015,7 @@ public class CDataDiscoveredInfoCalculator { private static HashMap createExtsSetSettingsMap(CFolderData data) { CLanguageData[] lDatas = data.getLanguageDatas(); - HashMap map = new HashMap(lDatas.length); + HashMap map = new HashMap<>(lDatas.length); ExtsSetSettings settings; if (lDatas.length != 0) { @@ -1032,7 +1032,7 @@ public class CDataDiscoveredInfoCalculator { private static PathFilePathInfo[] createOrderedInfo(Map map) { ListIndexStore store = new ListIndexStore(10); - HashMap infoMap = new HashMap(); + HashMap infoMap = new HashMap<>(); // LinkedHashMap result; Set> entries = map.entrySet(); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathContainer.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathContainer.java index 4fccc0ade94..d37fd8cf442 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathContainer.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathContainer.java @@ -79,7 +79,7 @@ public class DiscoveredPathContainer implements IPathEntryContainer { IDiscoveredPathInfo info = MakeCorePlugin.getDefault().getDiscoveryManager().getDiscoveredInfo(fProject); IPath[] includes = info.getIncludePaths(); Map syms = info.getSymbols(); - List entries = new ArrayList(includes.length + syms.size()); + List entries = new ArrayList<>(includes.length + syms.size()); for (IPath inc : includes) { entries.add(CoreModel.newIncludeEntry(Path.EMPTY, Path.EMPTY, inc, true)); } diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathInfo.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathInfo.java index 308a6564a3c..00a1321943b 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathInfo.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathInfo.java @@ -49,8 +49,8 @@ public class DiscoveredPathInfo implements IPerProjectDiscoveredPathInfo, IDisco public DiscoveredPathInfo(IProject project) { this.project = project; - discoveredPaths = new LinkedHashMap(); - discoveredSymbols = new LinkedHashMap(); + discoveredPaths = new LinkedHashMap<>(); + discoveredSymbols = new LinkedHashMap<>(); } @Override @@ -77,12 +77,12 @@ public class DiscoveredPathInfo implements IPerProjectDiscoveredPathInfo, IDisco @Override public LinkedHashMap getIncludeMap() { - return new LinkedHashMap(discoveredPaths); + return new LinkedHashMap<>(discoveredPaths); } @Override public synchronized void setIncludeMap(LinkedHashMap paths) { - discoveredPaths = SafeStringInterner.safeIntern(new LinkedHashMap(paths)); + discoveredPaths = SafeStringInterner.safeIntern(new LinkedHashMap<>(paths)); activePaths = null; } @@ -104,12 +104,12 @@ public class DiscoveredPathInfo implements IPerProjectDiscoveredPathInfo, IDisco @Override public LinkedHashMap getSymbolMap() { - return new LinkedHashMap(discoveredSymbols); + return new LinkedHashMap<>(discoveredSymbols); } @Override public synchronized void setSymbolMap(LinkedHashMap symbols) { - discoveredSymbols = SafeStringInterner.safeIntern(new LinkedHashMap(symbols)); + discoveredSymbols = SafeStringInterner.safeIntern(new LinkedHashMap<>(symbols)); activeSymbols = null; } @@ -125,14 +125,14 @@ public class DiscoveredPathInfo implements IPerProjectDiscoveredPathInfo, IDisco private List getActivePathList() { if (activePaths == null) { - activePaths = new ArrayList(); + activePaths = new ArrayList<>(); } return activePaths; } private Map getActiveSymbolsMap() { if (activeSymbols == null) { - activeSymbols = new HashMap(); + activeSymbols = new HashMap<>(); } return activeSymbols; } diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathManager.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathManager.java index 61800a1a04c..02e79c7cfcb 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathManager.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathManager.java @@ -52,7 +52,7 @@ import org.eclipse.core.runtime.Status; public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceChangeListener { - private Map fDiscoveredInfoHolderMap = new HashMap(); + private Map fDiscoveredInfoHolderMap = new HashMap<>(); private List listeners = Collections .synchronizedList(new ArrayList()); @@ -60,7 +60,7 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC private static final int INFO_REMOVED = 2; private static class DiscoveredInfoHolder { - Map fInfoMap = new HashMap(); + Map fInfoMap = new HashMap<>(); // PathSettingsContainer fContainer = PathSettingsContainer.createRootContainer(); public IDiscoveredPathInfo getInfo(InfoContext context) { @@ -339,7 +339,7 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC PerFileDiscoveredPathContainer container = new PerFileDiscoveredPathContainer(project); CoreModel.setPathEntryContainer(new ICProject[] { cProject }, container, null); if (changedResources != null) { - List changeDelta = new ArrayList( + List changeDelta = new ArrayList<>( changedResources.size()); for (IResource resource : changedResources) { IPath path = resource.getFullPath(); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredScannerInfoStore.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredScannerInfoStore.java index f8a2707ccce..8d219406413 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredScannerInfoStore.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredScannerInfoStore.java @@ -76,7 +76,7 @@ public final class DiscoveredScannerInfoStore { /** * Caches scanner config XML Documents per project using soft references. */ - private final Map> fDocumentCache = new HashMap>(); + private final Map> fDocumentCache = new HashMap<>(); public static DiscoveredScannerInfoStore getInstance() { if (instance == null) { @@ -179,7 +179,7 @@ public final class DiscoveredScannerInfoStore { rootElement.setAttribute(ID_ATTR, CDESCRIPTOR_ID); document.appendChild(rootElement); } - fDocumentCache.put(project, new SoftReference(document)); + fDocumentCache.put(project, new SoftReference<>(document)); } catch (IOException e) { MakeCorePlugin.log(e); throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/PerFileDiscoveredPathContainer.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/PerFileDiscoveredPathContainer.java index 94f53c116e2..dbb4d03c2b8 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/PerFileDiscoveredPathContainer.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/PerFileDiscoveredPathContainer.java @@ -37,7 +37,7 @@ public class PerFileDiscoveredPathContainer extends DiscoveredPathContainer impl @Override public IPathEntry[] getPathEntries(IPath path, int mask) { - ArrayList entries = new ArrayList(); + ArrayList entries = new ArrayList<>(); try { IDiscoveredPathInfo info = MakeCorePlugin.getDefault().getDiscoveryManager().getDiscoveredInfo(fProject); if (info instanceof IPerFileDiscoveredPathInfo) { diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerConfigUtil.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerConfigUtil.java index a03c3b98cce..f76e7e378c6 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerConfigUtil.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerConfigUtil.java @@ -66,7 +66,7 @@ public final class ScannerConfigUtil { */ public static List scSymbolsSymbolEntryMap2List(Map sumSymbols, boolean active) { Set> symbols = sumSymbols.entrySet(); - List rv = new ArrayList(symbols.size()); + List rv = new ArrayList<>(symbols.size()); for (Entry symbol : symbols) { SymbolEntry sEntry = symbol.getValue(); if (active) { @@ -85,7 +85,7 @@ public final class ScannerConfigUtil { * @return - active symbols as a plain Map */ public static Map scSymbolEntryMap2Map(Map sumSymbols) { - Map rv = new HashMap(); + Map rv = new HashMap<>(); Set keys = sumSymbols.keySet(); for (String key : keys) { SymbolEntry entries = sumSymbols.get(key); @@ -216,13 +216,13 @@ public final class ScannerConfigUtil { if (index1 == index2 || !(index1 >= 0 && index1 < size && index2 >= 0 && index2 < size)) { return sumPaths; } - ArrayList pathKeyList = new ArrayList(sumPaths.keySet()); + ArrayList pathKeyList = new ArrayList<>(sumPaths.keySet()); String temp1 = pathKeyList.get(index1); String temp2 = pathKeyList.get(index2); pathKeyList.set(index1, temp2); pathKeyList.set(index2, temp1); - LinkedHashMap newSumPaths = new LinkedHashMap(sumPaths.size()); + LinkedHashMap newSumPaths = new LinkedHashMap<>(sumPaths.size()); for (String key : pathKeyList) { newSumPaths.put(key, sumPaths.get(key)); } @@ -233,7 +233,7 @@ public final class ScannerConfigUtil { * Tokenizes string with quotes */ public static String[] tokenizeStringWithQuotes(String line, String quoteStyle) { - ArrayList allTokens = new ArrayList(); + ArrayList allTokens = new ArrayList<>(); String[] tokens = line.split(quoteStyle); for (int i = 0; i < tokens.length; ++i) { if (i % 2 == 0) { // even tokens need further tokenization diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParser.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParser.java index e869b3a7985..f900025c97b 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParser.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParser.java @@ -187,8 +187,8 @@ public abstract class AbstractGCCBOPConsoleParser implements IScannerInfoConsole * @return array of commands */ protected String[][] tokenize(String line, boolean escapeInsideDoubleQuotes) { - ArrayList commands = new ArrayList(); - ArrayList tokens = new ArrayList(); + ArrayList commands = new ArrayList<>(); + ArrayList tokens = new ArrayList<>(); StringBuilder token = new StringBuilder(); final char[] input = line.toCharArray(); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParserUtility.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParserUtility.java index f6abd11f199..9b6eb9b9881 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParserUtility.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParserUtility.java @@ -42,8 +42,8 @@ public abstract class AbstractGCCBOPConsoleParserUtility { */ public AbstractGCCBOPConsoleParserUtility(IProject project, IPath workingDirectory, IMarkerGenerator markerGenerator) { - fDirectoryStack = new Vector(); - fErrors = new ArrayList(); + fDirectoryStack = new Vector<>(); + fErrors = new ArrayList<>(); this.project = project; fBaseDirectory = new Path(EFSExtensionManager.getDefault().getPathFromURI(project.getLocationURI())); if (workingDirectory != null) { diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParser.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParser.java index 354248e07ef..0f4ab75ea4d 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParser.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParser.java @@ -138,9 +138,9 @@ public class GCCPerFileBOPConsoleParser extends AbstractGCCBOPConsoleParser { } if (file != null) { CCommandDSC cmd = fUtil.getNewCCommandDSC(tokens, compilerInvocationIndex, extensionsIndex > 0); - List cmdList = new CopyOnWriteArrayList(); + List cmdList = new CopyOnWriteArrayList<>(); cmdList.add(cmd); - Map> sc = new HashMap>(1); + Map> sc = new HashMap<>(1); sc.put(ScannerInfoTypes.COMPILER_COMMAND, cmdList); getCollector().contributeToScannerConfig(file, sc); } else diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParserUtility.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParserUtility.java index 51774fab885..e550d21800d 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParserUtility.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParserUtility.java @@ -61,7 +61,7 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars String workingDir = getWorkingDirectory().toString(); List>> directoryCommandList = directoryCommandListMap.get(workingDir); if (directoryCommandList == null) { - directoryCommandList = new CopyOnWriteArrayList>>(); + directoryCommandList = new CopyOnWriteArrayList<>(); directoryCommandListMap.put(workingDir, directoryCommandList); ++workingDirsN; } @@ -77,10 +77,10 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars return; } } - command21FileListMap = new HashMap>(1); + command21FileListMap = new HashMap<>(1); directoryCommandList.add(command21FileListMap); ++commandsN; - List fileList = new CopyOnWriteArrayList(); + List fileList = new CopyOnWriteArrayList<>(); command21FileListMap.put(genericCommand, fileList); fileList.add(longFileName); ++filesN; @@ -123,8 +123,8 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars * @return CCommandDSC compile command description */ public CCommandDSC getNewCCommandDSC(String[] tokens, final int idxOfCompilerCommand, boolean cppFileType) { - CopyOnWriteArrayList dirafter = new CopyOnWriteArrayList(); - CopyOnWriteArrayList includes = new CopyOnWriteArrayList(); + CopyOnWriteArrayList dirafter = new CopyOnWriteArrayList<>(); + CopyOnWriteArrayList includes = new CopyOnWriteArrayList<>(); CCommandDSC command = new CCommandDSC(cppFileType, getProject()); command.addSCOption(new KVStringPair(SCDOptionsEnum.COMMAND.toString(), tokens[idxOfCompilerCommand])); for (int i = idxOfCompilerCommand + 1; i < tokens.length; ++i) { @@ -161,7 +161,7 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars KVStringPair pair = new KVStringPair(SCDOptionsEnum.IQUOTE.toString(), option); command.addSCOption(pair); } - includes = new CopyOnWriteArrayList(); + includes = new CopyOnWriteArrayList<>(); // -I- has no parameter } else { // ex. -I /dir @@ -279,7 +279,7 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars * @return List of CCommandDSC */ public List getCCommandDSCList() { - return new CopyOnWriteArrayList(commandsList2); + return new CopyOnWriteArrayList<>(commandsList2); } } diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileSIPConsoleParser.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileSIPConsoleParser.java index 32d2ed6f4b8..58264bc0daf 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileSIPConsoleParser.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileSIPConsoleParser.java @@ -71,11 +71,11 @@ public class GCCPerFileSIPConsoleParser implements IScannerInfoConsoleParser { if (line.startsWith(COMMAND_ID_BEGIN)) { commandId = Integer.parseInt(line.substring(COMMAND_ID_BEGIN.length())); - symbols = new ArrayList(); - includes = new ArrayList(); - quoteIncludes = new ArrayList(); + symbols = new ArrayList<>(); + includes = new ArrayList<>(); + quoteIncludes = new ArrayList<>(); } else if (line.startsWith(COMMAND_ID_END)) { - Map> scannerInfo = new HashMap>(); + Map> scannerInfo = new HashMap<>(); scannerInfo.put(ScannerInfoTypes.INCLUDE_PATHS, includes); scannerInfo.put(ScannerInfoTypes.QUOTE_INCLUDE_PATHS, quoteIncludes); scannerInfo.put(ScannerInfoTypes.SYMBOL_DEFINITIONS, symbols); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCScannerInfoConsoleParser.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCScannerInfoConsoleParser.java index e834b093a0f..ee008d9357c 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCScannerInfoConsoleParser.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCScannerInfoConsoleParser.java @@ -74,9 +74,9 @@ public class GCCScannerInfoConsoleParser extends AbstractGCCBOPConsoleParser { } // Recognized gcc or g++ compiler invocation - List includes = new CopyOnWriteArrayList(); - List symbols = new CopyOnWriteArrayList(); - List targetSpecificOptions = new CopyOnWriteArrayList(); + List includes = new CopyOnWriteArrayList<>(); + List symbols = new CopyOnWriteArrayList<>(); + List targetSpecificOptions = new CopyOnWriteArrayList<>(); String fileName = null; for (int j = compilerInvocationIdx + 1; j < tokens.length; j++) { @@ -165,7 +165,7 @@ public class GCCScannerInfoConsoleParser extends AbstractGCCBOPConsoleParser { IProject project = getProject(); IFile file = null; - List translatedIncludes = new LinkedList(); + List translatedIncludes = new LinkedList<>(); translatedIncludes.addAll(includes); if (includes.size() > 0) { if (fUtil != null) { @@ -188,11 +188,11 @@ public class GCCScannerInfoConsoleParser extends AbstractGCCBOPConsoleParser { } } - CopyOnWriteArrayList translatedIncludesToPut = new CopyOnWriteArrayList(translatedIncludes); + CopyOnWriteArrayList translatedIncludesToPut = new CopyOnWriteArrayList<>(translatedIncludes); // Contribute discovered includes and symbols to the ScannerInfoCollector if (translatedIncludesToPut.size() > 0 || symbols.size() > 0) { - Map> scannerInfo = new HashMap>(); + Map> scannerInfo = new HashMap<>(); scannerInfo.put(ScannerInfoTypes.INCLUDE_PATHS, translatedIncludesToPut); scannerInfo.put(ScannerInfoTypes.SYMBOL_DEFINITIONS, symbols); scannerInfo.put(ScannerInfoTypes.TARGET_SPECIFIC_OPTION, targetSpecificOptions); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCSpecsConsoleParser.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCSpecsConsoleParser.java index 48c69b69534..53e791fc041 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCSpecsConsoleParser.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCSpecsConsoleParser.java @@ -44,8 +44,8 @@ public class GCCSpecsConsoleParser implements IScannerInfoConsoleParser { protected IScannerInfoCollector fCollector = null; private boolean expectingIncludes = false; - protected List symbols = new ArrayList(); - protected List includes = new ArrayList(); + protected List symbols = new ArrayList<>(); + protected List includes = new ArrayList<>(); @Override public void startup(IProject project, IPath workingDirectory, IScannerInfoCollector collector, @@ -120,7 +120,7 @@ public class GCCSpecsConsoleParser implements IScannerInfoConsoleParser { */ @Override public void shutdown() { - Map> scannerInfo = new HashMap>(); + Map> scannerInfo = new HashMap<>(); scannerInfo.put(ScannerInfoTypes.INCLUDE_PATHS, includes); scannerInfo.put(ScannerInfoTypes.SYMBOL_DEFINITIONS, symbols); if (fCollector != null) { diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/ScannerInfoConsoleParserUtility.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/ScannerInfoConsoleParserUtility.java index 0e270d2c62f..11ab1e24c8c 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/ScannerInfoConsoleParserUtility.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/ScannerInfoConsoleParserUtility.java @@ -53,9 +53,9 @@ public class ScannerInfoConsoleParserUtility extends AbstractGCCBOPConsoleParser public ScannerInfoConsoleParserUtility(IProject project, IPath workingDirectory, IMarkerGenerator markerGenerator) { super(project, workingDirectory, markerGenerator); - fFilesInProject = new HashMap(); - fCollectedFiles = new ArrayList(); - fNameConflicts = new ArrayList(); + fFilesInProject = new HashMap<>(); + fCollectedFiles = new ArrayList<>(); + fNameConflicts = new ArrayList<>(); collectFiles(getProject(), fCollectedFiles); @@ -188,7 +188,7 @@ public class ScannerInfoConsoleParserUtility extends AbstractGCCBOPConsoleParser } public List translateRelativePaths(IFile file, String fileName, List includes) { - List translatedIncludes = new ArrayList(includes.size()); + List translatedIncludes = new ArrayList<>(includes.size()); for (String include : includes) { IPath includePath = new Path(include); if (includePath.isUNC()) { diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/CCommandDSC.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/CCommandDSC.java index c8ec3492bfa..6270731096d 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/CCommandDSC.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/CCommandDSC.java @@ -63,13 +63,13 @@ public class CCommandDSC { } public CCommandDSC(boolean cppFileType, IProject project) { - compilerCommand = new ArrayList(); + compilerCommand = new ArrayList<>(); discovered = false; this.cppFileType = cppFileType; - symbols = new ArrayList(); - includes = new ArrayList(); - quoteIncludes = new ArrayList(); + symbols = new ArrayList<>(); + includes = new ArrayList<>(); + quoteIncludes = new ArrayList<>(); this.project = project; } @@ -181,7 +181,7 @@ public class CCommandDSC { * @return list of strings */ public List getImacrosFile() { - List imacrosFiles = new ArrayList(); + List imacrosFiles = new ArrayList<>(); for (Iterator i = compilerCommand.iterator(); i.hasNext();) { KVStringPair optionPair = i.next(); if (optionPair.getKey().equals(SCDOptionsEnum.IMACROS_FILE.toString())) { @@ -195,7 +195,7 @@ public class CCommandDSC { * @return list of strings */ public List getIncludeFile() { - List includeFiles = new ArrayList(); + List includeFiles = new ArrayList<>(); for (Iterator i = compilerCommand.iterator(); i.hasNext();) { KVStringPair optionPair = i.next(); if (optionPair.getKey().equals(SCDOptionsEnum.INCLUDE_FILE.toString())) { @@ -362,9 +362,9 @@ public class CCommandDSC { public void resolveOptions(IProject project) { if (!isDiscovered()) { // that's wrong for sure, options cannot be resolved fron the optionPairs?? - ArrayList symbols = new ArrayList(); - ArrayList includes = new ArrayList(); - ArrayList quoteincludes = new ArrayList(); + ArrayList symbols = new ArrayList<>(); + ArrayList includes = new ArrayList<>(); + ArrayList quoteincludes = new ArrayList<>(); for (Iterator options = compilerCommand.iterator(); options.hasNext();) { KVStringPair optionPair = options.next(); String key = optionPair.getKey(); @@ -410,7 +410,7 @@ public class CCommandDSC { } public static List makeRelative(IProject project, List paths) { - List list = new ArrayList(paths.size()); + List list = new ArrayList<>(paths.size()); for (Iterator iter = paths.iterator(); iter.hasNext();) { String path = iter.next(); path = makeRelative(project, new Path(path)).toOSString(); @@ -439,7 +439,7 @@ public class CCommandDSC { } public static List makeAbsolute(IProject project, List paths) { - List list = new ArrayList(paths.size()); + List list = new ArrayList<>(paths.size()); for (Iterator iter = paths.iterator(); iter.hasNext();) { String path = iter.next(); path = makeAbsolute(project, path); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/CygpathTranslator.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/CygpathTranslator.java index 5ed1a7e566a..4ece5410850 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/CygpathTranslator.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/CygpathTranslator.java @@ -111,7 +111,7 @@ public class CygpathTranslator { useCygwinFromPath = Cygwin.isAvailable(envPath); } - List translatedIncludePaths = new ArrayList(); + List translatedIncludePaths = new ArrayList<>(); for (Iterator i = sumIncludes.iterator(); i.hasNext();) { String includePath = i.next(); IPath realPath = new Path(includePath); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/SymbolEntry.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/SymbolEntry.java index 9b01afc6710..46e00971259 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/SymbolEntry.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/SymbolEntry.java @@ -37,7 +37,7 @@ public class SymbolEntry { public SymbolEntry(String name, String value, boolean active) { this.name = SafeStringInterner.safeIntern(name); if (values == null) { - values = new LinkedHashMap(1); + values = new LinkedHashMap<>(1); } values.put(SafeStringInterner.safeIntern(value), Boolean.valueOf(active)); } @@ -88,7 +88,7 @@ public class SymbolEntry { * @return List */ private List get(boolean format, boolean subset, boolean active) { - List rv = new ArrayList(values.size()); + List rv = new ArrayList<>(values.size()); for (String val : values.keySet()) { if (subset && (values.get(val)).booleanValue() != active) continue; @@ -106,7 +106,7 @@ public class SymbolEntry { * @return List */ public List getValuesOnly(boolean active) { - List rv = new ArrayList(values.size()); + List rv = new ArrayList<>(values.size()); for (Object element : values.keySet()) { String val = (String) element; if ((values.get(val)).booleanValue() == active) { diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java index fb3e725896b..6bc426ebaf2 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java @@ -131,7 +131,7 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider { ErrorParserManager epm = new ErrorParserManager(project, markerGenerator, new String[] { GMAKE_ERROR_PARSER_ID }); - List parsers = new ArrayList(); + List parsers = new ArrayList<>(); IConsoleParser parser = ScannerInfoConsoleParserFactory.getESIConsoleParser(project, context, providerId, buildInfo, collector, markerGenerator); if (parser != null) { @@ -229,7 +229,7 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider { protected String[] setEnvironment(ICommandLauncher launcher, Properties initialEnv) { Properties props = getEnvMap(launcher, initialEnv); String[] env = null; - ArrayList envList = new ArrayList(); + ArrayList envList = new ArrayList<>(); Enumeration names = props.propertyNames(); if (names != null) { while (names.hasMoreElements()) { diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerFileSICollector.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerFileSICollector.java index 07793c72111..2fb9bb32029 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerFileSICollector.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerFileSICollector.java @@ -75,9 +75,9 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC protected final Map commandIdCommandMap; // map of all commands public ScannerInfoData() { - commandIdCommandMap = new LinkedHashMap(); // [commandId, command] - fileToCommandIdMap = new HashMap(); // [file, commandId] - commandIdToFilesMap = new HashMap>(); // [commandId, set of files] + commandIdCommandMap = new LinkedHashMap<>(); // [commandId, command] + fileToCommandIdMap = new HashMap<>(); // [file, commandId] + commandIdToFilesMap = new HashMap<>(); // [commandId, set of files] } /* (non-Javadoc) @@ -88,7 +88,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC synchronized (PerFileSICollector.this.fLock) { Document doc = collectorElem.getOwnerDocument(); - List commandIds = new ArrayList(commandIdCommandMap.keySet()); + List commandIds = new ArrayList<>(commandIdCommandMap.keySet()); Collections.sort(commandIds); for (Integer commandId : commandIds) { CCommandDSC command = commandIdCommandMap.get(commandId); @@ -201,10 +201,10 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC sid = new ScannerInfoData(); // siChangedForFileList = new ArrayList(); - siChangedForFileMap = new HashMap(); - siChangedForCommandIdList = new ArrayList(); + siChangedForFileMap = new HashMap<>(); + siChangedForCommandIdList = new ArrayList<>(); - freeCommandIdPool = new TreeSet(); + freeCommandIdPool = new TreeSet<>(); } /* (non-Javadoc) @@ -300,7 +300,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC protected void addCompilerCommand(IFile file, CCommandDSC cmd) { assert Thread.holdsLock(fLock); - List existingCommands = new ArrayList(sid.commandIdCommandMap.values()); + List existingCommands = new ArrayList<>(sid.commandIdCommandMap.values()); int index = existingCommands.indexOf(cmd); if (index != -1) { cmd = existingCommands.get(index); @@ -344,7 +344,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC // update sid.commandIdToFilesMap Set fileSet = sid.commandIdToFilesMap.get(commandId); if (fileSet == null) { - fileSet = new HashSet(); + fileSet = new HashSet<>(); sid.commandIdToFilesMap.put(commandId, fileSet); CCommandDSC cmd = sid.commandIdCommandMap.get(commandId); if (cmd != null) { @@ -435,7 +435,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC if (scannerInfoChanged()) { applyFileDeltas(); removeUnusedCommands(); - changedResources = new ArrayList(siChangedForFileMap.keySet()); + changedResources = new ArrayList<>(siChangedForFileMap.keySet()); siChangedForFileMap.clear(); } siChangedForCommandIdList.clear(); @@ -480,7 +480,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC */ @Override public List getCollectedScannerInfo(Object resource, ScannerInfoTypes type) { - List rv = new ArrayList(); + List rv = new ArrayList<>(); // check the resource String errorMessage = null; if (resource == null) { @@ -628,7 +628,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC if (includepaths == null || includepaths.length == 0) { return quotepaths; } - ArrayList result = new ArrayList(includepaths.length + quotepaths.length); + ArrayList result = new ArrayList<>(includepaths.length + quotepaths.length); result.addAll(Arrays.asList(includepaths)); result.addAll(Arrays.asList(quotepaths)); return result.toArray(new IPath[result.size()]); @@ -693,7 +693,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC CCommandDSC cmd = getCommand(path); if (cmd != null && cmd.isDiscovered()) { List symbols = cmd.getSymbols(); - Map definedSymbols = new HashMap(symbols.size()); + Map definedSymbols = new HashMap<>(symbols.size()); for (String symbol : symbols) { String key = SafeStringInterner.safeIntern(ScannerConfigUtil.getSymbolKey(symbol)); String value = SafeStringInterner.safeIntern(ScannerConfigUtil.getSymbolValue(symbol)); @@ -789,7 +789,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC protected Map calculatePathInfoMap() { assert Thread.holdsLock(fLock); - Map map = new HashMap(sid.fileToCommandIdMap.size() + 1); + Map map = new HashMap<>(sid.fileToCommandIdMap.size() + 1); Set> entrySet = sid.fileToCommandIdMap.entrySet(); for (Entry entry : entrySet) { IFile file = entry.getKey(); @@ -821,7 +821,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC IPath[] incFiles = stringListToPathArray(cmd.getIncludeFile()); IPath[] macroFiles = stringListToPathArray(cmd.getImacrosFile()); List symbols = cmd.getSymbols(); - Map definedSymbols = new HashMap(symbols.size()); + Map definedSymbols = new HashMap<>(symbols.size()); for (String symbol : symbols) { String key = ScannerConfigUtil.getSymbolKey(symbol); String value = ScannerConfigUtil.getSymbolValue(symbol); @@ -862,7 +862,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC * @return list of IPath(s). */ protected IPath[] getAllIncludePaths(int type) { - List allIncludes = new ArrayList(); + List allIncludes = new ArrayList<>(); Set cmdIds = sid.commandIdCommandMap.keySet(); for (Integer cmdId : cmdIds) { CCommandDSC cmd = sid.commandIdCommandMap.get(cmdId); @@ -882,7 +882,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC discovered = cmd.getImacrosFile(); break; default: - discovered = new ArrayList(0); + discovered = new ArrayList<>(0); } for (String include : discovered) { // the following line degrades perfomance @@ -899,7 +899,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC } protected static IPath[] stringListToPathArray(List discovered) { - List allIncludes = new ArrayList(discovered.size()); + List allIncludes = new ArrayList<>(discovered.size()); for (String include : discovered) { if (!allIncludes.contains(include)) { allIncludes.add(new Path(include)); @@ -910,7 +910,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC protected Map getAllSymbols() { assert Thread.holdsLock(fLock); - Map symbols = new HashMap(); + Map symbols = new HashMap<>(); Set cmdIds = sid.commandIdCommandMap.keySet(); for (Integer cmdId : cmdIds) { CCommandDSC cmd = sid.commandIdCommandMap.get(cmdId); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java index 63acee31c14..70b5171ddf0 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java @@ -85,13 +85,13 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn protected boolean scPersisted = false; public PerProjectSICollector() { - discoveredSI = new HashMap>(); + discoveredSI = new HashMap<>(); // discoveredIncludes = new ArrayList(); // discoveredSymbols = new ArrayList(); // discoveredTSO = new ArrayList(); // - sumDiscoveredIncludes = new ArrayList(); - sumDiscoveredSymbols = new LinkedHashMap(); + sumDiscoveredIncludes = new ArrayList<>(); + sumDiscoveredSymbols = new LinkedHashMap<>(); } /* (non-Javadoc) @@ -151,7 +151,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn List discovered = discoveredSI.get(siType); if (discovered == null) { - discovered = new ArrayList(delta); + discovered = new ArrayList<>(delta); discoveredSI.put(siType, discovered); } else { final boolean addSorted = !isBuiltinConfig && siType.equals(ScannerInfoTypes.INCLUDE_PATHS); @@ -224,7 +224,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn monitor.subTask(MakeMessages.getString("ScannerInfoCollector.Updating") + project.getName()); //$NON-NLS-1$ try { // update scanner configuration - List resourceDelta = new ArrayList(1); + List resourceDelta = new ArrayList<>(1); resourceDelta.add(project); MakeCorePlugin.getDefault().getDiscoveryManager().updateDiscoveredInfo(context, pathInfo, context.isDefaultContext(), resourceDelta); @@ -275,12 +275,12 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn // Step 3. Merge scanner config from steps 1 and 2 // order is important, use list to preserve it - ArrayList persistedKeyList = new ArrayList(persistedIncludes.keySet()); + ArrayList persistedKeyList = new ArrayList<>(persistedIncludes.keySet()); addedIncludes = addItemsWithOrder(persistedKeyList, finalSumIncludes, true); LinkedHashMap newPersistedIncludes; if (addedIncludes) { - newPersistedIncludes = new LinkedHashMap(persistedKeyList.size()); + newPersistedIncludes = new LinkedHashMap<>(persistedKeyList.size()); for (String include : persistedKeyList) { if (persistedIncludes.containsKey(include)) { newPersistedIncludes.put(include, persistedIncludes.get(include)); @@ -338,7 +338,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn LinkedHashMap persistedSymbols = discPathInfo.getSymbolMap(); // Step 3. Merge scanner config from steps 1 and 2 - LinkedHashMap candidateSymbols = new LinkedHashMap( + LinkedHashMap candidateSymbols = new LinkedHashMap<>( persistedSymbols); addedSymbols |= ScannerConfigUtil.scAddSymbolEntryMap2SymbolEntryMap(candidateSymbols, sumDiscoveredSymbols); @@ -519,7 +519,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn ICProject cProject = CoreModel.getDefault().create(project); if (cProject != null) { IPathEntry[] entries = cProject.getRawPathEntries(); - List newEntries = new ArrayList(Arrays.asList(entries)); + List newEntries = new ArrayList<>(Arrays.asList(entries)); if (!newEntries.contains(container)) { newEntries.add(container); cProject.setRawPathEntries(newEntries.toArray(new IPathEntry[newEntries.size()]), monitor); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCMarkerGenerator.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCMarkerGenerator.java index a062dcd0cb7..81b4c160120 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCMarkerGenerator.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCMarkerGenerator.java @@ -122,7 +122,7 @@ public class SCMarkerGenerator implements IMarkerGenerator { try { IMarker[] markers = file.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_ONE); if (markers != null) { - List exactMarkers = new ArrayList(); + List exactMarkers = new ArrayList<>(); for (int i = 0; i < markers.length; i++) { IMarker marker = markers[i]; int location = ((Integer) marker.getAttribute(IMarker.LINE_NUMBER)).intValue(); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigInfoFactory2.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigInfoFactory2.java index dd5d36a1ab7..e7fe1a223ef 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigInfoFactory2.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigInfoFactory2.java @@ -218,7 +218,7 @@ public class ScannerConfigInfoFactory2 { public void save() throws CoreException { if (isDirty()) { - Set idSet = new HashSet(fMap.size() - 1); + Set idSet = new HashSet<>(fMap.size() - 1); Preference pref = (Preference) fMap.get(new InfoContext(null)); pref.store(); @@ -278,7 +278,7 @@ public class ScannerConfigInfoFactory2 { } private static abstract class StoreSet implements IScannerConfigBuilderInfo2Set { - protected HashMap fMap = new HashMap(); + protected HashMap fMap = new HashMap<>(); protected boolean fIsDirty; StoreSet() { @@ -363,9 +363,9 @@ public class ScannerConfigInfoFactory2 { protected String selectedProfile = EMPTY_STRING; /** Map from profile ID -> default ProfileOptions * allows us to avoid storing options to .cproject when they are default .*/ - protected static Map defaultProfiles = new ConcurrentHashMap(); + protected static Map defaultProfiles = new ConcurrentHashMap<>(); /** Map from profile ID -> ProfileOptions */ - protected Map profileOptionsMap = new LinkedHashMap(); + protected Map profileOptionsMap = new LinkedHashMap<>(); static class ProfileOptions implements Cloneable { protected boolean buildOutputFileActionEnabled; @@ -457,7 +457,7 @@ public class ScannerConfigInfoFactory2 { this.buildOutputFileActionEnabled = base.buildOutputFileActionEnabled; this.buildOutputFilePath = base.buildOutputFilePath; this.buildOutputParserEnabled = base.buildOutputParserEnabled; - this.providerOptionsMap = new LinkedHashMap(base.providerOptionsMap); + this.providerOptionsMap = new LinkedHashMap<>(base.providerOptionsMap); for (Map.Entry entry : providerOptionsMap.entrySet()) { ProviderOptions basePo = entry.getValue(); entry.setValue(new ProviderOptions(basePo)); @@ -506,7 +506,7 @@ public class ScannerConfigInfoFactory2 { try { ProfileOptions newProfOpts = (ProfileOptions) super.clone(); if (providerOptionsMap != null) { - newProfOpts.providerOptionsMap = new LinkedHashMap(); + newProfOpts.providerOptionsMap = new LinkedHashMap<>(); for (Map.Entry e : providerOptionsMap.entrySet()) newProfOpts.providerOptionsMap.put(e.getKey(), e.getValue().clone()); } @@ -597,7 +597,7 @@ public class ScannerConfigInfoFactory2 { */ @Override public List getProfileIdList() { - return new ArrayList(profileOptionsMap.keySet()); + return new ArrayList<>(profileOptionsMap.keySet()); } /* (non-Javadoc) @@ -666,7 +666,7 @@ public class ScannerConfigInfoFactory2 { @Override public List getProviderIdList() { ProfileOptions po = profileOptionsMap.get(selectedProfile); - return (po != null) ? new ArrayList(po.providerOptionsMap.keySet()) : new ArrayList(0); + return (po != null) ? new ArrayList<>(po.providerOptionsMap.keySet()) : new ArrayList<>(0); } /* (non-Javadoc) @@ -856,7 +856,7 @@ public class ScannerConfigInfoFactory2 { } } - po.providerOptionsMap = new LinkedHashMap(); + po.providerOptionsMap = new LinkedHashMap<>(); for (String providerId : configuredProfile.getSIProviderIds()) { ProfileOptions.ProviderOptions ppo = new ProfileOptions.ProviderOptions(); ScannerInfoProvider configuredProvider = configuredProfile.getScannerInfoProviderElement(providerId); @@ -987,10 +987,10 @@ public class ScannerConfigInfoFactory2 { .getSCProfileConfiguration(selectedProfile); // get the one and only provider id String providerId = configuredProfile.getSIProviderIds().get(0); - po.providerOptionsMap = new LinkedHashMap(1); + po.providerOptionsMap = new LinkedHashMap<>(1); po.providerOptionsMap.put(providerId, ppo); - profileOptionsMap = new LinkedHashMap(1); + profileOptionsMap = new LinkedHashMap<>(1); profileOptionsMap.put(profileId, po); // store migrated data @@ -1012,7 +1012,7 @@ public class ScannerConfigInfoFactory2 { .getSCProfileConfiguration(profileId); List providerIds = configuredProfile.getSIProviderIds(); int providerCounter = 0; - po.providerOptionsMap = new LinkedHashMap(providerIds.size()); + po.providerOptionsMap = new LinkedHashMap<>(providerIds.size()); for (ICStorageElement child : profile.getChildren()) { // buildOutputProvider element @@ -1106,7 +1106,7 @@ public class ScannerConfigInfoFactory2 { // ScannerConfigProfile configuredProfile = ScannerConfigProfileManager.getInstance(). // getSCProfileConfiguration(selectedProfile); // List providerIds = configuredProfile.getSIProviderIds(); - List providerIds = new ArrayList(po.providerOptionsMap.keySet()); + List providerIds = new ArrayList<>(po.providerOptionsMap.keySet()); for (int i = 0; i < providerIds.size(); ++i) { String providerId = providerIds.get(i); ProfileOptions.ProviderOptions ppo = po.providerOptionsMap.get(providerId); @@ -1221,7 +1221,7 @@ public class ScannerConfigInfoFactory2 { .safeIntern(prefs.getDefaultString(prefix + SCANNER_CONFIG_SELECTED_PROFILE_ID_SUFFIX)); } List profileIds = ScannerConfigProfileManager.getInstance().getProfileIds(context); - profileOptionsMap = new LinkedHashMap(profileIds.size()); + profileOptionsMap = new LinkedHashMap<>(profileIds.size()); for (String profileId : profileIds) { ProfileOptions po = new ProfileOptions(); profileOptionsMap.put(profileId, po); @@ -1240,7 +1240,7 @@ public class ScannerConfigInfoFactory2 { ScannerConfigProfile configuredProfile = ScannerConfigProfileManager.getInstance() .getSCProfileConfiguration(profileId); List providerIds = configuredProfile.getSIProviderIds(); - po.providerOptionsMap = new LinkedHashMap(providerIds.size()); + po.providerOptionsMap = new LinkedHashMap<>(providerIds.size()); for (String providerId : providerIds) { ProfileOptions.ProviderOptions ppo = new ProfileOptions.ProviderOptions(); po.providerOptionsMap.put(providerId, ppo); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigProfile.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigProfile.java index 015e369677f..ea33d5cd552 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigProfile.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigProfile.java @@ -243,7 +243,7 @@ public class ScannerConfigProfile { private ScannerInfoCollector scannerInfoCollector; private BuildOutputProvider buildOutputProvider; - private Map scannerInfoProviders = new LinkedHashMap(); + private Map scannerInfoProviders = new LinkedHashMap<>(); private Boolean supportsContext; @@ -296,7 +296,7 @@ public class ScannerConfigProfile { * @return Returns the list of providerIds */ public List getSIProviderIds() { - return new ArrayList(scannerInfoProviders.keySet()); + return new ArrayList<>(scannerInfoProviders.keySet()); } /** diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigProfileManager.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigProfileManager.java index a65cd3f5c79..484f4a5cfc6 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigProfileManager.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigProfileManager.java @@ -52,7 +52,7 @@ public final class ScannerConfigProfileManager { * Singleton pattern */ private ScannerConfigProfileManager() { - projectToProfileInstanceMap = new HashMap>(); + projectToProfileInstanceMap = new HashMap<>(); } private static final ScannerConfigProfileManager instance = new ScannerConfigProfileManager(); @@ -92,7 +92,7 @@ public final class ScannerConfigProfileManager { synchronized (fLock) { Map map = projectToProfileInstanceMap.get(project); if (map == null && create) { - map = new HashMap(); + map = new HashMap<>(); projectToProfileInstanceMap.put(project, map); } return Collections.synchronizedMap(map); @@ -129,7 +129,7 @@ public final class ScannerConfigProfileManager { if (profileInstance == null || !profileInstance.getProfile().getId().equals(profileId)) { profileInstance = new SCProfileInstance(project, context, getSCProfileConfiguration(profileId)); - map.put(context, new SoftReference(profileInstance)); + map.put(context, new SoftReference<>(profileInstance)); } return profileInstance; } @@ -158,7 +158,7 @@ public final class ScannerConfigProfileManager { public List getProfileIds() { synchronized (fLock) { if (profileIds == null) { - profileIds = new ArrayList(); + profileIds = new ArrayList<>(); IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint(MakeCorePlugin.PLUGIN_ID, ScannerConfigProfileManager.SI_PROFILE_SIMPLE_ID); if (extension != null) { @@ -182,7 +182,7 @@ public final class ScannerConfigProfileManager { synchronized (fLock) { if (contextAwareProfileIds == null) { - contextAwareProfileIds = new ArrayList(); + contextAwareProfileIds = new ArrayList<>(); List all = getProfileIds(); for (int i = 0; i < all.size(); i++) { diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeEnvironmentBlock.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeEnvironmentBlock.java index 57b3d30cfc1..de4e28f8d14 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeEnvironmentBlock.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeEnvironmentBlock.java @@ -311,7 +311,7 @@ public class MakeEnvironmentBlock extends AbstractCOptionPage { // Convert the table's items into a Map so that this can be saved in the // configuration's attributes. TableItem[] items = environmentTable.getTable().getItems(); - Map map = new HashMap(items.length); + Map map = new HashMap<>(items.length); for (int i = 0; i < items.length; i++) { EnvironmentVariable var = (EnvironmentVariable) items[i].getData(); map.put(var.getName(), var.getValue()); @@ -607,7 +607,7 @@ public class MakeEnvironmentBlock extends AbstractCOptionPage { private Map getNativeEnvironment() { @SuppressWarnings({ "unchecked", "rawtypes" }) Map stringVars = (Hashtable) EnvironmentReader.getEnvVars(); - HashMap vars = new HashMap(); + HashMap vars = new HashMap<>(); for (Iterator i = stringVars.keySet().iterator(); i.hasNext();) { String key = i.next(); String value = stringVars.get(key); @@ -713,7 +713,7 @@ public class MakeEnvironmentBlock extends AbstractCOptionPage { } }; - TreeMap envVars = new TreeMap(comparator); + TreeMap envVars = new TreeMap<>(comparator); envVars.putAll((Map) inputElement); elements = new EnvironmentVariable[envVars.size()]; int index = 0; diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MultipleInputDialog.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MultipleInputDialog.java index 69a88e63bc2..7896414156e 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MultipleInputDialog.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MultipleInputDialog.java @@ -51,10 +51,10 @@ public class MultipleInputDialog extends Dialog { protected Composite panel; - protected List fieldList = new ArrayList(); - protected List controlList = new ArrayList(); - protected List validators = new ArrayList(); - protected Map valueMap = new HashMap(); + protected List fieldList = new ArrayList<>(); + protected List controlList = new ArrayList<>(); + protected List validators = new ArrayList<>(); + protected Map valueMap = new HashMap<>(); private String title; diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/FileTransferDropTargetListener.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/FileTransferDropTargetListener.java index 0f7e2105850..1958eebf6ea 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/FileTransferDropTargetListener.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/FileTransferDropTargetListener.java @@ -117,7 +117,7 @@ public class FileTransferDropTargetListener extends AbstractContainerAreaDropAda */ private static IMakeTarget[] prepareMakeTargetsFromFiles(String[] filenames, IContainer dropContainer, Shell shell) { - List makeTargetsList = new ArrayList(filenames.length); + List makeTargetsList = new ArrayList<>(filenames.length); int errorCount = 0; int nonFileCount = 0; diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/LocalTransferDropTargetListener.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/LocalTransferDropTargetListener.java index 97762064d71..12b5023d616 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/LocalTransferDropTargetListener.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/LocalTransferDropTargetListener.java @@ -206,7 +206,7 @@ public class LocalTransferDropTargetListener extends AbstractContainerAreaDropAd private static IMakeTarget[] prepareMakeTargetsFromSelection(IStructuredSelection selection, IContainer dropContainer) { List elements = selection.toList(); - List makeTargetsList = new ArrayList(elements.size()); + List makeTargetsList = new ArrayList<>(elements.size()); for (Object element : elements) { if (element instanceof IMakeTarget) { makeTargetsList.add((IMakeTarget) element); diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/MakeTargetDndUtil.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/MakeTargetDndUtil.java index a2102124d0c..135321b5871 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/MakeTargetDndUtil.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/MakeTargetDndUtil.java @@ -100,7 +100,7 @@ public class MakeTargetDndUtil { return false; } - List names = new ArrayList(selectedElements.size()); + List names = new ArrayList<>(selectedElements.size()); for (Object element : selectedElements) { if (!(element instanceof IMakeTarget)) { return false; diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/MakeTargetTransferData.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/MakeTargetTransferData.java index 688ef39c687..e78f0853b06 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/MakeTargetTransferData.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/MakeTargetTransferData.java @@ -127,7 +127,7 @@ public class MakeTargetTransferData { * */ public MakeTargetTransferData() { - makeTargetData = new ArrayList(); + makeTargetData = new ArrayList<>(); } /** @@ -175,7 +175,7 @@ public class MakeTargetTransferData { */ public IMakeTarget[] createMakeTargets(IProject project) { IMakeTargetManager makeTargetManager = MakeCorePlugin.getDefault().getTargetManager(); - ArrayList makeTargets = new ArrayList(makeTargetData.size()); + ArrayList makeTargets = new ArrayList<>(makeTargetData.size()); String[] ids = makeTargetManager.getTargetBuilders(project); String builderId = ids[0]; diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/TextTransferDropTargetListener.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/TextTransferDropTargetListener.java index 8487269cdfe..2da17066acf 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/TextTransferDropTargetListener.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/TextTransferDropTargetListener.java @@ -113,7 +113,7 @@ public class TextTransferDropTargetListener extends AbstractContainerAreaDropAda private static IMakeTarget[] prepareMakeTargetsFromString(String multilineText, IContainer container) { if (container != null) { String[] lines = multilineText.split("[\n\r]"); //$NON-NLS-1$ - List makeTargets = new ArrayList(lines.length); + List makeTargets = new ArrayList<>(lines.length); for (String command : lines) { command = command.trim(); if (command.length() > 0) { diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/AddBuildTargetAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/AddBuildTargetAction.java index 34a9817b91a..b81084ddd90 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/AddBuildTargetAction.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/AddBuildTargetAction.java @@ -142,7 +142,7 @@ public class AddBuildTargetAction extends Action { if (!sel.isEmpty() && sel instanceof IStructuredSelection) { List list = ((IStructuredSelection) sel).toList(); if (list.size() > 0) { - List targets = new ArrayList(list.size()); + List targets = new ArrayList<>(list.size()); Object[] elements = list.toArray(); for (Object element : elements) { if (element instanceof ITargetRule) { diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileContentOutlinePage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileContentOutlinePage.java index c5ed626f86a..b3167933b9a 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileContentOutlinePage.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileContentOutlinePage.java @@ -120,7 +120,7 @@ public class MakefileContentOutlinePage extends ContentOutlinePage { } else { directives = new IDirective[0]; } - List list = new ArrayList(directives.length); + List list = new ArrayList<>(directives.length); for (IDirective directive : directives) { if (showMacroDefinition && directive instanceof IMacroDefinition) { list.add(directive); diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileToggleCommentAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileToggleCommentAction.java index eb31a60c991..0e4ff8ac41f 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileToggleCommentAction.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileToggleCommentAction.java @@ -335,7 +335,7 @@ public final class MakefileToggleCommentAction extends TextEditorAction { fPrefixesMap = null; String[] types = configuration.getConfiguredContentTypes(sourceViewer); - Map prefixesMap = new HashMap(types.length); + Map prefixesMap = new HashMap<>(types.length); for (String type : types) { String[] prefixes = configuration.getDefaultPrefixes(sourceViewer, type); if (prefixes != null && prefixes.length > 0) { diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/NotifyingReconciler.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/NotifyingReconciler.java index a3e47b2d40a..a6d2290d2fb 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/NotifyingReconciler.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/NotifyingReconciler.java @@ -24,7 +24,7 @@ import org.eclipse.jface.text.reconciler.MonoReconciler; * NotifyingReconciler */ public class NotifyingReconciler extends MonoReconciler { - private ArrayList fReconcilingParticipants = new ArrayList(); + private ArrayList fReconcilingParticipants = new ArrayList<>(); /** * Constructor for NotifyingReconciler. diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/OpenIncludeAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/OpenIncludeAction.java index 47767995b11..a6e8d9947c1 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/OpenIncludeAction.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/OpenIncludeAction.java @@ -106,7 +106,7 @@ public class OpenIncludeAction extends Action { @SuppressWarnings("unchecked") List list = ((IStructuredSelection) sel).toList(); if (list.size() > 0) { - List includes = new ArrayList(list.size()); + List includes = new ArrayList<>(list.size()); for (Object element : list) { if (element instanceof IInclude) { includes.add((IInclude) element); diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/ProjectionMakefileUpdater.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/ProjectionMakefileUpdater.java index ee1cb015f65..a5ebc6dcd56 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/ProjectionMakefileUpdater.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/ProjectionMakefileUpdater.java @@ -169,7 +169,7 @@ public class ProjectionMakefileUpdater implements IProjectionListener { } private Map computeAdditions(IParent parent) { - Map map = new HashMap(); + Map map = new HashMap<>(); computeAdditions(parent.getDirectives(), map); return map; } @@ -242,9 +242,9 @@ public class ProjectionMakefileUpdater implements IProjectionListener { fCachedDocument = provider.getDocument(fEditor.getEditorInput()); fAllowCollapsing = false; - Map additions = new HashMap(); - List deletions = new ArrayList(); - List updates = new ArrayList(); + Map additions = new HashMap<>(); + List deletions = new ArrayList<>(); + List updates = new ArrayList<>(); Map updated = computeAdditions((IParent) fInput); Map> previous = createAnnotationMap(model); @@ -306,8 +306,8 @@ public class ProjectionMakefileUpdater implements IProjectionListener { return; } - List newDeletions = new ArrayList(); - List newChanges = new ArrayList(); + List newDeletions = new ArrayList<>(); + List newChanges = new ArrayList<>(); Iterator deletionIterator = deletions.iterator(); outer: while (deletionIterator.hasNext()) { @@ -369,7 +369,7 @@ public class ProjectionMakefileUpdater implements IProjectionListener { } private Map> createAnnotationMap(IAnnotationModel model) { - Map> map = new HashMap>(); + Map> map = new HashMap<>(); Iterator e = model.getAnnotationIterator(); while (e.hasNext()) { Object annotation = e.next(); @@ -377,7 +377,7 @@ public class ProjectionMakefileUpdater implements IProjectionListener { MakefileProjectionAnnotation directive = (MakefileProjectionAnnotation) annotation; List list = map.get(directive.getElement()); if (list == null) { - list = new ArrayList(2); + list = new ArrayList<>(2); map.put(directive.getElement(), list); } list.add(directive); diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/WorkingCopyManager.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/WorkingCopyManager.java index 83384845796..5ba6e8cf727 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/WorkingCopyManager.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/WorkingCopyManager.java @@ -80,7 +80,7 @@ public class WorkingCopyManager implements IWorkingCopyManager, IWorkingCopyMana public void setWorkingCopy(IEditorInput input, IMakefile workingCopy) { if (fDocumentProvider.getDocument(input) != null) { if (fMap == null) { - fMap = new HashMap(); + fMap = new HashMap<>(); } fMap.put(input, workingCopy); } diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/AbstractMakefileEditorPreferencePage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/AbstractMakefileEditorPreferencePage.java index 0ead6eafacc..9dfe6de71aa 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/AbstractMakefileEditorPreferencePage.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/AbstractMakefileEditorPreferencePage.java @@ -50,7 +50,7 @@ import com.ibm.icu.text.MessageFormat; public abstract class AbstractMakefileEditorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { OverlayPreferenceStore fOverlayStore; - Map fCheckBoxes = new HashMap(); + Map fCheckBoxes = new HashMap<>(); private SelectionListener fCheckBoxListener = new SelectionListener() { @Override public void widgetDefaultSelected(SelectionEvent e) { @@ -63,7 +63,7 @@ public abstract class AbstractMakefileEditorPreferencePage extends PreferencePag } }; - Map fTextFields = new HashMap(); + Map fTextFields = new HashMap<>(); private ModifyListener fTextFieldListener = new ModifyListener() { @Override public void modifyText(ModifyEvent e) { @@ -72,7 +72,7 @@ public abstract class AbstractMakefileEditorPreferencePage extends PreferencePag } }; - private Map fNumberFields = new HashMap(); + private Map fNumberFields = new HashMap<>(); private ModifyListener fNumberFieldListener = new ModifyListener() { @Override public void modifyText(ModifyEvent e) { diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/MakefileEditorPreferencePage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/MakefileEditorPreferencePage.java index 1e25cdded39..4a353c19cfb 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/MakefileEditorPreferencePage.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/MakefileEditorPreferencePage.java @@ -60,7 +60,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen private String[][] fSyntaxColorListModel; private TableViewer fHighlightingColorListViewer; - private final List fHighlightingColorList = new ArrayList(7); + private final List fHighlightingColorList = new ArrayList<>(7); Button fAppearanceColorDefault; ColorSelector fSyntaxForegroundColorEditor; @@ -208,7 +208,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen ColorManager.MAKE_MATCHING_BRACKETS_COLOR, null }, { MakefilePreferencesMessages.getString("MakefileEditorPreferencePage.makefile_editor_default"), //$NON-NLS-1$ ColorManager.MAKE_DEFAULT_COLOR, null }, }; - ArrayList overlayKeys = new ArrayList(); + ArrayList overlayKeys = new ArrayList<>(); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, MakefileEditorPreferenceConstants.EDITOR_FOLDING_ENABLED)); diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/scannerconfig/DiscoveredElement.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/scannerconfig/DiscoveredElement.java index 569e93d5657..139c8553802 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/scannerconfig/DiscoveredElement.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/scannerconfig/DiscoveredElement.java @@ -43,7 +43,7 @@ public class DiscoveredElement { private String fEntry; private int fEntryKind; private boolean fRemoved; - private ArrayList fChildren = new ArrayList(); + private ArrayList fChildren = new ArrayList<>(); private DiscoveredElement fParent; public DiscoveredElement(IProject project, String entry, int kind, boolean removed, boolean system) { @@ -196,7 +196,7 @@ public class DiscoveredElement { } public void setChildren(DiscoveredElement[] children) { - fChildren = new ArrayList(Arrays.asList(children)); + fChildren = new ArrayList<>(Arrays.asList(children)); } public boolean delete() { diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/ColorManager.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/ColorManager.java index 01053c3d9a6..a69e2ca3dba 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/ColorManager.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/ColorManager.java @@ -51,7 +51,7 @@ public class ColorManager implements ISharedTextColors { return fgColorManager; } - protected Map fColorTable = new HashMap(10); + protected Map fColorTable = new HashMap<>(10); @Override public void dispose() { diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/AbstractMakefileCodeScanner.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/AbstractMakefileCodeScanner.java index edd321f929d..f5af2612723 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/AbstractMakefileCodeScanner.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/AbstractMakefileCodeScanner.java @@ -37,7 +37,7 @@ import org.eclipse.swt.graphics.RGB; */ public abstract class AbstractMakefileCodeScanner extends RuleBasedScanner { - private Map fTokenMap = new HashMap(); + private Map fTokenMap = new HashMap<>(); private String[] fPropertyNamesColor; /** * Preference keys for boolean preferences which are true, diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCodeScanner.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCodeScanner.java index 8bbc6ad5261..c69446ef902 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCodeScanner.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCodeScanner.java @@ -89,7 +89,7 @@ public class MakefileCodeScanner extends AbstractMakefileCodeScanner { IToken macroDefToken = getToken(ColorManager.MAKE_MACRO_DEF_COLOR); IToken defaultToken = getToken(ColorManager.MAKE_DEFAULT_COLOR); - List rules = new ArrayList(); + List rules = new ArrayList<>(); // Add generic whitespace rule. rules.add(new WhitespaceRule(new IWhitespaceDetector() { diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCompletionProcessor.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCompletionProcessor.java index d171ca1967d..893142798d6 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCompletionProcessor.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCompletionProcessor.java @@ -107,7 +107,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor { @Override public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) { - List proposalList = new ArrayList(); + List proposalList = new ArrayList<>(); IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput()); WordPartDetector wordPart = new WordPartDetector(viewer.getDocument(), documentOffset); if (wordPart.isMacro()) { @@ -139,7 +139,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor { private ArrayList createCompletionProposals(WordPartDetector wordPart, IAutomaticVariable[] autoVars) { - ArrayList proposalList = new ArrayList(autoVars.length); + ArrayList proposalList = new ArrayList<>(autoVars.length); String wordPartName = wordPart.getName(); BracketHandler bracket = new BracketHandler(wordPartName); String partialName = bracket.followingText; @@ -165,7 +165,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor { private ArrayList createCompletionProposals(WordPartDetector wordPart, IMacroDefinition[] macros) { - ArrayList proposalList = new ArrayList(macros.length); + ArrayList proposalList = new ArrayList<>(macros.length); String wordPartName = wordPart.getName(); BracketHandler bracket = new BracketHandler(wordPartName); @@ -192,7 +192,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor { private ArrayList createCompletionProposals(WordPartDetector wordPart, IBuiltinFunction[] builtinFuns) { - ArrayList proposalList = new ArrayList(builtinFuns.length); + ArrayList proposalList = new ArrayList<>(builtinFuns.length); String wordPartName = wordPart.getName(); BracketHandler bracket = new BracketHandler(wordPartName); @@ -219,7 +219,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor { } private ArrayList createCompletionProposals(WordPartDetector wordPart, ITargetRule[] targets) { - ArrayList proposalList = new ArrayList(targets.length); + ArrayList proposalList = new ArrayList<>(targets.length); String partialName = wordPart.getName(); for (ITargetRule target : targets) { @@ -238,8 +238,8 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor { public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) { WordPartDetector wordPart = new WordPartDetector(viewer.getDocument(), documentOffset); IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput()); - ArrayList contextList = new ArrayList(); - ArrayList contextInformationList = new ArrayList(); + ArrayList contextList = new ArrayList<>(); + ArrayList contextInformationList = new ArrayList<>(); if (wordPart.isMacro()) { IDirective[] statements = makefile.getMacroDefinitions(); for (IDirective statement : statements) { diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefilePartitionScanner.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefilePartitionScanner.java index d6b0abc0ad8..b2ae0fcc46d 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefilePartitionScanner.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefilePartitionScanner.java @@ -43,7 +43,7 @@ public class MakefilePartitionScanner extends RuleBasedPartitionScanner { IToken tComment = new Token(MAKEFILE_COMMENT_PARTITION); - List rules = new ArrayList(); + List rules = new ArrayList<>(); // Add rule for single line comments. diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java index 8f954e3c235..298cfaecdd4 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java @@ -95,7 +95,7 @@ public class MakeContentProvider implements ITreeContentProvider, IMakeTargetLis } } else if (obj instanceof IContainer) { IContainer container = (IContainer) obj; - ArrayList children = new ArrayList(); + ArrayList children = new ArrayList<>(); boolean isAddingSourceRoots = !bFlatten && (container instanceof IProject) && CCorePlugin.showSourceRootsAtTopOfProject(); @@ -135,7 +135,7 @@ public class MakeContentProvider implements ITreeContentProvider, IMakeTargetLis return children.toArray(); } else if (obj instanceof TargetSourceContainer) { - ArrayList children = new ArrayList(); + ArrayList children = new ArrayList<>(); try { IContainer container = ((TargetSourceContainer) obj).getContainer(); IResource[] resources = container.members(); @@ -177,7 +177,7 @@ public class MakeContentProvider implements ITreeContentProvider, IMakeTargetLis @Override public Object[] getElements(Object obj) { if (bFlatten) { - List list = new ArrayList(); + List list = new ArrayList<>(); Object[] children = getChildren(obj); for (int i = 0; i < children.length; i++) { list.add(children[i]); @@ -313,7 +313,7 @@ public class MakeContentProvider implements ITreeContentProvider, IMakeTargetLis return; } - Set affectedProjects = new HashSet(); + Set affectedProjects = new HashSet<>(); for (IMakeTarget target : event.getTargets()) { IContainer container = target.getContainer(); affectedProjects.add(container.getProject()); @@ -355,7 +355,7 @@ public class MakeContentProvider implements ITreeContentProvider, IMakeTargetLis return; } - Set affectedProjects = new HashSet(); + Set affectedProjects = new HashSet<>(); collectAffectedProjects(delta, affectedProjects); // If the view is being filtered or source roots shown, diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/TargetBuild.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/TargetBuild.java index 4540834039d..fe35f2b5082 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/TargetBuild.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/TargetBuild.java @@ -62,7 +62,7 @@ public class TargetBuild { if (!BuildAction.isSaveAllSet()) return; - List projects = new ArrayList(); + List projects = new ArrayList<>(); for (int i = 0; i < targets.length; ++i) { IMakeTarget target = targets[i]; projects.add(target.getProject()); diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/UpdateMakeProjectAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/UpdateMakeProjectAction.java index 94ab6051cb3..82a137a7c09 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/UpdateMakeProjectAction.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/UpdateMakeProjectAction.java @@ -72,7 +72,7 @@ public class UpdateMakeProjectAction implements IWorkbenchWindowActionDelegate { public void run(IAction action) { if (fSelection instanceof IStructuredSelection) { Object[] elems = ((IStructuredSelection) fSelection).toArray(); - ArrayList projects = new ArrayList(elems.length); + ArrayList projects = new ArrayList<>(elems.length); for (int i = 0; i < elems.length; i++) { Object elem = elems[i]; @@ -102,7 +102,7 @@ public class UpdateMakeProjectAction implements IWorkbenchWindowActionDelegate { public static IProject[] getOldProjects() { IProject[] project = MakeUIPlugin.getWorkspace().getRoot().getProjects(); - Vector result = new Vector(); + Vector result = new Vector<>(); try { for (int i = 0; i < project.length; i++) { if (isOldProject(project[i])) { diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/AbstractDiscoveryOptionsBlock.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/AbstractDiscoveryOptionsBlock.java index 43c00710e99..bca65db73d3 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/AbstractDiscoveryOptionsBlock.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/AbstractDiscoveryOptionsBlock.java @@ -178,7 +178,7 @@ public abstract class AbstractDiscoveryOptionsBlock extends AbstractCOptionPage * */ private void initializeProfilePageMap() { - fProfilePageMap = new HashMap(5); + fProfilePageMap = new HashMap<>(5); IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(MakeUIPlugin.getPluginId(), "DiscoveryProfilePage"); //$NON-NLS-1$ @@ -349,7 +349,7 @@ public abstract class AbstractDiscoveryOptionsBlock extends AbstractCOptionPage } protected List getDiscoveryProfileIdList() { - return new ArrayList(fProfilePageMap.keySet()); + return new ArrayList<>(fProfilePageMap.keySet()); } protected abstract String getCurrentProfileId(); diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveredPathContainerPage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveredPathContainerPage.java index 324cadd2c1f..08acbbe32e2 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveredPathContainerPage.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveredPathContainerPage.java @@ -146,7 +146,7 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr DiscoveredContainerAdapter adapter = new DiscoveredContainerAdapter(); - fDiscoveredContainerList = new TreeListDialogField(adapter, buttonLabels, + fDiscoveredContainerList = new TreeListDialogField<>(adapter, buttonLabels, new DiscoveredElementLabelProvider()); fDiscoveredContainerList.setDialogFieldListener(adapter); fDiscoveredContainerList.setLabelText(MakeUIPlugin.getResourceString(CONTAINER_LIST_LABEL)); @@ -154,7 +154,7 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr fDiscoveredContainerList.setTreeExpansionLevel(2); fDiscoveredContainerList.setViewerSorter(new DiscoveredElementSorter()); dirty = false; - deletedEntries = new ArrayList(); + deletedEntries = new ArrayList<>(); } /* (non-Javadoc) @@ -220,8 +220,8 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr if (info instanceof IPerProjectDiscoveredPathInfo) { IPerProjectDiscoveredPathInfo projectPathInfo = (IPerProjectDiscoveredPathInfo) info; - LinkedHashMap includes = new LinkedHashMap(); - LinkedHashMap symbols = new LinkedHashMap(); + LinkedHashMap includes = new LinkedHashMap<>(); + LinkedHashMap symbols = new LinkedHashMap<>(); DiscoveredElement container = (DiscoveredElement) fDiscoveredContainerList.getElement(0); if (container != null && container.getEntryKind() == DiscoveredElement.CONTAINER) { @@ -264,7 +264,7 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr try { // update scanner configuration - List resourceDelta = new ArrayList(1); + List resourceDelta = new ArrayList<>(1); resourceDelta.add(fCProject.getProject()); MakeCorePlugin.getDefault().getDiscoveryManager().updateDiscoveredInfo(info, resourceDelta); return true; @@ -294,7 +294,7 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr } if (fPathEntry != null) { DiscoveredElement element = populateDiscoveredElements(fPathEntry); - ArrayList elements = new ArrayList(); + ArrayList elements = new ArrayList<>(); elements.add(element); fDiscoveredContainerList.addElements(elements); } @@ -606,7 +606,7 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr private boolean moveDown() { boolean rc = false; List selElements = fDiscoveredContainerList.getSelectedElements(); - List revSelElements = new ArrayList(selElements); + List revSelElements = new ArrayList<>(selElements); Collections.reverse(revSelElements); for (Iterator i = revSelElements.iterator(); i.hasNext();) { DiscoveredElement elem = (DiscoveredElement) i.next(); @@ -649,7 +649,7 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr private boolean deleteEntry() { boolean rc = false; - List newSelection = new ArrayList(); + List newSelection = new ArrayList<>(); List selElements = fDiscoveredContainerList.getSelectedElements(); boolean skipIncludes = false, skipSymbols = false; for (int i = 0; i < selElements.size(); ++i) { diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveryOptionsBlock.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveryOptionsBlock.java index 0731352f96a..3a806deba13 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveryOptionsBlock.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveryOptionsBlock.java @@ -331,7 +331,7 @@ public class DiscoveryOptionsBlock extends AbstractDiscoveryOptionsBlock { ICProject cProject = CoreModel.getDefault().create(project); if (cProject != null) { IPathEntry[] entries = cProject.getRawPathEntries(); - List newEntries = new ArrayList(Arrays.asList(entries)); + List newEntries = new ArrayList<>(Arrays.asList(entries)); if (!newEntries.contains(container)) { newEntries.add(container); cProject.setRawPathEntries(newEntries.toArray(new IPathEntry[newEntries.size()]), monitor); @@ -345,7 +345,7 @@ public class DiscoveryOptionsBlock extends AbstractDiscoveryOptionsBlock { String profileId = getBuildInfo().getSelectedProfileId(); ScannerConfigScope profileScope = ScannerConfigProfileManager.getInstance().getSCProfileConfiguration(profileId) .getProfileScope(); - List changedResources = new ArrayList(); + List changedResources = new ArrayList<>(); // changedResources.add(project.getFullPath()); changedResources.add(project); MakeCorePlugin.getDefault().getDiscoveryManager().changeDiscoveredContainer(project, profileScope, diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/AbstractBuilderTest.java b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/AbstractBuilderTest.java index 72c1cdda6f5..bc5a5db06c3 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/AbstractBuilderTest.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/AbstractBuilderTest.java @@ -213,7 +213,7 @@ public abstract class AbstractBuilderTest extends TestCase { boolean externalBuilder) throws CoreException { IProject project = getWorkspace().getRoot().getProject(projectName); IFolder buildDir = project.getFolder(cfgName); - Collection resources = new LinkedHashSet(); + Collection resources = new LinkedHashSet<>(); resources.add(buildDir); if (externalBuilder) { resources.add(buildDir.getFile("makefile")); @@ -250,7 +250,7 @@ public abstract class AbstractBuilderTest extends TestCase { protected void setWorkspace(String name) { workspace = name; - projects = new ArrayList(); + projects = new ArrayList<>(); } protected IProject loadProject(String name) throws CoreException { @@ -263,7 +263,7 @@ public abstract class AbstractBuilderTest extends TestCase { } private List getAllMarkers() throws CoreException { - List markers = new ArrayList(); + List markers = new ArrayList<>(); for (IProject project : projects) markers.addAll(Arrays .asList(project.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE))); diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/BuildSystemTestHelper.java b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/BuildSystemTestHelper.java index 80c2254a1f5..55ff766b2da 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/BuildSystemTestHelper.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/BuildSystemTestHelper.java @@ -125,8 +125,8 @@ public class BuildSystemTestHelper { } static public void checkDiff(Object[] expected, Object[] actual) { - LinkedHashSet set1 = new LinkedHashSet(Arrays.asList(expected)); - LinkedHashSet set2 = new LinkedHashSet(Arrays.asList(actual)); + LinkedHashSet set1 = new LinkedHashSet<>(Arrays.asList(expected)); + LinkedHashSet set2 = new LinkedHashSet<>(Arrays.asList(actual)); LinkedHashSet set1Copy = new LinkedHashSet(set1); set1.removeAll(set2); set2.removeAll(set1Copy); diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/ManagedBuildTestHelper.java b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/ManagedBuildTestHelper.java index 663709246fd..58f3faecc86 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/ManagedBuildTestHelper.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/ManagedBuildTestHelper.java @@ -516,9 +516,9 @@ public class ManagedBuildTestHelper { ArrayList testArray = mergeContinuationLines(getContents(testFile)); ArrayList benchmarkArray = mergeContinuationLines(getContents(benchmarkFile)); - Set testNotMatchingLines = new TreeSet(); - Set benchNotMatchingLines = new TreeSet(); - Set extraLines = new TreeSet(); + Set testNotMatchingLines = new TreeSet<>(); + Set benchNotMatchingLines = new TreeSet<>(); + Set extraLines = new TreeSet<>(); for (int i = 0; i < benchmarkArray.size() || i < testArray.size(); i++) { if (!(i < benchmarkArray.size())) { System.err.println(testFile.lastSegment() + ": extra line =[" + testArray.get(i) @@ -540,9 +540,9 @@ public class ManagedBuildTestHelper { if (testLine.startsWith(" -$(RM) ")) { // accommodate to arbitrary order of 'rm' parameters final String DELIMITERS = "[ $]"; - String[] testMacros = new TreeSet(Arrays.asList(testLine.split(DELIMITERS))) + String[] testMacros = new TreeSet<>(Arrays.asList(testLine.split(DELIMITERS))) .toArray(new String[0]); - String[] benchMacros = new TreeSet(Arrays.asList(benchmarkLine.split(DELIMITERS))) + String[] benchMacros = new TreeSet<>(Arrays.asList(benchmarkLine.split(DELIMITERS))) .toArray(new String[0]); if (testMacros.length != benchMacros.length) { return false; @@ -697,7 +697,7 @@ public class ManagedBuildTestHelper { } private static ArrayList getContents(IPath fullPath) { - ArrayList lines = new ArrayList(); + ArrayList lines = new ArrayList<>(); try { BufferedReader in = new BufferedReader(new FileReader(fullPath.toFile())); String line; @@ -1082,7 +1082,7 @@ public class ManagedBuildTestHelper { } public static ITool[] getRcbsTools(IResourceConfiguration rcConfig) { - List list = new ArrayList(); + List list = new ArrayList<>(); ITool tools[] = rcConfig.getTools(); for (int i = 0; i < tools.length; i++) { ITool tool = tools[i]; diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/ResourceDeltaVerifier.java b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/ResourceDeltaVerifier.java index aaf764f598b..bd3d60f6ef5 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/ResourceDeltaVerifier.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/ResourceDeltaVerifier.java @@ -112,7 +112,7 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList /** * Table of IPath -> ExpectedChange */ - private Hashtable fExpectedChanges = new Hashtable(); + private Hashtable fExpectedChanges = new Hashtable<>(); boolean fIsDeltaValid = true; private StringBuilder fMessage = new StringBuilder(); /** @@ -133,7 +133,7 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList private static final int VERIFICATION_COMPLETE = 2; private int fState = RECEIVING_INPUTS; - private Set fIgnoreResources = new HashSet(); + private Set fIgnoreResources = new HashSet<>(); /** * @see #addExpectedChange @@ -263,7 +263,7 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList IResourceDelta[] removedChildren = delta.getAffectedChildren(IResourceDelta.REMOVED, IContainer.INCLUDE_TEAM_PRIVATE_MEMBERS | IContainer.INCLUDE_HIDDEN); - Hashtable h = new Hashtable(affectedChildren.length + 1); + Hashtable h = new Hashtable<>(affectedChildren.length + 1); for (int i = 0; i < addedChildren.length; ++i) { IResourceDelta childDelta1 = addedChildren[i]; @@ -467,7 +467,7 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList * are met after iterating over a resource delta. */ private void finishVerification() { - Hashtable resourcePaths = new Hashtable(); + Hashtable resourcePaths = new Hashtable<>(); Enumeration keys = fExpectedChanges.keys(); while (keys.hasMoreElements()) { diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/tests/suite/Preconditions.java b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/tests/suite/Preconditions.java index 5854f0ae7e7..7e92e4129d1 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/tests/suite/Preconditions.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/tests/suite/Preconditions.java @@ -49,7 +49,7 @@ public class Preconditions extends TestCase { * changed when the tests are run. */ public void testContentTypes() { - Set fileExts = new TreeSet(); + Set fileExts = new TreeSet<>(); IContentTypeManager manager = Platform.getContentTypeManager(); IContentType contentTypeCpp = manager.getContentType(CCorePlugin.CONTENT_TYPE_CXXSOURCE); @@ -58,7 +58,7 @@ public class Preconditions extends TestCase { IContentType contentTypeC = manager.getContentType(CCorePlugin.CONTENT_TYPE_CSOURCE); fileExts.addAll(Arrays.asList(contentTypeC.getFileSpecs(IContentType.FILE_EXTENSION_SPEC))); - Set expectedExts = new TreeSet( + Set expectedExts = new TreeSet<>( Arrays.asList(new String[] { "C", "c", "c++", "cc", "cpp", "cxx" })); assertEquals("Precodition FAILED - Content Types do not match expected defaults.", expectedExts.toString(), fileExts.toString()); diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/regressions/Bug_303953.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/regressions/Bug_303953.java index 10ae1420883..d032b63ecdd 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/regressions/Bug_303953.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/regressions/Bug_303953.java @@ -38,7 +38,7 @@ public class Bug_303953 extends AbstractBuilderTest { setWorkspace("regressions"); final IProject app = loadProject("helloworldC"); - List buildOutputResources = new ArrayList(); + List buildOutputResources = new ArrayList<>(); buildOutputResources.addAll(getProjectBuildExeResources("helloworldC", "Debug", "src/helloworldC")); // Ensure Debug is the active configuration diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildDescriptionModelTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildDescriptionModelTests.java index 477fe72da38..5cd67e38e39 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildDescriptionModelTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildDescriptionModelTests.java @@ -75,7 +75,7 @@ public class BuildDescriptionModelTests extends TestCase { private Runnable fCleaner = fCompositeCleaner; private class CompositeCleaner implements Runnable { - private List fRunnables = new ArrayList(); + private List fRunnables = new ArrayList<>(); public void addRunnable(Runnable r) { fRunnables.add(r); @@ -93,7 +93,7 @@ public class BuildDescriptionModelTests extends TestCase { } private class ProjectCleaner implements Runnable { - List fProjList = new ArrayList(); + List fProjList = new ArrayList<>(); public ProjectCleaner(IProject project) { addProject(project); @@ -576,8 +576,8 @@ public class BuildDescriptionModelTests extends TestCase { } */ private void doTestStep(IBuildStep step, IBuildStep oStep, boolean up) { - Map inMap = new HashMap(); - Map outMap = new HashMap(); + Map inMap = new HashMap<>(); + Map outMap = new HashMap<>(); stepsMatch(step, oStep, inMap, outMap, true); @@ -589,7 +589,7 @@ public class BuildDescriptionModelTests extends TestCase { } private void doTestType(IBuildIOType type, IBuildIOType oType) { - Map map = new HashMap(); + Map map = new HashMap<>(); typesMatch(type, oType, map, true); @@ -599,7 +599,7 @@ public class BuildDescriptionModelTests extends TestCase { } private void doTestResource(IBuildResource rc, IBuildResource oRc, boolean up) { - Map outMap = new HashMap(); + Map outMap = new HashMap<>(); doTestResourceMatch(rc, oRc, outMap); @@ -607,7 +607,7 @@ public class BuildDescriptionModelTests extends TestCase { typesMatch(rc.getProducerIOType(), oRc.getProducerIOType(), null, true); doTestStep(rc.getProducerIOType().getStep(), oRc.getProducerIOType().getStep(), up); } else { - Set stepSet = new HashSet(); + Set stepSet = new HashSet<>(); for (Entry entry : outMap.entrySet()) { IBuildIOType type = entry.getKey(); @@ -785,8 +785,8 @@ public class BuildDescriptionModelTests extends TestCase { return false; if (resourcesMatch(rcs, oRcs, rcMap)) { - Map inMap = new HashMap(); - Map outMap = new HashMap(); + Map inMap = new HashMap<>(); + Map outMap = new HashMap<>(); if (!checkStep) return true; return stepsMatch(type.getStep(), oType.getStep(), inMap, outMap, false, failOnError); diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildSystem40Tests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildSystem40Tests.java index 094e294abee..ce593337ddd 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildSystem40Tests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildSystem40Tests.java @@ -120,7 +120,7 @@ public class BuildSystem40Tests extends TestCase { assertTrue(Arrays.equals(modifiedValue, value)); { - List list = new ArrayList(); + List list = new ArrayList<>(); list.addAll(Arrays.asList(entries)); list.add(new CIncludePathEntry(platformDependentPath("dbg 3", "E:\\tmp\\w"), 0)); entries = list.toArray(new ICLanguageSettingEntry[0]); @@ -131,7 +131,7 @@ public class BuildSystem40Tests extends TestCase { } { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); list.addAll(Arrays.asList(value)); list.add(new OptionStringValue("\"E:\\tmp\\w\"")); value = list.toArray(new OptionStringValue[0]); @@ -185,7 +185,7 @@ public class BuildSystem40Tests extends TestCase { BuildSystemTestHelper.checkDiff(expectedEntries, entries); { - ArrayList list = new ArrayList(Arrays.asList(entries)); + ArrayList list = new ArrayList<>(Arrays.asList(entries)); list.remove(6); //new CIncludePathEntry("/d1_abs/path", 0), expectedEntries = list.toArray(new ICLanguageSettingEntry[0]); ls.setSettingEntries(ICLanguageSettingEntry.INCLUDE_PATH, list); @@ -219,7 +219,7 @@ public class BuildSystem40Tests extends TestCase { option = tool.getOptionsOfType(IOption.INCLUDE_PATH)[0]; { - ArrayList list = new ArrayList( + ArrayList list = new ArrayList<>( Arrays.asList(option.getBasicStringListValueElements())); assertTrue(list.remove(new OptionStringValue("${IncludeDefaults}"))); list.add(0, new OptionStringValue("${IncludeDefaults}")); @@ -253,7 +253,7 @@ public class BuildSystem40Tests extends TestCase { BuildSystemTestHelper.checkDiff(expectedEntries, entries); { - ArrayList list = new ArrayList( + ArrayList list = new ArrayList<>( Arrays.asList(option.getBasicStringListValueElements())); assertTrue(list.remove(new OptionStringValue("${IncludeDefaults}"))); list.add(list.size(), new OptionStringValue("${IncludeDefaults}")); @@ -335,7 +335,7 @@ public class BuildSystem40Tests extends TestCase { BuildSystemTestHelper.checkDiff(expectedValue, value); BuildSystemTestHelper.checkDiff(expectedEntries, entries); - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); list.addAll(Arrays.asList(entries)); list.add(new CIncludePathEntry("/test/another/abs", 0)); expectedEntries = list.toArray(new ICLanguageSettingEntry[0]); @@ -376,7 +376,7 @@ public class BuildSystem40Tests extends TestCase { BuildSystemTestHelper.checkDiff(expectedValue, value); BuildSystemTestHelper.checkDiff(expectedEntries, entries); - list = new ArrayList(); + list = new ArrayList<>(); list.addAll(Arrays.asList(entries)); list.add(new CIncludePathEntry("/another/abs", 0)); @@ -479,7 +479,7 @@ public class BuildSystem40Tests extends TestCase { } }); - projectList = new ArrayList(projectZips.length); + projectList = new ArrayList<>(projectZips.length); for (int i = 0; i < projectZips.length; i++) { try { String projectName = projectZips[i].getName(); @@ -505,7 +505,7 @@ public class BuildSystem40Tests extends TestCase { try { IProject project = ManagedBuildTestHelper.createProject(projName, null, location, projectTypeId); if (project != null) - projectList = new ArrayList(1); + projectList = new ArrayList<>(1); projectList.add(project); } catch (Exception e) { } diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/DefaultFortranDependencyCalculator.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/DefaultFortranDependencyCalculator.java index dc722ec5c0d..94a925eede3 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/DefaultFortranDependencyCalculator.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/DefaultFortranDependencyCalculator.java @@ -47,7 +47,7 @@ public class DefaultFortranDependencyCalculator implements IManagedDependencyGen * Return a list of the names of all modules used by a file */ private String[] findUsedModuleNames(File file) { - ArrayList names = new ArrayList(); + ArrayList names = new ArrayList<>(); InputStream in = null; try { in = new BufferedInputStream(new FileInputStream(file)); @@ -88,7 +88,7 @@ public class DefaultFortranDependencyCalculator implements IManagedDependencyGen * Return a list of the names of all modules defined in a file */ private String[] findModuleNames(File file) { - ArrayList names = new ArrayList(); + ArrayList names = new ArrayList<>(); InputStream in = null; try { in = new BufferedInputStream(new FileInputStream(file)); @@ -148,7 +148,7 @@ public class DefaultFortranDependencyCalculator implements IManagedDependencyGen */ private IResource[] FindModulesInResources(IProject project, ITool tool, IResource resource, IResource[] resourcesToSearch, String topBuildDir, String[] usedNames) { - ArrayList modRes = new ArrayList(); + ArrayList modRes = new ArrayList<>(); for (int ir = 0; ir < resourcesToSearch.length; ir++) { if (resourcesToSearch[ir].equals(resource)) continue; @@ -199,7 +199,7 @@ public class DefaultFortranDependencyCalculator implements IManagedDependencyGen */ @Override public IResource[] findDependencies(IResource resource, IProject project) { - ArrayList dependencies = new ArrayList(); + ArrayList dependencies = new ArrayList<>(); // TODO: This method should be passed the ITool and the relative path of the top build directory // For now we'll figure this out from the project. @@ -268,7 +268,7 @@ public class DefaultFortranDependencyCalculator implements IManagedDependencyGen @Override public IPath[] getOutputNames(ITool tool, IPath[] primaryInputNames) { // TODO: This method should be passed the relative path of the top build directory? - ArrayList outs = new ArrayList(); + ArrayList outs = new ArrayList<>(); if (primaryInputNames.length > 0) { // Get the names of modules created by this source file String[] modules = findModuleNames(primaryInputNames[0].toFile()); diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildCoreTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildCoreTests.java index 5c88395fcb6..1bd037fb571 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildCoreTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildCoreTests.java @@ -141,7 +141,7 @@ public class ManagedBuildCoreTests extends TestCase { // ITargetPlatform platform = toolChain.getTargetPlatform(); - List expectedOSListarr = new ArrayList(); + List expectedOSListarr = new ArrayList<>(); String[] expectedOSListTokens = expectedOSList.split(","); //$NON-NLS-1$ for (i = 0; i < expectedOSListTokens.length; ++i) { expectedOSListarr.add(expectedOSListTokens[i].trim()); @@ -208,7 +208,7 @@ public class ManagedBuildCoreTests extends TestCase { assertEquals(optionDefaultValue, expectedOptionIdValue1[iconfig]); String optionEnumCmd1 = option.getEnumCommand(optionDefaultValue); assertEquals(optionEnumCmd1, expectedOptionEnumCmd1arr[iconfig]); - List expectedEnumList1arr = new ArrayList(); + List expectedEnumList1arr = new ArrayList<>(); String[] expectedEnumList1Tokens = expectedEnumList1.split(","); //$NON-NLS-1$ for (i = 0; i < expectedEnumList1Tokens.length; ++i) { expectedEnumList1arr.add(expectedEnumList1Tokens[i].trim()); @@ -314,7 +314,7 @@ public class ManagedBuildCoreTests extends TestCase { IToolChain toolChain = configs[iconfig].getToolChain(); assertEquals(toolChain.getName(), (expectedToolChainName[iconfig])); - List expectedOSListarr = new ArrayList(); + List expectedOSListarr = new ArrayList<>(); String[] expectedOSListTokens = expectedOSList.split(","); //$NON-NLS-1$ for (i = 0; i < expectedOSListTokens.length; ++i) { expectedOSListarr.add(expectedOSListTokens[i].trim()); @@ -502,7 +502,7 @@ public class ManagedBuildCoreTests extends TestCase { // IToolChain toolChain = configs[iconfig].getToolChain(); - List expectedOSListarr = new ArrayList(); + List expectedOSListarr = new ArrayList<>(); String[] expectedOSListTokens = expectedOSList.split(","); //$NON-NLS-1$ for (i = 0; i < expectedOSListTokens.length; ++i) { expectedOSListarr.add(expectedOSListTokens[i].trim()); @@ -571,7 +571,7 @@ public class ManagedBuildCoreTests extends TestCase { String optionEnumCmd1 = option.getEnumCommand(optionDefaultValue); assertEquals(optionEnumCmd1, (expectedOptionEnumCmd1arr[iconfig])); - List expectedEnumList1arr = new ArrayList(); + List expectedEnumList1arr = new ArrayList<>(); String[] expectedEnumList1Tokens = expectedEnumList1.split(","); //$NON-NLS-1$ for (i = 0; i < expectedEnumList1Tokens.length; ++i) { expectedEnumList1arr.add(expectedEnumList1Tokens[i].trim()); diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildDependencyCalculatorTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildDependencyCalculatorTests.java index aab03ada0a9..f1ce25d3ac6 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildDependencyCalculatorTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildDependencyCalculatorTests.java @@ -74,7 +74,7 @@ public class ManagedBuildDependencyCalculatorTests extends TestCase { } }); - projectList = new ArrayList(projectZips.length); + projectList = new ArrayList<>(projectZips.length); for (int i = 0; i < projectZips.length; i++) { try { String projectName = projectZips[i].getName(); @@ -100,7 +100,7 @@ public class ManagedBuildDependencyCalculatorTests extends TestCase { try { IProject project = ManagedBuildTestHelper.createProject(projName, null, location, projectTypeId); if (project != null) - projectList = new ArrayList(1); + projectList = new ArrayList<>(1); projectList.add(project); } catch (Exception e) { } diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildDependencyLibsTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildDependencyLibsTests.java index f767c5bb99f..437cbeb2159 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildDependencyLibsTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildDependencyLibsTests.java @@ -190,7 +190,7 @@ public class ManagedBuildDependencyLibsTests extends AbstractBuilderTest { } private long getArtifactTimeStamp(IProject project) { - List files = new ArrayList(); + List files = new ArrayList<>(); findFiles(project, getArtefactFullName(project), files); if (files.size() == 0) // File not exists return 0; diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildMacrosTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildMacrosTests.java index ab280c43405..72479b0b2aa 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildMacrosTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildMacrosTests.java @@ -258,7 +258,7 @@ public class ManagedBuildMacrosTests extends TestCase { PATH_ENV_VAR }; String[] resArr1 = { "new a", /*"test=CFGTEST",*/ "x", "y", "z", "PRJ=NewMacrosForProjectContext", "LIST=x|y|z" }; - List res1 = new ArrayList(Arrays.asList(resArr1)); + List res1 = new ArrayList<>(Arrays.asList(resArr1)); try { // Add split ${PATH} to res1 String strList = mp.resolveValue(PATH_ENV_VAR, UNKNOWN, LISTSEP, IBuildMacroProvider.CONTEXT_OPTION, @@ -272,7 +272,7 @@ public class ManagedBuildMacrosTests extends TestCase { opt = cfgs[0].setOption(t, opt, set1); assertNotNull(opt); - ArrayList res2 = new ArrayList(res1.size()); + ArrayList res2 = new ArrayList<>(res1.size()); for (int i = 0; i < set1.length; i++) { try { String[] aus = mp.resolveStringListValue(set1[i], UNKNOWN, LISTSEP, @@ -698,7 +698,7 @@ public class ManagedBuildMacrosTests extends TestCase { // returns a list of macro's NAMES (not values). private String[] printMacros(IBuildMacro[] vars, String head) { - ArrayList ar = new ArrayList(0); + ArrayList ar = new ArrayList<>(0); if (vars != null) { if (vars.length > 0) { for (int i = 0; i < vars.length; i++) { diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject21MakefileTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject21MakefileTests.java index 780bb88ac8d..c0a0c689686 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject21MakefileTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject21MakefileTests.java @@ -99,7 +99,7 @@ public class ManagedProject21MakefileTests extends TestCase { } }); - projectList = new ArrayList(projectZips.length); + projectList = new ArrayList<>(projectZips.length); for (int i = 0; i < projectZips.length; i++) { try { String projectName = projectZips[i].getName(); @@ -125,7 +125,7 @@ public class ManagedProject21MakefileTests extends TestCase { try { IProject project = ManagedBuildTestHelper.createProject(projName, null, location, projectTypeId); if (project != null) - projectList = new ArrayList(1); + projectList = new ArrayList<>(1); projectList.add(project); } catch (Exception e) { } diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProjectUpdateTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProjectUpdateTests.java index 4a315af597e..72b71808cfc 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProjectUpdateTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProjectUpdateTests.java @@ -84,7 +84,7 @@ public class ManagedProjectUpdateTests extends TestCase { } }); - ArrayList projectList = new ArrayList(projectZips.length); + ArrayList projectList = new ArrayList<>(projectZips.length); for (int i = 0; i < projectZips.length; i++) { try { String projectName = projectZips[i].getName(); diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/MultiVersionSupportTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/MultiVersionSupportTests.java index 68e0781a146..b8b42c3c01f 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/MultiVersionSupportTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/MultiVersionSupportTests.java @@ -500,7 +500,7 @@ public class MultiVersionSupportTests extends TestCase { } }); - ArrayList projectList = new ArrayList(projectZips.length); + ArrayList projectList = new ArrayList<>(projectZips.length); assertEquals(projectZips.length, 1); try { diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/TestConfigElement.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/TestConfigElement.java index 7717108b625..12bcf24462e 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/TestConfigElement.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/TestConfigElement.java @@ -30,7 +30,7 @@ public class TestConfigElement implements IManagedConfigElement { public TestConfigElement(String name, String[][] attributes, IManagedConfigElement[] children) { this.name = name; this.children = children; - this.attributeMap = new TreeMap(); + this.attributeMap = new TreeMap<>(); for (int i = 0; i < attributes.length; i++) { attributeMap.put(attributes[i][0], attributes[i][1]); } @@ -65,7 +65,7 @@ public class TestConfigElement implements IManagedConfigElement { */ @Override public IManagedConfigElement[] getChildren(String elementName) { - List ret = new ArrayList(children.length); + List ret = new ArrayList<>(children.length); for (int i = 0; i < children.length; i++) { if (children[i].getName().equals(elementName)) { ret.add(children[i]); diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ToolChainModificationTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ToolChainModificationTests.java index 383fb842bcb..225c707505c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ToolChainModificationTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ToolChainModificationTests.java @@ -72,7 +72,7 @@ public class ToolChainModificationTests extends TestCase { assertTrue(cfgM.isBuilderCompatible()); IToolChain[] ctcs = cfgM.getCompatibleToolChains(); - HashSet set = new HashSet(); + HashSet set = new HashSet<>(); FolderInfo foInfo = (FolderInfo) cfg.getRootFolderInfo(); ToolChain tc = (ToolChain) foInfo.getToolChain(); IToolChain[] allSys = ManagedBuildManager.getRealToolChains(); @@ -83,12 +83,12 @@ public class ToolChainModificationTests extends TestCase { set.remove(incompatibleTc); compare(Arrays.asList(ctcs), set); - HashSet incomp = new HashSet(Arrays.asList(allSys)); + HashSet incomp = new HashSet<>(Arrays.asList(allSys)); incomp.removeAll(Arrays.asList(ctcs)); assertTrue(incomp.contains(incompatibleTc)); IBuilder[] cbs = cfgM.getCompatibleBuilders(); - Set bSet = new HashSet(); + Set bSet = new HashSet<>(); IBuilder[] allSysB = ManagedBuildManager.getRealBuilders(); filterPropsSupported(cfg, allSysB, bSet); IBuilder incompatibleB = ManagedBuildManager.getExtensionBuilder("tcm.tc4.b1"); @@ -97,7 +97,7 @@ public class ToolChainModificationTests extends TestCase { bSet.remove(incompatibleB); compare(Arrays.asList(cbs), bSet); - HashSet incompB = new HashSet(Arrays.asList(allSysB)); + HashSet incompB = new HashSet<>(Arrays.asList(allSysB)); incompB.removeAll(Arrays.asList(cbs)); assertTrue(incompB.contains(incompatibleB)); @@ -115,7 +115,7 @@ public class ToolChainModificationTests extends TestCase { } private HashSet filterSupportedToolChains(IFolderInfo foInfo, IToolChain tc) { - HashSet set = new HashSet(); + HashSet set = new HashSet<>(); IToolChain[] allSys = ManagedBuildManager.getRealToolChains(); filterPropsSupported((FolderInfo) foInfo, (ToolChain) tc, allSys, set); set.remove(ManagedBuildManager.getRealToolChain(tc)); @@ -239,7 +239,7 @@ public class ToolChainModificationTests extends TestCase { HashSet s1 = new HashSet(c1); HashSet s1c = new HashSet(s1); - HashSet s2 = new HashSet(c2); + HashSet s2 = new HashSet<>(c2); s1.removeAll(s2); s2.removeAll(s1c); @@ -267,7 +267,7 @@ public class ToolChainModificationTests extends TestCase { private Collection filterPropsSupported(FolderInfo foInfo, ToolChain tc, IToolChain[] tcs, Collection c) { if (c == null) - c = new ArrayList(); + c = new ArrayList<>(); for (int i = 0; i < tcs.length; i++) { if (foInfo.isToolChainCompatible(tc, tcs[i])) c.add(tcs[i]); @@ -279,7 +279,7 @@ public class ToolChainModificationTests extends TestCase { private Collection filterPropsSupported(IConfiguration cfg, IBuilder[] bs, Collection c) { if (c == null) - c = new ArrayList(); + c = new ArrayList<>(); for (int i = 0; i < bs.length; i++) { if (cfg.isBuilderCompatible(bs[i])) c.add(bs[i]); @@ -340,7 +340,7 @@ public class ToolChainModificationTests extends TestCase { IModificationOperation[] ops = tm.getSupportedOperations(); ITool tool31 = ManagedBuildManager.getExtensionTool("tcm.tc3.t1"); - Set replacement = new HashSet(); + Set replacement = new HashSet<>(); boolean removable = getReplacementToolInfo(ops, replacement); assertFalse(removable); @@ -350,7 +350,7 @@ public class ToolChainModificationTests extends TestCase { assertTrue(tm.isProjectTool()); ops = tm.getSupportedOperations(); - replacement = new HashSet(); + replacement = new HashSet<>(); removable = getReplacementToolInfo(ops, replacement); assertFalse(removable); diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/BuiltinSpecsDetectorTest.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/BuiltinSpecsDetectorTest.java index 67ff3408e2c..4252f366330 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/BuiltinSpecsDetectorTest.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/BuiltinSpecsDetectorTest.java @@ -299,11 +299,11 @@ public class BuiltinSpecsDetectorTest extends BaseTestCase { { // provider configured with non-null parameters MockBuiltinSpecsDetectorExecutedFlag provider = new MockBuiltinSpecsDetectorExecutedFlag(); - List languages = new ArrayList(); + List languages = new ArrayList<>(); languages.add(LANGUAGE_ID); - Map properties = new HashMap(); + Map properties = new HashMap<>(); properties.put(ATTR_PARAMETER, CUSTOM_COMMAND_1); - List entries = new ArrayList(); + List entries = new ArrayList<>(); ICLanguageSettingEntry entry = new CMacroEntry("MACRO", "VALUE", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY); entries.add(entry); @@ -349,9 +349,9 @@ public class BuiltinSpecsDetectorTest extends BaseTestCase { // create instance to compare to MockDetectorCloneable provider = new MockDetectorCloneable(); - List languages = new ArrayList(); + List languages = new ArrayList<>(); languages.add(LANGUAGE_ID); - List entries = new ArrayList(); + List entries = new ArrayList<>(); ICLanguageSettingEntry entry = new CMacroEntry("MACRO", "VALUE", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY); entries.add(entry); @@ -361,7 +361,7 @@ public class BuiltinSpecsDetectorTest extends BaseTestCase { assertTrue(provider.equals(clone0)); // configure provider - Map properties = new HashMap(); + Map properties = new HashMap<>(); properties.put(ATTR_PARAMETER, CUSTOM_COMMAND_1); provider.configureProvider(PROVIDER_ID, PROVIDER_NAME, languages, entries, properties); assertEquals(false, provider.isConsoleEnabled()); @@ -410,7 +410,7 @@ public class BuiltinSpecsDetectorTest extends BaseTestCase { // check entries { MockDetectorCloneable clone = provider.clone(); - List entries2 = new ArrayList(); + List entries2 = new ArrayList<>(); entries2.add(new CMacroEntry("MACRO2", "VALUE2", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY)); clone.setSettingEntries(null, null, null, entries2); assertFalse(provider.equals(clone)); @@ -489,7 +489,7 @@ public class BuiltinSpecsDetectorTest extends BaseTestCase { { // create provider MockBuiltinSpecsDetectorExecutedFlag provider = new MockBuiltinSpecsDetectorExecutedFlag(); - List entries = new ArrayList(); + List entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 1)); provider.setSettingEntries(null, null, null, entries); // serialize entries @@ -708,7 +708,7 @@ public class BuiltinSpecsDetectorTest extends BaseTestCase { ICConfigurationDescription cfgDescriptionWritable = prjDescriptionWritable.getActiveConfiguration(); // Create provider MockBuiltinSpecsDetectorEnvironmentChangeListener provider = new MockBuiltinSpecsDetectorEnvironmentChangeListener(); - List providers = new ArrayList(); + List providers = new ArrayList<>(); providers.add(provider); ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable).setLanguageSettingProviders(providers); // Write to project description diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuildCommandParserTest.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuildCommandParserTest.java index fbc2f48e810..31877514bbc 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuildCommandParserTest.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuildCommandParserTest.java @@ -195,7 +195,7 @@ public class GCCBuildCommandParserTest extends BaseTestCase { ICConfigurationDescription cfgDescription = cfgDescriptions[0]; Map refs = cfgDescription.getReferenceInfo(); assertEquals(1, refs.size()); - Set referencedProjectsNames = new LinkedHashSet(refs.keySet()); + Set referencedProjectsNames = new LinkedHashSet<>(refs.keySet()); assertEquals(projectReferenced.getName(), referencedProjectsNames.toArray()[0]); } @@ -221,11 +221,11 @@ public class GCCBuildCommandParserTest extends BaseTestCase { { // provider configured with non-null parameters MockBuildCommandParser provider = new MockBuildCommandParser(); - List languages = new ArrayList(); + List languages = new ArrayList<>(); languages.add(LANGUAGE_ID); - Map properties = new HashMap(); + Map properties = new HashMap<>(); properties.put(ATTR_PARAMETER, CUSTOM_PARAMETER); - List entries = new ArrayList(); + List entries = new ArrayList<>(); ICLanguageSettingEntry entry = new CMacroEntry("MACRO", "VALUE", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY); entries.add(entry); @@ -381,7 +381,7 @@ public class GCCBuildCommandParserTest extends BaseTestCase { public boolean processLine(String line) { // pretending that we parsed the line currentResource = file; - List entries = new ArrayList(); + List entries = new ArrayList<>(); ICLanguageSettingEntry entry = new CMacroEntry("MACRO", "VALUE", ICSettingEntry.BUILTIN); entries.add(entry); setSettingEntries(entries); @@ -2089,7 +2089,7 @@ public class GCCBuildCommandParserTest extends BaseTestCase { parser.shutdown(); // check populated entries - List expected = new ArrayList(); + List expected = new ArrayList<>(); expected.add(new CIncludePathEntry("/path0", 0)); assertEquals(expected, parser.getSettingEntries(cfgDescription, file, languageId)); assertEquals(null, parser.getSettingEntries(cfgDescription, folder, languageId)); @@ -2122,7 +2122,7 @@ public class GCCBuildCommandParserTest extends BaseTestCase { parser.shutdown(); // check populated entries - List expected = new ArrayList(); + List expected = new ArrayList<>(); expected.add(new CIncludePathEntry("/path0", 0)); assertEquals(null, parser.getSettingEntries(cfgDescription, file, languageId)); assertEquals(expected, parser.getSettingEntries(cfgDescription, folder, languageId)); @@ -2155,7 +2155,7 @@ public class GCCBuildCommandParserTest extends BaseTestCase { parser.shutdown(); // check populated entries - List expected = new ArrayList(); + List expected = new ArrayList<>(); expected.add(new CIncludePathEntry("/path0", 0)); assertEquals(null, parser.getSettingEntries(cfgDescription, file, languageId)); @@ -2180,7 +2180,7 @@ public class GCCBuildCommandParserTest extends BaseTestCase { parser.shutdown(); // check populated entries - List expected = new ArrayList(); + List expected = new ArrayList<>(); expected.add(new CIncludePathEntry("/path0", 0)); assertEquals(expected, parser.getSettingEntries(null, null, LANG_CPP)); } diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuiltinSpecsDetectorTest.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuiltinSpecsDetectorTest.java index 8f960afda26..24ba7186a01 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuiltinSpecsDetectorTest.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuiltinSpecsDetectorTest.java @@ -651,7 +651,7 @@ public class GCCBuiltinSpecsDetectorTest extends BaseTestCase { ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations(); assertTrue(cfgDescriptions.length > 0); ICConfigurationDescription cfgDescription = cfgDescriptions[0]; - List providers = new ArrayList(); + List providers = new ArrayList<>(); providers.add(detector); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); // change the default command in all the tools of the toolchain diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/templateengine/tests/TemplateEngineTestsHelper.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/templateengine/tests/TemplateEngineTestsHelper.java index c643f3f60b9..5ade37fab62 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/templateengine/tests/TemplateEngineTestsHelper.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/templateengine/tests/TemplateEngineTestsHelper.java @@ -50,8 +50,8 @@ import junit.framework.TestCase; public class TemplateEngineTestsHelper { public static final String LOGGER_FILE_NAME = "TemplateEngineTests"; //$NON-NLS-1$ - private static List projectTypes = new ArrayList(); - private static List projectTypeNames = new ArrayList(); + private static List projectTypes = new ArrayList<>(); + private static List projectTypeNames = new ArrayList<>(); /** * get the url of a xml template, by passing the xml file name. diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/projectmodel/tests/BackwardCompatiblityTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/projectmodel/tests/BackwardCompatiblityTests.java index 8f43cfa5acc..c0dd5c8510d 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/projectmodel/tests/BackwardCompatiblityTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/projectmodel/tests/BackwardCompatiblityTests.java @@ -31,7 +31,7 @@ import junit.framework.TestSuite; public class BackwardCompatiblityTests extends TestCase { private static final String TEST_3X_STD_MAKE_PROJECTS = "test3xStdMakeProjects"; - private List projList = new LinkedList(); + private List projList = new LinkedList<>(); public static Test suite() { return new TestSuite(BackwardCompatiblityTests.class); diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/projectmodel/tests/OptionStringListValueTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/projectmodel/tests/OptionStringListValueTests.java index 0543f0fcdbe..1300fe2c349 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/projectmodel/tests/OptionStringListValueTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/projectmodel/tests/OptionStringListValueTests.java @@ -81,7 +81,7 @@ public class OptionStringListValueTests extends TestCase { IFolderInfo fInfo = cfg.getRootFolderInfo(); ICLanguageSetting ls = fDes.getLanguageSettingForFile("a.c"); - List list = new ArrayList(); + List list = new ArrayList<>(); list.add(new CIncludePathEntry("a", 0)); list.add(new CIncludePathEntry("b", 0)); list.addAll(ls.getSettingEntriesList(ICSettingEntry.INCLUDE_PATH)); @@ -129,7 +129,7 @@ public class OptionStringListValueTests extends TestCase { ICFolderDescription fDes = cfgDes.getRootFolderDescription(); ICLanguageSetting ls = fDes.getLanguageSettingForFile("a.c"); - List list = new ArrayList(); + List list = new ArrayList<>(); list.add(new CLibraryFileEntry("usr_a", 0, new Path("ap"), new Path("arp"), new Path("apx"))); list.add(new CLibraryFileEntry("usr_b", 0, new Path("bp"), null, null)); list.add(new CLibraryFileEntry("usr_c", 0, new Path("cp"), new Path("crp"), null)); @@ -178,9 +178,9 @@ public class OptionStringListValueTests extends TestCase { } private void checkEntriesMatch(List list1, List list2) { - Set set1 = new LinkedHashSet(list1); + Set set1 = new LinkedHashSet<>(list1); set1.removeAll(list2); - Set set2 = new LinkedHashSet(list2); + Set set2 = new LinkedHashSet<>(list2); set2.removeAll(list1); if (set1.size() != 0 || set2.size() != 0) { fail("entries diff"); @@ -229,7 +229,7 @@ public class OptionStringListValueTests extends TestCase { checkOptionValues(option); - List list = new ArrayList(); + List list = new ArrayList<>(); list.add("usr_1"); list.add("usr_2"); list.addAll(Arrays.asList(option.getBasicStringListValue())); @@ -239,7 +239,7 @@ public class OptionStringListValueTests extends TestCase { assertTrue(Arrays.equals(updated, option.getBasicStringListValue())); checkOptionValues(option); - list = new ArrayList(); + list = new ArrayList<>(); list.add(new OptionStringValue("usr_3", false, "ap", "arp", "apx")); list.add(new OptionStringValue("usr_4", false, null, null, null)); list.add(new OptionStringValue("usr_5", false, "cp", null, null)); diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/projectmodel/tests/ProjectModelTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/projectmodel/tests/ProjectModelTests.java index d930cda60c5..d473bb553e7 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/projectmodel/tests/ProjectModelTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/projectmodel/tests/ProjectModelTests.java @@ -637,7 +637,7 @@ public class ProjectModelTests extends TestCase implements IElementChangedListen } CMacroEntry entry = new CMacroEntry("a", "b", 0); - List list = new ArrayList(); + List list = new ArrayList<>(); list.add(entry); list.addAll(Arrays.asList(entries)); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgDiscoveredPathManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgDiscoveredPathManager.java index 748dcdfe0ff..fc41f7cb5a1 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgDiscoveredPathManager.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgDiscoveredPathManager.java @@ -219,7 +219,7 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener { .getSettingInfos(cInfo.fLoadContext.getConfiguration().getOwner().getProject(), data, info, true); CResourceData rcDatas[] = data.getResourceDatas(); - Map rcDataMap = new HashMap(); + Map rcDataMap = new HashMap<>(); CResourceData rcData; for (int i = 0; i < rcDatas.length; i++) { rcData = rcDatas[i]; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgScannerConfigUtil.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgScannerConfigUtil.java index 609d72722b3..b0355bec955 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgScannerConfigUtil.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgScannerConfigUtil.java @@ -158,7 +158,7 @@ public class CfgScannerConfigUtil { public static Set getAllScannerDiscoveryProfileIds(IToolChain toolchain) { Assert.isNotNull(toolchain); - Set profiles = new TreeSet(); + Set profiles = new TreeSet<>(); if (toolchain != null) { String toolchainProfileId = null; @@ -201,7 +201,7 @@ public class CfgScannerConfigUtil { throw new UnsupportedOperationException(msg); } - Set profiles = new TreeSet(); + Set profiles = new TreeSet<>(); for (IInputType inputType : ((Tool) tool).getAllInputTypes()) { for (String profileId : getAllScannerDiscoveryProfileIds(inputType)) { @@ -233,7 +233,7 @@ public class CfgScannerConfigUtil { throw new UnsupportedOperationException(msg); } - Set profiles = new TreeSet(); + Set profiles = new TreeSet<>(); String attribute = ((InputType) inputType).getLegacyDiscoveryProfileIdAttribute(); if (attribute != null) { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/PerFileSettingsCalculator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/PerFileSettingsCalculator.java index a20e8e9137c..e6660e7ade1 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/PerFileSettingsCalculator.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/PerFileSettingsCalculator.java @@ -87,7 +87,7 @@ public class PerFileSettingsCalculator { void add(ILangSettingInfo info) { if (fLangInfoList == null) - fLangInfoList = new ArrayList(); + fLangInfoList = new ArrayList<>(); fLangInfoList.add(info); } } @@ -130,9 +130,9 @@ public class PerFileSettingsCalculator { } public void add(int index, PathFilePathInfo value) { - List list = checkResize(index) ? new ArrayList() : fStore[index]; + List list = checkResize(index) ? new ArrayList<>() : fStore[index]; if (list == null) { - list = new ArrayList(); + list = new ArrayList<>(); fStore[index] = list; } @@ -157,7 +157,7 @@ public class PerFileSettingsCalculator { public List[] getLists() { int size = fMaxIndex + 1; - List> list = new ArrayList>(size); + List> list = new ArrayList<>(size); List l; for (int i = 0; i < size; i++) { l = fStore[i]; @@ -214,13 +214,13 @@ public class PerFileSettingsCalculator { public void add(PathFilePathInfo pInfo) { if (fPathFilePathInfoMap == null) - fPathFilePathInfoMap = new HashMap>(3); + fPathFilePathInfoMap = new HashMap<>(3); PathInfo fileInfo = pInfo.fInfo; List list = fileInfo == fMaxMatchInfo ? fMaxMatchInfoList : fPathFilePathInfoMap.get(fileInfo); if (list == null) { - List emptyList = new ArrayList(); + List emptyList = new ArrayList<>(); fPathFilePathInfoMap.put(fileInfo, emptyList); if (fMaxMatchInfo == null) { fMaxMatchInfo = fileInfo; @@ -342,7 +342,7 @@ public class PerFileSettingsCalculator { private HashSet calcExtsSet() { if (fExtsSet == null) - fExtsSet = new HashSet(Arrays.asList(fExts)); + fExtsSet = new HashSet<>(Arrays.asList(fExts)); return fExtsSet; } @@ -473,7 +473,7 @@ public class PerFileSettingsCalculator { void internalAdd(ExtsSetSettings setting) { if (fExtsSetToExtsSetSettingsMap == null) { - fExtsSetToExtsSetSettingsMap = new HashMap(); + fExtsSetToExtsSetSettingsMap = new HashMap<>(); } ExtsSetSettings cur = fExtsSetToExtsSetSettingsMap.get(setting.fExtsSet); @@ -507,7 +507,7 @@ public class PerFileSettingsCalculator { // } public RcSetSettings[] getChildren(final boolean includeCurrent) { - final List list = new ArrayList(); + final List list = new ArrayList<>(); fContainer.accept(new IPathSettingsContainerVisitor() { @Override @@ -572,7 +572,7 @@ public class PerFileSettingsCalculator { String[] exts = setting.fExtsSet.fExts; String ext; if (map == null) { - map = new HashMap(); + map = new HashMap<>(); forceAdd = true; } @@ -611,7 +611,7 @@ public class PerFileSettingsCalculator { path = rcData.getPath(); curRcSet = rcSet.createChild(path, rcData, false); if (rcData.getType() == ICSettingBase.SETTING_FILE) { - fileMap = new HashMap(1); + fileMap = new HashMap<>(1); fileSetting = createExtsSetSettings(path, (CFileData) rcData); fileMap.put(fileSetting.fExtsSet, fileSetting); curRcSet.internalSetSettingsMap(fileMap); @@ -664,7 +664,7 @@ public class PerFileSettingsCalculator { private static void addEmptyLanguageInfos(RcSettingInfo rcInfo, CLanguageData[] lDatas) { ArrayList list = rcInfo.fLangInfoList; if (list == null) { - list = new ArrayList(lDatas.length); + list = new ArrayList<>(lDatas.length); rcInfo.fLangInfoList = list; } else { list.ensureCapacity(lDatas.length); @@ -682,7 +682,7 @@ public class PerFileSettingsCalculator { IPath projRelPath; CResourceData rcData; // RcSetSettings dataSetting; - List list = new ArrayList(pfpis.length); + List list = new ArrayList<>(pfpis.length); RcSettingInfo rcInfo; LangSettingInfo lInfo; CLanguageData lData; @@ -723,7 +723,7 @@ public class PerFileSettingsCalculator { if (rcInfo == null) { rcInfo = new RcSettingInfo(rootData); - tmpList = new ArrayList(lDatas.length - k); + tmpList = new ArrayList<>(lDatas.length - k); rcInfo.fLangInfoList = tmpList; } @@ -777,7 +777,7 @@ public class PerFileSettingsCalculator { if (lData != null) { rcInfo = new RcSettingInfo(rcData); lInfo = new LangSettingInfo(lData, pInfo); - tmpList = new ArrayList(1); + tmpList = new ArrayList<>(1); tmpList.add(lInfo); rcInfo.fLangInfoList = tmpList; list.add(rcInfo); @@ -806,7 +806,7 @@ public class PerFileSettingsCalculator { RcSetSettings settings[] = rootSetting.getChildren(true); RcSetSettings setting; CResourceData rcData; - List resultList = new ArrayList(); + List resultList = new ArrayList<>(); LangSettingInfo langInfo; RcSettingInfo rcInfo; PathInfo pathInfo; @@ -838,7 +838,7 @@ public class PerFileSettingsCalculator { if (pathInfo != null) { langInfo = new LangSettingInfo(extSetting.fBaseLangData, pathInfo); rcInfo = new RcSettingInfo(rcData); - rcInfo.fLangInfoList = new ArrayList(1); + rcInfo.fLangInfoList = new ArrayList<>(1); rcInfo.fLangInfoList.add(langInfo); resultList.add(rcInfo); } @@ -846,7 +846,7 @@ public class PerFileSettingsCalculator { } else { if (setting.fExtsSetToExtsSetSettingsMap.size() != 0) { rcInfo = new RcSettingInfo(rcData); - rcInfo.fLangInfoList = new ArrayList(setting.fExtsSetToExtsSetSettingsMap.size()); + rcInfo.fLangInfoList = new ArrayList<>(setting.fExtsSetToExtsSetSettingsMap.size()); resultList.add(rcInfo); Collection values = setting.fExtsSetToExtsSetSettingsMap.values(); @@ -1008,7 +1008,7 @@ public class PerFileSettingsCalculator { private static HashMap createExtsSetSettingsMap(CFolderData data) { CLanguageData[] lDatas = data.getLanguageDatas(); - HashMap map = new HashMap(lDatas.length); + HashMap map = new HashMap<>(lDatas.length); ExtsSetSettings settings; if (lDatas.length != 0) { @@ -1028,7 +1028,7 @@ public class PerFileSettingsCalculator { IPath path; PathInfo info, storedInfo; ListIndexStore store = new ListIndexStore(10); - HashMap infoMap = new HashMap(); + HashMap infoMap = new HashMap<>(); // LinkedHashMap result; Set> entrySet = map.entrySet(); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigInfoFactory2.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigInfoFactory2.java index 15adfbb3530..ce1204f503e 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigInfoFactory2.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigInfoFactory2.java @@ -133,13 +133,13 @@ public class CfgScannerConfigInfoFactory2 { } if (fContainer == null) { - fContainer = new SoftReference(container); + fContainer = new SoftReference<>(container); } return container; } private Map createMap() { - HashMap map = new HashMap(); + HashMap map = new HashMap<>(); try { IScannerConfigBuilderInfo2Set container = getContainer(); @@ -314,7 +314,7 @@ public class CfgScannerConfigInfoFactory2 { private Map getConfigInfoMap( Map baseMap) { - Map map = new HashMap(); + Map map = new HashMap<>(); for (Entry entry : baseMap.entrySet()) { InfoContext baseContext = entry.getKey(); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/BuildDescriptionManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/BuildDescriptionManager.java index 3468c7ded31..67a230db0cf 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/BuildDescriptionManager.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/BuildDescriptionManager.java @@ -65,7 +65,7 @@ public class BuildDescriptionManager { */ public static final int DEPFILES = 1 << 3; - private Set fVisitedSteps = new HashSet(); + private Set fVisitedSteps = new HashSet<>(); private boolean fUp; private IBuildDescription fInfo; @@ -168,7 +168,7 @@ public class BuildDescriptionManager { } public static IBuildStep[] getSteps(IBuildStep step, boolean input) { - Set set = new HashSet(); + Set set = new HashSet<>(); IBuildIOType args[] = input ? step.getInputIOTypes() : step.getOutputIOTypes(); @@ -194,7 +194,7 @@ public class BuildDescriptionManager { } public static IBuildResource[] filterGeneratedBuildResources(IBuildResource rc[], int rcState) { - List list = new ArrayList(); + List list = new ArrayList<>(); addBuildResources(rc, list, rcState); return list.toArray(new IBuildResource[list.size()]); @@ -256,7 +256,7 @@ public class BuildDescriptionManager { */ public static void cleanGeneratedRebuildResources(IBuildDescription des) throws CoreException { IBuildResource bRcs[] = filterGeneratedBuildResources(des.getResources(), REMOVED | REBUILD); - List failList = new ArrayList(); + List failList = new ArrayList<>(); for (int i = 0; i < bRcs.length; i++) { if (!bRcs[i].isProjectResource()) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ExternalBuildRunner.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ExternalBuildRunner.java index b9e4b9edd34..395469cd3ca 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ExternalBuildRunner.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ExternalBuildRunner.java @@ -114,7 +114,7 @@ public class ExternalBuildRunner extends AbstractBuildRunner { ErrorParserManager epm = new ErrorParserManager(project, workingDirectoryURI, markerGenerator, errorParsers); - List parsers = new ArrayList(); + List parsers = new ArrayList<>(); if (!isOnlyClean) { ICConfigurationDescription cfgDescription = ManagedBuildManager .getDescriptionForConfiguration(configuration); @@ -199,7 +199,7 @@ public class ExternalBuildRunner extends AbstractBuildRunner { } protected Map getEnvironment(IBuilder builder) throws CoreException { - Map envMap = new HashMap(); + Map envMap = new HashMap<>(); if (builder.appendEnvironment()) { ICConfigurationDescription cfgDes = ManagedBuildManager .getDescriptionForConfiguration(builder.getParent().getParent()); @@ -221,7 +221,7 @@ public class ExternalBuildRunner extends AbstractBuildRunner { @Deprecated protected static String[] getEnvStrings(Map env) { // Convert into env strings - List strings = new ArrayList(env.size()); + List strings = new ArrayList<>(env.size()); for (Entry entry : env.entrySet()) { StringBuilder buffer = new StringBuilder(entry.getKey()); buffer.append('=').append(entry.getValue()); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java index e15b95c149c..b0b2e9f627e 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java @@ -103,7 +103,7 @@ public class InternalBuildRunner extends AbstractBuildRunner { ErrorParserManager epm = new ErrorParserManager(project, workingDirectoryURI, markerGenerator, errorParsers); - List parsers = new ArrayList(); + List parsers = new ArrayList<>(); ManagedBuildManager.collectLanguageSettingsConsoleParsers(cfgDescription, epm, parsers); buildRunnerHelper.prepareStreams(epm, parsers, console, diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java index 52cee0b9945..29c0bcaa538 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java @@ -264,7 +264,7 @@ public class ManagedBuildManager extends AbstractCExtension { private static HashMap, List> fSortedTools; private static HashMap, List> fSortedBuilders; - private static Map fInfoMap = new HashMap(); + private static Map fInfoMap = new HashMap<>(); private static ISorter fToolChainSorter = new ISorter() { @Override @@ -383,7 +383,7 @@ public class ManagedBuildManager extends AbstractCExtension { } catch (BuildException e) { } if (projectTypeMap == null) { - projectTypeMap = new TreeMap(); + projectTypeMap = new TreeMap<>(); } return projectTypeMap; } @@ -393,7 +393,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ protected static Map getExtensionConfigurationMap() { if (extensionConfigurationMap == null) { - extensionConfigurationMap = new HashMap(); + extensionConfigurationMap = new HashMap<>(); } return extensionConfigurationMap; } @@ -403,7 +403,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ protected static Map getExtensionResourceConfigurationMap() { if (extensionResourceConfigurationMap == null) { - extensionResourceConfigurationMap = new HashMap(); + extensionResourceConfigurationMap = new HashMap<>(); } return extensionResourceConfigurationMap; } @@ -418,7 +418,7 @@ public class ManagedBuildManager extends AbstractCExtension { } if (extensionToolChainMap == null) { - extensionToolChainMap = new TreeMap(); + extensionToolChainMap = new TreeMap<>(); } return extensionToolChainMap; } @@ -443,7 +443,7 @@ public class ManagedBuildManager extends AbstractCExtension { } catch (BuildException e) { } if (extensionToolMap == null) { - extensionToolMap = new TreeMap(); + extensionToolMap = new TreeMap<>(); } return extensionToolMap; } @@ -464,7 +464,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ protected static Map getExtensionTargetPlatformMap() { if (extensionTargetPlatformMap == null) { - extensionTargetPlatformMap = new HashMap(); + extensionTargetPlatformMap = new HashMap<>(); } return extensionTargetPlatformMap; } @@ -478,7 +478,7 @@ public class ManagedBuildManager extends AbstractCExtension { } catch (BuildException e) { } if (extensionBuilderMap == null) { - extensionBuilderMap = new TreeMap(); + extensionBuilderMap = new TreeMap<>(); } return extensionBuilderMap; } @@ -499,7 +499,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ protected static Map getExtensionOptionMap() { if (extensionOptionMap == null) { - extensionOptionMap = new HashMap(); + extensionOptionMap = new HashMap<>(); } return extensionOptionMap; } @@ -509,7 +509,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ protected static Map getExtensionOptionCategoryMap() { if (extensionOptionCategoryMap == null) { - extensionOptionCategoryMap = new HashMap(); + extensionOptionCategoryMap = new HashMap<>(); } return extensionOptionCategoryMap; } @@ -519,7 +519,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ protected static Map getExtensionInputTypeMap() { if (extensionInputTypeMap == null) { - extensionInputTypeMap = new HashMap(); + extensionInputTypeMap = new HashMap<>(); } return extensionInputTypeMap; } @@ -529,7 +529,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ protected static Map getExtensionOutputTypeMap() { if (extensionOutputTypeMap == null) { - extensionOutputTypeMap = new HashMap(); + extensionOutputTypeMap = new HashMap<>(); } return extensionOutputTypeMap; } @@ -539,7 +539,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ protected static Map getExtensionTargetMap() { if (extensionTargetMap == null) { - extensionTargetMap = new HashMap(); + extensionTargetMap = new HashMap<>(); } return extensionTargetMap; } @@ -1633,7 +1633,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ public static void addExtensionProjectType(ProjectType projectType) { if (projectTypes == null) { - projectTypes = new ArrayList(); + projectTypes = new ArrayList<>(); } projectTypes.add(projectType); @@ -2163,7 +2163,7 @@ public class ManagedBuildManager extends AbstractCExtension { // Call the start up config extensions. These may rely on the standard elements // having already been loaded so we wait to call them from here. if (startUpConfigElements != null) { - buildDefStartupList = new ArrayList( + buildDefStartupList = new ArrayList<>( startUpConfigElements.size()); for (IManagedConfigElement startUpConfigElement : startUpConfigElements) { @@ -2492,7 +2492,7 @@ public class ManagedBuildManager extends AbstractCExtension { // Cache up early configuration extension elements so was can call them after // other configuration elements have loaded. if (startUpConfigElements == null) - startUpConfigElements = new ArrayList(); + startUpConfigElements = new ArrayList<>(); startUpConfigElements.add(element); } } else { @@ -3043,7 +3043,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ private static Map> getBuildModelListeners() { if (buildModelListeners == null) { - buildModelListeners = new HashMap>(); + buildModelListeners = new HashMap<>(); } return buildModelListeners; } @@ -3053,7 +3053,7 @@ public class ManagedBuildManager extends AbstractCExtension { throw new IllegalStateException(); if (configElementMap == null) { - configElementMap = new HashMap(); + configElementMap = new HashMap<>(); } return configElementMap; } @@ -3507,7 +3507,7 @@ public class ManagedBuildManager extends AbstractCExtension { public static Map getConversionElements(IBuildObject buildObj) { - Map conversionTargets = new HashMap(); + Map conversionTargets = new HashMap<>(); // Get the Converter Extension Point IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint( @@ -4002,7 +4002,7 @@ public class ManagedBuildManager extends AbstractCExtension { // } public static IToolChain[] getExtensionToolChains(IProjectType type) { - List result = new ArrayList(); + List result = new ArrayList<>(); IConfiguration cfgs[] = type.getConfigurations(); for (IConfiguration cfg : cfgs) { @@ -4025,7 +4025,7 @@ public class ManagedBuildManager extends AbstractCExtension { } public static IConfiguration[] getExtensionConfigurations(IToolChain tChain, IProjectType type) { - List list = new ArrayList(); + List list = new ArrayList<>(); IConfiguration cfgs[] = type.getConfigurations(); for (IConfiguration cfg : cfgs) { IToolChain cur = cfg.getToolChain(); @@ -4057,7 +4057,7 @@ public class ManagedBuildManager extends AbstractCExtension { String propertyValue) { // List all = getSortedToolChains(); List list = findIdenticalElements((ToolChain) tChain, fToolChainSorter); - LinkedHashSet result = new LinkedHashSet(); + LinkedHashSet result = new LinkedHashSet<>(); boolean tcFound = false; if (list != null) { for (int i = 0; i < list.size(); i++) { @@ -4135,7 +4135,7 @@ public class ManagedBuildManager extends AbstractCExtension { private static > HashMap, List> getSortedElements( Collection elements) { - HashMap, List> map = new HashMap, List>(); + HashMap, List> map = new HashMap<>(); for (T p : elements) { MatchKey key = p.getMatchKey(); if (key == null) @@ -4143,7 +4143,7 @@ public class ManagedBuildManager extends AbstractCExtension { List list = map.get(key); if (list == null) { - list = new ArrayList(); + list = new ArrayList<>(); map.put(key, list); } list.add(p); @@ -4297,7 +4297,7 @@ public class ManagedBuildManager extends AbstractCExtension { public static IToolChain[] getExtensionsToolChains(String propertyType, String propertyValue, boolean supportedPropsOnly) { HashMap, List> all = getSortedToolChains(); - List result = new ArrayList(); + List result = new ArrayList<>(); for (List list : all.values()) { IToolChain tc = findToolChain(list, propertyType, propertyValue, supportedPropsOnly); if (tc != null) @@ -4386,7 +4386,7 @@ public class ManagedBuildManager extends AbstractCExtension { sorter.sort(); list = p.getIdenticalList(); if (list == null) { - list = new ArrayList(0); + list = new ArrayList<>(0); p.setIdenticalList(list); } } @@ -4409,7 +4409,7 @@ public class ManagedBuildManager extends AbstractCExtension { ICConfigurationDescription cfgDes = getDescriptionForConfiguration(config); if (cfgDes != null) { ICConfigurationDescription[] descs = CoreModelUtil.getReferencedConfigurationDescriptions(cfgDes, false); - List result = new ArrayList(); + List result = new ArrayList<>(); for (ICConfigurationDescription desc : descs) { IConfiguration cfg = getConfigurationForDescription(desc); if (cfg != null) { @@ -4483,18 +4483,18 @@ public class ManagedBuildManager extends AbstractCExtension { } private static Map sortConfigs(IConfiguration cfgs[]) { - Map> cfgSetMap = new HashMap>(); + Map> cfgSetMap = new HashMap<>(); for (IConfiguration cfg : cfgs) { IProject proj = cfg.getOwner().getProject(); Set set = cfgSetMap.get(proj); if (set == null) { - set = new HashSet(); + set = new HashSet<>(); cfgSetMap.put(proj, set); } set.add(cfg); } - Map cfgArrayMap = new HashMap(); + Map cfgArrayMap = new HashMap<>(); if (cfgSetMap.size() != 0) { Set>> entrySet = cfgSetMap.entrySet(); for (Entry> entry : entrySet) { @@ -4584,7 +4584,7 @@ public class ManagedBuildManager extends AbstractCExtension { String builderName = command.getBuilderName(); Map newArgs = null; if (buildKind != IncrementalProjectBuilder.CLEAN_BUILD) { - newArgs = new HashMap(args); + newArgs = new HashMap<>(args); if (!builderName.equals(CommonBuilder.BUILDER_ID)) { newArgs.putAll(command.getArguments()); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCProjectNature.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCProjectNature.java index a46c0c8a481..e6ebfb8fbc8 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCProjectNature.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCProjectNature.java @@ -59,7 +59,7 @@ public class ManagedCProjectNature implements IProjectNature { ICommand command = commands[i]; if (command.getBuilderName().equals("org.eclipse.cdt.core.cbuilder")) { //$NON-NLS-1$ // Remove the command - Vector vec = new Vector(Arrays.asList(commands)); + Vector vec = new Vector<>(Arrays.asList(commands)); vec.removeElementAt(i); vec.trimToSize(); ICommand[] tempCommands = vec.toArray(new ICommand[commands.length - 1]); @@ -210,7 +210,7 @@ public class ManagedCProjectNature implements IProjectNature { public static void removeNature(IProject project, String natureId, IProgressMonitor monitor) throws CoreException { IProjectDescription description = project.getDescription(); String[] prevNatures = description.getNatureIds(); - List newNatures = new ArrayList(Arrays.asList(prevNatures)); + List newNatures = new ArrayList<>(Arrays.asList(prevNatures)); newNatures.remove(natureId); description.setNatureIds(newNatures.toArray(new String[newNatures.size()])); project.setDescription(description, monitor); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ResourceChangeHandler2.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ResourceChangeHandler2.java index 7e169c859b7..ecfe70c857c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ResourceChangeHandler2.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ResourceChangeHandler2.java @@ -131,7 +131,7 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase { String cachedIds[] = ConfigurationDataProvider.getNaturesIdsUsedOnCache(cfgs[i]); if (checkNaturesNeedUpdate(cachedIds, natureIds)) { if (fProjSet == null) - fProjSet = new HashSet(); + fProjSet = new HashSet<>(); fProjSet.add(project); break; @@ -155,9 +155,9 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase { if (oldIds == null) return true; - Set oldSet = new HashSet(Arrays.asList(oldIds)); - Set oldSetCopy = new HashSet(oldSet); - Set newSet = new HashSet(Arrays.asList(newIds)); + Set oldSet = new HashSet<>(Arrays.asList(oldIds)); + Set oldSetCopy = new HashSet<>(oldSet); + Set newSet = new HashSet<>(Arrays.asList(newIds)); oldSet.removeAll(newSet); newSet.removeAll(oldSetCopy); if (oldSet.contains(CProjectNature.C_NATURE_ID) || oldSet.contains(CCProjectNature.CC_NATURE_ID) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildCommand.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildCommand.java index 73a104bf0d2..953d4fb2285 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildCommand.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildCommand.java @@ -33,7 +33,7 @@ public class BuildCommand implements IBuildCommand { if (args != null) fArgs = args.clone(); if (env != null) - fEnv = new HashMap(env); + fEnv = new HashMap<>(env); fCWD = cwd; } @@ -62,7 +62,7 @@ public class BuildCommand implements IBuildCommand { @Override public Map getEnvironment() { if (fEnv != null) - return new HashMap(fEnv); + return new HashMap<>(fEnv); return null; } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java index 7c7fb15e22f..629c4a11d84 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java @@ -103,15 +103,15 @@ public class BuildDescription implements IBuildDescription { private IResourceDelta fDelta; private IConfigurationBuildState fBuildState; - private Map fToolToMultiStepMap = new HashMap(); + private Map fToolToMultiStepMap = new HashMap<>(); private BuildStep fOrderedMultiActions[]; /** Map from Location URI to BuildResource */ - private Map fLocationToRcMap = new HashMap(); + private Map fLocationToRcMap = new HashMap<>(); - private Map> fVarToAddlInSetMap = new HashMap>(); + private Map> fVarToAddlInSetMap = new HashMap<>(); - private List fStepList = new ArrayList(); + private List fStepList = new ArrayList<>(); private BuildStep fTargetStep; @@ -125,8 +125,8 @@ public class BuildDescription implements IBuildDescription { private BuildStep fInputStep; private BuildStep fOutputStep; - private Map fToolOrderMap = new HashMap(); - private Set fToolInProcesSet = new HashSet(); + private Map fToolOrderMap = new HashMap<>(); + private Set fToolInProcesSet = new HashSet<>(); private ITool fOrderedTools[]; private ICSourceEntry[] fSourceEntries; @@ -143,7 +143,7 @@ public class BuildDescription implements IBuildDescription { private class ToolInfoHolder { Map> fExtToToolAndTypeListMap; - Map fInTypeToGroupMap = new HashMap(); + Map fInTypeToGroupMap = new HashMap<>(); } class ToolAndType { @@ -489,7 +489,7 @@ public class BuildDescription implements IBuildDescription { } private Map> initToolAndTypeMap(IFolderInfo foInfo) { - Map> extToToolAndTypeListMap = new HashMap>(); + Map> extToToolAndTypeListMap = new HashMap<>(); for (ITool tool : foInfo.getFilteredTools()) { IInputType types[] = tool.getInputTypes(); if (types.length != 0) { @@ -498,7 +498,7 @@ public class BuildDescription implements IBuildDescription { if (tool.buildsFileType(ext)) { List list = extToToolAndTypeListMap.get(ext); if (list == null) { - list = new ArrayList(); + list = new ArrayList<>(); extToToolAndTypeListMap.put(ext, list); } list.add(new ToolAndType(tool, type, ext)); @@ -510,7 +510,7 @@ public class BuildDescription implements IBuildDescription { if (tool.buildsFileType(ext)) { List list = extToToolAndTypeListMap.get(ext); if (list == null) { - list = new ArrayList(); + list = new ArrayList<>(); extToToolAndTypeListMap.put(ext, list); } list.add(new ToolAndType(tool, null, ext)); @@ -936,7 +936,7 @@ public class BuildDescription implements IBuildDescription { } while (foundUnused); Set> set = fLocationToRcMap.entrySet(); - List list = new ArrayList(); + List list = new ArrayList<>(); for (Entry entry : set) { BuildResource rc = entry.getValue(); boolean doRemove = false; @@ -1019,7 +1019,7 @@ public class BuildDescription implements IBuildDescription { private BuildResource[] addOutputs(IPath paths[], BuildIOType buildArg, IPath outDirPath) { if (paths != null) { - List list = new ArrayList(); + List list = new ArrayList<>(); for (IPath path : paths) { IPath outFullPath = path; IPath outWorkspacePath = path; @@ -1474,7 +1474,7 @@ public class BuildDescription implements IBuildDescription { } public IBuildResource[] getResources(boolean generated) { - List list = new ArrayList(); + List list = new ArrayList<>(); for (IBuildResource rc : getResources()) { if (generated == (rc.getProducerStep() != fInputStep)) list.add(rc); @@ -1500,7 +1500,7 @@ public class BuildDescription implements IBuildDescription { protected Map calculateEnvironment() { IBuildEnvironmentVariable variables[] = ManagedBuildManager.getEnvironmentVariableProvider().getVariables(fCfg, true, true); - Map map = new HashMap(); + Map map = new HashMap<>(); for (IBuildEnvironmentVariable var : variables) { map.put(var.getName(), var.getValue()); @@ -1533,7 +1533,7 @@ public class BuildDescription implements IBuildDescription { // Option? if (option != null) { try { - List inputs = new ArrayList(); + List inputs = new ArrayList<>(); int optType = option.getValueType(); if (optType == IOption.STRING) { inputs.add(option.getStringValue()); @@ -1618,7 +1618,7 @@ public class BuildDescription implements IBuildDescription { Set set = fVarToAddlInSetMap.get(var); if (set == null) { - set = new HashSet(); + set = new HashSet<>(); fVarToAddlInSetMap.put(var, set); } @@ -1648,7 +1648,7 @@ public class BuildDescription implements IBuildDescription { private void calculateDeps(BuildStep step) { BuildResource rcs[] = (BuildResource[]) step.getInputResources(); - Set depSet = new HashSet(); + Set depSet = new HashSet<>(); for (BuildResource rc : rcs) { IManagedDependencyCalculator depCalc = getDependencyCalculator(step, rc); @@ -1775,7 +1775,7 @@ public class BuildDescription implements IBuildDescription { } public String[] getLibs(BuildStep step) { - Vector libs = new Vector(); + Vector libs = new Vector<>(); ITool tool = step.getLibTool(); if (tool != null) { @@ -1821,7 +1821,7 @@ public class BuildDescription implements IBuildDescription { } public String[] getUserObjs(BuildStep step) { - Vector objs = new Vector(); + Vector objs = new Vector<>(); ITool tool = fCfg.calculateTargetTool(); if (tool == null) tool = step.getTool(); @@ -2038,7 +2038,7 @@ public class BuildDescription implements IBuildDescription { String exts[] = tool.getAllInputExtensions(); - Set set = new HashSet(); + Set set = new HashSet<>(); for (ITool t : fCfg.getFilteredTools()) { if (t == tool) continue; @@ -2080,7 +2080,7 @@ public class BuildDescription implements IBuildDescription { String exts[] = tool.getAllOutputExtensions(); - Set set = new HashSet(); + Set set = new HashSet<>(); for (ITool t : fCfg.getFilteredTools()) { if (t == tool) continue; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildGroup.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildGroup.java index 7ef23ade637..deec7f7256f 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildGroup.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildGroup.java @@ -19,7 +19,7 @@ import java.util.Set; import org.eclipse.cdt.managedbuilder.buildmodel.IBuildStep; public class BuildGroup { - private Set fActions = new HashSet(); + private Set fActions = new HashSet<>(); private boolean fNeedsRebuild; /* (non-Javadoc) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildIOType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildIOType.java index debdd80b591..e51c9ba08f4 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildIOType.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildIOType.java @@ -25,7 +25,7 @@ import org.eclipse.cdt.managedbuilder.core.IOutputType; public class BuildIOType implements IBuildIOType { private BuildStep fStep; - private List fResources = new ArrayList(); + private List fResources = new ArrayList<>(); private boolean fIsInput; private boolean fIsPrimary; private String fLinkId; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildProcessManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildProcessManager.java index c6591c72815..ce69fa24fcd 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildProcessManager.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildProcessManager.java @@ -48,7 +48,7 @@ public class BuildProcessManager { err = _err; show = _show; maxProcesses = _procNumber; - processes = new Vector(Math.min(10, maxProcesses), 10); + processes = new Vector<>(Math.min(10, maxProcesses), 10); } /** @@ -131,7 +131,7 @@ public class BuildProcessManager { if (map == null) return null; - List list = new ArrayList(); + List list = new ArrayList<>(); Set> entrySet = map.entrySet(); for (Entry entry : entrySet) { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java index 1f2ee3d97fe..206654cf761 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java @@ -31,7 +31,7 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; public class BuildResource implements IBuildResource { - private List fDepArgs = new ArrayList(); + private List fDepArgs = new ArrayList<>(); private BuildIOType fProducerArg; private boolean fNeedsRebuild; private boolean fIsRemoved; @@ -226,7 +226,7 @@ public class BuildResource implements IBuildResource { @Override public IBuildStep[] getDependentSteps() { - Set set = new HashSet(); + Set set = new HashSet<>(); for (Iterator iter = fDepArgs.iterator(); iter.hasNext();) { set.add(iter.next().getStep()); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStep.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStep.java index 9eeaead489c..2cf4bc22a24 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStep.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStep.java @@ -64,8 +64,8 @@ public class BuildStep implements IBuildStep { */ private static final int MAX_CLEAN_LENGTH = 6000; - private List fInputTypes = new ArrayList(); - private List fOutputTypes = new ArrayList(); + private List fInputTypes = new ArrayList<>(); + private List fOutputTypes = new ArrayList<>(); private ITool fTool; private BuildGroup fBuildGroup; private boolean fNeedsRebuild; @@ -190,7 +190,7 @@ public class BuildStep implements IBuildStep { public BuildIOType[] getPrimaryTypes(boolean input) { List types = input ? fInputTypes : fOutputTypes; - List list = new ArrayList(); + List list = new ArrayList<>(); for (BuildIOType arg : types) { if (arg.isPrimary()) list.add(arg); @@ -229,7 +229,7 @@ public class BuildStep implements IBuildStep { public IBuildResource[] getResources(boolean input) { List list = input ? fInputTypes : fOutputTypes; - Set set = new HashSet(); + Set set = new HashSet<>(); for (BuildIOType arg : list) { IBuildResource rcs[] = arg.getResources(); @@ -250,7 +250,7 @@ public class BuildStep implements IBuildStep { String cleanCmd = fBuildDescription.getConfiguration().getCleanCommand(); if (cleanCmd != null && (cleanCmd = cleanCmd.trim()).length() > 0) { - List list = new ArrayList(); + List list = new ArrayList<>(); cleanCmd = resolveMacros(cleanCmd, resolveAll); String commands[] = cleanCmd.split(";"); //$NON-NLS-1$ for (int i = 0; i < commands.length - 1; i++) { @@ -309,7 +309,7 @@ public class BuildStep implements IBuildStep { if (step != null && (step = step.trim()).length() > 0) { String commands[] = step.split(";"); //$NON-NLS-1$ - List list = new ArrayList(); + List list = new ArrayList<>(); for (int i = 0; i < commands.length; i++) { IBuildCommand cmds[] = createCommandsFromString(commands[i], cwd, getEnvironment()); for (int j = 0; j < cmds.length; j++) { @@ -427,7 +427,7 @@ public class BuildStep implements IBuildStep { char expect = 0; char prev = 0; // int start = 0; - List list = new ArrayList(); + List list = new ArrayList<>(); StringBuilder buf = new StringBuilder(); for (int i = 0; i < arr.length; i++) { char ch = arr[i]; @@ -476,7 +476,7 @@ public class BuildStep implements IBuildStep { BuildIOType[] types = getPrimaryTypes(input); if (types.length == 0) types = input ? (BuildIOType[]) getInputIOTypes() : (BuildIOType[]) getOutputIOTypes(); - List list = new ArrayList(); + List list = new ArrayList<>(); for (int i = 0; i < types.length; i++) { BuildResource[] rcs = (BuildResource[]) types[i].getResources(); @@ -490,7 +490,7 @@ public class BuildStep implements IBuildStep { } private String[] resourcesToStrings(IPath cwd, BuildResource rcs[], String prefixToRm) { - List list = new ArrayList(rcs.length); + List list = new ArrayList<>(rcs.length); for (int i = 0; i < rcs.length; i++) { IPath path = BuildDescriptionManager.getRelPath(cwd, rcs[i].getLocation()); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java index 2b84254c9ec..735dd8bc9aa 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java @@ -162,7 +162,7 @@ public class CommandBuilder implements IBuildModelBuilder { if (map == null) return null; - List list = new ArrayList(); + List list = new ArrayList<>(); Set> entrySet = map.entrySet(); for (Entry entry : entrySet) { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ConfigurationBuildState.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ConfigurationBuildState.java index 163eec8991d..cb9aa060dba 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ConfigurationBuildState.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ConfigurationBuildState.java @@ -92,7 +92,7 @@ public class ConfigurationBuildState implements IConfigurationBuildState { if (fPathToStateProps == null) { fPathToStateProps = new Properties(); - fStateToPathListMap = new HashMap>(); + fStateToPathListMap = new HashMap<>(); } String strState = stateToString(Integer.valueOf(state)); Integer iState = stateToInt(strState); @@ -110,7 +110,7 @@ public class ConfigurationBuildState implements IConfigurationBuildState { fPathToStateProps.setProperty(str, strState); Set set = fStateToPathListMap.get(iState); if (set == null) { - set = new HashSet(); + set = new HashSet<>(); fStateToPathListMap.put(iState, set); } set.add(str); @@ -130,13 +130,13 @@ public class ConfigurationBuildState implements IConfigurationBuildState { } private void load(Properties props) { - HashMap> map = new HashMap>(); + HashMap> map = new HashMap<>(); for (@SuppressWarnings("rawtypes") Entry entry : props.entrySet()) { Integer i = stateToInt((String) entry.getValue()); Set list = map.get(i); if (list == null) { - list = new HashSet(); + list = new HashSet<>(); map.put(i, list); } list.add((String) entry.getKey()); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DbgUtil.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DbgUtil.java index 8b38012f05a..501ce058bca 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DbgUtil.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DbgUtil.java @@ -122,7 +122,7 @@ public class DbgUtil { IBuildIOType types[] = rc.getDependentIOTypes(); if (types.length > 0) { - Set set = new HashSet(); + Set set = new HashSet<>(); for (int i = 0; i < types.length; i++) { if (set.add(types[i].getStep())) { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DescriptionBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DescriptionBuilder.java index be3404d1c72..46e822098a3 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DescriptionBuilder.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DescriptionBuilder.java @@ -50,7 +50,7 @@ public class DescriptionBuilder implements IBuildModelBuilder { private IPath fCWD; private boolean fBuildIncrementaly; private boolean fResumeOnErrs; - private Map fStepToStepBuilderMap = new HashMap(); + private Map fStepToStepBuilderMap = new HashMap<>(); private int fNumCommands = -1; private GenDirInfo fDir; private IResourceRebuildStateContainer fRebuildStateContainer; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/GenDirInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/GenDirInfo.java index 64db3bc93fa..75f831e748b 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/GenDirInfo.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/GenDirInfo.java @@ -34,7 +34,7 @@ import org.eclipse.core.runtime.IProgressMonitor; public class GenDirInfo { private IProject fProject; private IPath fProjPath; - private Set fDirPathSet = new HashSet(); + private Set fDirPathSet = new HashSet<>(); public GenDirInfo(IProject proj) { fProject = proj; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ParallelBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ParallelBuilder.java index bd915816f46..d3b9b7586b4 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ParallelBuilder.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ParallelBuilder.java @@ -66,9 +66,9 @@ public class ParallelBuilder { protected OutputStream err; protected boolean resumeOnErrors; protected boolean buildIncrementally; - protected HashSet unsorted = new HashSet(); - protected HashMap queueHash = new HashMap(); - protected LinkedList queue = new LinkedList(); + protected HashSet unsorted = new HashSet<>(); + protected HashMap queueHash = new HashMap<>(); + protected LinkedList queue = new LinkedList<>(); private IResourceRebuildStateContainer fRebuildStateContainer; private IBuildDescription fDes; @@ -472,7 +472,7 @@ public class ParallelBuilder { */ protected int dispatch(BuildProcessManager mgr) { int maxProcesses = mgr.getMaxProcesses(); - Vector active = new Vector(Math.min(maxProcesses, 10), 10); + Vector active = new Vector<>(Math.min(maxProcesses, 10), 10); int activeCount = 0; int maxLevel = 0; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProjectBuildState.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProjectBuildState.java index 13e7bf0b4a7..855c6d1a478 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProjectBuildState.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProjectBuildState.java @@ -35,7 +35,7 @@ import org.eclipse.core.runtime.IPath; public class ProjectBuildState implements IProjectBuildState { private Properties fCfgIdToFileNameProps; - private Map fCfgIdToStateMap = new HashMap(); + private Map fCfgIdToStateMap = new HashMap<>(); private IProject fProject; private boolean fIsMapInfoDirty; @@ -84,7 +84,7 @@ public class ProjectBuildState implements IProjectBuildState { @Override public IConfigurationBuildState[] getConfigurationBuildStates() { Properties props = getIdToNameProperties(); - List list = new ArrayList(props.size()); + List list = new ArrayList<>(props.size()); Set keySet = props.keySet(); for (Object key : keySet) { String id = (String) key; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildProperties.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildProperties.java index eb2cec78373..b9fa395d314 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildProperties.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildProperties.java @@ -24,7 +24,7 @@ import org.eclipse.cdt.managedbuilder.buildproperties.IBuildProperty; import org.eclipse.core.runtime.CoreException; public class BuildProperties implements IBuildProperties { - private HashMap fPropertiesMap = new HashMap(); + private HashMap fPropertiesMap = new HashMap<>(); private ArrayList fInexistentProperties; public BuildProperties() { @@ -40,7 +40,7 @@ public class BuildProperties implements IBuildProperties { addProperty(prop); } catch (CoreException e) { if (fInexistentProperties == null) - fInexistentProperties = new ArrayList(); + fInexistentProperties = new ArrayList<>(); fInexistentProperties.add(property); } @@ -86,7 +86,7 @@ public class BuildProperties implements IBuildProperties { } catch (CoreException e) { if (force) { if (fInexistentProperties == null) - fInexistentProperties = new ArrayList(1); + fInexistentProperties = new ArrayList<>(1); fInexistentProperties.add(BuildProperty.toString(propertyId, propertyValue)); fInexistentProperties.trimToSize(); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyManager.java index 80ed810f9b6..caf1c2b119c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyManager.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyManager.java @@ -64,7 +64,7 @@ public class BuildPropertyManager implements IBuildPropertyManager { return properties.toString(); } - private Map fPropertyTypeMap = new HashMap(); + private Map fPropertyTypeMap = new HashMap<>(); @Override public IBuildPropertyType getPropertyType(String id) { @@ -136,13 +136,13 @@ public class BuildPropertyManager implements IBuildPropertyManager { private List getTypeElList(boolean create) { if (fTypeCfgElements == null && create) - fTypeCfgElements = new ArrayList(); + fTypeCfgElements = new ArrayList<>(); return fTypeCfgElements; } private List getValueElList(boolean create) { if (fValueCfgElements == null && create) - fValueCfgElements = new ArrayList(); + fValueCfgElements = new ArrayList<>(); return fValueCfgElements; } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyType.java index 3d2781354d4..a0ef3398a4c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyType.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyType.java @@ -20,7 +20,7 @@ import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyType; import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue; public class BuildPropertyType extends PropertyBase implements IBuildPropertyType { - private Map fValuesMap = new HashMap(); + private Map fValuesMap = new HashMap<>(); BuildPropertyType(String id, String name) { super(id, name); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java index 90fdbce539d..d1c6b57d320 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java @@ -459,7 +459,7 @@ public class AdditionalInput implements IAdditionalInput { libNames = options[i].getLibraries(); } else if (type == IOption.LIBRARY_PATHS) { if (null == libPaths) - libPaths = new ArrayList(); + libPaths = new ArrayList<>(); libPaths.addAll(Arrays.asList(restoreLibraryPaths(options[i]))); } } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BooleanExpressionApplicabilityCalculator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BooleanExpressionApplicabilityCalculator.java index bbd8387febf..9b5a7d2cf61 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BooleanExpressionApplicabilityCalculator.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BooleanExpressionApplicabilityCalculator.java @@ -193,7 +193,7 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab private Map> getReferencedProperties() { if (fRefPropsMap == null) { - fRefPropsMap = new HashMap>(); + fRefPropsMap = new HashMap<>(); for (int i = 0; i < fExpressions.length; i++) { fExpressions[i].getReferencedProperties(fRefPropsMap); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObjectProperties.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObjectProperties.java index 56838b4a6bc..6e69f7d539a 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObjectProperties.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObjectProperties.java @@ -54,7 +54,7 @@ public class BuildObjectProperties extends BuildProperties implements IBuildObje IBuildPropertyType types[] = BuildPropertyManager.getInstance().getPropertyTypes(); if (fRestriction != null && types.length != 0) { - List list = new ArrayList(types.length); + List list = new ArrayList<>(types.length); for (IBuildPropertyType type : types) { if (fRestriction.supportsType(type.getId())) list.add(type); @@ -72,7 +72,7 @@ public class BuildObjectProperties extends BuildProperties implements IBuildObje if (type != null) { IBuildPropertyValue values[] = type.getSupportedValues(); if (fRestriction != null && values.length != 0) { - List list = new ArrayList(values.length); + List list = new ArrayList<>(values.length); for (IBuildPropertyValue value : values) { if (fRestriction.supportsValue(type.getId(), value.getId())) list.add(value); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildSettingsUtil.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildSettingsUtil.java index bd60d8b5f34..d3049dacc06 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildSettingsUtil.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildSettingsUtil.java @@ -68,7 +68,7 @@ public class BuildSettingsUtil { public static ITool[] getDependentTools(IConfiguration cfg, ITool tool) { IResourceInfo rcInfos[] = cfg.getResourceInfos(); - List list = new ArrayList(); + List list = new ArrayList<>(); for (int i = 0; i < rcInfos.length; i++) { calcDependentTools(rcInfos[i], tool, list); } @@ -81,7 +81,7 @@ public class BuildSettingsUtil { public static List calcDependentTools(ITool tools[], ITool tool, List list) { if (list == null) - list = new ArrayList(); + list = new ArrayList<>(); for (int i = 0; i < tools.length; i++) { ITool superTool = tools[i]; @@ -98,7 +98,7 @@ public class BuildSettingsUtil { public static void copyCommonSettings(ITool fromTool, ITool toTool) { Tool fromT = (Tool) fromTool; Tool toT = (Tool) toTool; - List values = new ArrayList(); + List values = new ArrayList<>(); for (int i = 0; i < COMMON_SETTINGS_IDS.length; i++) { int type = COMMON_SETTINGS_IDS[i]; IOption[] toOptions = toT.getOptionsOfType(type); @@ -211,7 +211,7 @@ public class BuildSettingsUtil { } public static ITool[] getToolsBySuperClassId(ITool[] tools, String id) { - List retTools = new ArrayList(); + List retTools = new ArrayList<>(); if (id != null) { for (int i = 0; i < tools.length; i++) { ITool targetTool = tools[i]; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java index dfd5c21252c..7098f24baf8 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java @@ -596,7 +596,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider if (entries.length == 0) { outputEntries = new ICOutputEntry[0]; } else { - List list = new ArrayList(entries.length); + List list = new ArrayList<>(entries.length); for (int k = 0; k < entries.length; k++) { if (entries[k].getKind() == ICLanguageSettingEntry.OUTPUT_PATH) list.add(entries[k]); @@ -815,7 +815,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider if (entries.length == 0) { outputEntries = new ICOutputEntry[0]; } else { - List list = new ArrayList(entries.length); + List list = new ArrayList<>(entries.length); for (int k = 0; k < entries.length; k++) { if (entries[k].getKind() == ICLanguageSettingEntry.OUTPUT_PATH) list.add(entries[k]); @@ -1276,7 +1276,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider errorParsers = new String[0]; } else { StringTokenizer tok = new StringTokenizer(parserIDs, ";"); //$NON-NLS-1$ - List list = new ArrayList(tok.countTokens()); + List list = new ArrayList<>(tok.countTokens()); while (tok.hasMoreElements()) { list.add(tok.nextToken()); } @@ -2356,14 +2356,14 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider private Map getCustomBuildPropertiesMap() { if (customBuildProperties == null) { - customBuildProperties = new HashMap(); + customBuildProperties = new HashMap<>(); } return customBuildProperties; } @Override public void setEnvironment(Map env) throws CoreException { - customizedEnvironment = new HashMap(env); + customizedEnvironment = new HashMap<>(env); } @Override @@ -2473,7 +2473,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider return null; if (!isExtensionBuilder) return null; - return new MatchKey(this); + return new MatchKey<>(this); } @Override @@ -2667,7 +2667,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider public Set contributeErrorParsers(Set set) { if (getErrorParserIds() != null) { if (set == null) - set = new HashSet(); + set = new HashSet<>(); String ids[] = getErrorParserList(); if (ids.length != 0) @@ -2683,7 +2683,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider void removeErrorParsers(Set set) { Set oldSet = contributeErrorParsers(null); if (oldSet == null) - oldSet = new HashSet(); + oldSet = new HashSet<>(); oldSet.removeAll(set); setErrorParserList(oldSet.toArray(new String[oldSet.size()])); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuilderFactory.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuilderFactory.java index 65d7f4de7ff..2c41e08b8a1 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuilderFactory.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuilderFactory.java @@ -160,7 +160,7 @@ public class BuilderFactory { } public static Map createBuildArgs(IConfiguration cfgs[]) { - Map map = new HashMap(); + Map map = new HashMap<>(); cfgsToMap(cfgs, map); map.put(CONTENTS, CONTENTS_CONFIGURATION_IDS); return map; @@ -195,7 +195,7 @@ public class BuilderFactory { } private static IConfiguration[] idsToConfigurations(String ids[], IConfiguration allCfgs[]) { - List list = new ArrayList(ids.length); + List list = new ArrayList<>(ids.length); for (int i = 0; i < ids.length; i++) { String id = ids[i]; for (int j = 0; j < allCfgs.length; j++) { @@ -379,7 +379,7 @@ public class BuilderFactory { } else if (CONTENTS_BUILDER.equals(type)) { IConfiguration cfgs[] = configsFromMap(args, info); if (cfgs.length != 0) { - List list = new ArrayList(cfgs.length); + List list = new ArrayList<>(cfgs.length); for (int i = 0; i < cfgs.length; i++) { IBuilder builder = createBuilder(cfgs[i], args, false); if (builder != null) @@ -391,7 +391,7 @@ public class BuilderFactory { } else if (CONTENTS_CONFIGURATION_IDS.equals(type)) { IConfiguration cfgs[] = configsFromMap(args, info); if (cfgs.length != 0) { - List list = new ArrayList(cfgs.length); + List list = new ArrayList<>(cfgs.length); for (int i = 0; i < cfgs.length; i++) { list.add(cfgs[i].getEditableBuilder()); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java index dc69cbb60cd..955f82cbd7f 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java @@ -116,12 +116,12 @@ public class CommonBuilder extends ACBuilder { } private static class CfgBuildSet { - Map> fMap = new HashMap>(); + Map> fMap = new HashMap<>(); public Set getCfgIdSet(IProject project, boolean create) { Set set = fMap.get(project); if (set == null && create) { - set = new HashSet(); + set = new HashSet<>(); fMap.put(project, set); } return set; @@ -326,7 +326,7 @@ public class CommonBuilder extends ACBuilder { }; OtherConfigVerifier(IBuilder builders[], IConfiguration allCfgs[]) { - Set buildCfgSet = new HashSet(); + Set buildCfgSet = new HashSet<>(); for (IBuilder builder : builders) { buildCfgSet.add(builder.getParent().getParent()); } @@ -337,7 +337,7 @@ public class CommonBuilder extends ACBuilder { else otherConfigs = new Configuration[0]; - List list = new ArrayList(builders.length); + List list = new ArrayList<>(builders.length); // buildFullPaths = new IPath[builders.length]; for (IBuilder builder : builders) { IPath path = ManagedBuildManager.getBuildFullPath(builder.getParent().getParent(), builder); @@ -565,7 +565,7 @@ public class CommonBuilder extends ACBuilder { } private IConfiguration[] filterConfigsToBuild(IConfiguration[] cfgs) { - List cfgList = new ArrayList(cfgs.length); + List cfgList = new ArrayList<>(cfgs.length); for (IConfiguration cfg : cfgs) { IProject project = cfg.getOwner().getProject(); Set set = fBuildSet.getCfgIdSet(project, true); @@ -593,7 +593,7 @@ public class CommonBuilder extends ACBuilder { } private IConfiguration[] getReferencedConfigs(IBuilder[] builders) { - Set set = new HashSet(); + Set set = new HashSet<>(); for (IBuilder builder : builders) { IConfiguration cfg = builder.getParent().getParent(); IConfiguration refs[] = ManagedBuildManager.getReferencedConfigurations(cfg); @@ -606,9 +606,9 @@ public class CommonBuilder extends ACBuilder { private Set getProjectsSet(IConfiguration[] cfgs) { if (cfgs.length == 0) - return new HashSet(0); + return new HashSet<>(0); - Set set = new HashSet(); + Set set = new HashSet<>(); for (IConfiguration cfg : cfgs) { set.add(cfg.getOwner().getProject()); } @@ -664,7 +664,7 @@ public class CommonBuilder extends ACBuilder { private final boolean fManagedBuildOn; private boolean fRebuild; private boolean fBuild = true; - private final List fConsoleMessages = new ArrayList(); + private final List fConsoleMessages = new ArrayList<>(); private IManagedBuilderMakefileGenerator fMakeGen; public BuildStatus(IBuilder builder) { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java index 6243e28dd7d..a6fb4c7d961 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java @@ -229,8 +229,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild // Load the children IManagedConfigElement[] configElements = element.getChildren(); - List srcPathList = new ArrayList(); - excludeList = new ArrayList(); + List srcPathList = new ArrayList<>(); + excludeList = new ArrayList<>(); for (int l = 0; l < configElements.length; ++l) { IManagedConfigElement configElement = configElements[l]; if (configElement.getName().equals(IToolChain.TOOL_CHAIN_ELEMENT_NAME)) { @@ -315,7 +315,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild return curEntries; int pathSize = pathList.size(); - Map map = new LinkedHashMap(); + Map map = new LinkedHashMap<>(); for (int i = 0; i < pathSize; i++) { IPath path = pathList.get(i); @@ -416,8 +416,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild managedProject.addConfiguration(this); ICStorageElement configElements[] = element.getChildren(); - List srcPathList = new ArrayList(); - excludeList = new ArrayList(); + List srcPathList = new ArrayList<>(); + excludeList = new ArrayList<>(); for (int i = 0; i < configElements.length; ++i) { ICStorageElement configElement = configElements[i]; if (configElement.getName().equals(IToolChain.TOOL_CHAIN_ELEMENT_NAME)) { @@ -690,7 +690,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild boolean copyIds = cloneConfig.getId().equals(id); String subId; // Resource Configurations - Map> toolIdMap = new HashMap>(); + Map> toolIdMap = new HashMap<>(); IResourceInfo infos[] = cloneConfig.rcInfos.getResourceInfos(); for (int i = 0; i < infos.length; i++) { if (infos[i] instanceof FolderInfo) { @@ -1356,7 +1356,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild String parserIDs = getErrorParserIdsAttribute(); if (parserIDs != null) { if (set == null) - set = new LinkedHashSet(); + set = new LinkedHashSet<>(); if (parserIDs.length() != 0) { StringTokenizer tok = new StringTokenizer(parserIDs, ";"); //$NON-NLS-1$ while (tok.hasMoreElements()) { @@ -1399,7 +1399,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild if (defaultLanguageSettingsProviderIds == null) { defaultLanguageSettingsProvidersAttribute = getDefaultLanguageSettingsProvidersAttribute(); if (defaultLanguageSettingsProvidersAttribute != null) { - List ids = new ArrayList(); + List ids = new ArrayList<>(); String[] defaultIds = defaultLanguageSettingsProvidersAttribute .split(LANGUAGE_SETTINGS_PROVIDER_DELIMITER); for (String id : defaultIds) { @@ -1466,7 +1466,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild ICSettingEntry[] libs = CDataUtil.resolveEntries(unresolved, des); if (libs.length > 0) { for (ICExternalSetting setting : des.getExternalSettings()) { - Set entries = new LinkedHashSet( + Set entries = new LinkedHashSet<>( Arrays.asList(setting.getEntries())); for (ICSettingEntry lib : libs) { if (entries.contains(lib)) { @@ -2374,7 +2374,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild if (set != null && set.isEmpty()) { Set oldSet = contributeErrorParsers(null, false); if (oldSet == null) - oldSet = new LinkedHashSet(); + oldSet = new LinkedHashSet<>(); oldSet.removeAll(set); setErrorParserAttribute(oldSet.toArray(new String[oldSet.size()])); @@ -2589,7 +2589,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild @Override public String[] getUserObjects(String extension) { - Vector objs = new Vector(); + Vector objs = new Vector<>(); ITool tool = calculateTargetTool(); if (tool == null) tool = getToolFromOutputExtension(extension); @@ -2630,7 +2630,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild @Override public String[] getLibs(String extension) { - Vector libs = new Vector(); + Vector libs = new Vector<>(); ITool tool = calculateTargetTool(); if (tool == null) tool = getToolFromOutputExtension(extension); @@ -2721,7 +2721,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild ICOutputEntry entries[] = getConfigurationData().getBuildData().getOutputDirectories(); IPath path = getOwner().getFullPath(); - List list = new ArrayList(entries.length + 1); + List list = new ArrayList<>(entries.length + 1); // Add project level include path list.add(CDataUtil.createCIncludePathEntry(path.toString(), ICSettingEntry.VALUE_WORKSPACE_PATH)); @@ -2816,7 +2816,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild @Override public String[] getRequiredTypeIds() { SupportedProperties props = findSupportedProperties(); - List list = new ArrayList(); + List list = new ArrayList<>(); if (props != null) { list.addAll(Arrays.asList(props.getRequiredTypeIds())); } @@ -2829,7 +2829,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild @Override public String[] getSupportedTypeIds() { SupportedProperties props = findSupportedProperties(); - List list = new ArrayList(); + List list = new ArrayList<>(); if (props != null) { list.addAll(Arrays.asList(props.getSupportedTypeIds())); } @@ -2842,7 +2842,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild @Override public String[] getSupportedValueIds(String typeId) { SupportedProperties props = findSupportedProperties(); - List list = new ArrayList(); + List list = new ArrayList<>(); if (props != null) { list.addAll(Arrays.asList(props.getSupportedValueIds(typeId))); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConfigurationV2.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConfigurationV2.java index 6ca2cd399df..9d8bf21c76f 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConfigurationV2.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConfigurationV2.java @@ -112,7 +112,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 { IProject project = (IProject) target.getOwner(); // Get the tool references from the target and parent - List allToolRefs = new Vector(target.getLocalToolReferences()); + List allToolRefs = new Vector<>(target.getLocalToolReferences()); allToolRefs.addAll(((ConfigurationV2) parentConfig).getLocalToolReferences()); for (IToolReference toolRef : allToolRefs) { // Make a new ToolReference based on the tool in the ref @@ -300,7 +300,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 { @Override public ITool[] getFilteredTools(IProject project) { ITool[] localTools = getTools(); - Vector tools = new Vector(localTools.length); + Vector tools = new Vector<>(localTools.length); for (ITool tool : localTools) { try { // Make sure the tool is right for the project @@ -339,7 +339,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 { */ protected List getLocalToolReferences() { if (toolReferences == null) { - toolReferences = new ArrayList(); + toolReferences = new ArrayList<>(); } return toolReferences; } @@ -362,7 +362,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 { // Validate that the tools correspond to the nature IProject project = (IProject) target.getOwner(); if (project != null) { - List validTools = new ArrayList(); + List validTools = new ArrayList<>(); // The target is associated with a real project for (int i = 0; i < tools.length; ++i) { @@ -448,7 +448,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 { * @return List */ protected List getOptionReferences(ITool tool) { - List references = new ArrayList(); + List references = new ArrayList<>(); // Get all the option references I add for this tool IToolReference toolRef = getToolReference(tool); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConverterInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConverterInfo.java index 9dd1e8dbd35..2392d62a2e2 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConverterInfo.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConverterInfo.java @@ -51,9 +51,9 @@ public class ConverterInfo { IConfiguration[] cfgs = mProj.getConfigurations(); fConvertedFromObject = ManagedBuildManager.convert(fFromObject, fToObject.getId(), true); IConfiguration[] updatedCfgs = mProj.getConfigurations(); - Set oldSet = new HashSet(Arrays.asList(cfgs)); - Set updatedSet = new HashSet(Arrays.asList(updatedCfgs)); - Set oldSetCopy = new HashSet(oldSet); + Set oldSet = new HashSet<>(Arrays.asList(cfgs)); + Set updatedSet = new HashSet<>(Arrays.asList(updatedCfgs)); + Set oldSetCopy = new HashSet<>(oldSet); oldSet.removeAll(updatedSet); updatedSet.removeAll(oldSetCopy); if (updatedSet.size() != 0) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/FolderInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/FolderInfo.java index 387702382b8..eab243cf57c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/FolderInfo.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/FolderInfo.java @@ -286,7 +286,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { return localTools; } IProject project = (IProject) manProj.getOwner(); - Vector tools = new Vector(localTools.length); + Vector tools = new Vector<>(localTools.length); for (ITool t : localTools) { Tool tool = (Tool) t; if (!tool.isEnabled(this)) @@ -432,7 +432,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { @Override public CLanguageData[] getCLanguageDatas() { - List list = new ArrayList(); + List list = new ArrayList<>(); for (ITool t : getFilteredTools()) for (CLanguageData d : t.getCLanguageDatas()) list.add(d); @@ -488,7 +488,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { } private Map typeIdsToMap(String[] ids, IBuildObjectProperties props) { - Map map = new HashMap(ids.length); + Map map = new HashMap<>(ids.length); for (String id : ids) { IBuildProperty prop = props.getProperty(id); map.put(id, prop.getValue().getId()); @@ -497,7 +497,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { } private Map propsToMap(IBuildProperty props[]) { - Map map = new HashMap(props.length); + Map map = new HashMap<>(props.length); for (IBuildProperty p : props) map.put(p.getPropertyType().getId(), p.getValue().getId()); return map; @@ -591,7 +591,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { @Override public String[] getRequiredTypeIds() { - List list = new ArrayList(); + List list = new ArrayList<>(); list.addAll(Arrays.asList(tc.getRequiredTypeIds(false))); @@ -604,7 +604,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { @Override public String[] getSupportedTypeIds() { - List list = new ArrayList(); + List list = new ArrayList<>(); list.addAll(Arrays.asList(tc.getSupportedTypeIds(false))); @@ -617,7 +617,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { @Override public String[] getSupportedValueIds(String typeId) { - List list = new ArrayList(); + List list = new ArrayList<>(); list.addAll(Arrays.asList(tc.getSupportedValueIds(typeId, false))); @@ -651,9 +651,9 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { } public boolean isPropertiesModificationCompatible(IToolChain tc) { - Map requiredMap = new HashMap(); - Map unsupportedMap = new HashMap(); - Set undefinedSet = new HashSet(); + Map requiredMap = new HashMap<>(); + Map unsupportedMap = new HashMap<>(); + Set undefinedSet = new HashSet<>(); if (!checkPropertiesModificationCompatibility(tc, requiredMap, unsupportedMap, undefinedSet)) return false; return true; @@ -661,7 +661,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { private Set getRequiredUnspecifiedProperties() { IBuildObjectProperties props = null; - Set set = new HashSet(); + Set set = new HashSet<>(); IConfiguration cfg = getParent(); if (cfg != null) @@ -799,8 +799,8 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { } private ITool[][] getBestMatches(ITool[] tools1, ITool[] tools2) { - HashSet set = new HashSet(Arrays.asList(tools2)); - List list = new ArrayList(tools1.length); + HashSet set = new HashSet<>(Arrays.asList(tools2)); + List list = new ArrayList<>(tools1.length); for (ITool tool1 : tools1) { ITool bestMatchTool = null; int num = 0; @@ -919,7 +919,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { } private LinkedHashMap createRealToExtToolMap(ITool[] tools, boolean extValues) { - LinkedHashMap map = new LinkedHashMap(); + LinkedHashMap map = new LinkedHashMap<>(); for (ITool t : tools) { Tool realTool = (Tool) ManagedBuildManager.getRealTool(t); MatchKey key = realTool.getMatchKey(); @@ -993,7 +993,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { if (!isRoot()) return; - Set set = new HashSet(); + Set set = new HashSet<>(); String[] ids = toolChain.getTargetToolList(); boolean targetToolsModified = false; set.addAll(Arrays.asList(ids)); @@ -1031,7 +1031,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { private ITool findCompatibleTargetTool(ITool tool, ITool allTools[]) { IProject project = getParent().getOwner().getProject(); String exts[] = ((Tool) tool).getAllOutputExtensions(project); - Set extsSet = new HashSet(Arrays.asList(exts)); + Set extsSet = new HashSet<>(Arrays.asList(exts)); ITool compatibleTool = null; for (ITool t : allTools) { String otherExts[] = ((Tool) t).getAllOutputExtensions(project); @@ -1068,7 +1068,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { } private Set getToolOutputVars(ITool tool) { - Set set = new HashSet(); + Set set = new HashSet<>(); IOutputType types[] = tool.getOutputTypes(); for (IOutputType type : types) { @@ -1163,14 +1163,14 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { @SuppressWarnings("unchecked") private ITool[][] calculateConflictingTools(ITool[] newTools) { - HashSet set = new HashSet(); + HashSet set = new HashSet<>(); set.addAll(Arrays.asList(newTools)); - List result = new ArrayList(); + List result = new ArrayList<>(); for (Iterator iter = set.iterator(); iter.hasNext();) { ITool t = iter.next(); iter.remove(); HashSet tmp = (HashSet) set.clone(); - List list = new ArrayList(); + List list = new ArrayList<>(); for (Iterator tmpIt = tmp.iterator(); tmpIt.hasNext();) { ITool other = tmpIt.next(); String conflicts[] = getConflictingInputExts(t, other); @@ -1195,8 +1195,8 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { IProject project = getParent().getOwner().getProject(); String ext1[] = ((Tool) tool1).getAllInputExtensions(project); String ext2[] = ((Tool) tool2).getAllInputExtensions(project); - Set set1 = new HashSet(Arrays.asList(ext1)); - Set result = new HashSet(); + Set set1 = new HashSet<>(Arrays.asList(ext1)); + Set result = new HashSet<>(); for (String e : ext2) { if (set1.remove(e)) result.add(e); @@ -1211,13 +1211,13 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { added = checked[1]; ITool newTools[] = calculateToolsArray(removed, added); ITool[][] conflicting = calculateConflictingTools(filterTools(newTools, getParent().getManagedProject())); - Map unspecifiedRequiredProps = new HashMap(); - Map unspecifiedProps = new HashMap(); - Set undefinedSet = new HashSet(); + Map unspecifiedRequiredProps = new HashMap<>(); + Map unspecifiedProps = new HashMap<>(); + Set undefinedSet = new HashSet<>(); IConfiguration cfg = getParent(); ITool[] nonManagedTools = null; if (cfg.isManagedBuildOn() && cfg.supportsBuild(true)) { - List list = new ArrayList(); + List list = new ArrayList<>(); for (ITool t : newTools) if (!t.supportsBuild(true)) list.add(t); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java index 1d0120df986..64ac3c306df 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java @@ -765,7 +765,7 @@ public class GeneratedMakefileBuilder extends ACBuilder { */ private Vector getGenerationProblems() { if (generationProblems == null) { - generationProblems = new Vector(); + generationProblems = new Vector<>(); } return generationProblems; } @@ -778,7 +778,7 @@ public class GeneratedMakefileBuilder extends ACBuilder { * @return */ protected String[] getMakeTargets(int buildType) { - List args = new ArrayList(); + List args = new ArrayList<>(); switch (buildType) { case CLEAN_BUILD: args.add("clean"); //$NON-NLS-1$ @@ -793,7 +793,7 @@ public class GeneratedMakefileBuilder extends ACBuilder { protected List getResourcesToBuild() { if (resourcesToBuild == null) { - resourcesToBuild = new ArrayList(); + resourcesToBuild = new ArrayList<>(); } return resourcesToBuild; } @@ -981,7 +981,7 @@ public class GeneratedMakefileBuilder extends ACBuilder { IBuildEnvironmentVariable variables[] = ManagedBuildManager.getEnvironmentVariableProvider() .getVariables(cfg, true, true); String[] envp = null; - ArrayList envList = new ArrayList(); + ArrayList envList = new ArrayList<>(); if (variables != null) { for (int i = 0; i < variables.length; i++) { envList.add(variables[i].getName() + "=" + variables[i].getValue()); //$NON-NLS-1$ @@ -998,7 +998,7 @@ public class GeneratedMakefileBuilder extends ACBuilder { OutputStream epmOutputStream = epm.getOutputStream(); // Get the arguments to be passed to make from build model - ArrayList makeArgs = new ArrayList(); + ArrayList makeArgs = new ArrayList<>(); String arg = info.getBuildArguments(); if (arg.length() > 0) { String[] args = arg.split("\\s"); //$NON-NLS-1$ @@ -1389,12 +1389,12 @@ public class GeneratedMakefileBuilder extends ACBuilder { } private Map> arrangeFilesByProject(List files) { - Map> projectMap = new HashMap>(); + Map> projectMap = new HashMap<>(); for (IFile file : files) { IProject project = file.getProject(); List filesInProject = projectMap.get(project); if (filesInProject == null) { - filesInProject = new ArrayList(); + filesInProject = new ArrayList<>(); projectMap.put(project, filesInProject); } filesInProject.add(file); @@ -1483,7 +1483,7 @@ public class GeneratedMakefileBuilder extends ACBuilder { try { IBuildResource buildResource = des.getBuildResource(file); - Set dependentSteps = new HashSet(); + Set dependentSteps = new HashSet<>(); IBuildIOType depTypes[] = buildResource.getDependentIOTypes(); for (IBuildIOType btype : depTypes) { if (btype != null && btype.getStep() != null) @@ -1624,7 +1624,7 @@ public class GeneratedMakefileBuilder extends ACBuilder { try { IBuildResource buildResource = des.getBuildResource(file); if (buildResource != null) { - Set dependentSteps = new HashSet(); + Set dependentSteps = new HashSet<>(); IBuildIOType depTypes[] = buildResource.getDependentIOTypes(); for (IBuildIOType btype : depTypes) { if (btype != null && btype.getStep() != null) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java index 6897e6d621d..a23612c389c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java @@ -176,21 +176,21 @@ public class HeadlessBuilder implements IApplication { public static final Integer OK = IApplication.EXIT_OK; /** Set of project URIs / paths to import */ - protected final Set projectsToImport = new HashSet(); + protected final Set projectsToImport = new HashSet<>(); /** Tree of projects to recursively import */ - protected final Set projectTreeToImport = new HashSet(); + protected final Set projectTreeToImport = new HashSet<>(); /** Set of project names to build */ - protected final Set projectRegExToBuild = new HashSet(); + protected final Set projectRegExToBuild = new HashSet<>(); /** Set of project names to clean */ - protected final Set projectRegExToClean = new HashSet(); + protected final Set projectRegExToClean = new HashSet<>(); protected boolean buildAll = false; protected boolean cleanAll = false; protected boolean disableIndexer = false; /** List of Tool Option values being set */ - protected List toolOptions = new ArrayList(); + protected List toolOptions = new ArrayList<>(); /** Map from configuration ID -> Set of SavedToolOptions */ - protected Map> savedToolOptions = new HashMap>(); + protected Map> savedToolOptions = new HashMap<>(); protected boolean markerTypesDefault = true; protected boolean markerTypesAll = false; protected Set markerTypes = new HashSet<>(); @@ -245,7 +245,7 @@ public class HeadlessBuilder implements IApplication { // Build this configuration for this project Set set = cfgMap.get(project); if (set == null) - set = new HashSet(); + set = new HashSet<>(); set.add(cfg); cfgMap.put(project, set); } @@ -499,7 +499,7 @@ public class HeadlessBuilder implements IApplication { IProject[] allProjects = root.getProjects(); // Map from Project -> Configurations to build. We also Build all projects which are clean'd - Map> configsToBuild = new HashMap>(); + Map> configsToBuild = new HashMap<>(); /* * Perform the Clean / Build @@ -845,7 +845,7 @@ public class HeadlessBuilder implements IApplication { case IOption.UNDEF_LIBRARY_PATHS: case IOption.UNDEF_LIBRARY_FILES: case IOption.UNDEF_MACRO_FILES: - List listValue = new ArrayList(); + List listValue = new ArrayList<>(); switch (toolOption.operation) { case ToolOption.APPEND: listValue.addAll((List) option.getValue()); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilderExternalSettingsProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilderExternalSettingsProvider.java index d6c8af7843d..0c06fe854c5 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilderExternalSettingsProvider.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilderExternalSettingsProvider.java @@ -39,7 +39,7 @@ public class HeadlessBuilderExternalSettingsProvider extends CExternalSettingPro private static final String ID = "org.eclipse.cdt.managedbuilder.core.headlessSettings"; //$NON-NLS-1$ /** List of external settings which should be appended to build */ - static List additionalSettings = new ArrayList(); + static List additionalSettings = new ArrayList<>(); public HeadlessBuilderExternalSettingsProvider() { } @@ -91,7 +91,7 @@ public class HeadlessBuilderExternalSettingsProvider extends CExternalSettingPro if (desc == null) continue; for (ICConfigurationDescription cfg : desc.getConfigurations()) { - ArrayList extSettingIds = new ArrayList( + ArrayList extSettingIds = new ArrayList<>( Arrays.asList(cfg.getExternalSettingsProviderIds())); for (Iterator it = extSettingIds.iterator(); it.hasNext();) if (ID.equals(it.next())) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java index 9ba47bae536..529eda56170 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java @@ -281,7 +281,7 @@ public abstract class HoldsOptions extends BuildObject Map map = null; if (this.superClass == null) { - map = new LinkedHashMap(); // LinkedHashMap ensures we maintain option ordering + map = new LinkedHashMap<>(); // LinkedHashMap ensures we maintain option ordering for (Option ourOpt : getOptionCollection()) { if (ourOpt.isValid()) { @@ -411,14 +411,14 @@ public abstract class HoldsOptions extends BuildObject */ private Vector getCategoryIds() { if (categoryIds == null) { - categoryIds = new Vector(); + categoryIds = new Vector<>(); } return categoryIds; } public void addChildCategory(IOptionCategory category) { if (childOptionCategories == null) - childOptionCategories = new ArrayList(); + childOptionCategories = new ArrayList<>(); childOptionCategories.add(category); } @@ -431,7 +431,7 @@ public abstract class HoldsOptions extends BuildObject */ private Map getCategoryMap() { if (categoryMap == null) { - categoryMap = new HashMap(); + categoryMap = new HashMap<>(); } return categoryMap; } @@ -452,7 +452,7 @@ public abstract class HoldsOptions extends BuildObject */ private Map getOptionMap() { if (optionMap == null) { - optionMap = new LinkedHashMap(); + optionMap = new LinkedHashMap<>(); } return optionMap; } @@ -718,7 +718,7 @@ public abstract class HoldsOptions extends BuildObject @Override public String[] getRequiredTypeIds() { - List list = new ArrayList(); + List list = new ArrayList<>(); for (IOption op : getOptions()) list.addAll(Arrays.asList(((Option) op).getRequiredTypeIds())); return list.toArray(new String[list.size()]); @@ -726,7 +726,7 @@ public abstract class HoldsOptions extends BuildObject @Override public String[] getSupportedTypeIds() { - List list = new ArrayList(); + List list = new ArrayList<>(); for (IOption op : getOptions()) list.addAll(Arrays.asList(((Option) op).getSupportedTypeIds())); return list.toArray(new String[list.size()]); @@ -734,7 +734,7 @@ public abstract class HoldsOptions extends BuildObject @Override public String[] getSupportedValueIds(String typeId) { - List list = new ArrayList(); + List list = new ArrayList<>(); for (IOption op : getOptions()) list.addAll(Arrays.asList(((Option) op).getSupportedValueIds(typeId))); return list.toArray(new String[list.size()]); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java index 895dd6ac90b..843b7c3852f 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java @@ -325,7 +325,7 @@ public class InputType extends BuildObject implements IInputType { superClassId = SafeStringInterner.safeIntern(element.getAttribute(IProjectType.SUPERCLASS)); // sourceContentType - List list = new ArrayList(); + List list = new ArrayList<>(); String ids = element.getAttribute(IInputType.SOURCE_CONTENT_TYPE); if (ids != null) { StringTokenizer tokenizer = new StringTokenizer(ids, DEFAULT_SEPARATOR); @@ -456,7 +456,7 @@ public class InputType extends BuildObject implements IInputType { // sourceContentType IContentTypeManager manager = Platform.getContentTypeManager(); - List list = new ArrayList(); + List list = new ArrayList<>(); if (element.getAttribute(IInputType.SOURCE_CONTENT_TYPE) != null) { String ids = element.getAttribute(IInputType.SOURCE_CONTENT_TYPE); if (ids != null) { @@ -471,7 +471,7 @@ public class InputType extends BuildObject implements IInputType { } if (sourceContentTypeIds != null) { - List types = new ArrayList(); + List types = new ArrayList<>(); for (String sourceContentTypeId : sourceContentTypeIds) { IContentType type = manager.getContentType(sourceContentTypeId); if (type != null) @@ -869,7 +869,7 @@ public class InputType extends BuildObject implements IInputType { */ @Override public IPath[] getAdditionalDependencies() { - List deps = new ArrayList(); + List deps = new ArrayList<>(); for (AdditionalInput additionalInput : getAdditionalInputList()) { int kind = additionalInput.getKind(); if (kind == IAdditionalInput.KIND_ADDITIONAL_DEPENDENCY @@ -892,7 +892,7 @@ public class InputType extends BuildObject implements IInputType { */ @Override public IPath[] getAdditionalResources() { - List ins = new ArrayList(); + List ins = new ArrayList<>(); for (AdditionalInput additionalInput : getAdditionalInputList()) { int kind = additionalInput.getKind(); if (kind == IAdditionalInput.KIND_ADDITIONAL_INPUT @@ -915,7 +915,7 @@ public class InputType extends BuildObject implements IInputType { */ private Vector getInputOrderList() { if (inputOrderList == null) { - inputOrderList = new Vector(); + inputOrderList = new Vector<>(); } return inputOrderList; } @@ -925,7 +925,7 @@ public class InputType extends BuildObject implements IInputType { */ private Vector getAdditionalInputList() { if (additionalInputList == null) { - additionalInputList = new Vector(); + additionalInputList = new Vector<>(); } return additionalInputList; } @@ -1023,7 +1023,7 @@ public class InputType extends BuildObject implements IInputType { return superClass.getDependencyExtensionsAttribute(); } else { if (dependencyExtensions == null) { - dependencyExtensions = new ArrayList(); + dependencyExtensions = new ArrayList<>(); } } } @@ -1096,7 +1096,7 @@ public class InputType extends BuildObject implements IInputType { private List getDependencyExtensionsList() { if (dependencyExtensions == null) { - dependencyExtensions = new ArrayList(); + dependencyExtensions = new ArrayList<>(); } return dependencyExtensions; } @@ -1441,7 +1441,7 @@ public class InputType extends BuildObject implements IInputType { setRebuildState(true); } } else { - List list = new ArrayList(); + List list = new ArrayList<>(); StringTokenizer tokenizer = new StringTokenizer(extensions, DEFAULT_SEPARATOR); while (tokenizer.hasMoreElements()) { list.add(tokenizer.nextToken()); @@ -1480,7 +1480,7 @@ public class InputType extends BuildObject implements IInputType { // Use content type if specified and registered with Eclipse IContentType types[] = getSourceContentTypes(); if (types.length != 0) { - List list = new ArrayList(); + List list = new ArrayList<>(); for (IContentType type : types) { list.addAll(Arrays.asList(((Tool) tool).getContentTypeFileSpecs(type, project))); } @@ -1493,7 +1493,7 @@ public class InputType extends BuildObject implements IInputType { public String[] getHeaderExtensions(ITool tool) { IContentType types[] = getHeaderContentTypes(); if (types.length != 0) { - List list = new ArrayList(); + List list = new ArrayList<>(); for (IContentType type : types) { list.addAll(Arrays.asList(((Tool) tool).getContentTypeFileSpecs(type))); } @@ -1589,7 +1589,7 @@ public class InputType extends BuildObject implements IInputType { // Resolve content types IContentTypeManager manager = Platform.getContentTypeManager(); - List list = new ArrayList(); + List list = new ArrayList<>(); if (sourceContentTypeIds != null) { for (String sourceContentTypeId : sourceContentTypeIds) { IContentType type = manager.getContentType(sourceContentTypeId); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java index e61e8349825..775664c1483 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java @@ -212,7 +212,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { */ @Override public String[] getConfigurationNames() { - ArrayList configNames = new ArrayList(); + ArrayList configNames = new ArrayList<>(); IConfiguration[] configs = managedProject.getConfigurations(); for (int i = 0; i < configs.length; i++) { IConfiguration configuration = configs[i]; @@ -384,7 +384,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { private ArrayList getIncludePathEntries() { // Extract the resolved paths from the project (if any) - ArrayList paths = new ArrayList(); + ArrayList paths = new ArrayList<>(); if (cProject != null) { try { IPathEntry[] entries = cProject.getResolvedPathEntries(); @@ -426,7 +426,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { } private HashMap getMacroPathEntries() { - HashMap macros = new HashMap(); + HashMap macros = new HashMap<>(); if (cProject != null) { try { IPathEntry[] entries = cProject.getResolvedPathEntries(); @@ -1003,7 +1003,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { @Deprecated private Map getTargetMap() { if (targetMap == null) { - targetMap = new HashMap(); + targetMap = new HashMap<>(); } return targetMap; } @@ -1016,7 +1016,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { @Deprecated public List getTargets() { if (targetList == null) { - targetList = new ArrayList(); + targetList = new ArrayList<>(); } return targetList; } @@ -1106,7 +1106,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { * @return IPathEntry[] */ public IPathEntry[] getManagedBuildValues() { - List entries = new ArrayList(); + List entries = new ArrayList<>(); int i = 0; IPathEntry[] a = getManagedBuildValues(IPathEntry.CDT_INCLUDE); if (a != null) { @@ -1131,7 +1131,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { * @return IPathEntry[] */ public IPathEntry[] getManagedBuildBuiltIns() { - List entries = new ArrayList(); + List entries = new ArrayList<>(); int i = 0; IPathEntry[] a = getManagedBuildBuiltIns(IPathEntry.CDT_INCLUDE); if (a != null) { @@ -1177,7 +1177,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { * @return list of strings which contains all found values */ private List getOptionValues(int entryType, boolean builtIns) { - List entries = new ArrayList(); + List entries = new ArrayList<>(); IConfiguration cfg = getDefaultConfiguration(); // process config toolchain's options @@ -1286,7 +1286,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { protected List addPaths(List entries, String[] values, IPath resPath, int context, Object obj, int type) { if (values != null && values.length > 0) { - List list = new ArrayList(); + List list = new ArrayList<>(); for (int k = 0; k < values.length; k++) { processPath(list, values[k], context, obj); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedConfigStorageElement.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedConfigStorageElement.java index ea4832ffc58..966cf2d355e 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedConfigStorageElement.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedConfigStorageElement.java @@ -67,7 +67,7 @@ public class ManagedConfigStorageElement implements ICStorageElement { if (fChildList == null && create) { IManagedConfigElement children[] = fElement.getChildren(); - fChildList = new ArrayList(children.length); + fChildList = new ArrayList<>(children.length); fChildList.addAll(Arrays.asList(children)); } return fChildList; @@ -75,7 +75,7 @@ public class ManagedConfigStorageElement implements ICStorageElement { @Override public ICStorageElement[] getChildrenByName(String name) { - List children = new ArrayList(); + List children = new ArrayList<>(); for (ICStorageElement child : getChildren()) if (name.equals(child.getName())) children.add(child); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java index af3928ac836..62f31b105d8 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java @@ -418,7 +418,7 @@ public class ManagedProject extends BuildObject */ private Collection getConfigurationCollection() { synchronized (configMap) { - return new ArrayList(configMap.values()); + return new ArrayList<>(configMap.values()); } } @@ -658,7 +658,7 @@ public class ManagedProject extends BuildObject @Override public String[] getRequiredTypeIds() { - List result = new ArrayList(); + List result = new ArrayList<>(); IConfiguration cfgs[] = getConfigurations(); for (IConfiguration cfg : cfgs) { result.addAll(Arrays.asList(((Configuration) cfg).getRequiredTypeIds())); @@ -668,7 +668,7 @@ public class ManagedProject extends BuildObject @Override public String[] getSupportedTypeIds() { - List result = new ArrayList(); + List result = new ArrayList<>(); IConfiguration cfgs[] = getConfigurations(); for (IConfiguration cfg : cfgs) { result.addAll(Arrays.asList(((Configuration) cfg).getSupportedTypeIds())); @@ -678,7 +678,7 @@ public class ManagedProject extends BuildObject @Override public String[] getSupportedValueIds(String typeId) { - List result = new ArrayList(); + List result = new ArrayList<>(); IConfiguration cfgs[] = getConfigurations(); for (IConfiguration cfg : cfgs) { result.addAll(Arrays.asList(((Configuration) cfg).getSupportedValueIds(typeId))); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MapStorageElement.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MapStorageElement.java index 66f07285bb8..21689b9e078 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MapStorageElement.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MapStorageElement.java @@ -34,19 +34,19 @@ public class MapStorageElement implements ICStorageElement { private static final String CHILDREN_KEY = "?children?"; //$NON-NLS-1$ private static final String NAME_KEY = "?name?"; //$NON-NLS-1$ private static final String VALUE_KEY = "?value?"; //$NON-NLS-1$ - private List fChildren = new ArrayList(); + private List fChildren = new ArrayList<>(); private String fValue; public MapStorageElement(String name, MapStorageElement parent) { fName = name; fParent = parent; - fMap = new HashMap(); + fMap = new HashMap<>(); } public MapStorageElement(Map map, MapStorageElement parent) { fName = map.get(getMapKey(NAME_KEY)); fValue = map.get(getMapKey(VALUE_KEY)); - fMap = new HashMap(map); + fMap = new HashMap<>(map); fParent = parent; String children = map.get(getMapKey(CHILDREN_KEY)); @@ -86,7 +86,7 @@ public class MapStorageElement implements ICStorageElement { int size = fChildren.size(); if (size != 0) { - List childrenStrList = new ArrayList(size); + List childrenStrList = new ArrayList<>(size); for (int i = 0; i < size; i++) { MapStorageElement child = fChildren.get(i); Map childStrMap = child.toStringMap(); @@ -143,7 +143,7 @@ public class MapStorageElement implements ICStorageElement { @Override public ICStorageElement[] getChildrenByName(String name) { - List children = new ArrayList(); + List children = new ArrayList<>(); for (ICStorageElement child : fChildren) if (name.equals(child.getName())) children.add(child); @@ -189,7 +189,7 @@ public class MapStorageElement implements ICStorageElement { public static HashMap decodeMap(String value) { List list = decodeList(value); - HashMap map = new HashMap(); + HashMap map = new HashMap<>(); char escapeChar = '\\'; for (int i = 0; i < list.size(); i++) { @@ -215,7 +215,7 @@ public class MapStorageElement implements ICStorageElement { } public static List decodeList(String value) { - List list = new ArrayList(); + List list = new ArrayList<>(); if (value != null) { StringBuilder envStr = new StringBuilder(value); String escapeChars = "|\\"; //$NON-NLS-1$ @@ -313,7 +313,7 @@ public class MapStorageElement implements ICStorageElement { @Override public String[] getAttributeNames() { - List list = new ArrayList(fMap.size()); + List list = new ArrayList<>(fMap.size()); Set> entrySet = fMap.entrySet(); for (Entry entry : entrySet) { String key = entry.getKey(); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ModificationStatus.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ModificationStatus.java index 2f79fc761be..cf4ef0a5858 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ModificationStatus.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ModificationStatus.java @@ -25,9 +25,9 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; public class ModificationStatus extends Status implements IModificationStatus { - private HashMap fUnsupportedProperties = new HashMap(); - private HashMap fUnsupportedRequiredProperties = new HashMap(); - private HashSet fUndefinedProperties = new HashSet(); + private HashMap fUnsupportedProperties = new HashMap<>(); + private HashMap fUnsupportedRequiredProperties = new HashMap<>(); + private HashSet fUndefinedProperties = new HashSet<>(); private ITool[][] fToolConflicts; private ITool[] fNonManagedBuildTools; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java index e46fa64c5b1..fc3a6f10dca 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java @@ -659,7 +659,7 @@ public class MultiConfiguration extends MultiItemsHolder implements IMultiConfig */ @Override public IResourceInfo[] getResourceInfos() { - ArrayList ri = new ArrayList(); + ArrayList ri = new ArrayList<>(); for (int i = 0; i < fCfgs.length; i++) { IResourceInfo[] ris = fCfgs[i].getResourceInfos(); ri.addAll(Arrays.asList(ris)); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/NotificationManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/NotificationManager.java index fa0def6bbc3..9ed1dd0a041 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/NotificationManager.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/NotificationManager.java @@ -25,7 +25,7 @@ public class NotificationManager /*implements ISettingsChangeListener */ { private List fListeners; private NotificationManager() { - fListeners = new CopyOnWriteArrayList(); + fListeners = new CopyOnWriteArrayList<>(); } public static NotificationManager getInstance() { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java index 2eba61ef9f9..47669958f47 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java @@ -232,7 +232,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest categoryId = option.categoryId; } if (option.builtIns != null) { - builtIns = new ArrayList(option.builtIns); + builtIns = new ArrayList<>(option.builtIns); } if (option.browseType != null) { browseType = option.browseType; @@ -247,9 +247,9 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest resourceFilter = option.resourceFilter; } if (option.applicableValuesList != null) { - applicableValuesList = new ArrayList(option.applicableValuesList); - commandsMap = new HashMap(option.commandsMap); - namesMap = new HashMap(option.namesMap); + applicableValuesList = new ArrayList<>(option.applicableValuesList); + commandsMap = new HashMap<>(option.commandsMap); + namesMap = new HashMap<>(option.namesMap); } if (option.treeRoot != null) { treeRoot = new TreeRoot((TreeRoot) option.treeRoot); @@ -296,13 +296,13 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest case UNDEF_MACRO_FILES: if (option.value != null) { @SuppressWarnings("unchecked") - ArrayList list = new ArrayList( + ArrayList list = new ArrayList<>( (ArrayList) option.value); value = list; } if (option.defaultValue != null) { @SuppressWarnings("unchecked") - ArrayList list = new ArrayList( + ArrayList list = new ArrayList<>( (ArrayList) option.defaultValue); defaultValue = list; } @@ -602,7 +602,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest ICStorageElement configElement = configNode; String optId = SafeStringInterner.safeIntern(configElement.getAttribute(ID)); if (i == 0) { - applicableValuesList = new ArrayList(); + applicableValuesList = new ArrayList<>(); if (defaultValue == null) { defaultValue = optId; // Default value to be overridden is default is specified } @@ -650,8 +650,8 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest // Note: These string-list options do not load either the "value" or // "defaultValue" attributes. Instead, the ListOptionValue children // are loaded in the value field. - List vList = new ArrayList(); - List biList = new ArrayList(); + List vList = new ArrayList<>(); + List biList = new ArrayList<>(); configElements = element.getChildren(); for (ICStorageElement veNode : configElements) { if (veNode.getName().equals(LIST_VALUE)) { @@ -1473,7 +1473,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest */ private Map getCommandMap() { if (commandsMap == null) { - commandsMap = new HashMap(); + commandsMap = new HashMap<>(); } return commandsMap; } @@ -1516,7 +1516,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest */ private Map getNameMap() { if (namesMap == null) { - namesMap = new HashMap(); + namesMap = new HashMap<>(); } return namesMap; } @@ -1794,7 +1794,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest return null; } - List valueList = new ArrayList(list.size()); + List valueList = new ArrayList<>(list.size()); for (int i = 0; i < list.size(); i++) { OptionStringValue el = list.get(i); valueList.add(el.getValue()); @@ -1807,7 +1807,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest return null; } - List lvList = new ArrayList(list.size()); + List lvList = new ArrayList<>(list.size()); for (int i = 0; i < list.size(); i++) { String v = list.get(i); lvList.add(new OptionStringValue(v, builtIn)); @@ -2034,7 +2034,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest if (value == null) { this.value = null; } else { - this.value = new ArrayList(Arrays.asList(value)); + this.value = new ArrayList<>(Arrays.asList(value)); } } else { throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ @@ -2255,7 +2255,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest for (int i = 0; i < enumElements.length; ++i) { String optId = SafeStringInterner.safeIntern(enumElements[i].getAttribute(ID)); if (i == 0) { - applicableValuesList = new ArrayList(); + applicableValuesList = new ArrayList<>(); if (defaultValue == null) { defaultValue = optId; // Default value to be overridden if default is specified } @@ -2278,7 +2278,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest if (treeRootConfigs != null && treeRootConfigs.length == 1) { IManagedConfigElement treeRootConfig = treeRootConfigs[0]; treeRoot = new TreeRoot(treeRootConfig, element, getParent() instanceof IToolChain); - applicableValuesList = new ArrayList(); + applicableValuesList = new ArrayList<>(); iterateOnTree(treeRoot, new ITreeNodeIterator() { @Override @@ -2317,8 +2317,8 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest IManagedConfigElement[] vElements = element.getChildren(LIST_VALUE); for (IManagedConfigElement vElement : vElements) { if (vList == null) { - vList = new ArrayList(); - builtIns = new ArrayList(); + vList = new ArrayList<>(); + builtIns = new ArrayList<>(); } OptionStringValue ve = new OptionStringValue(vElement); if (ve.isBuiltIn()) { @@ -2774,7 +2774,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest IManagedConfigElement[] treeChildren = element.getChildren(TREE_VALUE); if (treeChildren != null && treeChildren.length > 0) { - children = new ArrayList(); + children = new ArrayList<>(); for (IManagedConfigElement configElement : treeChildren) { children.add(new TreeOption(configElement, this, readTool)); } @@ -2791,7 +2791,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest this.parent = parent; if (clone.children != null) { - children = new ArrayList(); + children = new ArrayList<>(); for (ITreeOption cloneChild : clone.children) { children.add(new TreeOption((TreeOption) cloneChild, this)); } @@ -2808,7 +2808,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest public ITreeOption addChild(String id, String name) { ITreeOption option = new TreeOption(id, name, this); if (children == null) { - children = new ArrayList(); + children = new ArrayList<>(); } children.add(0, option); return option; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java index 403b53905d4..9d900f51ede 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java @@ -251,7 +251,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory { public void addChildCategory(OptionCategory category) { if (children == null) - children = new ArrayList(); + children = new ArrayList<>(); children.add(category); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java index 208e34b6ca1..f1bdb6a3732 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java @@ -145,7 +145,7 @@ public class OptionReference implements IOption { case UNDEF_LIBRARY_PATHS: case UNDEF_LIBRARY_FILES: case UNDEF_MACRO_FILES: - List valueList = new ArrayList(); + List valueList = new ArrayList<>(); NodeList nodes = element.getElementsByTagName(LIST_VALUE); for (int i = 0; i < nodes.getLength(); ++i) { Node node = nodes.item(i); @@ -221,7 +221,7 @@ public class OptionReference implements IOption { case UNDEF_LIBRARY_PATHS: case UNDEF_LIBRARY_FILES: case UNDEF_MACRO_FILES: - List valueList = new ArrayList(); + List valueList = new ArrayList<>(); IManagedConfigElement[] valueElements = element.getChildren(LIST_VALUE); for (IManagedConfigElement valueElement : valueElements) { Boolean isBuiltIn = Boolean.valueOf(valueElement.getAttribute(LIST_ITEM_BUILTIN)); @@ -539,14 +539,14 @@ public class OptionReference implements IOption { private List getBuiltInList() { if (builtIns == null) { - builtIns = new ArrayList(); + builtIns = new ArrayList<>(); } return builtIns; } @Override public String[] getBuiltIns() { - List answer = new ArrayList(); + List answer = new ArrayList<>(); if (builtIns != null) { answer.addAll(builtIns); } @@ -716,7 +716,7 @@ public class OptionReference implements IOption { || getValueType() == UNDEF_INCLUDE_FILES || getValueType() == UNDEF_LIBRARY_PATHS || getValueType() == UNDEF_LIBRARY_FILES || getValueType() == UNDEF_MACRO_FILES) { // Just replace what the option reference is holding onto - this.value = new ArrayList(Arrays.asList(value)); + this.value = new ArrayList<>(Arrays.asList(value)); } else { throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java index 069db10bb44..88fcbc9342e 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java @@ -286,7 +286,7 @@ public class ProjectType extends BuildObject */ private List getConfigurationList() { if (configList == null) { - configList = new ArrayList(); + configList = new ArrayList<>(); } return configList; } @@ -296,7 +296,7 @@ public class ProjectType extends BuildObject */ private Map getConfigurationMap() { if (configMap == null) { - configMap = new HashMap(); + configMap = new HashMap<>(); } return configMap; } @@ -768,7 +768,7 @@ public class ProjectType extends BuildObject @Override public String[] getRequiredTypeIds() { - List result = new ArrayList(); + List result = new ArrayList<>(); List list = getConfigurationList(); for (int i = 0; i < list.size(); i++) { result.addAll(Arrays.asList((list.get(i)).getRequiredTypeIds())); @@ -778,7 +778,7 @@ public class ProjectType extends BuildObject @Override public String[] getSupportedTypeIds() { - List result = new ArrayList(); + List result = new ArrayList<>(); List list = getConfigurationList(); for (int i = 0; i < list.size(); i++) { result.addAll(Arrays.asList((list.get(i)).getSupportedTypeIds())); @@ -788,7 +788,7 @@ public class ProjectType extends BuildObject @Override public String[] getSupportedValueIds(String typeId) { - List result = new ArrayList(); + List result = new ArrayList<>(); List list = getConfigurationList(); for (int i = 0; i < list.size(); i++) { result.addAll(Arrays.asList((list.get(i)).getSupportedValueIds(typeId))); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PropertyManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PropertyManager.java index ad4ea33fc02..c0833f720ad 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PropertyManager.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PropertyManager.java @@ -379,7 +379,7 @@ public class PropertyManager { map = propsToMap(props); if (map == null) - map = new LinkedHashMap(); + map = new LinkedHashMap<>(); return map; } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceChangeHandler.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceChangeHandler.java index edb72f718c1..e6009e25e4a 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceChangeHandler.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceChangeHandler.java @@ -52,13 +52,13 @@ import org.eclipse.core.runtime.jobs.MultiRule; public class ResourceChangeHandler implements IResourceChangeListener, ISaveParticipant { - private Map fRmProjectToBuildInfoMap = new HashMap(); + private Map fRmProjectToBuildInfoMap = new HashMap<>(); private class ResourceConfigurationChecker implements IResourceDeltaVisitor { private IResourceDelta fRootDelta; - private HashMap fBuildFileGeneratorMap = new HashMap(); - private HashSet fValidatedFilesSet = new HashSet(); - private HashSet fModifiedProjects = new HashSet(); + private HashMap fBuildFileGeneratorMap = new HashMap<>(); + private HashSet fValidatedFilesSet = new HashSet<>(); + private HashSet fModifiedProjects = new HashSet<>(); public ResourceConfigurationChecker(IResourceDelta rootDelta) { fRootDelta = rootDelta; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java index 61e20e38bd1..74ce5b7a7a7 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java @@ -253,7 +253,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo { : ManagedBuildManager.calculateChildId(otherExtTool.getId(), null); Map idMap = superClassIdMap.get(otherRcInfo.getPath()); if (idMap == null) { - idMap = new HashMap(); + idMap = new HashMap<>(); superClassIdMap.put(otherRcInfo.getPath(), idMap); } idMap.put(otherExtTool.getId(), superId); @@ -468,7 +468,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo { */ private List getToolList() { if (toolList == null) { - toolList = new ArrayList(); + toolList = new ArrayList<>(); } return toolList; } @@ -480,7 +480,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo { */ private Map getToolMap() { if (toolMap == null) { - toolMap = new HashMap(); + toolMap = new HashMap<>(); } return toolMap; } @@ -908,7 +908,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo { @Override public CLanguageData[] getCLanguageDatas() { ITool tools[] = getTools/*ToInvoke*/(); - List list = new ArrayList(); + List list = new ArrayList<>(); for (ITool tool : tools) { CLanguageData datas[] = tool.getCLanguageDatas(); for (int j = 0; j < datas.length; j++) { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfoContainer.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfoContainer.java index d0092554009..2f8ef4d367f 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfoContainer.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfoContainer.java @@ -90,7 +90,7 @@ public class ResourceInfoContainer { } public List getRcInfoList(final int kind, final boolean includeCurrent) { - final List list = new ArrayList(); + final List list = new ArrayList<>(); fRcDataContainer.accept(new IPathSettingsContainerVisitor() { @Override diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SupportedProperties.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SupportedProperties.java index 2b841fa7aa0..e6ac22532ca 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SupportedProperties.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SupportedProperties.java @@ -32,11 +32,11 @@ public class SupportedProperties implements IBuildPropertiesRestriction { public static final String ID = "id"; //$NON-NLS-1$ public static final String REQUIRED = "required"; //$NON-NLS-1$ - private HashMap fSupportedProperties = new HashMap(); + private HashMap fSupportedProperties = new HashMap<>(); private class SupportedProperty { private boolean fIsRequired; - private Set fValues = new HashSet(); + private Set fValues = new HashSet<>(); private String fId; SupportedProperty(String id) { @@ -118,7 +118,7 @@ public class SupportedProperties implements IBuildPropertiesRestriction { // if(type == null) // continue; - Set set = new HashSet(); + Set set = new HashSet<>(); IManagedConfigElement values[] = child.getChildren(); for (int k = 0; k < values.length; k++) { @@ -176,7 +176,7 @@ public class SupportedProperties implements IBuildPropertiesRestriction { @Override public String[] getRequiredTypeIds() { - List list = new ArrayList(fSupportedProperties.size()); + List list = new ArrayList<>(fSupportedProperties.size()); Collection values = fSupportedProperties.values(); for (SupportedProperty prop : values) { if (prop.isRequired()) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java index d441885a998..1334ad63a0e 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java @@ -126,7 +126,7 @@ public class Target extends BuildObject implements ITarget { // Get the comma-separated list of valid OS String os = element.getAttribute(OS_LIST); if (os != null) { - targetOSList = new ArrayList(); + targetOSList = new ArrayList<>(); String[] osTokens = os.split(","); //$NON-NLS-1$ for (int i = 0; i < osTokens.length; ++i) { targetOSList.add(SafeStringInterner.safeIntern(osTokens[i].trim())); @@ -136,7 +136,7 @@ public class Target extends BuildObject implements ITarget { // Get the comma-separated list of valid Architectures String arch = element.getAttribute(ARCH_LIST); if (arch != null) { - targetArchList = new ArrayList(); + targetArchList = new ArrayList<>(); String[] archTokens = arch.split(","); //$NON-NLS-1$ for (int j = 0; j < archTokens.length; ++j) { targetArchList.add(SafeStringInterner.safeIntern(archTokens[j].trim())); @@ -410,7 +410,7 @@ public class Target extends BuildObject implements ITarget { */ private List getConfigurationList() { if (configList == null) { - configList = new ArrayList(); + configList = new ArrayList<>(); } return configList; } @@ -420,7 +420,7 @@ public class Target extends BuildObject implements ITarget { */ private Map getConfigurationMap() { if (configMap == null) { - configMap = new HashMap(); + configMap = new HashMap<>(); } return configMap; } @@ -475,7 +475,7 @@ public class Target extends BuildObject implements ITarget { errorParsers = new String[0]; } else { StringTokenizer tok = new StringTokenizer(parserIDs, ";"); //$NON-NLS-1$ - List list = new ArrayList(tok.countTokens()); + List list = new ArrayList<>(tok.countTokens()); while (tok.hasMoreElements()) { list.add(tok.nextToken()); } @@ -498,7 +498,7 @@ public class Target extends BuildObject implements ITarget { */ protected List getLocalToolReferences() { if (toolReferences == null) { - toolReferences = new ArrayList(); + toolReferences = new ArrayList<>(); } return toolReferences; } @@ -557,7 +557,7 @@ public class Target extends BuildObject implements ITarget { } protected List getOptionReferences(ITool tool) { - List references = new ArrayList(); + List references = new ArrayList<>(); // Get all the option references I add for this tool ToolReference toolRef = getToolReference(tool); @@ -658,7 +658,7 @@ public class Target extends BuildObject implements ITarget { */ private List getToolList() { if (toolList == null) { - toolList = new ArrayList(); + toolList = new ArrayList<>(); } return toolList; } @@ -669,7 +669,7 @@ public class Target extends BuildObject implements ITarget { */ private Map getToolMap() { if (toolMap == null) { - toolMap = new HashMap(); + toolMap = new HashMap<>(); } return toolMap; } @@ -698,7 +698,7 @@ public class Target extends BuildObject implements ITarget { */ @Override public ITool[] getTools() { - Vector toolArray = new Vector(); + Vector toolArray = new Vector<>(); addToolsToArray(toolArray); return toolArray.toArray(new ITool[toolArray.size()]); } @@ -1058,7 +1058,7 @@ public class Target extends BuildObject implements ITarget { IToolReference[] configToolRefs = configV2.getToolReferences(); // Add the "local" tool references (they are direct children of the target and // its parent targets) - Vector targetToolRefs = new Vector(); + Vector targetToolRefs = new Vector<>(); addTargetToolReferences(targetToolRefs); IToolReference[] toolRefs; if (targetToolRefs.size() > 0) { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java index 34e0e67ee97..582c3394868 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java @@ -163,13 +163,13 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform { isAbstract = targetPlatform.isAbstract; } if (targetPlatform.osList != null) { - osList = new ArrayList(targetPlatform.osList); + osList = new ArrayList<>(targetPlatform.osList); } if (targetPlatform.archList != null) { - archList = new ArrayList(targetPlatform.archList); + archList = new ArrayList<>(targetPlatform.archList); } if (targetPlatform.binaryParserList != null) { - binaryParserList = new ArrayList(targetPlatform.binaryParserList); + binaryParserList = new ArrayList<>(targetPlatform.binaryParserList); } setDirty(true); @@ -209,7 +209,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform { // Get the comma-separated list of valid OS String os = element.getAttribute(OS_LIST); if (os != null) { - osList = new ArrayList(); + osList = new ArrayList<>(); String[] osTokens = os.split(","); //$NON-NLS-1$ for (int i = 0; i < osTokens.length; ++i) { osList.add(osTokens[i].trim()); @@ -219,7 +219,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform { // Get the comma-separated list of valid Architectures String arch = element.getAttribute(ARCH_LIST); if (arch != null) { - archList = new ArrayList(); + archList = new ArrayList<>(); String[] archTokens = arch.split(","); //$NON-NLS-1$ for (int j = 0; j < archTokens.length; ++j) { archList.add(SafeStringInterner.safeIntern(archTokens[j].trim())); @@ -229,7 +229,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform { // Get the IDs of the binary parsers from a semi-colon-separated list. String bpars = element.getAttribute(BINARY_PARSER); if (bpars != null) { - binaryParserList = new ArrayList(); + binaryParserList = new ArrayList<>(); String[] bparsTokens = CDataUtil.stringToArray(bpars, ";"); //$NON-NLS-1$ for (int j = 0; j < bparsTokens.length; ++j) { binaryParserList.add(SafeStringInterner.safeIntern(bparsTokens[j].trim())); @@ -279,7 +279,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform { if (element.getAttribute(OS_LIST) != null) { String os = element.getAttribute(OS_LIST); if (os != null) { - osList = new ArrayList(); + osList = new ArrayList<>(); String[] osTokens = os.split(","); //$NON-NLS-1$ for (int i = 0; i < osTokens.length; ++i) { osList.add(SafeStringInterner.safeIntern(osTokens[i].trim())); @@ -291,7 +291,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform { if (element.getAttribute(ARCH_LIST) != null) { String arch = element.getAttribute(ARCH_LIST); if (arch != null) { - archList = new ArrayList(); + archList = new ArrayList<>(); String[] archTokens = arch.split(","); //$NON-NLS-1$ for (int j = 0; j < archTokens.length; ++j) { archList.add(SafeStringInterner.safeIntern(archTokens[j].trim())); @@ -303,7 +303,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform { if (element.getAttribute(BINARY_PARSER) != null) { String bpars = element.getAttribute(BINARY_PARSER); if (bpars != null) { - binaryParserList = new ArrayList(); + binaryParserList = new ArrayList<>(); String[] bparsTokens = CDataUtil.stringToArray(bpars, ";"); //$NON-NLS-1$ for (int j = 0; j < bparsTokens.length; ++j) { binaryParserList.add(SafeStringInterner.safeIntern(bparsTokens[j].trim())); @@ -514,7 +514,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform { public void setBinaryParserList(String[] ids) { if (ids != null) { if (binaryParserList == null) { - binaryParserList = new ArrayList(); + binaryParserList = new ArrayList<>(); } else { binaryParserList.clear(); } @@ -544,7 +544,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform { @Override public void setOSList(String[] OSs) { if (osList == null) { - osList = new ArrayList(); + osList = new ArrayList<>(); } else { osList.clear(); } @@ -562,7 +562,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform { @Override public void setArchList(String[] archs) { if (archList == null) { - archList = new ArrayList(); + archList = new ArrayList<>(); } else { archList.clear(); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java index 9af0033c0b0..cb83c089ea0 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java @@ -170,10 +170,10 @@ public class Tool extends HoldsOptions private boolean rebuildState; private BooleanExpressionApplicabilityCalculator booleanExpressionCalculator; - private HashMap typeToDataMap = new HashMap(2); + private HashMap typeToDataMap = new HashMap<>(2); private boolean fDataMapInited; private List identicalList; - private HashMap discoveredInfoMap = new HashMap(2); + private HashMap discoveredInfoMap = new HashMap<>(2); private String scannerConfigDiscoveryProfileId; /* @@ -420,10 +420,10 @@ public class Tool extends HoldsOptions commandLinePattern = tool.commandLinePattern; } if (tool.inputExtensions != null) { - inputExtensions = new ArrayList(tool.inputExtensions); + inputExtensions = new ArrayList<>(tool.inputExtensions); } if (tool.interfaceExtensions != null) { - interfaceExtensions = new ArrayList(tool.interfaceExtensions); + interfaceExtensions = new ArrayList<>(tool.interfaceExtensions); } if (tool.natureFilter != null) { natureFilter = tool.natureFilter; @@ -467,7 +467,7 @@ public class Tool extends HoldsOptions optionPathConverter = tool.optionPathConverter; if (tool.envVarBuildPathList != null) - envVarBuildPathList = new ArrayList(tool.envVarBuildPathList); + envVarBuildPathList = new ArrayList<>(tool.envVarBuildPathList); // tool.updateScannerInfoSettingsToInputTypes(); @@ -559,10 +559,10 @@ public class Tool extends HoldsOptions commandLinePattern = tool.commandLinePattern; } if (inputExtensions == null && tool.inputExtensions != null) { - inputExtensions = new ArrayList(tool.inputExtensions); + inputExtensions = new ArrayList<>(tool.inputExtensions); } if (interfaceExtensions == null && tool.interfaceExtensions != null) { - interfaceExtensions = new ArrayList(tool.interfaceExtensions); + interfaceExtensions = new ArrayList<>(tool.interfaceExtensions); } if (natureFilter == null) { natureFilter = tool.natureFilter; @@ -619,7 +619,7 @@ public class Tool extends HoldsOptions } if (envVarBuildPathList == null && tool.envVarBuildPathList != null) - envVarBuildPathList = new ArrayList(tool.envVarBuildPathList); + envVarBuildPathList = new ArrayList<>(tool.envVarBuildPathList); // Clone the children in superclass super.copyNonoverriddenSettings(tool); @@ -1371,7 +1371,7 @@ public class Tool extends HoldsOptions if (isExtensionTool || types.length == 0) return types; - List list = new ArrayList(types.length); + List list = new ArrayList<>(types.length); for (IOutputType itype : types) { OutputType type = (OutputType) itype; if (type.isEnabled(this)) @@ -1385,7 +1385,7 @@ public class Tool extends HoldsOptions if (isExtensionTool || types.length == 0) return types; - List list = new ArrayList(types.length); + List list = new ArrayList<>(types.length); for (IInputType itype : types) { InputType type = (InputType) itype; if (type.isEnabled(this)) @@ -1577,7 +1577,7 @@ public class Tool extends HoldsOptions */ private Vector getInputTypeList() { if (inputTypeList == null) { - inputTypeList = new Vector(); + inputTypeList = new Vector<>(); } return inputTypeList; } @@ -1587,7 +1587,7 @@ public class Tool extends HoldsOptions */ private Map getInputTypeMap() { if (inputTypeMap == null) { - inputTypeMap = new HashMap(); + inputTypeMap = new HashMap<>(); } return inputTypeMap; } @@ -1602,7 +1602,7 @@ public class Tool extends HoldsOptions */ private Vector getOutputTypeList() { if (outputTypeList == null) { - outputTypeList = new Vector(); + outputTypeList = new Vector<>(); } return outputTypeList; } @@ -1612,7 +1612,7 @@ public class Tool extends HoldsOptions */ private Map getOutputTypeMap() { if (outputTypeMap == null) { - outputTypeMap = new HashMap(); + outputTypeMap = new HashMap<>(); } return outputTypeMap; } @@ -1724,7 +1724,7 @@ public class Tool extends HoldsOptions errorParsers = new String[0]; } else { StringTokenizer tok = new StringTokenizer(parserIDs, ";"); //$NON-NLS-1$ - List list = new ArrayList(tok.countTokens()); + List list = new ArrayList<>(tok.countTokens()); while (tok.hasMoreElements()) { list.add(tok.nextToken()); } @@ -1740,7 +1740,7 @@ public class Tool extends HoldsOptions public Set contributeErrorParsers(Set set) { if (getErrorParserIds() != null) { if (set == null) - set = new HashSet(); + set = new HashSet<>(); String ids[] = getErrorParserList(); if (ids.length != 0) set.addAll(Arrays.asList(ids)); @@ -1755,7 +1755,7 @@ public class Tool extends HoldsOptions @Override public List getInputExtensions() { String[] exts = getPrimaryInputExtensions(); - List extList = new ArrayList(); + List extList = new ArrayList<>(); for (String ext : exts) { extList.add(ext); } @@ -1768,7 +1768,7 @@ public class Tool extends HoldsOptions if (getSuperClass() != null) { return ((Tool) getSuperClass()).getInputExtensionsAttribute(); } else { - inputExtensions = new ArrayList(); + inputExtensions = new ArrayList<>(); } } return inputExtensions; @@ -1776,7 +1776,7 @@ public class Tool extends HoldsOptions private List getInputExtensionsList() { if (inputExtensions == null) { - inputExtensions = new ArrayList(); + inputExtensions = new ArrayList<>(); } return inputExtensions; } @@ -1834,7 +1834,7 @@ public class Tool extends HoldsOptions public String[] getAllInputExtensions(IProject project) { IInputType[] types = getInputTypes(); if (types != null && types.length > 0) { - List allExts = new ArrayList(); + List allExts = new ArrayList<>(); for (IInputType type : types) { String[] exts = ((InputType) type).getSourceExtensions(this, project); for (String ext : exts) { @@ -1897,7 +1897,7 @@ public class Tool extends HoldsOptions */ @Override public IPath[] getAdditionalDependencies() { - List allDeps = new ArrayList(); + List allDeps = new ArrayList<>(); IInputType[] types = getInputTypes(); for (IInputType type : types) { // Additional dependencies come from 2 places. @@ -1911,7 +1911,7 @@ public class Tool extends HoldsOptions IOption option = getOptionBySuperClassId(type.getOptionId()); if (option != null) { try { - List inputs = new ArrayList(); + List inputs = new ArrayList<>(); int optType = option.getValueType(); if (optType == IOption.STRING) { inputs.add(Path.fromOSString(option.getStringValue())); @@ -1942,7 +1942,7 @@ public class Tool extends HoldsOptions */ @Override public IPath[] getAdditionalResources() { - List allRes = new ArrayList(); + List allRes = new ArrayList<>(); for (IInputType type : getInputTypes()) { // Additional resources come from 2 places. // 1. From AdditionalInput childen @@ -1967,7 +1967,7 @@ public class Tool extends HoldsOptions public String[] getAllDependencyExtensions() { IInputType[] types = getInputTypes(); if (types != null && types.length > 0) { - List allExts = new ArrayList(); + List allExts = new ArrayList<>(); for (IInputType t : types) for (String s : t.getDependencyExtensions(this)) allExts.add(s); @@ -1999,7 +1999,7 @@ public class Tool extends HoldsOptions return ((Tool) getSuperClass()).getHeaderExtensionsAttribute(); } else { if (interfaceExtensions == null) { - interfaceExtensions = new ArrayList(); + interfaceExtensions = new ArrayList<>(); } } } @@ -2008,7 +2008,7 @@ public class Tool extends HoldsOptions private List getInterfaceExtensionsList() { if (interfaceExtensions == null) { - interfaceExtensions = new ArrayList(); + interfaceExtensions = new ArrayList<>(); } return interfaceExtensions; } @@ -2318,7 +2318,7 @@ public class Tool extends HoldsOptions public String[] getAllOutputExtensions(IProject project) { IOutputType[] types = getOutputTypes(); if (types != null && types.length > 0) { - List allExts = new ArrayList(); + List allExts = new ArrayList<>(); for (IOutputType t : types) { String[] exts = ((OutputType) t).getOutputExtensions(this, project); if (exts != null) @@ -2610,7 +2610,7 @@ public class Tool extends HoldsOptions public String[] getToolCommandFlags(IPath inputFileLocation, IPath outputFileLocation, SupplierBasedCdtVariableSubstitutor macroSubstitutor, IMacroContextInfoProvider provider) { IOption[] opts = getOptions(); - ArrayList flags = new ArrayList(); + ArrayList flags = new ArrayList<>(); StringBuilder sb = new StringBuilder(); for (IOption option : opts) { if (option == null) @@ -3199,7 +3199,7 @@ public class Tool extends HoldsOptions if (path == null) return; if (envVarBuildPathList == null) - envVarBuildPathList = new ArrayList(); + envVarBuildPathList = new ArrayList<>(); envVarBuildPathList.add(path); } @@ -3564,7 +3564,7 @@ public class Tool extends HoldsOptions } private List getLanguageInputTypes() { - List list = new ArrayList(); + List list = new ArrayList<>(); IInputType[] types = getInputTypes(); for (IInputType t : types) { InputType type = (InputType) t; @@ -3781,7 +3781,7 @@ public class Tool extends HoldsOptions return null; if (!isExtensionTool) return null; - return new MatchKey(this); + return new MatchKey<>(this); } @Override @@ -3858,7 +3858,7 @@ public class Tool extends HoldsOptions supported = props.getSupportedTypeIds(); } else { BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator(); - List list = new ArrayList(); + List list = new ArrayList<>(); if (calc != null) { list.addAll(Arrays.asList(calc.getReferencedPropertyIds())); } @@ -3877,7 +3877,7 @@ public class Tool extends HoldsOptions supported = props.getSupportedValueIds(typeId); } else { BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator(); - List list = new ArrayList(); + List list = new ArrayList<>(); if (calc != null) { list.addAll(Arrays.asList(calc.getReferencedValueIds(typeId))); } @@ -3908,7 +3908,7 @@ public class Tool extends HoldsOptions if (set != null && !set.isEmpty()) { Set oldSet = contributeErrorParsers(null); if (oldSet == null) - oldSet = new HashSet(); + oldSet = new HashSet<>(); oldSet.removeAll(set); setErrorParserList(oldSet.toArray(new String[oldSet.size()])); @@ -4135,7 +4135,7 @@ public class Tool extends HoldsOptions } public IOption[] getOptionsOfType(int type) { - List list = new ArrayList(); + List list = new ArrayList<>(); for (IOption op : getOptions()) { try { if (op.getValueType() == type) @@ -4153,7 +4153,7 @@ public class Tool extends HoldsOptions int opType = Option.getOppositeType(type); if (opType != 0) { - Set filterSet = new HashSet(); + Set filterSet = new HashSet<>(); for (IOption op : getOptionsOfType(opType)) { filterSet.addAll((List) op.getValue()); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java index b9830d2bbde..523dca4c776 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java @@ -333,10 +333,10 @@ public class ToolChain extends HoldsOptions errorParserIds = toolChain.errorParserIds; } if (toolChain.osList != null) { - osList = new ArrayList(toolChain.osList); + osList = new ArrayList<>(toolChain.osList); } if (toolChain.archList != null) { - archList = new ArrayList(toolChain.archList); + archList = new ArrayList<>(toolChain.archList); } if (toolChain.targetToolIds != null) { targetToolIds = toolChain.targetToolIds; @@ -486,7 +486,7 @@ public class ToolChain extends HoldsOptions : ManagedBuildManager.calculateChildId(otherExtTool.getId(), null); Map idMap = superIdMap.get(otherRcInfo.getPath()); if (idMap == null) { - idMap = new HashMap(); + idMap = new HashMap<>(); superIdMap.put(otherRcInfo.getPath(), idMap); } idMap.put(otherExtTool.getId(), superId); @@ -590,7 +590,7 @@ public class ToolChain extends HoldsOptions // Get the comma-separated list of valid OS String os = element.getAttribute(OS_LIST); if (os != null) { - osList = new ArrayList(); + osList = new ArrayList<>(); String[] osTokens = os.split(","); //$NON-NLS-1$ for (int i = 0; i < osTokens.length; ++i) { osList.add(SafeStringInterner.safeIntern(osTokens[i].trim())); @@ -600,7 +600,7 @@ public class ToolChain extends HoldsOptions // Get the comma-separated list of valid Architectures String arch = element.getAttribute(ARCH_LIST); if (arch != null) { - archList = new ArrayList(); + archList = new ArrayList<>(); String[] archTokens = arch.split(","); //$NON-NLS-1$ for (int j = 0; j < archTokens.length; ++j) { archList.add(SafeStringInterner.safeIntern(archTokens[j].trim())); @@ -709,7 +709,7 @@ public class ToolChain extends HoldsOptions if (element.getAttribute(OS_LIST) != null) { String os = element.getAttribute(OS_LIST); if (os != null) { - osList = new ArrayList(); + osList = new ArrayList<>(); String[] osTokens = os.split(","); //$NON-NLS-1$ for (int i = 0; i < osTokens.length; ++i) { osList.add(SafeStringInterner.safeIntern(osTokens[i].trim())); @@ -721,7 +721,7 @@ public class ToolChain extends HoldsOptions if (element.getAttribute(ARCH_LIST) != null) { String arch = element.getAttribute(ARCH_LIST); if (arch != null) { - archList = new ArrayList(); + archList = new ArrayList<>(); String[] archTokens = arch.split(","); //$NON-NLS-1$ for (int j = 0; j < archTokens.length; ++j) { archList.add(SafeStringInterner.safeIntern(archTokens[j].trim())); @@ -1039,7 +1039,7 @@ public class ToolChain extends HoldsOptions if (set.size() == 0) return used ? tools : new Tool[0]; - List list = new ArrayList(tools.length); + List list = new ArrayList<>(tools.length); for (Tool t : tools) { if (set.contains(t.getId()) != used) list.add(t); @@ -1060,7 +1060,7 @@ public class ToolChain extends HoldsOptions @Override public ITool[] getToolsBySuperClassId(String id) { - List retTools = new ArrayList(); + List retTools = new ArrayList<>(); if (id != null) { // Look for a tool with this ID, or the tool(s) with a superclass with this id ITool[] tools = getTools(); @@ -1085,7 +1085,7 @@ public class ToolChain extends HoldsOptions */ public List getToolList() { if (toolList == null) { - toolList = new ArrayList(); + toolList = new ArrayList<>(); } return toolList; } @@ -1095,7 +1095,7 @@ public class ToolChain extends HoldsOptions */ private Map getToolMap() { if (toolMap == null) { - toolMap = new HashMap(); + toolMap = new HashMap<>(); } return toolMap; } @@ -1276,7 +1276,7 @@ public class ToolChain extends HoldsOptions targetTools = new String[0]; } else { StringTokenizer tok = new StringTokenizer(IDs, ";"); //$NON-NLS-1$ - List list = new ArrayList(tok.countTokens()); + List list = new ArrayList<>(tok.countTokens()); while (tok.hasMoreElements()) { list.add(tok.nextToken()); } @@ -1330,7 +1330,7 @@ public class ToolChain extends HoldsOptions errorParsers = new String[0]; } else { StringTokenizer tok = new StringTokenizer(parserIDs, ";"); //$NON-NLS-1$ - List list = new ArrayList(tok.countTokens()); + List list = new ArrayList<>(tok.countTokens()); while (tok.hasMoreElements()) { list.add(tok.nextToken()); } @@ -1347,7 +1347,7 @@ public class ToolChain extends HoldsOptions String parserIDs = getErrorParserIdsAttribute(); if (parserIDs != null) { if (set == null) - set = new HashSet(); + set = new HashSet<>(); if (parserIDs.length() != 0) { StringTokenizer tok = new StringTokenizer(parserIDs, ";"); //$NON-NLS-1$ while (tok.hasMoreElements()) { @@ -1436,7 +1436,7 @@ public class ToolChain extends HoldsOptions @Override public void setOSList(String[] OSs) { if (osList == null) { - osList = new ArrayList(); + osList = new ArrayList<>(); } else { osList.clear(); } @@ -1449,7 +1449,7 @@ public class ToolChain extends HoldsOptions @Override public void setArchList(String[] archs) { if (archList == null) { - archList = new ArrayList(); + archList = new ArrayList<>(); } else { archList.clear(); } @@ -2284,7 +2284,7 @@ public class ToolChain extends HoldsOptions return null; if (!isExtensionToolChain) return null; - return new MatchKey(this); + return new MatchKey<>(this); } @Override @@ -2339,7 +2339,7 @@ public class ToolChain extends HoldsOptions public String[] getRequiredTypeIds(boolean checkTools) { SupportedProperties props = findSupportedProperties(); - List result = new ArrayList(); + List result = new ArrayList<>(); if (props != null) { result.addAll(Arrays.asList(props.getRequiredTypeIds())); } else { @@ -2368,7 +2368,7 @@ public class ToolChain extends HoldsOptions public String[] getSupportedTypeIds(boolean checkTools) { SupportedProperties props = findSupportedProperties(); - List result = new ArrayList(); + List result = new ArrayList<>(); if (props != null) { result.addAll(Arrays.asList(props.getSupportedTypeIds())); } else { @@ -2397,7 +2397,7 @@ public class ToolChain extends HoldsOptions public String[] getSupportedValueIds(String typeId, boolean checkTools) { SupportedProperties props = findSupportedProperties(); - List result = new ArrayList(); + List result = new ArrayList<>(); if (props != null) { result.addAll(Arrays.asList(props.getSupportedValueIds(typeId))); } else { @@ -2488,7 +2488,7 @@ public class ToolChain extends HoldsOptions if (set != null && !set.isEmpty()) { Set oldSet = contributeErrorParsers(info, null, false); if (oldSet == null) - oldSet = new HashSet(); + oldSet = new HashSet<>(); oldSet.removeAll(set); setErrorParserList(oldSet.toArray(new String[oldSet.size()])); @@ -2629,9 +2629,9 @@ public class ToolChain extends HoldsOptions if (unusedChildrenSet == null) { String childIds[] = CDataUtil.stringToArray(unusedChildren, ";"); //$NON-NLS-1$ if (childIds == null) - unusedChildrenSet = new HashSet(); + unusedChildrenSet = new HashSet<>(); else { - unusedChildrenSet = new HashSet(); + unusedChildrenSet = new HashSet<>(); unusedChildrenSet.addAll(Arrays.asList(childIds)); } } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChainModificationHelper.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChainModificationHelper.java index 209f3e3e194..90a553643db 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChainModificationHelper.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChainModificationHelper.java @@ -124,7 +124,7 @@ public class ToolChainModificationHelper { curMap.clearEmptyLists(); - List resultingList = new ArrayList(); + List resultingList = new ArrayList<>(); curMap.putValuesToCollection(resultingList); return getModificationInfo(rcInfo, fromTools, resultingList.toArray(new ITool[resultingList.size()])); @@ -134,11 +134,11 @@ public class ToolChainModificationHelper { ITool[] toTools) { ToolListMap curMap = createRealToToolMap(fromTools, false); - List resultingList = new ArrayList(); - List addedList = new ArrayList(7); - List remainedList = new ArrayList(7); - List removedList = new ArrayList(7); - List removedToolsList = new ArrayList(7); + List resultingList = new ArrayList<>(); + List addedList = new ArrayList<>(7); + List remainedList = new ArrayList<>(7); + List removedList = new ArrayList<>(7); + List removedToolsList = new ArrayList<>(7); for (int i = 0; i < toTools.length; i++) { ITool tool = toTools[i]; @@ -244,9 +244,9 @@ public class ToolChainModificationHelper { private static Map calculateConverterTools(IResourceInfo rcInfo, ToolInfo[] removed, ToolInfo[] added, List remainingRemoved, List remainingAdded) { if (remainingAdded == null) - remainingAdded = new ArrayList(added.length); + remainingAdded = new ArrayList<>(added.length); if (remainingRemoved == null) - remainingRemoved = new ArrayList(removed.length); + remainingRemoved = new ArrayList<>(removed.length); remainingAdded.clear(); remainingRemoved.clear(); @@ -254,7 +254,7 @@ public class ToolChainModificationHelper { remainingAdded.addAll(Arrays.asList(added)); remainingRemoved.addAll(Arrays.asList(removed)); - Map resultMap = new HashMap(); + Map resultMap = new HashMap<>(); for (Iterator rIter = remainingRemoved.iterator(); rIter.hasNext();) { ToolInfo rti = rIter.next(); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolListModificationInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolListModificationInfo.java index a235eff1a00..f3043b6ea7f 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolListModificationInfo.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolListModificationInfo.java @@ -52,7 +52,7 @@ public class ToolListModificationInfo { public List getResultingToolList(List list) { if (list == null) - list = new ArrayList(fResultingTools.length); + list = new ArrayList<>(fResultingTools.length); for (int i = 0; i < fResultingTools.length; i++) { list.add(fResultingTools[i].getResultingTool()); @@ -104,18 +104,18 @@ public class ToolListModificationInfo { } public MultiStatus getModificationStatus() { - List statusList = new ArrayList(); + List statusList = new ArrayList<>(); ToolInfo[][] conflictInfos = calculateConflictingTools(fResultingTools); ITool[][] conflicting = toToolArray(conflictInfos, true); - Map unspecifiedRequiredProps = new HashMap(); - Map unspecifiedProps = new HashMap(); - Set undefinedSet = new HashSet(); + Map unspecifiedRequiredProps = new HashMap<>(); + Map unspecifiedProps = new HashMap<>(); + Set undefinedSet = new HashSet<>(); IConfiguration cfg = fRcInfo.getParent(); ITool[] nonManagedTools = null; if (cfg.isManagedBuildOn() && cfg.supportsBuild(true)) { - List list = new ArrayList(); + List list = new ArrayList<>(); for (int i = 0; i < fResultingTools.length; i++) { if (!fResultingTools[i].getInitialTool().supportsBuild(true)) { list.add(fResultingTools[i].getInitialTool()); @@ -152,7 +152,7 @@ public class ToolListModificationInfo { private ToolInfo[] filterInfos(ToolInfo[] infos) { if (fRcInfo instanceof FolderInfo) { Map map = createInitialToolToToolInfoMap(infos); - ITool[] tools = new ArrayList(map.keySet()).toArray(new ITool[map.size()]); + ITool[] tools = new ArrayList<>(map.keySet()).toArray(new ITool[map.size()]); tools = ((FolderInfo) fRcInfo).filterTools(tools, fRcInfo.getParent().getManagedProject()); @@ -168,7 +168,7 @@ public class ToolListModificationInfo { } private static Map createInitialToolToToolInfoMap(ToolInfo[] infos) { - Map map = new LinkedHashMap(); + Map map = new LinkedHashMap<>(); for (int i = 0; i < infos.length; i++) { map.put(infos[i].getInitialTool(), infos[i]); } @@ -177,16 +177,16 @@ public class ToolListModificationInfo { } private ToolInfo[][] doCalculateConflictingTools(ToolInfo[] infos) { - HashSet set = new HashSet(); + HashSet set = new HashSet<>(); set.addAll(Arrays.asList(infos)); - List result = new ArrayList(); + List result = new ArrayList<>(); for (Iterator iter = set.iterator(); iter.hasNext();) { ToolInfo ti = iter.next(); ITool t = ti.getInitialTool(); iter.remove(); @SuppressWarnings("unchecked") HashSet tmp = (HashSet) set.clone(); - List list = new ArrayList(); + List list = new ArrayList<>(); for (Iterator tmpIt = tmp.iterator(); tmpIt.hasNext();) { ToolInfo otherTi = tmpIt.next(); ITool other = otherTi.getInitialTool(); @@ -213,8 +213,8 @@ public class ToolListModificationInfo { IProject project = fRcInfo.getParent().getOwner().getProject(); String ext1[] = ((Tool) tool1).getAllInputExtensions(project); String ext2[] = ((Tool) tool2).getAllInputExtensions(project); - Set set1 = new HashSet(Arrays.asList(ext1)); - Set result = new HashSet(); + Set set1 = new HashSet<>(Arrays.asList(ext1)); + Set result = new HashSet<>(); for (int i = 0; i < ext2.length; i++) { if (set1.remove(ext2[i])) result.add(ext2[i]); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java index 5e8880c7c12..fb436f052b4 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java @@ -373,7 +373,7 @@ public class ToolReference implements IToolReference { @Override public List getInputExtensions() { String[] exts = getPrimaryInputExtensions(); - List extList = new ArrayList(); + List extList = new ArrayList<>(); for (int i = 0; i < exts.length; i++) { extList.add(exts[i]); } @@ -445,7 +445,7 @@ public class ToolReference implements IToolReference { * @return */ private List getOutputsList() { - ArrayList answer = new ArrayList(); + ArrayList answer = new ArrayList<>(); if (outputExtensions != null) { String[] exts = outputExtensions.split(DEFAULT_SEPARATOR); answer.addAll(Arrays.asList(exts)); @@ -632,7 +632,7 @@ public class ToolReference implements IToolReference { @Override public List getOptionReferenceList() { if (optionReferences == null) { - optionReferences = new ArrayList(); + optionReferences = new ArrayList<>(); } return optionReferences; } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEntryStorage.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEntryStorage.java index e07a923c231..91f4563b209 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEntryStorage.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEntryStorage.java @@ -177,7 +177,7 @@ public class BuildEntryStorage extends AbstractEntryStorage { protected void putEntriesToLevel(int levelNum, SettingLevel level) { switch (levelNum) { case USER_ENTRIES_LEVEL: - List emptyEntryInfos = new ArrayList(); + List emptyEntryInfos = new ArrayList<>(); for (UserEntryInfo userEntry : getUserEntries(level.getFlags(0), true, emptyEntryInfos)) { level.addEntry(userEntry.fEntry, userEntry); } @@ -233,7 +233,7 @@ public class BuildEntryStorage extends AbstractEntryStorage { private UserEntryInfo[] getUserEntries(int flags, boolean usr, List emptyValuesInfos) { IOption options[] = fLangData.getOptionsForKind(getKind()); if (options.length > 0) { - List entryList = new ArrayList(); + List entryList = new ArrayList<>(); for (IOption opt : options) { Option option = (Option) opt; try { @@ -254,7 +254,7 @@ public class BuildEntryStorage extends AbstractEntryStorage { } else { // If resolved, add each resolved entry as a separate UserEntryInfo boolean isMultiple = rVes.length > 1; - List sequense = isMultiple ? new ArrayList(rVes.length) + List sequense = isMultiple ? new ArrayList<>(rVes.length) : null; for (OptionStringValue rVe : rVes) { ICLanguageSettingEntry entry = createUserEntry(option, rVe, flags, subst); @@ -303,7 +303,7 @@ public class BuildEntryStorage extends AbstractEntryStorage { List list = (List) option.getValue(); if (list.size() != 0) { if (set == null) - set = new HashSet(); + set = new HashSet<>(); set.addAll(list); } } @@ -709,7 +709,7 @@ public class BuildEntryStorage extends AbstractEntryStorage { if (emptyEntryInfos == null || emptyEntryInfos.size() == 0) return infos; - LinkedList list = new LinkedList(); + LinkedList list = new LinkedList<>(); list.addAll(Arrays.asList(infos)); for (int i = 0; i < emptyEntryInfos.size(); i++) { EmptyEntryInfo ei = emptyEntryInfos.get(i); @@ -735,7 +735,7 @@ public class BuildEntryStorage extends AbstractEntryStorage { if (infos.length == 0) return infos; - List list = new ArrayList(infos.length); + List list = new ArrayList<>(infos.length); for (int i = 0; i < infos.length; i++) { UserEntryInfo info = infos[i]; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEnvironmentContributor.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEnvironmentContributor.java index d6639e8d843..9f72c66161c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEnvironmentContributor.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEnvironmentContributor.java @@ -98,7 +98,7 @@ public class BuildEnvironmentContributor implements IEnvironmentContributor { boolean checkSet = true; if (vars != null && vars.length != 0) { if (set == null) { - set = new HashSet(); + set = new HashSet<>(); checkSet = false; } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildLanguageData.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildLanguageData.java index 24dbef293d4..9e4d91da569 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildLanguageData.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildLanguageData.java @@ -55,12 +55,12 @@ public class BuildLanguageData extends CLanguageData { /** The main kind => BuildEntryStorage store * The BuildEntryStorage calls back to this BuildLanguageData * to work out which entries are actually (un)defined. */ - private KindBasedStore fKindToEntryStore = new KindBasedStore(); + private KindBasedStore fKindToEntryStore = new KindBasedStore<>(); /** Indicates that the option array stores have been inited */ private volatile boolean fOptionStoreInited; - private KindBasedStore fKindToOptionArrayStore = new KindBasedStore(); - private KindBasedStore fKindToUndefOptionArrayStore = new KindBasedStore(); + private KindBasedStore fKindToOptionArrayStore = new KindBasedStore<>(); + private KindBasedStore fKindToUndefOptionArrayStore = new KindBasedStore<>(); // private Map fKindToEntryArrayMap = new HashMap(); // private ProfileInfoProvider fDiscoveredInfo; @@ -155,7 +155,7 @@ public class BuildLanguageData extends CLanguageData { @Override public ICLanguageSettingEntry[] getEntries(int kinds) { - List list = new ArrayList(); + List list = new ArrayList<>(); if ((kinds & ICLanguageSettingEntry.INCLUDE_PATH) != 0) { BuildEntryStorage storage = getEntryStorage(ICLanguageSettingEntry.INCLUDE_PATH); @@ -239,7 +239,7 @@ public class BuildLanguageData extends CLanguageData { private void calculateKindToOptionArrayStore() { fKindToOptionArrayStore.clear(); - Map> kindToOptionList = new HashMap>(); + Map> kindToOptionList = new HashMap<>(); IOption options[] = fTool.getOptions(); for (final IOption option : options) { try { @@ -272,7 +272,7 @@ public class BuildLanguageData extends CLanguageData { private void calculateKindToUndefOptionArrayStore() { fKindToUndefOptionArrayStore.clear(); - Map> kindToOptionList = new HashMap>(); + Map> kindToOptionList = new HashMap<>(); IOption options[] = fTool.getOptions(); for (final IOption option : options) { try { @@ -397,8 +397,8 @@ public class BuildLanguageData extends CLanguageData { public void setSourceContentTypeIds(String[] ids) { String[] headerIds = fInputType.getHeaderContentTypeIds(); - List newSrc = new ArrayList(ids.length); - List newHeaders = new ArrayList(ids.length); + List newSrc = new ArrayList<>(ids.length); + List newHeaders = new ArrayList<>(ids.length); for (int i = 0; i < ids.length; i++) { String id = ids[i]; int j = 0; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildSystemSpecificVariableSubstitutor.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildSystemSpecificVariableSubstitutor.java index 0ddfc08d41d..8897d8c5fe8 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildSystemSpecificVariableSubstitutor.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildSystemSpecificVariableSubstitutor.java @@ -26,11 +26,11 @@ import org.eclipse.cdt.utils.cdtvariables.IVariableContextInfo; import org.eclipse.cdt.utils.cdtvariables.SupplierBasedCdtVariableSubstitutor; public class BuildSystemSpecificVariableSubstitutor extends SupplierBasedCdtVariableSubstitutor { - private static final Set fFileVarsSet = new HashSet( + private static final Set fFileVarsSet = new HashSet<>( Arrays.asList(MbsMacroSupplier.getInstance().getMacroNames(IBuildMacroProvider.CONTEXT_FILE))); - private static final Set fOptionVarsSet = new HashSet( + private static final Set fOptionVarsSet = new HashSet<>( Arrays.asList(MbsMacroSupplier.getInstance().getMacroNames(IBuildMacroProvider.CONTEXT_OPTION))); - private static final Set fToolVarsSet = new HashSet( + private static final Set fToolVarsSet = new HashSet<>( Arrays.asList(MbsMacroSupplier.getInstance().getMacroNames(IBuildMacroProvider.CONTEXT_TOOL))); public BuildSystemSpecificVariableSubstitutor(IVariableContextInfo contextInfo, String inexistentMacroValue, diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java index 463e4ff8a32..33203750cc5 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java @@ -450,7 +450,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem private static void adjustFolderInfo(IFolderInfo info, ILanguageDescriptor dess[], HashMap map) { IToolChain tch = info.getToolChain(); - Map langMap = new HashMap(); + Map langMap = new HashMap<>(); for (int i = 0; i < dess.length; i++) { langMap.put(dess[i].getId(), dess[i]); } @@ -495,12 +495,12 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem String srcIds[] = type.getSourceContentTypeIds(); String hIds[] = type.getHeaderContentTypeIds(); - Set landTypes = new HashSet(Arrays.asList(cTypeIds)); + Set landTypes = new HashSet<>(Arrays.asList(cTypeIds)); landTypes.removeAll(Arrays.asList(srcIds)); landTypes.removeAll(Arrays.asList(hIds)); if (landTypes.size() != 0) { - List srcList = new ArrayList(); + List srcList = new ArrayList<>(); srcList.addAll(landTypes); type = (InputType) tool.getEditableInputType(type); type.setSourceContentTypeIds(srcList.toArray(new String[srcList.size()])); @@ -517,7 +517,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem private static void addTools(IToolChain tc, Map langMap, Map cTypeToLangMap) { ITool extTool = ManagedBuildManager.getExtensionTool(PREF_TOOL_ID); - List list = new ArrayList(langMap.values()); + List list = new ArrayList<>(langMap.values()); ILanguageDescriptor des; while (list.size() != 0) { des = list.remove(list.size() - 1); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ProjectConverter.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ProjectConverter.java index f0901661546..f50e278209f 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ProjectConverter.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ProjectConverter.java @@ -100,7 +100,7 @@ public class ProjectConverter implements ICProjectConverter { return false; IProjectDescription eDes = project.getDescription(); - Set natureSet = new HashSet(Arrays.asList(eDes.getNatureIds())); + Set natureSet = new HashSet<>(Arrays.asList(eDes.getNatureIds())); if (natureSet.contains(OLD_MAKE_NATURE_ID)) return true; @@ -117,7 +117,7 @@ public class ProjectConverter implements ICProjectConverter { @Override public ICProjectDescription convertProject(IProject project, IProjectDescription eDes, String oldOwnerId, ICProjectDescription oldDes) throws CoreException { - Set natureSet = new HashSet(Arrays.asList(eDes.getNatureIds())); + Set natureSet = new HashSet<>(Arrays.asList(eDes.getNatureIds())); CoreModel model = CoreModel.getDefault(); ICProjectDescription newDes = null; IManagedBuildInfo info = null; @@ -173,7 +173,7 @@ public class ProjectConverter implements ICProjectConverter { changeEDes = false; ICommand[] cmds = eDes.getBuildSpec(); - List list = new ArrayList(Arrays.asList(cmds)); + List list = new ArrayList<>(Arrays.asList(cmds)); ICommand makeBuilderCmd = null; for (Iterator iter = list.iterator(); iter.hasNext();) { ICommand cmd = iter.next(); @@ -365,7 +365,7 @@ public class ProjectConverter implements ICProjectConverter { Map fromMap = fromTarget.getEnvironment(); if (fromMap != null) - toTarget.setEnvironment(new HashMap(fromMap)); + toTarget.setEnvironment(new HashMap<>(fromMap)); // toTarget.setErrorParsers(fromTarget.getErrorParsers()); @@ -385,7 +385,7 @@ public class ProjectConverter implements ICProjectConverter { if (el != null) { IPathEntry[] entries = PathEntryTranslator.decodePathEntries(project, el); if (entries.length != 0) { - List list = new ArrayList(Arrays.asList(entries)); + List list = new ArrayList<>(Arrays.asList(entries)); for (Iterator iter = list.iterator(); iter.hasNext();) { IPathEntry entry = iter.next(); if (entry.getEntryKind() == IPathEntry.CDT_CONTAINER) { @@ -413,7 +413,7 @@ public class ProjectConverter implements ICProjectConverter { IPath projPaths[] = refInfo.getReferencedProjectsPaths(); if (projPaths.length != 0) { - Map map = new HashMap(projPaths.length); + Map map = new HashMap<>(projPaths.length); for (int i = 0; i < projPaths.length; i++) { map.put(projPaths[i].segment(0), ""); //$NON-NLS-1$ } @@ -511,7 +511,7 @@ public class ProjectConverter implements ICProjectConverter { final IProjectDescription eDes = project.getDescription(); String natureIds[] = eDes.getNatureIds(); - Set set = new HashSet(Arrays.asList(natureIds)); + Set set = new HashSet<>(Arrays.asList(natureIds)); if (!set.contains(OLD_MAKE_NATURE_ID)) { if (throwExceptions) throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ResourcePropertyHolder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ResourcePropertyHolder.java index 37aa52f666d..e2f600d0d3e 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ResourcePropertyHolder.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ResourcePropertyHolder.java @@ -22,7 +22,7 @@ import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResourceChangeEvent; class ResourcePropertyHolder extends ResourceChangeHandlerBase { - private Map> fRcMap = new HashMap>(); + private Map> fRcMap = new HashMap<>(); private boolean fProjectOnly; public ResourcePropertyHolder(boolean projectOnly) { @@ -88,7 +88,7 @@ class ResourcePropertyHolder extends ResourceChangeHandlerBase { String key = keyForResource(rc); Map map = fRcMap.get(key); if (map == null && create) { - map = new HashMap(); + map = new HashMap<>(); fRcMap.put(key, map); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/AdjustmentContext.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/AdjustmentContext.java index 914938544e7..f7711d08104 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/AdjustmentContext.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/AdjustmentContext.java @@ -51,7 +51,7 @@ public class AdjustmentContext { // return fType; // } - private HashMap fMap = new HashMap(); + private HashMap fMap = new HashMap<>(); public void addAdjustedState(String attr, boolean adjusted) { Boolean b = fMap.get(attr); @@ -64,7 +64,7 @@ public class AdjustmentContext { if (fMap.size() == 0) return new String[0]; - ArrayList list = new ArrayList(fMap.size()); + ArrayList list = new ArrayList<>(fMap.size()); Set> entrySet = fMap.entrySet(); for (Entry entry : entrySet) { Boolean b = entry.getValue(); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CompositeExpression.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CompositeExpression.java index 5b4700b2d32..86837d0fb8b 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CompositeExpression.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CompositeExpression.java @@ -71,7 +71,7 @@ public abstract class CompositeExpression implements IBooleanExpression { public Map> getReferencedProperties(Map> map) { IBooleanExpression children[] = getChildren(); if (map == null) - map = new HashMap>(); + map = new HashMap<>(); for (int i = 0; i < children.length; i++) { IBooleanExpression child = children[i]; @@ -84,7 +84,7 @@ public abstract class CompositeExpression implements IBooleanExpression { if (prop != null && prop.length() != 0 && val != null && val.length() != 0) { Set set = map.get(prop); if (set == null) { - set = new HashSet(); + set = new HashSet<>(); map.put(prop, set); } set.add(val); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/OptionEnablementExpression.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/OptionEnablementExpression.java index ce516d3276b..8e2957b3a69 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/OptionEnablementExpression.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/OptionEnablementExpression.java @@ -122,7 +122,7 @@ public class OptionEnablementExpression extends AndExpression { } public String[] convertToList(String value, String delimiter) { - List list = new ArrayList(); + List list = new ArrayList<>(); int delLength = delimiter.length(); int valLength = value.length(); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java index 88d8956f5ee..6b84144f62c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java @@ -192,7 +192,7 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider @Override public String[] getBuildPaths(IConfiguration configuration, int buildPathType) { ITool tools[] = configuration.getFilteredTools(); - List list = new ArrayList(); + List list = new ArrayList<>(); for (ITool tool : tools) { IEnvVarBuildPath pathDescriptors[] = tool.getEnvVarBuildPaths(); @@ -237,7 +237,7 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider */ private List getListeners() { if (fListeners == null) - fListeners = new ArrayList(); + fListeners = new ArrayList<>(); return fListeners; } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/MbsEnvironmentSupplier.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/MbsEnvironmentSupplier.java index bab8be8c29c..31e8eae2740 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/MbsEnvironmentSupplier.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/MbsEnvironmentSupplier.java @@ -83,7 +83,7 @@ public class MbsEnvironmentSupplier implements IEnvironmentVariableSupplier { @Override public IEnvironmentVariable[] getVariables(Object context) { if (context instanceof IConfiguration) { - List variables = new ArrayList(2); + List variables = new ArrayList<>(2); IBuildEnvironmentVariable var = getConfigurationVariable("CWD", (IConfiguration) context); //$NON-NLS-1$ if (var != null) { variables.add(var); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/StoredBuildPathEnvironmentContainer.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/StoredBuildPathEnvironmentContainer.java index 4fc9d959fb4..4e18abf35da 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/StoredBuildPathEnvironmentContainer.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/StoredBuildPathEnvironmentContainer.java @@ -248,7 +248,7 @@ public class StoredBuildPathEnvironmentContainer extends StorableEnvironmentLoad private String[] getBuildPathVarNames(IConfiguration configuration, int buildPathType) { ITool tools[] = configuration.getFilteredTools(); - List list = new ArrayList(); + List list = new ArrayList<>(); for (int i = 0; i < tools.length; i++) { IEnvVarBuildPath pathDescriptors[] = tools[i].getEnvVarBuildPaths(); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/MBSLanguageSettingsProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/MBSLanguageSettingsProvider.java index 3f12c97ff6f..e297f4e102a 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/MBSLanguageSettingsProvider.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/MBSLanguageSettingsProvider.java @@ -69,7 +69,7 @@ public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase } // this list is allowed to contain duplicate entries, cannot be LinkedHashSet - List list = new ArrayList(); + List list = new ArrayList<>(); if (languageSettings != null) { for (ICLanguageSetting langSetting : languageSettings) { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildMacroProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildMacroProvider.java index 200176190e6..bd6a8c3275c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildMacroProvider.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildMacroProvider.java @@ -121,7 +121,7 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf } private static IBuildMacroSupplier[] filterMacroSuppliers(ICdtVariableSupplier suppliers[]) { - List list = new ArrayList(suppliers.length); + List list = new ArrayList<>(suppliers.length); for (int i = 0; i < suppliers.length; i++) { if (suppliers[i] instanceof IBuildMacroSupplier) list.add(suppliers[i]); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildfileMacroSubstitutor.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildfileMacroSubstitutor.java index 63a637c1b0e..a937b15f0e4 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildfileMacroSubstitutor.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildfileMacroSubstitutor.java @@ -95,7 +95,7 @@ public class BuildfileMacroSubstitutor extends SupplierBasedCdtVariableSubstitut protected String[] getConfigurationReservedNames(IConfiguration configuration) { ITool tools[] = configuration.getFilteredTools(); if (tools != null) { - Set set = new HashSet(); + Set set = new HashSet<>(); for (int i = 0; i < tools.length; i++) { IOutputType ots[] = tools[i].getOutputTypes(); if (ots != null) { @@ -273,7 +273,7 @@ public class BuildfileMacroSubstitutor extends SupplierBasedCdtVariableSubstitut protected Set getCaseInsensitiveReferencedNames() { if (fCaseInsensitiveReferencedNames == null) - fCaseInsensitiveReferencedNames = new HashSet(); + fCaseInsensitiveReferencedNames = new HashSet<>(); return fCaseInsensitiveReferencedNames; } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/ExplicitFileMacroCollector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/ExplicitFileMacroCollector.java index f7c523f87a7..ba3c8ed3f42 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/ExplicitFileMacroCollector.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/ExplicitFileMacroCollector.java @@ -30,7 +30,7 @@ import org.eclipse.cdt.utils.cdtvariables.SupplierBasedCdtVariableSubstitutor; public class ExplicitFileMacroCollector extends SupplierBasedCdtVariableSubstitutor { private static final String EMPTY_STRING = ""; //$NON-NLS-1$ - private List fMacrosList = new ArrayList(); + private List fMacrosList = new ArrayList<>(); /* public ExplicitFileMacroCollector(int contextType, Object contextData){ super(contextType, contextData, EMPTY_STRING, EMPTY_STRING); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/FileContextBuildMacroValues.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/FileContextBuildMacroValues.java index d8a332d0887..1cb2b1a157f 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/FileContextBuildMacroValues.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/FileContextBuildMacroValues.java @@ -31,8 +31,8 @@ public class FileContextBuildMacroValues implements IFileContextBuildMacroValues private IBuilder fBuilder; private IFileContextBuildMacroValues fSupperClassValues; - private HashMap fValues = new HashMap(); - private HashMap fAllValues = new HashMap(); + private HashMap fValues = new HashMap<>(); + private HashMap fAllValues = new HashMap<>(); private boolean fInitialized; public FileContextBuildMacroValues(IBuilder builder, IManagedConfigElement element) { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildCPathEntryContainer.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildCPathEntryContainer.java index 5aea167cf93..f79826aaf91 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildCPathEntryContainer.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildCPathEntryContainer.java @@ -90,7 +90,7 @@ public class ManagedBuildCPathEntryContainer implements IPathEntryContainer { public ManagedBuildCPathEntryContainer(IProject project) { super(); this.project = project; - entries = new Vector(); + entries = new Vector<>(); } protected void addDefinedSymbols(Map definedSymbols) { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConfigurationModification.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConfigurationModification.java index c9b2567bfad..16f60f99806 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConfigurationModification.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConfigurationModification.java @@ -138,8 +138,8 @@ public class ConfigurationModification extends FolderInfoModification implements if (fCompatibilityInfoInited) return; - fCompatibleBuilders = new HashMap(); - fInCompatibleBuilders = new HashMap(); + fCompatibleBuilders = new HashMap<>(); + fInCompatibleBuilders = new HashMap<>(); ConflictMatchSet conflicts = getParentConflictMatchSet(); IBuilder sysBs[] = getAllSysBuilders(); @SuppressWarnings("unchecked") @@ -172,7 +172,7 @@ public class ConfigurationModification extends FolderInfoModification implements @Override public IBuilder[] getCompatibleBuilders() { initCompatibilityInfo(); - List l = new ArrayList(fCompatibleBuilders.size()); + List l = new ArrayList<>(fCompatibleBuilders.size()); IConfiguration cfg = getResourceInfo().getParent(); Set keySet = fCompatibleBuilders.keySet(); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConflictSet.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConflictSet.java index 569a14db447..a166526c7ee 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConflictSet.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConflictSet.java @@ -45,10 +45,10 @@ public class ConflictSet { private void init() { if (fConflictStorage == null) { - fConflictStorage = new PerTypeMapStorage(); + fConflictStorage = new PerTypeMapStorage<>(); if (fConflictMatchList != null && fConflictMatchList.size() != 0) { int size = fConflictMatchList.size(); - PerTypeMapStorage> result = new PerTypeMapStorage>(); + PerTypeMapStorage> result = new PerTypeMapStorage<>(); for (int i = 0; i < size; i++) { ConflictMatch match = fConflictMatchList.get(i); int objType = match.fMatchType; @@ -65,7 +65,7 @@ public class ConflictSet { Set set = cur.get(bo); if (set == null) { - set = new TreeSet(PathComparator.INSTANCE); + set = new TreeSet<>(PathComparator.INSTANCE); cur.put(bo, set); } @@ -129,7 +129,7 @@ public class ConflictSet { public IConflict[] getConflicts() { init(); int types[] = ObjectTypeBasedStorage.getSupportedObjectTypes(); - List list = new ArrayList(); + List list = new ArrayList<>(); for (int i = 0; i < types.length; i++) { Map map = fConflictStorage.getMap(types[i], false); if (map == null) @@ -143,7 +143,7 @@ public class ConflictSet { private static List getConflicts(Map map, List list) { if (list == null) - list = new ArrayList(); + list = new ArrayList<>(); Collection conflicts = map.values(); for (Conflict conflict : conflicts) { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FileInfoModification.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FileInfoModification.java index 52011296ccf..615a37234c5 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FileInfoModification.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FileInfoModification.java @@ -59,7 +59,7 @@ public class FileInfoModification extends ToolListModification implements IFileI @Override protected Set getToolApplicabilityPathSet(Tool realTool, boolean isProject) { if (fApplPathSet == null) { - Set s = new HashSet(1); + Set s = new HashSet<>(1); s.add(getResourceInfo().getPath()); fApplPathSet = Collections.unmodifiableSet(s); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FolderInfoModification.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FolderInfoModification.java index a12353bea65..ba70125b145 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FolderInfoModification.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FolderInfoModification.java @@ -100,9 +100,9 @@ public class FolderInfoModification extends ToolListModification implements IFol } private static class ToolChainApplicabilityPaths { - private Set fFileInfoPaths = new HashSet(); - private Set fFolderInfoPaths = new HashSet(); - private Map> fToolPathMap = new HashMap>(); + private Set fFileInfoPaths = new HashSet<>(); + private Set fFolderInfoPaths = new HashSet<>(); + private Map> fToolPathMap = new HashMap<>(); } public static class ToolChainCompatibilityInfoElement { @@ -143,7 +143,7 @@ public class FolderInfoModification extends ToolListModification implements IFol initCompatibilityInfo(); FolderInfo foInfo = (FolderInfo) getResourceInfo(); - List l = new ArrayList(fCompatibleToolChains.size()); + List l = new ArrayList<>(fCompatibleToolChains.size()); Set keySet = fCompatibleToolChains.keySet(); for (ToolChain tc : keySet) { if (tc != fRealToolChain && foInfo.isToolChainCompatible(fRealToolChain, tc)) @@ -177,8 +177,8 @@ public class FolderInfoModification extends ToolListModification implements IFol if (fCompatibilityInfoInited) return; - fCompatibleToolChains = new HashMap(); - fInCompatibleToolChains = new HashMap(); + fCompatibleToolChains = new HashMap<>(); + fInCompatibleToolChains = new HashMap<>(); ConflictMatchSet parentConflicts = getParentConflictMatchSet(); ToolChain sysTCs[] = (ToolChain[]) getAllSysToolChains(); @@ -259,7 +259,7 @@ public class FolderInfoModification extends ToolListModification implements IFol for (String ext : exts) { if (inputExts.contains(ext)) { if (curInputExts == null) - curInputExts = new HashSet(Arrays.asList(fromTool.getPrimaryInputExtensions())); + curInputExts = new HashSet<>(Arrays.asList(fromTool.getPrimaryInputExtensions())); if (curInputExts.contains(ext)) { return true; @@ -272,7 +272,7 @@ public class FolderInfoModification extends ToolListModification implements IFol @Override protected Set getExtensionConflictToolSet(Tool tool, Tool[] tools) { String exts[] = tool.getPrimaryInputExtensions(); - Set extsSet = new HashSet(Arrays.asList(exts)); + Set extsSet = new HashSet<>(Arrays.asList(exts)); Set conflictsSet = null; for (int i = 0; i < tools.length; i++) { Tool t = tools[i]; @@ -280,7 +280,7 @@ public class FolderInfoModification extends ToolListModification implements IFol continue; if (TcModificationUtil.containCommonEntries(extsSet, t.getPrimaryInputExtensions())) { if (conflictsSet == null) - conflictsSet = new HashSet(); + conflictsSet = new HashSet<>(); conflictsSet.add(t); } @@ -336,7 +336,7 @@ public class FolderInfoModification extends ToolListModification implements IFol if (toolSet != null) { for (IRealBuildObjectAssociation oa : toolSet) { Tool tool = (Tool) oa; - Set set = new HashSet(); + Set set = new HashSet<>(); toolPathsMap.put(tool, set); set.add(path); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectSet.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectSet.java index 8efd5a250cb..a1557646b75 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectSet.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectSet.java @@ -42,7 +42,7 @@ public class ObjectSet implements IObjectSet { @Override public Collection getRealBuildObjects(Collection set) { if (set == null) - set = new HashSet(); + set = new HashSet<>(); set.addAll(fObjectSet); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PathComparator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PathComparator.java index 52f60f0a29b..0729b097a0e 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PathComparator.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PathComparator.java @@ -82,7 +82,7 @@ public class PathComparator implements Comparator { SortedMap> result = next != null ? map.subMap(start, next) : map.tailMap(start); if (copy) - result = new TreeMap>(result); + result = new TreeMap<>(result); return result; } @@ -92,14 +92,14 @@ public class PathComparator implements Comparator { IPath next = getNext(path); SortedSet result = next != null ? set.subSet(start, next) : set.tailSet(start); if (copy) - result = new TreeSet(result); + result = new TreeSet<>(result); return result; } public static SortedSet getDirectChildPathSet(SortedSet set, IPath path) { //all children SortedSet children = getChildPathSet(set, path, false, false); - SortedSet result = new TreeSet(INSTANCE); + SortedSet result = new TreeSet<>(INSTANCE); for (IPath childPath : children) { result.add(childPath); children = children.tailSet(getNext(childPath)); @@ -113,7 +113,7 @@ public class PathComparator implements Comparator { //all children SortedMap> children = getChildPathMap(map, path, false, false); - SortedMap> result = new TreeMap>( + SortedMap> result = new TreeMap<>( INSTANCE); for (Iterator>> iter = children.entrySet() .iterator(); iter.hasNext(); iter = children.entrySet().iterator()) { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PerTypeMapStorage.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PerTypeMapStorage.java index 11a3ccabd1d..b2da5de16dc 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PerTypeMapStorage.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PerTypeMapStorage.java @@ -26,7 +26,7 @@ import org.eclipse.cdt.managedbuilder.internal.core.IRealBuildObjectAssociation; * @param - the type of values in the map */ public class PerTypeMapStorage implements Cloneable { - private ObjectTypeBasedStorage> fStorage = new ObjectTypeBasedStorage>(); + private ObjectTypeBasedStorage> fStorage = new ObjectTypeBasedStorage<>(); public Map getMap(int type, boolean create) { Map map = fStorage.get(type); @@ -39,7 +39,7 @@ public class PerTypeMapStorage impleme protected Map createMap(Map map) { if (map == null) { - return new HashMap(); + return new HashMap<>(); } @SuppressWarnings("unchecked") Map clone = (Map) ((HashMap) map).clone(); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PerTypeSetStorage.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PerTypeSetStorage.java index 1438e261b62..3ac8b476951 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PerTypeSetStorage.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PerTypeSetStorage.java @@ -17,7 +17,7 @@ import java.util.LinkedHashSet; import java.util.Set; public class PerTypeSetStorage implements Cloneable { - private ObjectTypeBasedStorage> fStorage = new ObjectTypeBasedStorage>(); + private ObjectTypeBasedStorage> fStorage = new ObjectTypeBasedStorage<>(); public Set getSet(int type, boolean create) { Set set = fStorage.get(type); @@ -30,7 +30,7 @@ public class PerTypeSetStorage implements Cloneable { protected Set createSet(Set set) { if (set == null) - return new LinkedHashSet(); + return new LinkedHashSet<>(); @SuppressWarnings("unchecked") Set clone = (Set) ((LinkedHashSet) set).clone(); return clone; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/TcModificationUtil.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/TcModificationUtil.java index 12be582a12d..d3c08b071bc 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/TcModificationUtil.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/TcModificationUtil.java @@ -78,7 +78,7 @@ public class TcModificationUtil { public static PerTypeMapStorage> createChildObjectsRealToolToPathSet( FolderInfo foInfo, Map> toolChainMap, Map> toolsMap, boolean addSkipPaths) { - PerTypeMapStorage> storage = new PerTypeMapStorage>(); + PerTypeMapStorage> storage = new PerTypeMapStorage<>(); IToolChain tc = foInfo.getToolChain(); IToolChain rTc = ManagedBuildManager.getRealToolChain(tc); @@ -98,7 +98,7 @@ public class TcModificationUtil { public static PerTypeMapStorage> createParentObjectsRealToolToPathSet( final FolderInfo foInfo) { - PerTypeMapStorage> storage = new PerTypeMapStorage>(); + PerTypeMapStorage> storage = new PerTypeMapStorage<>(); IConfiguration cfg = foInfo.getParent(); FolderInfo rf = (FolderInfo) cfg.getRootFolderInfo(); IPath p = rf.getPath(); @@ -106,18 +106,18 @@ public class TcModificationUtil { IBuilder realBuilder = ManagedBuildManager.getRealBuilder(cfg.getBuilder()); Map> map = storage.getMap(IRealBuildObjectAssociation.OBJECT_BUILDER, true); - Set pathSet = new TreeSet(PathComparator.INSTANCE); + Set pathSet = new TreeSet<>(PathComparator.INSTANCE); pathSet.add(p); map.put((Builder) realBuilder, pathSet); IRealBuildObjectAssociation realCfg = ((Configuration) cfg).getRealBuildObject(); map = storage.getMap(IRealBuildObjectAssociation.OBJECT_CONFIGURATION, true); - pathSet = new TreeSet(PathComparator.INSTANCE); + pathSet = new TreeSet<>(PathComparator.INSTANCE); pathSet.add(p); map.put(realCfg, pathSet); if (!foInfo.isRoot()) { - Set allRcInfos = new HashSet(Arrays.asList(cfg.getResourceInfos())); + Set allRcInfos = new HashSet<>(Arrays.asList(cfg.getResourceInfos())); allRcInfos.removeAll(foInfo.getChildResourceInfoList(true)); for (IResourceInfo rc : allRcInfos) { if (rc instanceof ResourceConfiguration) { @@ -155,7 +155,7 @@ public class TcModificationUtil { public static PerTypeMapStorage> createRealToolToPathSet(IConfiguration cfg, PerTypeMapStorage> skipMapStorage, boolean addSkipPaths) { - PerTypeMapStorage> storage = new PerTypeMapStorage>(); + PerTypeMapStorage> storage = new PerTypeMapStorage<>(); FolderInfo rf = (FolderInfo) cfg.getRootFolderInfo(); IPath p = rf.getPath(); @@ -171,7 +171,7 @@ public class TcModificationUtil { } else { Map> map = storage .getMap(IRealBuildObjectAssociation.OBJECT_BUILDER, true); - Set pathSet = new TreeSet(PathComparator.INSTANCE); + Set pathSet = new TreeSet<>(PathComparator.INSTANCE); pathSet.add(p); map.put((Builder) realBuilder, pathSet); } @@ -188,7 +188,7 @@ public class TcModificationUtil { } else { Map> map = storage .getMap(IRealBuildObjectAssociation.OBJECT_CONFIGURATION, true); - Set pathSet = new TreeSet(PathComparator.INSTANCE); + Set pathSet = new TreeSet<>(PathComparator.INSTANCE); pathSet.add(p); map.put(realCfg, pathSet); } @@ -213,7 +213,7 @@ public class TcModificationUtil { int[] types = new int[] { IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, IRealBuildObjectAssociation.OBJECT_BUILDER, IRealBuildObjectAssociation.OBJECT_TOOL, }; - TreeMap> result = new TreeMap>( + TreeMap> result = new TreeMap<>( PathComparator.INSTANCE); @SuppressWarnings("unchecked") TreeMap> clone = (TreeMap>) initialMap @@ -234,10 +234,10 @@ public class TcModificationUtil { .clone(); storage = clone2; } else { - storage = new PerTypeSetStorage(); + storage = new PerTypeSetStorage<>(); } } else if (resStorage == null || resStorage.isEmpty(true)) { - storage = new PerTypeSetStorage(); + storage = new PerTypeSetStorage<>(); for (int i = 0; i < types.length; i++) { Set set = initStorage.getSet(types[i], false); if (set != null && set.size() != 0) { @@ -247,7 +247,7 @@ public class TcModificationUtil { } else { Set tcInitSet, resSet, setToStore; Set bInitSet = null, tInitSet = null; - storage = new PerTypeSetStorage(); + storage = new PerTypeSetStorage<>(); tcInitSet = initStorage.getSet(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, false); resSet = resStorage.getSet(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, false); @@ -263,10 +263,10 @@ public class TcModificationUtil { IPath path = oPath; if (tc != null) { - tInitSet = new LinkedHashSet(); + tInitSet = new LinkedHashSet<>(); TcModificationUtil.getRealObjectsSet((Tool[]) tc.getTools(), tInitSet); if (path.segmentCount() == 0) { - bInitSet = new LinkedHashSet(); + bInitSet = new LinkedHashSet<>(); IBuilder builder = tc.getBuilder(); if (builder != null) { bInitSet.add((Builder) ManagedBuildManager.getRealBuilder(builder)); @@ -312,7 +312,7 @@ public class TcModificationUtil { PerTypeSetStorage initStorage = entry.getValue(); if (!initStorage.isEmpty(true)) { - PerTypeSetStorage storage = new PerTypeSetStorage(); + PerTypeSetStorage storage = new PerTypeSetStorage<>(); for (int i = 0; i < types.length; i++) { Set set = initStorage.getSet(types[i], false); @@ -387,7 +387,7 @@ public class TcModificationUtil { public static Set getRealObjectsSet(IRealBuildObjectAssociation[] objs, Set set) { if (set == null) - set = new LinkedHashSet(); + set = new LinkedHashSet<>(); for (int i = 0; i < objs.length; i++) { set.add(objs[i].getRealBuildObject()); } @@ -397,7 +397,7 @@ public class TcModificationUtil { public static Map getRealToObjectsMap( IRealBuildObjectAssociation[] objs, Map map) { if (map == null) - map = new LinkedHashMap(); + map = new LinkedHashMap<>(); for (int i = 0; i < objs.length; i++) { map.put(objs[i].getRealBuildObject(), objs[i]); } @@ -444,7 +444,7 @@ public class TcModificationUtil { IRealBuildObjectAssociation bo) { Set set = map.get(bo); if (set == null) { - set = new TreeSet(PathComparator.INSTANCE); + set = new TreeSet<>(PathComparator.INSTANCE); map.put(bo, set); } return set; @@ -453,7 +453,7 @@ public class TcModificationUtil { public static List getArrayList(Map> map, K obj) { List list = map.get(obj); if (list == null) { - list = new ArrayList(); + list = new ArrayList<>(); map.put(obj, list); } return list; @@ -528,7 +528,7 @@ public class TcModificationUtil { Set objPaths = map.get(bo); if (objPaths == null) { - objPaths = new TreeSet(PathComparator.INSTANCE); + objPaths = new TreeSet<>(PathComparator.INSTANCE); map.put(bo, objPaths); } @@ -538,7 +538,7 @@ public class TcModificationUtil { public static void addPath(Map> map, T bo, IPath path) { Set objPaths = map.get(bo); if (objPaths == null) { - objPaths = new TreeSet(PathComparator.INSTANCE); + objPaths = new TreeSet<>(PathComparator.INSTANCE); map.put(bo, objPaths); } @@ -572,7 +572,7 @@ public class TcModificationUtil { public static TreeMap> createPathMap( PerTypeMapStorage> storage) { int[] types = ObjectTypeBasedStorage.getSupportedObjectTypes(); - TreeMap> result = new TreeMap>( + TreeMap> result = new TreeMap<>( PathComparator.INSTANCE); for (int i = 0; i < types.length; i++) { int type = types[i]; @@ -587,7 +587,7 @@ public class TcModificationUtil { for (IPath path : pathSet) { PerTypeSetStorage oset = result.get(path); if (oset == null) { - oset = new PerTypeSetStorage(); + oset = new PerTypeSetStorage<>(); result.put(path, oset); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolChainModificationManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolChainModificationManager.java index df34f6aba5d..8b8079f2517 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolChainModificationManager.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolChainModificationManager.java @@ -134,7 +134,7 @@ public class ToolChainModificationManager implements IToolChainModificationManag continue; if (tmp == null) - tmp = new HashSet(); + tmp = new HashSet<>(); else tmp.clear(); @@ -199,8 +199,8 @@ public class ToolChainModificationManager implements IToolChainModificationManag //2. get variants for applicable ones //1.first filter applicable to not-this - List conflictList = new ArrayList(); - Map> objToConflictMatchMap = new HashMap>(); + List conflictList = new ArrayList<>(); + Map> objToConflictMatchMap = new HashMap<>(); ObjectSetListBasedDefinition[] defs = RulesManager.getInstance() .getRules(ObjectSetListBasedDefinition.CONFLICT); @@ -230,7 +230,7 @@ public class ToolChainModificationManager implements IToolChainModificationManag os.retainMatches(objSet); if (objSet.size() != 0) { - List remainingList = new ArrayList(Arrays.asList(oss)); + List remainingList = new ArrayList<>(Arrays.asList(oss)); remainingList.remove(os); IObjectSet[] remaining = remainingList.toArray(new IObjectSet[remainingList.size()]); @@ -238,7 +238,7 @@ public class ToolChainModificationManager implements IToolChainModificationManag Set skipSet2 = skip != null ? (Set) skip.getSet(type, false) : null; - Set matchingObjects = new HashSet(); + Set matchingObjects = new HashSet<>(); getMatchingObjects(type, remaining, skipSet2, null, matchingObjects); if (matchingObjects.size() != 0) { ConflictMatch conflict = new ConflictMatch(objType, rtToPathMap, type, matchingObjects); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListMap.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListMap.java index 2e78842ed6a..dc51d0b10f1 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListMap.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListMap.java @@ -30,7 +30,7 @@ public class ToolListMap implements Cloneable { private CollectionEntrySet fCollectionEntrySet; public ToolListMap() { - fMap = new HashMap>(); + fMap = new HashMap<>(); } // public class ValueIter { @@ -173,7 +173,7 @@ public class ToolListMap implements Cloneable { // } protected List newList(int size) { - return new ArrayList(size); + return new ArrayList<>(size); } @SuppressWarnings("unchecked") diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListModification.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListModification.java index 4268332bb96..6e89dc52a16 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListModification.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListModification.java @@ -54,10 +54,10 @@ import org.eclipse.core.runtime.Status; public abstract class ToolListModification implements IToolListModification { // private Tool []fTools; - private HashSet fInputExtsSet = new HashSet(); + private HashSet fInputExtsSet = new HashSet<>(); private ResourceInfo fRcInfo; - private LinkedHashMap fProjCompInfoMap = new LinkedHashMap(); - private HashMap fSysCompInfoMap = new HashMap(); + private LinkedHashMap fProjCompInfoMap = new LinkedHashMap<>(); + private HashMap fSysCompInfoMap = new HashMap<>(); private Tool[] fAllSysTools; private HashSet fFilteredOutSysTools; // private LinkedHashMap fRealToToolMap = new LinkedHashMap(); @@ -197,8 +197,8 @@ public abstract class ToolListModification implements IToolListModification { IRealBuildObjectAssociation.OBJECT_TOOL, (PerTypeMapStorage>) storage); - fCompatibleTools = new HashMap(); - fInCompatibleTools = new HashMap(); + fCompatibleTools = new HashMap<>(); + fInCompatibleTools = new HashMap<>(); Tool sysTools[] = getTools(false, true); @SuppressWarnings("unchecked") Map> conflictMap = (Map>) conflicts.fObjToConflictListMap; @@ -247,7 +247,7 @@ public abstract class ToolListModification implements IToolListModification { fOperations = new ModificationOperation[0]; } } else { - List opList = new ArrayList( + List opList = new ArrayList<>( fCompatibleTools.size() + 1); Set keySet = fCompatibleTools.keySet(); for (Tool tool : keySet) { @@ -353,7 +353,7 @@ public abstract class ToolListModification implements IToolListModification { fOperations = new ModificationOperation[] { new ModificationOperation(this, null) }; } else { Map projMap = getMap(true); - List opList = new ArrayList(projMap.size()); + List opList = new ArrayList<>(projMap.size()); for (IToolModification tm : projMap.values()) { ProjToolCompatibilityStatusInfo info = (ProjToolCompatibilityStatusInfo) tm; if (info.getCompatibleTools().containsKey(fRealTool) @@ -396,7 +396,7 @@ public abstract class ToolListModification implements IToolListModification { private Set getAddCompatibleSysTools() { if (fAddCapableTools == null) { - fAddCapableTools = new HashSet(Arrays.asList(getAllSysTools())); + fAddCapableTools = new HashSet<>(Arrays.asList(getAllSysTools())); PerTypeMapStorage> storage = getCompleteObjectStore(); ConflictMatchSet conflicts = ToolChainModificationManager.getInstance() .getConflictInfo(IRealBuildObjectAssociation.OBJECT_TOOL, storage); @@ -529,7 +529,7 @@ public abstract class ToolListModification implements IToolListModification { if (fAllSysTools == null) { ITool[] allSys = ManagedBuildManager.getRealTools(); fAllSysTools = filterTools((Tool[]) allSys); - HashSet set = new HashSet(Arrays.asList(allSys)); + HashSet set = new HashSet<>(Arrays.asList(allSys)); set.removeAll(Arrays.asList(fAllSysTools)); fFilteredOutSysTools = set; } @@ -695,7 +695,7 @@ public abstract class ToolListModification implements IToolListModification { addSet = rmSet; } - List list = new ArrayList(); + List list = new ArrayList<>(); list.addAll(map.values()); clearToolInfo(map.values().toArray(new Tool[map.size()])); @@ -710,7 +710,7 @@ public abstract class ToolListModification implements IToolListModification { } private HashMap createRealToToolMap(/*boolean includeFilteredOut*/) { - HashMap map = new HashMap(); + HashMap map = new HashMap<>(); Set> entries = fProjCompInfoMap.entrySet(); for (Entry entry : entries) { map.put(entry.getKey(), entry.getValue().getTool()); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/MatchObjectElement.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/MatchObjectElement.java index c6cf1ea528e..28f39826761 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/MatchObjectElement.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/MatchObjectElement.java @@ -40,8 +40,8 @@ public class MatchObjectElement { public static class TypeToStringAssociation { private int fType; private String fString; - private static ObjectTypeBasedStorage fTypeAssociationStorage = new ObjectTypeBasedStorage(); - private static Map fStringAssociationStorage = new HashMap(); + private static ObjectTypeBasedStorage fTypeAssociationStorage = new ObjectTypeBasedStorage<>(); + private static Map fStringAssociationStorage = new HashMap<>(); public static TypeToStringAssociation TOOL = new TypeToStringAssociation( IRealBuildObjectAssociation.OBJECT_TOOL, "tool"); //$NON-NLS-1$ @@ -125,7 +125,7 @@ public class MatchObjectElement { PatternElement(IConfigurationElement el, int defaultSearchType, int defaultIdType) { String tmp = el.getAttribute(ATTR_OBJECT_IDS); - fIds = new HashSet(Arrays.asList(CDataUtil.stringToArray(tmp, DELIMITER))); + fIds = new HashSet<>(Arrays.asList(CDataUtil.stringToArray(tmp, DELIMITER))); int type = 0; tmp = el.getAttribute(ATTR_PATTERN_TYPE_SEARCH_SCOPE); @@ -193,7 +193,7 @@ public class MatchObjectElement { if (el.fType != fType) throw new IllegalArgumentException(); - HashSet set = new HashSet(); + HashSet set = new HashSet<>(); set.addAll(fIds); set.addAll(el.fIds); return new PatternElement(set, fType); @@ -219,7 +219,7 @@ public class MatchObjectElement { fObjectType = assoc.getType(); - Map patternMap = new HashMap(); + Map patternMap = new HashMap<>(); int defaultSearchType = PatternElement.DEFAULT_PATTERN_SEARCH_TYPE; int defaultIdType = PatternElement.DEFAULT_PATTERN_ID_TYPE; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/RulesManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/RulesManager.java index 2bf1b5c92d8..e2f0ac6cfd7 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/RulesManager.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/RulesManager.java @@ -46,7 +46,7 @@ public class RulesManager { private ConflictDefinition[] fConflictDefinitions; - private Map fMatchObjectMap = new HashMap(); + private Map fMatchObjectMap = new HashMap<>(); private PerTypeMapStorage> fObjToChildSuperClassMap; private StarterJob fStarter; private boolean fIsStartInited; @@ -106,7 +106,7 @@ public class RulesManager { fConflictDefinitions = new ConflictDefinition[0]; } else { IExtension[] extensions = extensionPoint.getExtensions(); - List conflictDefs = new ArrayList(); + List conflictDefs = new ArrayList<>(); for (int i = 0; i < extensions.length; ++i) { IExtension extension = extensions[i]; IConfigurationElement[] elements = extension.getConfigurationElements(); @@ -153,7 +153,7 @@ public class RulesManager { if (oSet == null) { int type = el.getObjectType(); PatternElement[] patterns = el.getPatterns(); - HashSet objectsSet = new HashSet(); + HashSet objectsSet = new HashSet<>(); for (int i = 0; i < patterns.length; i++) { PatternElement pattern = patterns[i]; processPattern(type, pattern, objectsSet); @@ -174,7 +174,7 @@ public class RulesManager { IRealBuildObjectAssociation[] allObjs = TcModificationUtil.getExtensionObjects(objType); Pattern pattern = Pattern.compile(id); - List list = new ArrayList(); + List list = new ArrayList<>(); for (int i = 0; i < allObjs.length; i++) { if (pattern.matcher(allObjs[i].getId()).matches()) @@ -187,7 +187,7 @@ public class RulesManager { private Set processPattern(int objType, PatternElement el, Set set) { if (set == null) - set = new HashSet(); + set = new HashSet<>(); String ids[] = el.getIds(); if (el.getSearchType() == PatternElement.TYPE_SEARCH_EXTENSION_OBJECT) { @@ -237,7 +237,7 @@ public class RulesManager { private Set getChildSuperClassRealSet(IRealBuildObjectAssociation obj, IRealBuildObjectAssociation[] all) { if (fObjToChildSuperClassMap == null) - fObjToChildSuperClassMap = new PerTypeMapStorage>(); + fObjToChildSuperClassMap = new PerTypeMapStorage<>(); if (all == null) all = TcModificationUtil.getExtensionObjects(obj.getType()); @@ -256,7 +256,7 @@ public class RulesManager { private static Set createChildSuperClassRealSet(IRealBuildObjectAssociation obj, IRealBuildObjectAssociation[] all, Set set) { if (set == null) - set = new HashSet(); + set = new HashSet<>(); if (all == null) all = TcModificationUtil.getExtensionObjects(obj.getType()); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuildCommandParser.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuildCommandParser.java index 3cc3334ad42..525b624c789 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuildCommandParser.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuildCommandParser.java @@ -233,7 +233,7 @@ public abstract class AbstractBuildCommandParser extends AbstractLanguageSetting return null; } - List options = new ArrayList(); + List options = new ArrayList<>(); Matcher optionMatcher = OPTIONS_PATTERN.matcher(line); while (optionMatcher.find()) { String option = optionMatcher.group(OPTION_GROUP); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java index c935edca7f3..c06d5a17c0c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java @@ -433,7 +433,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti List languageIds = getLanguageScope(); if (languageIds == null) { - languageIds = new ArrayList(1); + languageIds = new ArrayList<>(1); // "null" language indicates that the provider provides for any language languageIds.add(null); } @@ -640,7 +640,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti specFile = null; // init specFile *before* calling resolveCommand(), can be changed in there currentCommandResolved = resolveCommand(currentLanguageId); - detectedSettingEntries = new ArrayList(); + detectedSettingEntries = new ArrayList<>(); collected = 0; } @@ -711,7 +711,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti new String[] { GMAKE_ERROR_PARSER_ID }); ConsoleParserAdapter consoleParser = new ConsoleParserAdapter(); consoleParser.startup(currentCfgDescription, epm); - List parsers = new ArrayList(); + List parsers = new ArrayList<>(); parsers.add(consoleParser); buildRunnerHelper.setLaunchParameters(launcher, program, args, buildDirURI, envp); @@ -754,7 +754,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti if (envMngr == null) { envMngr = CCorePlugin.getDefault().getBuildEnvironmentManager(); } - List vars = new ArrayList( + List vars = new ArrayList<>( Arrays.asList(envMngr.getVariables(currentCfgDescription, true))); // On POSIX (Linux, UNIX) systems reset language variables to default (English) @@ -773,7 +773,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti * Create a handy map of environment variables. */ private Map createEnvironmentMap(ICConfigurationDescription cfgDescription) { - Map envMap = new HashMap(); + Map envMap = new HashMap<>(); for (IEnvironmentVariable var : getEnvironmentVariables()) { String name = var.getName(); if (!envMngr.isVariableCaseSensitive()) { @@ -788,7 +788,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti * Convert map of environment variables to array in format "var=value". */ private String[] toEnvp(Map environmentMap) { - Set envp = new HashSet(); + Set envp = new HashSet<>(); for (Entry var : environmentMap.entrySet()) { envp.add(var.getKey() + '=' + var.getValue()); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java index b7de3fc60ae..9f1540db227 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java @@ -471,7 +471,7 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett buildDirURI = getBuildDirURI(mappedRootURI); } - List entries = new ArrayList(); + List entries = new ArrayList<>(); List options = parseOptions(line); if (options != null) { @@ -916,7 +916,7 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett * Find all resources in the folder which might be represented by relative path passed. */ private static List findPathInFolder(IPath path, IContainer folder) { - List paths = new ArrayList(); + List paths = new ArrayList<>(); IResource resource = folder.findMember(path); if (resource != null) { paths.add(resource); @@ -939,7 +939,7 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett * Determine which resource in workspace is the best fit to parsedName passed. */ private IResource findBestFitInWorkspace(String parsedName) { - Set referencedProjectsNames = new LinkedHashSet(); + Set referencedProjectsNames = new LinkedHashSet<>(); if (currentCfgDescription != null) { Map refs = currentCfgDescription.getReferenceInfo(); referencedProjectsNames.addAll(refs.keySet()); @@ -1205,7 +1205,7 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett protected String getPatternFileExtensions() { IContentTypeManager manager = Platform.getContentTypeManager(); - Set fileExts = new HashSet(); + Set fileExts = new HashSet<>(); IContentType contentTypeCpp = manager.getContentType(CCorePlugin.CONTENT_TYPE_CXXSOURCE); fileExts.addAll(Arrays.asList(contentTypeCpp.getFileSpecs(IContentType.FILE_EXTENSION_SPEC))); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java index a00429c4a01..e7ca62d1b33 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java @@ -75,7 +75,7 @@ public class GCCBuiltinSpecsDetector extends ToolchainBuiltinSpecsDetector * Create a list from one item. */ private List makeList(String line) { - List list = new ArrayList(); + List list = new ArrayList<>(); list.add(line); return list; } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/ToolchainBuiltinSpecsDetector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/ToolchainBuiltinSpecsDetector.java index 9ca89c36882..c8a64eeb283 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/ToolchainBuiltinSpecsDetector.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/ToolchainBuiltinSpecsDetector.java @@ -45,7 +45,7 @@ import org.eclipse.cdt.managedbuilder.internal.envvar.EnvironmentVariableManager */ public abstract class ToolchainBuiltinSpecsDetector extends AbstractBuiltinSpecsDetector { private static final String EMPTY_QUOTED_STRING = "\"\""; //$NON-NLS-1$ - private Map toolMap = new HashMap(); + private Map toolMap = new HashMap<>(); /** * Concrete compiler specs detectors need to supply tool-chain ID. diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuildCommands.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuildCommands.java index 70bf3e43c4b..3499ecae2b1 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuildCommands.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuildCommands.java @@ -210,7 +210,7 @@ public class DefaultGCCDependencyCalculatorPreBuildCommands implements IManagedD IManagedCommandLineInfo cmdLInfo = null; // Set up the command line options that will generate the dependency file - Vector options = new Vector(); + Vector options = new Vector<>(); // -w options.add("-w"); //$NON-NLS-1$ // -MM diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java index f23c29aceef..2bbd9347c70 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java @@ -373,12 +373,12 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { // private Set outputExtensionsSet; //=== Maps of macro names (String) to values (List) // Map of source file build variable names to a List of source file Path's - private final HashMap> buildSrcVars = new HashMap>(); + private final HashMap> buildSrcVars = new HashMap<>(); // Map of output file build variable names to a List of output file Path's - private final HashMap> buildOutVars = new HashMap>(); + private final HashMap> buildOutVars = new HashMap<>(); // Map of dependency file build variable names to a List of GnuDependencyGroupInfo objects - private final HashMap buildDepVars = new HashMap(); - private final LinkedHashMap topBuildOutVars = new LinkedHashMap(); + private final HashMap buildDepVars = new HashMap<>(); + private final LinkedHashMap topBuildOutVars = new LinkedHashMap<>(); // Dependency file variables // private Vector dependencyMakefiles; // IPath's - relative to the top build directory or absolute @@ -548,7 +548,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { @Override public boolean visit(PathSettingsContainer container) { ToolInfoHolder h = (ToolInfoHolder) container.getValue(); - Vector depExts = new Vector(); // Vector of dependency file extensions + Vector depExts = new Vector<>(); // Vector of dependency file extensions IManagedDependencyGenerator2[] postProcessors = new IManagedDependencyGenerator2[h.buildTools.length]; boolean callPopulateDummyTargets = collectDependencyGeneratorInformation(h, depExts, postProcessors); @@ -839,7 +839,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { public boolean visit(PathSettingsContainer container) { ToolInfoHolder h = (ToolInfoHolder) container.getValue(); // Collect the methods that will need to be called - Vector depExts = new Vector(); // Vector of dependency file extensions + Vector depExts = new Vector<>(); // Vector of dependency file extensions IManagedDependencyGenerator2[] postProcessors = new IManagedDependencyGenerator2[h.buildTools.length]; boolean callPopulateDummyTargets = collectDependencyGeneratorInformation(h, depExts, postProcessors); @@ -1010,12 +1010,12 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { macroBuffer.append(addDefaultHeader()); // Map of macro names (String) to its definition (List of Strings) - HashMap> outputMacros = new HashMap>(); + HashMap> outputMacros = new HashMap<>(); // Add the predefined LIBS, USER_OBJS macros // Add the libraries this project depends on - valueList = new ArrayList(); + valueList = new ArrayList<>(); String[] libs = config.getLibs(buildTargetExt); for (String lib : libs) { valueList.add(lib); @@ -1023,7 +1023,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { outputMacros.put("LIBS", valueList); //$NON-NLS-1$ // Add the extra user-specified objects - valueList = new ArrayList(); + valueList = new ArrayList<>(); String[] userObjs = config.getUserObjects(buildTargetExt); for (String obj : userObjs) { valueList.add(obj); @@ -1068,7 +1068,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { public boolean visit(PathSettingsContainer container) { ToolInfoHolder h = (ToolInfoHolder) container.getValue(); ITool[] buildTools = h.buildTools; - HashSet handledInputExtensions = new HashSet(); + HashSet handledInputExtensions = new HashSet<>(); String buildMacro; for (ITool buildTool : buildTools) { if (buildTool.getCustomBuildStep()) @@ -1159,7 +1159,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { buffer.append(addMacros()); // List to collect needed build output variables - List outputVarsAdditionsList = new ArrayList(); + List outputVarsAdditionsList = new ArrayList<>(); // Determine target rules StringBuffer targetRules = addTargets(outputVarsAdditionsList, rebuild); @@ -1222,7 +1222,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { buffer.append("-include sources.mk").append(NEWLINE); //$NON-NLS-1$ // Add includes for each subdir in child-subdir-first order (required for makefile rule matching to work). - List subDirList = new ArrayList(); + List subDirList = new ArrayList<>(); for (IContainer subDir : getSubdirList()) { String projectRelativePath = subDir.getProjectRelativePath().toString(); if (!projectRelativePath.isEmpty()) @@ -1380,7 +1380,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { */ // Vector managedProjectOutputs = new Vector(refdProjects.length); // if (refdProjects.length > 0) { - Vector managedProjectOutputs = new Vector(refConfigs.length); + Vector managedProjectOutputs = new Vector<>(refConfigs.length); if (refConfigs.length > 0) { boolean addDeps = true; // if (refdProjects != null) { @@ -1598,13 +1598,13 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { boolean bEmitPostBuildStepCall) { // Get the tool's inputs and outputs - Vector inputs = new Vector(); - Vector dependencies = new Vector(); - Vector outputs = new Vector(); - Vector enumeratedPrimaryOutputs = new Vector(); - Vector enumeratedSecondaryOutputs = new Vector(); - Vector outputVariables = new Vector(); - Vector additionalTargets = new Vector(); + Vector inputs = new Vector<>(); + Vector dependencies = new Vector<>(); + Vector outputs = new Vector<>(); + Vector enumeratedPrimaryOutputs = new Vector<>(); + Vector enumeratedSecondaryOutputs = new Vector<>(); + Vector outputVariables = new Vector<>(); + Vector additionalTargets = new Vector<>(); String outputPrefix = EMPTY_STRING; if (!getToolInputsOutputs(tool, inputs, dependencies, outputs, enumeratedPrimaryOutputs, @@ -1741,7 +1741,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { // If we have secondary outputs, output dependency rules without commands if (enumeratedSecondaryOutputs.size() > 0 || additionalTargets.size() > 0) { String primaryOutput = enumeratedPrimaryOutputs.get(0); - Vector addlOutputs = new Vector(); + Vector addlOutputs = new Vector<>(); addlOutputs.addAll(enumeratedSecondaryOutputs); addlOutputs.addAll(additionalTargets); for (int i = 0; i < addlOutputs.size(); i++) { @@ -1841,7 +1841,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { protected Vector calculateSecondaryOutputs(IOutputType[] secondaryOutputs) { ToolInfoHolder h = (ToolInfoHolder) toolInfos.getValue(); ITool[] buildTools = h.buildTools; - Vector buildVars = new Vector(); + Vector buildVars = new Vector<>(); for (int i = 0; i < buildTools.length; i++) { // Add the specified output build variables IOutputType[] outTypes = buildTools[i].getOutputTypes(); @@ -1948,7 +1948,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { // For build macros in the configuration, create a map which will map them // to a string which holds its list of sources. - LinkedHashMap buildVarToRuleStringMap = new LinkedHashMap(); + LinkedHashMap buildVarToRuleStringMap = new LinkedHashMap<>(); // Add statements that add the source files in this folder, // and generated source files, and generated dependency files @@ -2070,8 +2070,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { || (inputType == null && tool != config.calculateTargetTool())) { // Try to add the rule for the file - Vector generatedOutputs = new Vector(); // IPath's - build directory relative - Vector generatedDepFiles = new Vector(); // IPath's - build directory relative or absolute + Vector generatedOutputs = new Vector<>(); // IPath's - build directory relative + Vector generatedDepFiles = new Vector<>(); // IPath's - build directory relative or absolute addRuleForSource(relativePath, ruleBuffer, resource, sourceLocation, rcInfo, generatedSource, generatedDepFiles, generatedOutputs); @@ -2364,9 +2364,9 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { if (outputExtension.length() > 0) optDotExt = DOT + outputExtension; - Vector ruleOutputs = new Vector(); - Vector enumeratedPrimaryOutputs = new Vector(); // IPaths relative to the top build directory - Vector enumeratedSecondaryOutputs = new Vector(); // IPaths relative to the top build directory + Vector ruleOutputs = new Vector<>(); + Vector enumeratedPrimaryOutputs = new Vector<>(); // IPaths relative to the top build directory + Vector enumeratedSecondaryOutputs = new Vector<>(); // IPaths relative to the top build directory calculateOutputsForSource(tool, relativePath, resource, sourceLocation, ruleOutputs, enumeratedPrimaryOutputs, enumeratedSecondaryOutputs); enumeratedOutputs.addAll(enumeratedPrimaryOutputs); @@ -2576,7 +2576,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { // Generate the command line - Vector inputs = new Vector(); + Vector inputs = new Vector<>(); inputs.add(IN_MACRO); // Other additional inputs @@ -2756,7 +2756,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { } // Add any additional outputs here using dependency lines - Vector addlOutputs = new Vector(); + Vector addlOutputs = new Vector<>(); if (enumeratedPrimaryOutputs.size() > 1) { // Starting with 1 is intentional in order to skip the primary output for (int i = 1; i < enumeratedPrimaryOutputs.size(); i++) @@ -2865,7 +2865,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { * Returns any additional resources specified for the tool in other InputType elements and AdditionalInput elements */ protected IPath[] getAdditionalResourcesForSource(ITool tool) { - List allRes = new ArrayList(); + List allRes = new ArrayList<>(); IInputType[] types = tool.getInputTypes(); for (IInputType type : types) { // Additional resources come from 2 places. @@ -3066,7 +3066,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { // 2. If an option is specified, use the value of the option if (option != null) { try { - List outputList = new ArrayList(); + List outputList = new ArrayList<>(); int optType = option.getValueType(); if (optType == IOption.STRING) { outputList.add(outputPrefix + option.getStringValue()); @@ -3287,7 +3287,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { */ protected IPath[] oldCalculateDependenciesForSource(IManagedDependencyGenerator depGen, ITool tool, String relativePath, IResource resource) { - Vector deps = new Vector(); + Vector deps = new Vector<>(); int type = depGen.getCalculatorType(); switch (type) { @@ -3397,7 +3397,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { // The set of output extensions which will be produced by this tool. // It is presumed that this set is not very large (likely < 10) so // a HashSet should provide good performance. - h.outputExtensionsSet = new HashSet(); + h.outputExtensionsSet = new HashSet<>(); // For each tool for the target, lookup the kinds of sources it outputs // and add that to our list of output extensions. @@ -3471,8 +3471,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { } // Reconstruct the buffer tokens into useful chunks of dependency information - Vector bufferTokens = new Vector(Arrays.asList(inBufferString.split("\\s"))); //$NON-NLS-1$ - Vector deps = new Vector(bufferTokens.size()); + Vector bufferTokens = new Vector<>(Arrays.asList(inBufferString.split("\\s"))); //$NON-NLS-1$ + Vector deps = new Vector<>(bufferTokens.size()); Iterator tokenIter = bufferTokens.iterator(); while (tokenIter.hasNext()) { String token = tokenIter.next(); @@ -3889,8 +3889,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { } // Set of input extensions for which macros have been created so far - HashSet handledDepsInputExtensions = new HashSet(); - HashSet handledOutsInputExtensions = new HashSet(); + HashSet handledDepsInputExtensions = new HashSet<>(); + HashSet handledOutsInputExtensions = new HashSet<>(); while (!done) { int[] testState = new int[doneState.length]; @@ -4010,7 +4010,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { } } if (fileList == null) { - fileList = new Vector(); + fileList = new Vector<>(); } fileList.add(path.toString()); } @@ -4045,7 +4045,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { */ protected Vector getRuleList() { if (ruleList == null) { - ruleList = new Vector(); + ruleList = new Vector<>(); } return ruleList; } @@ -4058,7 +4058,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { */ protected Vector getDepLineList() { if (depLineList == null) { - depLineList = new Vector(); + depLineList = new Vector<>(); } return depLineList; } @@ -4071,7 +4071,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { */ protected Vector getDepRuleList() { if (depRuleList == null) { - depRuleList = new Vector(); + depRuleList = new Vector<>(); } return depRuleList; } @@ -4358,21 +4358,21 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { */ private Vector getDeletedDirList() { if (deletedDirList == null) { - deletedDirList = new Vector(); + deletedDirList = new Vector<>(); } return deletedDirList; } private Vector getDeletedFileList() { if (deletedFileList == null) { - deletedFileList = new Vector(); + deletedFileList = new Vector<>(); } return deletedFileList; } private List getDependencyMakefiles(ToolInfoHolder h) { if (h.dependencyMakefiles == null) { - h.dependencyMakefiles = new ArrayList(); + h.dependencyMakefiles = new ArrayList<>(); } return h.dependencyMakefiles; } @@ -4401,7 +4401,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { */ private Vector getInvalidDirList() { if (invalidDirList == null) { - invalidDirList = new Vector(); + invalidDirList = new Vector<>(); } return invalidDirList; } @@ -4411,7 +4411,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { */ private Collection getModifiedList() { if (modifiedList == null) - modifiedList = new LinkedHashSet(); + modifiedList = new LinkedHashSet<>(); return modifiedList; } @@ -4420,7 +4420,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { */ private Collection getSubdirList() { if (subdirList == null) - subdirList = new LinkedHashSet(); + subdirList = new LinkedHashSet<>(); return subdirList; } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/ManagedBuildGnuToolInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/ManagedBuildGnuToolInfo.java index a9565da46a5..df253441829 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/ManagedBuildGnuToolInfo.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/ManagedBuildGnuToolInfo.java @@ -69,14 +69,14 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo { private boolean outputsCalculated = false; private boolean outputVariablesCalculated = false; private boolean dependenciesCalculated = false; - private Vector commandInputs = new Vector(); - private Vector enumeratedInputs = new Vector(); - private Vector commandOutputs = new Vector(); - private Vector enumeratedPrimaryOutputs = new Vector(); - private Vector enumeratedSecondaryOutputs = new Vector(); - private Vector outputVariables = new Vector(); - private Vector commandDependencies = new Vector(); - private Vector additionalTargets = new Vector(); + private Vector commandInputs = new Vector<>(); + private Vector enumeratedInputs = new Vector<>(); + private Vector commandOutputs = new Vector<>(); + private Vector enumeratedPrimaryOutputs = new Vector<>(); + private Vector enumeratedSecondaryOutputs = new Vector<>(); + private Vector outputVariables = new Vector<>(); + private Vector commandDependencies = new Vector<>(); + private Vector additionalTargets = new Vector<>(); //private Vector enumeratedDependencies = new Vector(); // Map of macro names (String) to values (List) @@ -185,16 +185,16 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo { * 3. Use the file extensions and the resources in the project */ boolean done = true; - Vector myCommandInputs = new Vector(); // Inputs for the tool command line - Vector myCommandDependencies = new Vector(); // Dependencies for the make rule - Vector myEnumeratedInputs = new Vector(); // Complete list of individual inputs + Vector myCommandInputs = new Vector<>(); // Inputs for the tool command line + Vector myCommandDependencies = new Vector<>(); // Dependencies for the make rule + Vector myEnumeratedInputs = new Vector<>(); // Complete list of individual inputs IInputType[] inTypes = tool.getInputTypes(); if (inTypes != null && inTypes.length > 0) { for (IInputType type : inTypes) { - Vector itCommandInputs = new Vector(); // Inputs for the tool command line for this input-type - Vector itCommandDependencies = new Vector(); // Dependencies for the make rule for this input-type - Vector itEnumeratedInputs = new Vector(); // Complete list of individual inputs for this input-type + Vector itCommandInputs = new Vector<>(); // Inputs for the tool command line for this input-type + Vector itCommandDependencies = new Vector<>(); // Dependencies for the make rule for this input-type + Vector itEnumeratedInputs = new Vector<>(); // Complete list of individual inputs for this input-type String variable = type.getBuildVariable(); boolean primaryInput = type.getPrimaryInput(); boolean useFileExts = false; @@ -204,7 +204,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo { // Option? if (option != null) { try { - List inputs = new ArrayList(); + List inputs = new ArrayList<>(); int optType = option.getValueType(); if (optType == IOption.STRING) { inputs.add(option.getStringValue()); @@ -295,7 +295,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo { // Note: This is only correct for tools with multipleOfType == true, but for other tools // it gives us an input resource for generating default names // Determine the set of source input macros to use - HashSet handledInputExtensions = new HashSet(); + HashSet handledInputExtensions = new HashSet<>(); String[] exts = type.getSourceExtensions(tool); if (projResources != null) { for (IResource rc : projResources) { @@ -469,19 +469,19 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo { HashSet handledInputExtensions, boolean lastChance) { boolean done = true; - Vector myCommandOutputs = new Vector(); - Vector myEnumeratedPrimaryOutputs = new Vector(); - Vector myEnumeratedSecondaryOutputs = new Vector(); - HashMap> myOutputMacros = new HashMap>(); + Vector myCommandOutputs = new Vector<>(); + Vector myEnumeratedPrimaryOutputs = new Vector<>(); + Vector myEnumeratedSecondaryOutputs = new Vector<>(); + HashMap> myOutputMacros = new HashMap<>(); // The next two fields are used together - Vector myBuildVars = new Vector(); - Vector> myBuildVarsValues = new Vector>(); + Vector myBuildVars = new Vector<>(); + Vector> myBuildVarsValues = new Vector<>(); // Get the outputs for this tool invocation IOutputType[] outTypes = tool.getOutputTypes(); if (outTypes != null && outTypes.length > 0) { for (int i = 0; i < outTypes.length; i++) { - Vector typeEnumeratedOutputs = new Vector(); + Vector typeEnumeratedOutputs = new Vector<>(); IOutputType type = outTypes[i]; String outputPrefix = type.getOutputPrefix(); @@ -525,7 +525,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo { // 2. If an option is specified, use the value of the option if (option != null) { try { - List outputs = new ArrayList(); + List outputs = new ArrayList<>(); int optType = option.getValueType(); if (optType == IOption.STRING) { outputs.add(outputPrefix + option.getStringValue()); @@ -562,7 +562,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo { // NO - myCommandOutputs.addAll(outputs); typeEnumeratedOutputs.addAll(outputs); if (variable.length() > 0) { - List outputPaths = new ArrayList(); + List outputPaths = new ArrayList<>(); for (int j = 0; j < outputs.size(); j++) { outputPaths.add(Path.fromOSString(outputs.get(j))); } @@ -619,7 +619,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo { currList.addAll(Arrays.asList(outNames)); myOutputMacros.put(variable, currList); } else { - myOutputMacros.put(variable, new ArrayList(Arrays.asList(outNames))); + myOutputMacros.put(variable, new ArrayList<>(Arrays.asList(outNames))); } } } else @@ -646,7 +646,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo { } typeEnumeratedOutputs.addAll(namesList); if (variable.length() > 0) { - List outputPaths = new ArrayList(); + List outputPaths = new ArrayList<>(); for (int j = 0; j < namesList.size(); j++) { outputPaths.add(Path.fromOSString(namesList.get(j))); } @@ -665,7 +665,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo { // using the built-in string substitution functions of make. if (multOfType) { // This case is not handled - a nameProvider or outputNames must be specified - List errList = new ArrayList(); + List errList = new ArrayList<>(); errList.add(ManagedMakeMessages.getResourceString("MakefileGenerator.error.no.nameprovider")); //$NON-NLS-1$ myCommandOutputs.addAll(errList); } else { @@ -703,7 +703,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo { } typeEnumeratedOutputs.add(namePattern.replaceAll("%", fileName)); //$NON-NLS-1$ if (variable.length() > 0) { - List outputs = new ArrayList(); + List outputs = new ArrayList<>(); outputs.add(Path.fromOSString(fileName)); if (myOutputMacros.containsKey(variable)) { List currList = myOutputMacros.get(variable); @@ -802,7 +802,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo { String depsMacroEntry = calculateSourceMacro(makeGen, extensionName, depExt, IManagedBuilderMakefileGenerator.WILDCARD); - List depsList = new ArrayList(); + List depsList = new ArrayList<>(); depsList.add(Path.fromOSString(depsMacroEntry)); String depsMacro = makeGen.getDepMacroName(extensionName).toString(); if (myOutputMacros.containsKey(depsMacro)) { @@ -880,10 +880,10 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo { HashSet handledInputExtensions, ToolInfoHolder h, boolean lastChance) { // Get the dependencies for this tool invocation boolean done = true; - Vector myCommandDependencies = new Vector(); - Vector myAdditionalTargets = new Vector(); + Vector myCommandDependencies = new Vector<>(); + Vector myAdditionalTargets = new Vector<>(); //Vector myEnumeratedDependencies = new Vector(); - HashMap> myOutputMacros = new HashMap>(); + HashMap> myOutputMacros = new HashMap<>(); IInputType[] inTypes = tool.getInputTypes(); if (inTypes != null && inTypes.length > 0) { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/pdomdepgen/PDOMDependencyCalculator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/pdomdepgen/PDOMDependencyCalculator.java index 2d5ae707461..444f2fe62d5 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/pdomdepgen/PDOMDependencyCalculator.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/pdomdepgen/PDOMDependencyCalculator.java @@ -77,7 +77,7 @@ public class PDOMDependencyCalculator implements IManagedDependencyCalculator { if (files.length > 0) { IIndexInclude[] includes = index.findIncludes(files[0], IIndex.DEPTH_INFINITE); - List list = new ArrayList(); + List list = new ArrayList<>(); for (IIndexInclude inc : includes) { if (inc.isResolved()) { list.add(IndexLocationFactory.getAbsolutePath(inc.getIncludesLocation())); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java index b8dee4902d1..3a0683862b1 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java @@ -118,7 +118,7 @@ class UpdateManagedProject12 { boolean debug = false; int type = -1; - Vector idTokens = new Vector(Arrays.asList(oldId.split(REGEXP_SEPARATOR))); + Vector idTokens = new Vector<>(Arrays.asList(oldId.split(REGEXP_SEPARATOR))); try { String platform = idTokens.get(0); if (platform.equalsIgnoreCase(ID_CYGWIN)) { @@ -240,11 +240,11 @@ class UpdateManagedProject12 { String optId = null; String[] idTokens = oldId.split(REGEXP_SEPARATOR); - Vector oldIdVector = new Vector(Arrays.asList(idTokens)); + Vector oldIdVector = new Vector<>(Arrays.asList(idTokens)); if (isBuiltInOption(oldIdVector)) { // New ID will be in form gnu.[c|c++|both].[compiler|link|lib].option.{1.2_component} - Vector newIdVector = new Vector(idTokens.length + 2); + Vector newIdVector = new Vector<>(idTokens.length + 2); // We can ignore the first element of the old IDs since it is just [cygwin|linux|solaris] for (int index = 1; index < idTokens.length; ++index) { @@ -412,7 +412,7 @@ class UpdateManagedProject12 { case IOption.PREPROCESSOR_SYMBOLS: case IOption.LIBRARIES: case IOption.OBJECTS: - Vector values = new Vector(); + Vector values = new Vector<>(); NodeList nodes = optRef.getElementsByTagName(IOption.LIST_VALUE); for (int i = 0; i < nodes.getLength(); ++i) { Node node = nodes.item(i); @@ -450,7 +450,7 @@ class UpdateManagedProject12 { // Is this a built-in target or one we cannot convert boolean builtIn = false; - Vector idTokens = new Vector(Arrays.asList(oldId.split(REGEXP_SEPARATOR))); + Vector idTokens = new Vector<>(Arrays.asList(oldId.split(REGEXP_SEPARATOR))); try { String platform = idTokens.get(0); if (platform.equalsIgnoreCase(ID_CYGWIN)) { @@ -558,7 +558,7 @@ class UpdateManagedProject12 { int toolType = -1; // Figure out what kind of tool the ref pointed to - Vector idTokens = new Vector(Arrays.asList(oldId.split(REGEXP_SEPARATOR))); + Vector idTokens = new Vector<>(Arrays.asList(oldId.split(REGEXP_SEPARATOR))); for (String token : idTokens) { if (token.equals(TOOL_LANG_C)) { @@ -789,7 +789,7 @@ class UpdateManagedProject12 { */ protected static Map getConfigIdMap() { if (configIdMap == null) { - configIdMap = new HashMap(); + configIdMap = new HashMap<>(); } return configIdMap; } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject20.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject20.java index 793ce9d99e7..be4db6fe38c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject20.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject20.java @@ -433,7 +433,7 @@ class UpdateManagedProject20 { case IOption.PREPROCESSOR_SYMBOLS: case IOption.LIBRARIES: case IOption.OBJECTS: { - Vector values = new Vector(); + Vector values = new Vector<>(); NodeList nodes = optRef.getElementsByTagName(IOption.LIST_VALUE); for (int j = 0; j < nodes.getLength(); ++j) { Node node = nodes.item(j); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProjectManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProjectManager.java index 153451b2356..2e3884d3503 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProjectManager.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProjectManager.java @@ -47,7 +47,7 @@ import org.osgi.framework.Version; * @noinstantiate This class is not intended to be instantiated by clients. */ public class UpdateManagedProjectManager { - static private ThreadLocal> fThreadInfo = new ThreadLocal>(); + static private ThreadLocal> fThreadInfo = new ThreadLocal<>(); static private IOverwriteQuery fBackupFileOverwriteQuery = null; static private IOverwriteQuery fOpenQuestionQuery = null; static private IOverwriteQuery fUpdateProjectQuery = null; @@ -109,7 +109,7 @@ public class UpdateManagedProjectManager { static private Map getManagerMap(boolean create) { Map map = fThreadInfo.get(); if (map == null && create) { - map = new HashMap(); + map = new HashMap<>(); fThreadInfo.set(map); } return map; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/ProjectCreatedActions.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/ProjectCreatedActions.java index 6762c2df814..719008c8427 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/ProjectCreatedActions.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/ProjectCreatedActions.java @@ -117,7 +117,7 @@ public class ProjectCreatedActions { ManagedProject newManagedProject = new ManagedProject(project, configs[0].getProjectType()); info.setManagedProject(newManagedProject); - original2newConfigs = new HashMap(); + original2newConfigs = new HashMap<>(); ICConfigurationDescription active = null; for (IConfiguration cfg : configs) { if (cfg != null) { @@ -180,7 +180,7 @@ public class ProjectCreatedActions { } public Set getNewConfigurations(Collection originalConfigs) { - Set result = new HashSet(); + Set result = new HashSet<>(); for (IConfiguration cfg : originalConfigs) { result.add(getNewConfiguration(cfg)); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/ExcludeResources.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/ExcludeResources.java index e7f716f7bc5..bc3e8821449 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/ExcludeResources.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/ExcludeResources.java @@ -78,7 +78,7 @@ public class ExcludeResources extends ProcessRunner { * Determine which configurations to exclude for */ IConfiguration[] allConfigs = managedProject.getConfigurations(); - List matchingConfigs = new ArrayList(); + List matchingConfigs = new ArrayList<>(); for (int i = 0; i < allConfigs.length; i++) { IConfiguration config = allConfigs[i]; if (config.getId().matches(configIdPattern)) { @@ -87,7 +87,7 @@ public class ExcludeResources extends ProcessRunner { } if (invert) { - List invertedConfigs = new ArrayList(Arrays.asList(allConfigs)); + List invertedConfigs = new ArrayList<>(Arrays.asList(allConfigs)); invertedConfigs.removeAll(matchingConfigs); matchingConfigs = invertedConfigs; } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerInfo.java index 499988445ce..b921dcb9fd0 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerInfo.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerInfo.java @@ -89,7 +89,7 @@ public class MakeScannerInfo implements IScannerInfo { @Override public synchronized Map getDefinedSymbols() { // Return the defined symbols for the default configuration - HashMap symbols = new HashMap(); + HashMap symbols = new HashMap<>(); String[] symbolList = getPreprocessorSymbols(); for (int i = 0; i < symbolList.length; ++i) { String symbol = symbolList[i]; @@ -112,7 +112,7 @@ public class MakeScannerInfo implements IScannerInfo { protected List getPathList() { if (pathList == null) { - pathList = new ArrayList(); + pathList = new ArrayList<>(); } return pathList; } @@ -123,7 +123,7 @@ public class MakeScannerInfo implements IScannerInfo { protected List getSymbolList() { if (symbolList == null) { - symbolList = new ArrayList(); + symbolList = new ArrayList<>(); } return symbolList; } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerProvider.java index a6fd11f4c21..b9e4f57e791 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerProvider.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerProvider.java @@ -122,8 +122,8 @@ public class MakeScannerProvider extends ScannerProvider { private MakeScannerInfo loadScannerInfo(IProject project) throws CoreException { ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(project); ICStorageElement root = descriptor.getProjectStorageElement(CDESCRIPTOR_ID); - ArrayList includes = new ArrayList(); - ArrayList symbols = new ArrayList(); + ArrayList includes = new ArrayList<>(); + ArrayList symbols = new ArrayList<>(); for (ICStorageElement child : root.getChildren()) { if (child.getName().equals(INCLUDE_PATH)) { // Add the path to the property list @@ -144,7 +144,7 @@ public class MakeScannerProvider extends ScannerProvider { String[] includes = info.getIncludePaths(); ICProject cProject = CoreModel.getDefault().create(info.getProject()); IPathEntry[] entries = cProject.getRawPathEntries(); - List cPaths = new ArrayList(Arrays.asList(entries)); + List cPaths = new ArrayList<>(Arrays.asList(entries)); Iterator cpIter = cPaths.iterator(); while (cpIter.hasNext()) { diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java index 697e0caa7d9..297cd23644e 100644 --- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java +++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java @@ -238,7 +238,7 @@ public class CygwinPathResolver implements IBuildPathResolver { InputStream ein = proc.getInputStream(); try { BufferedReader d1 = new BufferedReader(new InputStreamReader(ein)); - ArrayList ls = new ArrayList(10); + ArrayList ls = new ArrayList<>(10); String s; while ((s = d1.readLine()) != null) { ls.add(s); diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/templates/SimpleMakefileGenerator.java b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/templates/SimpleMakefileGenerator.java index fe372eb7667..5c3e32a54a7 100644 --- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/templates/SimpleMakefileGenerator.java +++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/templates/SimpleMakefileGenerator.java @@ -81,7 +81,7 @@ public class SimpleMakefileGenerator extends ProcessRunner { getProcessMessage(processId, IStatus.ERROR, Messages.getString("AddFile.2") + MAKEFILE)); //$NON-NLS-1$ } - Map macros = new HashMap(template.getValueStore()); + Map macros = new HashMap<>(template.getValueStore()); macros.put("exe", Platform.getOS().equals(Platform.OS_WIN32) ? ".exe" : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ fileContents = replaceMacros(fileContents, macros); diff --git a/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/TestCustomPageManager.java b/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/TestCustomPageManager.java index 1164bafd941..dd7c4d32f44 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/TestCustomPageManager.java +++ b/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/TestCustomPageManager.java @@ -69,7 +69,7 @@ public class TestCustomPageManager extends TestCase { MBSCustomPageManager.addPageProperty(MBSCustomPageManager.PAGE_ID, MBSCustomPageManager.PROJECT_TYPE, "X"); // set the toolchain to "Y" - List toolchainSet = new ArrayList(); + List toolchainSet = new ArrayList<>(); TestToolchain toolchain = new TestToolchain(); toolchain.setID("Y"); toolchainSet.add(toolchain); @@ -135,7 +135,7 @@ public class TestCustomPageManager extends TestCase { MBSCustomPageManager.addPageProperty(MBSCustomPageManager.PAGE_ID, MBSCustomPageManager.PROJECT_TYPE, "X"); // set the toolchain to "Y" - List toolchainSet = new ArrayList(); + List toolchainSet = new ArrayList<>(); TestToolchain toolchain = new TestToolchain(); toolchain.setID("Y"); toolchainSet.add(toolchain); @@ -213,7 +213,7 @@ public class TestCustomPageManager extends TestCase { MBSCustomPageManager.addPageProperty(MBSCustomPageManager.PAGE_ID, MBSCustomPageManager.PROJECT_TYPE, "X"); // set the toolchain to "Y" - List toolchainSet = new ArrayList(); + List toolchainSet = new ArrayList<>(); TestToolchain toolchain = new TestToolchain(); toolchain.setID("Y"); toolchainSet.add(toolchain); @@ -291,7 +291,7 @@ public class TestCustomPageManager extends TestCase { MBSCustomPageManager.addPageProperty(MBSCustomPageManager.PAGE_ID, MBSCustomPageManager.PROJECT_TYPE, "X"); // set the toolchain to "C" - List toolchainSet = new ArrayList(); + List toolchainSet = new ArrayList<>(); TestToolchain toolchain = new TestToolchain(); toolchain.setID("C"); toolchainSet.add(toolchain); @@ -369,7 +369,7 @@ public class TestCustomPageManager extends TestCase { MBSCustomPageManager.addPageProperty(MBSCustomPageManager.PAGE_ID, MBSCustomPageManager.PROJECT_TYPE, "X"); // set the toolchain to "C" - List toolchainSet = new ArrayList(); + List toolchainSet = new ArrayList<>(); TestToolchain toolchain = new TestToolchain(); toolchain.setID("C_2.0.0"); toolchainSet.add(toolchain); @@ -459,7 +459,7 @@ public class TestCustomPageManager extends TestCase { MBSCustomPageManager.addPageProperty(MBSCustomPageManager.PAGE_ID, MBSCustomPageManager.PROJECT_TYPE, "D"); // set the toolchain to "Y" - List toolchainSet = new ArrayList(); + List toolchainSet = new ArrayList<>(); TestToolchain toolchain = new TestToolchain(); toolchain.setID("Y"); toolchainSet.add(toolchain); @@ -538,7 +538,7 @@ public class TestCustomPageManager extends TestCase { MBSCustomPageManager.addPageProperty(MBSCustomPageManager.PAGE_ID, MBSCustomPageManager.PROJECT_TYPE, "E"); // set the toolchain to "Y" - List toolchainSet = new ArrayList(); + List toolchainSet = new ArrayList<>(); TestToolchain toolchain = new TestToolchain(); toolchain.setID("Y"); toolchainSet.add(toolchain); @@ -617,7 +617,7 @@ public class TestCustomPageManager extends TestCase { MBSCustomPageManager.addPageProperty(MBSCustomPageManager.PAGE_ID, MBSCustomPageManager.PROJECT_TYPE, "X"); // set the toolchain to "F" - List toolchainSet = new ArrayList(); + List toolchainSet = new ArrayList<>(); TestToolchain toolchain = new TestToolchain(); toolchain.setID("F"); toolchainSet.add(toolchain); @@ -695,7 +695,7 @@ public class TestCustomPageManager extends TestCase { MBSCustomPageManager.addPageProperty(MBSCustomPageManager.PAGE_ID, MBSCustomPageManager.PROJECT_TYPE, "D"); // set the toolchain to "C" - List toolchainSet = new ArrayList(); + List toolchainSet = new ArrayList<>(); TestToolchain toolchain = new TestToolchain(); toolchain.setID("C"); toolchainSet.add(toolchain); diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/commands/BuildFilesHandler.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/commands/BuildFilesHandler.java index ba53fcc3349..e160b4d7f54 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/commands/BuildFilesHandler.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/commands/BuildFilesHandler.java @@ -128,7 +128,7 @@ public class BuildFilesHandler extends AbstractResourceActionHandler { * across all selected resources. */ private Collection getProjectsToBuild(List selectedFiles) { - Set projectsToBuild = new HashSet(); + Set projectsToBuild = new HashSet<>(); for (IFile file : selectedFiles) { IProject project = file.getProject(); if (!projectsToBuild.contains(project)) { diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/commands/ConvertTargetDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/commands/ConvertTargetDialog.java index 365cc2a2ff2..55d4e75cf53 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/commands/ConvertTargetDialog.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/commands/ConvertTargetDialog.java @@ -192,7 +192,7 @@ public class ConvertTargetDialog extends Dialog { private Map getConversionElements() { if (conversionElements == null) { - conversionElements = new HashMap(); + conversionElements = new HashMap<>(); } return conversionElements; } diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ArtifactTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ArtifactTab.java index a7ba26b34e8..c8bde41f4c7 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ArtifactTab.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ArtifactTab.java @@ -60,9 +60,9 @@ public class ArtifactTab extends AbstractCBuildPropertyTab { NAME, EXT, PREF } - private Set set2 = new TreeSet(); - private Set set3 = new TreeSet(); - private Set set4 = new TreeSet(); + private Set set2 = new TreeSet<>(); + private Set set3 = new TreeSet<>(); + private Set set4 = new TreeSet<>(); @Override public void createControls(Composite parent) { diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsUI.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsUI.java index 287e7c0cbe7..d20ac18b21c 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsUI.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsUI.java @@ -99,7 +99,7 @@ import org.eclipse.ui.dialogs.PatternFilter; * Option settings page in project properties Build Settings under Tool Settings tab. */ public class BuildOptionSettingsUI extends AbstractToolSettingUI { - private Map fieldsMap = new HashMap(); + private Map fieldsMap = new HashMap<>(); private IOptionCategory category; private IHoldsOptions optionHolder; /** Option Holders involved */ @@ -107,7 +107,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI { /** The index of the current IHoldsOptions in ohs */ private int curr = -1; private Map customFieldEditorDescriptorIndex; - private Map fieldEditorsToParentMap = new HashMap(); + private Map fieldEditorsToParentMap = new HashMap<>(); /** True if the user selected "Display tool option tips at a fixed location" in Preferences */ private boolean displayFixedTip; /** type of mouse action the displayFixedTip responds to. @@ -206,7 +206,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI { * which contain the option category and accept the input type * of this option holder. */ - ArrayList lst = new ArrayList(); + ArrayList lst = new ArrayList<>(); if (optionHolder instanceof ITool) { String ext = ((ITool) optionHolder).getDefaultInputExtension(); for (int i = 0; i < ris.length; i++) { @@ -417,7 +417,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI { // in the plugin.xml file) in the UI Combobox. This refrains the user from selecting an // invalid value and avoids issuing an error message. String[] enumNames = opt.getApplicableValues(); - Vector enumValidList = new Vector(); + Vector enumValidList = new Vector<>(); for (int i = 0; i < enumNames.length; ++i) { if (opt.getValueHandler().isEnumValueAppropriate(config, opt.getOptionHolder(), opt, opt.getValueHandlerExtraArgument(), enumNames[i])) { @@ -564,7 +564,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI { if (this.customFieldEditorDescriptorIndex != null) return; - this.customFieldEditorDescriptorIndex = new HashMap(); + this.customFieldEditorDescriptorIndex = new HashMap<>(); IExtensionPoint ep = Platform.getExtensionRegistry() .getExtensionPoint(ManagedBuilderUIPlugin.getUniqueIdentifier() + ".buildDefinitionsUI"); //$NON-NLS-1$ @@ -977,7 +977,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI { boolean selectNewEnum = true; boolean selectDefault = false; - Vector enumValidList = new Vector(); + Vector enumValidList = new Vector<>(); for (int i = 0; i < enumNames.length; ++i) { if (opt.getValueHandler().isEnumValueAppropriate(config, opt.getOptionHolder(), opt, opt.getValueHandlerExtraArgument(), enumNames[i])) { @@ -1166,14 +1166,14 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI { if (children == null) return null; - List childrenList = new ArrayList(Arrays.asList(children)); + List childrenList = new ArrayList<>(Arrays.asList(children)); // Check if any of the children has empty name List toRemove = null; for (ITreeOption child : children) { if (child.getName() == null || child.getName().trim().length() == 0) { if (toRemove == null) { - toRemove = new ArrayList(); + toRemove = new ArrayList<>(); } toRemove.add(child); } diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java index ee05a1d2319..a5207a2dbe7 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java @@ -74,10 +74,10 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab { PRECMD, PREANN, PSTCMD, PSTANN } - private Set set1 = new TreeSet(); - private Set set2 = new TreeSet(); - private Set set3 = new TreeSet(); - private Set set4 = new TreeSet(); + private Set set1 = new TreeSet<>(); + private Set set2 = new TreeSet<>(); + private Set set3 = new TreeSet<>(); + private Set set4 = new TreeSet<>(); private static final String[] rcbsApplicabilityRules = { Messages.ResourceCustomBuildStepBlock_label_applicability_rule_override, @@ -292,7 +292,7 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab { } private ITool[] getRcbsTools(IResourceInfo rcConfig) { - List list = new ArrayList(); + List list = new ArrayList<>(); ITool tools[] = rcConfig.getTools(); for (int i = 0; i < tools.length; i++) { diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingUI.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingUI.java index 9d6c882df5f..705d84b9343 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingUI.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingUI.java @@ -125,8 +125,8 @@ public class BuildToolSettingUI extends AbstractToolSettingUI { super(info); this.fTool = _tool; buildPropPage = page; - stringOptionsMap = new HashMap(); - userObjsMap = new HashMap(); + stringOptionsMap = new HashMap<>(); + userObjsMap = new HashMap<>(); } /* (non-Javadoc) @@ -188,7 +188,7 @@ public class BuildToolSettingUI extends AbstractToolSettingUI { */ private Vector getDefaultOptionNames() { if (defaultOptionNames == null) { - defaultOptionNames = new Vector(); + defaultOptionNames = new Vector<>(); defaultOptionNames.add("Other flags"); //$NON-NLS-1$ defaultOptionNames.add("Linker flags"); //$NON-NLS-1$ defaultOptionNames.add("Archiver flags"); //$NON-NLS-1$ @@ -215,8 +215,8 @@ public class BuildToolSettingUI extends AbstractToolSettingUI { * @return Vector containing all options */ private Vector getOptionVector(String rawOptionString) { - Vector tokens = new Vector(Arrays.asList(rawOptionString.split("\\s"))); //$NON-NLS-1$ - Vector output = new Vector(tokens.size()); + Vector tokens = new Vector<>(Arrays.asList(rawOptionString.split("\\s"))); //$NON-NLS-1$ + Vector output = new Vector<>(tokens.size()); Iterator iter = tokens.iterator(); while (iter.hasNext()) { @@ -269,7 +269,7 @@ public class BuildToolSettingUI extends AbstractToolSettingUI { String alloptions = getToolSettingsPrefStore().getString(ToolSettingsPrefStore.ALL_OPTIONS_ID); // list that holds the options for the option type other than // boolean,string and enumerated - List optionsList = new ArrayList(); + List optionsList = new ArrayList<>(); // additional options buffer StringBuilder addnOptions = new StringBuilder(); // split all build options string @@ -393,7 +393,7 @@ public class BuildToolSettingUI extends AbstractToolSettingUI { for (int s = 0; s < objSet.size(); s++) { for (IOption op : objSet) { String val = userObjsMap.get(op); - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); for (String v : parseString(val)) { if (alloptions.indexOf(v) != -1) list.add(v); @@ -414,7 +414,7 @@ public class BuildToolSettingUI extends AbstractToolSettingUI { try { switch (opt.getValueType()) { case IOption.BOOLEAN: - ArrayList optsList = new ArrayList(optionsArr); + ArrayList optsList = new ArrayList<>(optionsArr); if (opt.getCommand() != null && opt.getCommand().length() > 0 && !optsList.contains(opt.getCommand())) setOption(opt, false); @@ -436,7 +436,7 @@ public class BuildToolSettingUI extends AbstractToolSettingUI { case IOption.INCLUDE_PATH: case IOption.PREPROCESSOR_SYMBOLS: case IOption.LIBRARIES: - ArrayList newList = new ArrayList(); + ArrayList newList = new ArrayList<>(); for (String s : optionsList) { if (opt.getCommand() != null && s.startsWith(opt.getCommand())) { newList.add(s.substring(opt.getCommand().length())); diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/CPropertyVarsTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/CPropertyVarsTab.java index 02cfa7795f2..bbed363c19f 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/CPropertyVarsTab.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/CPropertyVarsTab.java @@ -102,7 +102,7 @@ public class CPropertyVarsTab extends AbstractCPropertyTab { }; private boolean fShowSysMacros = false; - private Set fIncorrectlyDefinedMacrosNames = new HashSet(); + private Set fIncorrectlyDefinedMacrosNames = new HashSet<>(); private TableViewer tv; private Label fStatusLabel; @@ -545,7 +545,7 @@ public class CPropertyVarsTab extends AbstractCPropertyTab { if (cfgd == null) { chkVars(); if (fShowSysMacros) { - List lst = new ArrayList(_vars.length); + List lst = new ArrayList<>(_vars.length); ICdtVariable[] uvars = prefvars.getMacros(); for (int i = 0; i < uvars.length; i++) { lst.add(uvars[i]); @@ -567,7 +567,7 @@ public class CPropertyVarsTab extends AbstractCPropertyTab { } } - ArrayList list = new ArrayList(_vars.length); + ArrayList list = new ArrayList<>(_vars.length); for (int i = 0; i < _vars.length; i++) { if (_vars[i] != null && (fShowSysMacros || isUserVar(_vars[i]))) list.add(_vars[i]); diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java index 43ae518d2aa..8111f0ed67a 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java @@ -451,7 +451,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf Set contextProfiles = null; if (page.isForPrefs()) { // for preference page get all profiles - contextProfiles = new TreeSet(profilesList); + contextProfiles = new TreeSet<>(profilesList); } else { // property page if (!needPerRcProfile) { @@ -467,7 +467,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf if (isMakefileProjectToolChain(toolchain)) { // for generic Makefile project let user choose any profile - contextProfiles = new TreeSet(profilesList); + contextProfiles = new TreeSet<>(profilesList); } else { contextProfiles = CfgScannerConfigUtil.getAllScannerDiscoveryProfileIds(toolchain); } @@ -486,7 +486,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf } } - visibleProfilesList = new ArrayList(contextProfiles); + visibleProfilesList = new ArrayList<>(contextProfiles); realPages = new AbstractDiscoveryPage[visibleProfilesList.size()]; String[] labels = new String[visibleProfilesList.size()]; @@ -596,7 +596,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf private void initializeProfilePageMap() { GCCPerProjectSCDProfilePage.isSIConsoleEnabled = DefaultRunSIProvider.isConsoleEnabled(); - pagesList = new ArrayList(5); + pagesList = new ArrayList<>(5); IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(NAMESPACE, POINT); if (point == null) return; @@ -707,11 +707,11 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf private List checkChanges() { if (cbi == null || baseInfoMap == null) - return new ArrayList(0); + return new ArrayList<>(0); Map cfgInfoMap = cbi.getInfoMap(); - HashMap baseCopy = new HashMap(baseInfoMap); - List list = new ArrayList(); + HashMap baseCopy = new HashMap<>(baseInfoMap); + List list = new ArrayList<>(); for (Map.Entry entry : cfgInfoMap.entrySet()) { CfgInfoContext cic = entry.getKey(); InfoContext c = cic.toInfoContext(); diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControlFieldEditor.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControlFieldEditor.java index a1a6e3fad4c..93dee751692 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControlFieldEditor.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControlFieldEditor.java @@ -300,7 +300,7 @@ public class FileListControlFieldEditor extends FieldEditor { */ private String[] parseString(String stringList) { StringTokenizer tokenizer = new StringTokenizer(stringList, DEFAULT_SEPARATOR); - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); while (tokenizer.hasMoreElements()) { list.add((String) tokenizer.nextElement()); } diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewCfgDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewCfgDialog.java index bc9cbb8bbdd..58cd9655777 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewCfgDialog.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewCfgDialog.java @@ -437,7 +437,7 @@ public class NewCfgDialog implements INewCfgDialog { des = prj; ICConfigurationDescription[] descs = des.getConfigurations(); cfgds = new IConfiguration[descs.length]; - ArrayList lst = new ArrayList(); + ArrayList lst = new ArrayList<>(); for (int i = 0; i < descs.length; ++i) { cfgds[i] = ManagedBuildManager.getConfigurationForDescription(descs[i]); IConfiguration cfg = cfgds[i]; @@ -620,7 +620,7 @@ public class NewCfgDialog implements INewCfgDialog { } private String[] getImportItems() { - imported = new HashMap(); + imported = new HashMap<>(); if (des != null) { IProject[] ps = des.getProject().getWorkspace().getRoot().getProjects(); for (IProject p : ps) { @@ -637,14 +637,14 @@ public class NewCfgDialog implements INewCfgDialog { } } } - ArrayList lst = new ArrayList(imported.keySet()); + ArrayList lst = new ArrayList<>(imported.keySet()); Collections.sort(lst); lst.add(0, NOT); return lst.toArray(new String[lst.size()]); } private String[] getImportDefItems() { - importedDef = new HashMap(); + importedDef = new HashMap<>(); IBuildPropertyManager bpm = ManagedBuildManager.getBuildPropertyManager(); IBuildPropertyType bpt = bpm.getPropertyType(ART); for (IBuildPropertyValue v : bpt.getSupportedValues()) { @@ -664,7 +664,7 @@ public class NewCfgDialog implements INewCfgDialog { } } } - ArrayList lst = new ArrayList(importedDef.keySet()); + ArrayList lst = new ArrayList<>(importedDef.keySet()); Collections.sort(lst); lst.add(0, NOT); return lst.toArray(new String[lst.size()]); diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/RefreshPolicyExceptionDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/RefreshPolicyExceptionDialog.java index e0978e86e2f..8c476c373d5 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/RefreshPolicyExceptionDialog.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/RefreshPolicyExceptionDialog.java @@ -65,7 +65,7 @@ public class RefreshPolicyExceptionDialog extends Dialog { setShellStyle(getShellStyle()); fContrManager = RefreshExclusionContributionManager.getInstance(); fAddException = addException; - fExclusionContributors = new LinkedList(fContrManager.getContributors()); + fExclusionContributors = new LinkedList<>(fContrManager.getContributors()); } public RefreshPolicyExceptionDialog(Shell parent, IResource resource, java.util.List exclusions, diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/RefreshPolicyTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/RefreshPolicyTab.java index fd67c76e001..a051a26300c 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/RefreshPolicyTab.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/RefreshPolicyTab.java @@ -96,7 +96,7 @@ public class RefreshPolicyTab extends AbstractCBuildPropertyTab { HashMap> resourceMap = fConfigurationToResourcesToExclusionsMap .get(configName); if (resourceMap == null) { - resourceMap = new HashMap>(); + resourceMap = new HashMap<>(); resourceMap.put(fProject, new ArrayList()); fConfigurationToResourcesToExclusionsMap.put(configName, resourceMap); } @@ -111,7 +111,7 @@ public class RefreshPolicyTab extends AbstractCBuildPropertyTab { private HashMap>> copyHashMap( HashMap>> source) { - HashMap>> target = new HashMap>>(); + HashMap>> target = new HashMap<>(); if (source.isEmpty()) return target; @@ -122,13 +122,13 @@ public class RefreshPolicyTab extends AbstractCBuildPropertyTab { String configName = config_iterator.next(); HashMap> source_resourceMap = source.get(configName); - HashMap> target_resourceMap = new HashMap>(); + HashMap> target_resourceMap = new HashMap<>(); Iterator resource_iterator = source_resourceMap.keySet().iterator(); while (resource_iterator.hasNext()) { IResource source_resource = resource_iterator.next(); List source_exclusions = source_resourceMap.get(source_resource); - List target_exclusions = new LinkedList(); + List target_exclusions = new LinkedList<>(); for (RefreshExclusion exclusion : source_exclusions) { // ADD each exclusion to the target exclusion list. RefreshExclusion target_exclusion = (RefreshExclusion) exclusion.clone(); @@ -157,7 +157,7 @@ public class RefreshPolicyTab extends AbstractCBuildPropertyTab { HashMap> resourceMap = getResourcesToExclusionsMap(configName); List exclusions = resourceMap.get(resource); if (exclusions == null) { - exclusions = new LinkedList(); + exclusions = new LinkedList<>(); resourceMap.put(resource, exclusions); } @@ -181,7 +181,7 @@ public class RefreshPolicyTab extends AbstractCBuildPropertyTab { _Exception_Node exceptions_node = null; // if this is a refresh exclusion, exclusion_instances is a list of exclusion instances associated with this exclusion - List<_Exclusion_Instance> exclusion_instances = new ArrayList<_Exclusion_Instance>(); + List<_Exclusion_Instance> exclusion_instances = new ArrayList<>(); _Entry(IResource _ent) { resourceToRefresh = _ent; @@ -214,7 +214,7 @@ public class RefreshPolicyTab extends AbstractCBuildPropertyTab { public Object[] getChildren() { if (isExclusion()) { - List children = new ArrayList(exclusion_instances); + List children = new ArrayList<>(exclusion_instances); if (exceptions_node != null) children.add(exceptions_node); return children.toArray(); @@ -278,7 +278,7 @@ public class RefreshPolicyTab extends AbstractCBuildPropertyTab { _Entry parent; //can be IResource or RefreshExclusion - must not be null //list of refresh exclusions under this Exceptions node - List<_Entry> exceptions = new ArrayList<_Entry>(); + List<_Entry> exceptions = new ArrayList<>(); _Exception_Node(_Entry ent) { parent = ent; @@ -307,7 +307,7 @@ public class RefreshPolicyTab extends AbstractCBuildPropertyTab { } else { List exclusions = getExclusions(getConfigName(), parent.resourceToRefresh); if (exclusions == null) { - exclusions = new LinkedList(); + exclusions = new LinkedList<>(); getResourcesToExclusionsMap(getConfigName()).put(parent.resourceToRefresh, exclusions); } @@ -377,7 +377,7 @@ public class RefreshPolicyTab extends AbstractCBuildPropertyTab { Group g1 = setupGroup(usercomp, Messages.RefreshPolicyTab_resourcesGroupLabel, 2, GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL); - fSrc = new ArrayList<_Entry>(); + fSrc = new ArrayList<>(); generateTreeContent(); fTree = new TreeViewer(g1); @@ -561,7 +561,7 @@ public class RefreshPolicyTab extends AbstractCBuildPropertyTab { */ @Override public Object[] getChildren(Object element) { - ArrayList filteredChildren = new ArrayList(Arrays.asList(super.getChildren(element))); + ArrayList filteredChildren = new ArrayList<>(Arrays.asList(super.getChildren(element))); Iterator iterator = getResourcesToExclusionsMap(getConfigName()).keySet().iterator(); while (iterator.hasNext()) { diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolChainEditTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolChainEditTab.java index 9a65bf02fd7..b1b3383c375 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolChainEditTab.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolChainEditTab.java @@ -275,7 +275,7 @@ public class ToolChainEditTab extends AbstractCBuildPropertyTab { c_toolchain.removeAll(); boolean isMng = cfg.getBuilder().isManagedBuildOn(); - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); IToolChain[] tcs = r_tcs; if (b_dispCompatible.getSelection() && (ri instanceof IFolderInfo)) { @@ -318,7 +318,7 @@ public class ToolChainEditTab extends AbstractCBuildPropertyTab { realBuilder = cfg.getBuilder(); int pos = -1; c_builder.removeAll(); - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); IBuilder[] bs = r_bs; @@ -443,7 +443,7 @@ public class ToolChainEditTab extends AbstractCBuildPropertyTab { private boolean updateCompatibleTools(ITool real) { boolean result = false; - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); IFileInfoModification fim = (IFileInfoModification) mod; if (real != null) { // Current tool exists diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java index 22d83d9346a..2cbd8a41fd4 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java @@ -57,7 +57,7 @@ public class ToolListContentProvider implements ITreeContentProvider { private ToolListElement[] createElements(IConfiguration config) { IOptionCategory toolChainCategories[]; ITool filteredTools[]; - List elementList = new ArrayList(); + List elementList = new ArrayList<>(); if (config != null) { // Get the the option categories of the toolChain IToolChain toolChain = config.getToolChain(); @@ -88,7 +88,7 @@ public class ToolListContentProvider implements ITreeContentProvider { } private ToolListElement[] createElements(IResourceInfo info) { - List elementList = new ArrayList(); + List elementList = new ArrayList<>(); if (info != null) { ITool[] tools = null; if (info instanceof IFolderInfo) { diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListElement.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListElement.java index a7a7fa551e2..53c55dd8e3f 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListElement.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListElement.java @@ -126,7 +126,7 @@ public class ToolListElement { public void addChildElement(ToolListElement element) { if (childElements == null) - childElements = new ArrayList(); + childElements = new ArrayList<>(); childElements.add(element); } } diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSelectionDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSelectionDialog.java index 146f1bed0a4..3aeae29f9f1 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSelectionDialog.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSelectionDialog.java @@ -98,10 +98,10 @@ public class ToolSelectionDialog extends Dialog { gd.heightHint = 300; composite.setLayoutData(gd); - added = new ArrayList(); - removed = new ArrayList(); - left = new ArrayList(); - right = new ArrayList(); + added = new ArrayList<>(); + removed = new ArrayList<>(); + left = new ArrayList<>(); + right = new ArrayList<>(); Composite c1 = new Composite(composite, SWT.NONE); c1.setLayoutData(new GridData(GridData.FILL_BOTH)); @@ -476,7 +476,7 @@ public class ToolSelectionDialog extends Dialog { if ((c & IModificationStatus.TOOLS_CONFLICT) != 0) { s = s + Messages.ToolSelectionDialog_7; ITool[][] tools = st.getToolsConflicts(); - List conflictTools = new ArrayList(); + List conflictTools = new ArrayList<>(); for (int k = 0; k < t2.getItemCount(); k++) { TableItem ti = t2.getItem(k); ITool t = (ITool) ti.getData(); diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java index e213cfa6f8b..671185fbf1e 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java @@ -108,7 +108,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe super.createControls(par); usercomp.setLayout(new GridLayout()); - configToPageListMap = new HashMap>(); + configToPageListMap = new HashMap<>(); settingsStore = ToolSettingsPrefStore.getDefault(); // Create the sash form @@ -674,7 +674,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe return null; List pages = configToPageListMap.get(getCfg().getId()); if (pages == null) { - pages = new ArrayList(); + pages = new ArrayList<>(); configToPageListMap.put(getCfg().getId(), pages); } return pages; @@ -839,8 +839,8 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe * @return the one-for-one correspondence of tools, in order of t2 */ private Map getToolCorrespondence(ITool[] t1, ITool[] t2) { - Map result = new java.util.LinkedHashMap(); - Map> realT1Tools = new java.util.LinkedHashMap>(); + Map result = new java.util.LinkedHashMap<>(); + Map> realT1Tools = new java.util.LinkedHashMap<>(); for (ITool next : t1) { ITool real = ManagedBuildManager.getRealTool(next); @@ -851,7 +851,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe } else { if (list.size() == 1) { // make the list mutable - list = new java.util.ArrayList(list); + list = new java.util.ArrayList<>(list); realT1Tools.put(real, list); } list.add(next); diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CDTConfigWizardPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CDTConfigWizardPage.java index b092ff8ac2f..2501f5dd0da 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CDTConfigWizardPage.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CDTConfigWizardPage.java @@ -93,7 +93,7 @@ public class CDTConfigWizardPage extends WizardPage { if (getDefault || table == null || !isVisited()) its = getDefaultCfgs(handler); else { - ArrayList out = new ArrayList(table.getItemCount()); + ArrayList out = new ArrayList<>(table.getItemCount()); for (TableItem ti : table.getItems()) { if (ti.getChecked()) out.add((CfgHolder) ti.getData()); @@ -217,7 +217,7 @@ public class CDTConfigWizardPage extends WizardPage { static public CfgHolder[] getDefaultCfgs(MBSWizardHandler handler) { String id = handler.getPropertyId(); IProjectType pt = handler.getProjectType(); - ArrayList out = new ArrayList(); + ArrayList out = new ArrayList<>(); for (IToolChain tc : handler.getSelectedToolChains()) { CfgHolder[] cfgs = null; if (id != null) diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CfgHolder.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CfgHolder.java index 3ef5ddb84b8..541f4fe0e9e 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CfgHolder.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CfgHolder.java @@ -176,7 +176,7 @@ public class CfgHolder { */ public static CfgHolder[] reorder(CfgHolder[] its) { - ArrayList ls = new ArrayList(its.length); + ArrayList ls = new ArrayList<>(its.length); boolean found = true; while (found) { found = false; @@ -210,7 +210,7 @@ public class CfgHolder { * Note that null configurations are ignored ! */ public static IConfiguration[] items2cfgs(CfgHolder[] its) { - ArrayList lst = new ArrayList(its.length); + ArrayList lst = new ArrayList<>(its.length); for (CfgHolder h : its) if (h.cfg != null) lst.add(h.cfg); diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java index a30db77225a..066ba6fba3e 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java @@ -94,7 +94,7 @@ public class MBSWizardHandler extends CWizardHandler { private static final String tooltip = Messages.CWizardHandler_1 + Messages.CWizardHandler_2 + Messages.CWizardHandler_3 + Messages.CWizardHandler_4 + Messages.CWizardHandler_5; - protected SortedMap full_tcs = new TreeMap(); + protected SortedMap full_tcs = new TreeMap<>(); private String propertyId = null; private IProjectType pt = null; protected IWizardItemsListListener listener; @@ -110,7 +110,7 @@ public class MBSWizardHandler extends CWizardHandler { /** * Current list of preferred toolchains */ - private List preferredTCs = new ArrayList(); + private List preferredTCs = new ArrayList<>(); protected static final class EntryInfo { private SortedMap tcs; @@ -172,7 +172,7 @@ public class MBSWizardHandler extends CWizardHandler { ICDTCommonProjectWizard wz = (ICDTCommonProjectWizard) wizard; String[] langIDs = wz.getLanguageIDs(); if (langIDs.length > 0) { - List