diff options
author | Jonah Graham | 2018-11-20 16:20:42 +0000 |
---|---|---|
committer | Jonah Graham | 2018-11-22 21:55:36 +0000 |
commit | caf2292768deccd885b5b6989b731742e2e5edf4 (patch) | |
tree | 711a6088f2e17c7e31ebb51af1eadc1af00768e5 | |
parent | 8844a8f9f22802fedffa3cb2a8a21b041aa64b74 (diff) | |
download | org.eclipse.cdt-caf2292768deccd885b5b6989b731742e2e5edf4.tar.gz org.eclipse.cdt-caf2292768deccd885b5b6989b731742e2e5edf4.tar.xz org.eclipse.cdt-caf2292768deccd885b5b6989b731742e2e5edf4.zip |
Bug 540373: Cleanup: Remove redundant type arguments
This was done by selecting all projects in Eclipse then
Source -> Clean Up... -> choosing:
- Remove redundant type arguments
and completing the wizard
Change-Id: Iaecc7010f097b4b1fabd29ccaa34ccb23a716fbf
1432 files changed, 4538 insertions, 4538 deletions
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<ScannerInfoTypes, List> fInfoMap = new HashMap<ScannerInfoTypes, List>(); - private HashMap<Object, Map<ScannerInfoTypes, List>> fResourceToInfoMap = new HashMap<Object, Map<ScannerInfoTypes, List>>(); + private HashMap<ScannerInfoTypes, List> fInfoMap = new HashMap<>(); + private HashMap<Object, Map<ScannerInfoTypes, List>> 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<String> col) { List<String> target = fInfoMap.get(type); if (target == null) { - target = new ArrayList<String>(); + 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<IConsoleParser> parsers = new ArrayList<IConsoleParser>(); + List<IConsoleParser> 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<String, String> getEnvironment(ICommandLauncher launcher, IMakeBuilderInfo info) throws CoreException { - HashMap<String, String> envMap = new HashMap<String, String>(); + HashMap<String, String> envMap = new HashMap<>(); if (info.appendEnvironment()) { @SuppressWarnings({ "unchecked", "rawtypes" }) Map<String, String> 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<String> v = new ArrayList<String>(); + ArrayList<String> 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<String> includeList = new ArrayList<String>(); + ArrayList<String> 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<String> includeList = new ArrayList<String>(); + ArrayList<String> 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<String> parserIds = new ArrayList<String>(extensions.length); + List<String> 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<String, String> getDefinedSymbols() { // Return the defined symbols for the default configuration - HashMap<String, String> symbols = new HashMap<String, String>(); + HashMap<String, String> 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<String> getPathList() { if (pathList == null) { - pathList = new ArrayList<String>(); + pathList = new ArrayList<>(); } return pathList; } @@ -123,7 +123,7 @@ public class MakeScannerInfo implements IScannerInfo { protected List<String> getSymbolList() { if (symbolList == null) { - symbolList = new ArrayList<String>(); + 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<String> includes = new ArrayList<String>(); - ArrayList<String> symbols = new ArrayList<String>(); + ArrayList<String> includes = new ArrayList<>(); + ArrayList<String> 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<IPathEntry> cPaths = new ArrayList<IPathEntry>(Arrays.asList(entries)); + List<IPathEntry> cPaths = new ArrayList<>(Arrays.asList(entries)); Iterator<IPathEntry> 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<String, Boolean> getDiscoveredIncludePaths() { if (discoveredPaths == null) { - return new LinkedHashMap<String, Boolean>(); + return new LinkedHashMap<>(); } - return new LinkedHashMap<String, Boolean>(discoveredPaths); + return new LinkedHashMap<>(discoveredPaths); } public synchronized void setDiscoveredIncludePaths(LinkedHashMap<String, Boolean> paths) { - discoveredPaths = new LinkedHashMap<String, Boolean>(paths); + discoveredPaths = new LinkedHashMap<>(paths); createPathLists(); } @@ -119,13 +119,13 @@ public class DiscoveredScannerInfo implements IScannerInfo { public LinkedHashMap<String, SymbolEntry> getDiscoveredSymbolDefinitions() { if (discoveredSymbols == null) { - return new LinkedHashMap<String, SymbolEntry>(); + return new LinkedHashMap<>(); } - return new LinkedHashMap<String, SymbolEntry>(discoveredSymbols); + return new LinkedHashMap<>(discoveredSymbols); } public synchronized void setDiscoveredSymbolDefinitions(LinkedHashMap<String, SymbolEntry> symbols) { - discoveredSymbols = new LinkedHashMap<String, SymbolEntry>(symbols); + discoveredSymbols = new LinkedHashMap<>(symbols); createSymbolsLists(); } @@ -184,28 +184,28 @@ public class DiscoveredScannerInfo implements IScannerInfo { private List<String> getActivePathList() { if (activePaths == null) { - activePaths = new ArrayList<String>(); + activePaths = new ArrayList<>(); } return activePaths; } private List<String> getRemovedPathList() { if (removedPaths == null) { - removedPaths = new ArrayList<String>(); + removedPaths = new ArrayList<>(); } return removedPaths; } private List<String> getActiveSymbolsList() { if (activeSymbols == null) { - activeSymbols = new ArrayList<String>(); + activeSymbols = new ArrayList<>(); } return activeSymbols; } private List<String> getRemovedSymbolsList() { if (removedSymbols == null) { - removedSymbols = new ArrayList<String>(); + 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<IPathEntry> newEntries = new ArrayList<IPathEntry>(Arrays.asList(entries)); + List<IPathEntry> 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<String, String>(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<String, String>(oldMap); + return new HashMap<>(oldMap); - HashMap<String, String> newMap = new HashMap<String, String>(oldMap.size()); + HashMap<String, String> 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<String, String> getExpandedEnvironment() { Map<String, String> env = getEnvironment(); - HashMap<String, String> envMap = new HashMap<String, String>(env.entrySet().size()); + HashMap<String, String> envMap = new HashMap<>(env.entrySet().size()); boolean win32 = Platform.getOS().equals(Constants.OS_WIN32); for (Map.Entry<String, String> 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<String> list = new ArrayList<String>(tok.countTokens()); + ArrayList<String> 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<IProject, ProjectTargets> projectMap = new HashMap<IProject, ProjectTargets>(); + private final Map<IProject, ProjectTargets> projectMap = new HashMap<>(); private HashMap<String, String> builderMap; - protected Vector<IProject> fProjects = new Vector<IProject>(); + protected Vector<IProject> 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<String> ids = new Vector<String>(); + Vector<String> 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<String, String>(); + 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<IContainer, List<IMakeTarget>> targetMap = new HashMap<IContainer, List<IMakeTarget>>(); + private HashMap<IContainer, List<IMakeTarget>> targetMap = new HashMap<>(); private IProject project; @@ -111,7 +111,7 @@ public class ProjectTargets { } public void set(IContainer container, IMakeTarget[] targets) throws CoreException { - List<IMakeTarget> newList = new ArrayList<IMakeTarget>(); + List<IMakeTarget> 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<IMakeTarget>(); + 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<IDirective> array = new ArrayList<IDirective>(stmts.length); + List<IDirective> 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<IRule> array = new ArrayList<IRule>(rules.length); + List<IRule> 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<IRule> array = new ArrayList<IRule>(rules.length); + List<IRule> 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<IInferenceRule> array = new ArrayList<IInferenceRule>(irules.length); + List<IInferenceRule> 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<IRule> array = new ArrayList<IRule>(trules.length); + List<IRule> 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<ITargetRule> array = new ArrayList<ITargetRule>(trules.length); + List<ITargetRule> 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<IDirective> array = new ArrayList<IDirective>(stmts.length); + List<IDirective> 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<IMacroDefinition> array = new ArrayList<IMacroDefinition>(variables.length); + List<IMacroDefinition> 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<IDirective> array = new ArrayList<IDirective>(stmts.length); + List<IDirective> 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<IMacroDefinition> array = new ArrayList<IMacroDefinition>(variables.length); + List<IMacroDefinition> 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<IDirective> array = new ArrayList<IDirective>(stmts.length); + List<IDirective> 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<IInferenceRule> array = new ArrayList<IInferenceRule>(irules.length); + List<IInferenceRule> 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<Directive> children = new ArrayList<Directive>(); + ArrayList<Directive> 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<IDirective> directives = new ArrayList<IDirective>(); + List<IDirective> 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<IDirective> cmds = new ArrayList<IDirective>(directives.length); + ArrayList<IDirective> 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<Directive> conditions = new Stack<Directive>(); - Stack<VariableDefinition> defines = new Stack<VariableDefinition>(); + Stack<Directive> conditions = new Stack<>(); + Stack<VariableDefinition> 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<String> dirs = new ArrayList<String>(count); + List<String> 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<IProject, IMakefileValidator> validatorMap = new HashMap<IProject, IMakefileValidator>(); + protected Map<IProject, IMakefileValidator> 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<String> aList = new ArrayList<String>(); + List<String> 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<ILangSettingInfo>(); + fLangInfoList = new ArrayList<>(); fLangInfoList.add(info); } } @@ -140,9 +140,9 @@ public class CDataDiscoveredInfoCalculator { } public void add(int index, PathFilePathInfo value) { - List<PathFilePathInfo> list = checkResize(index) ? new ArrayList<PathFilePathInfo>() : fStore[index]; + List<PathFilePathInfo> list = checkResize(index) ? new ArrayList<>() : fStore[index]; if (list == null) { - list = new ArrayList<PathFilePathInfo>(); + list = new ArrayList<>(); fStore[index] = list; } @@ -168,7 +168,7 @@ public class CDataDiscoveredInfoCalculator { public List<PathFilePathInfo>[] getLists() { int size = fMaxIndex + 1; - List<List<PathFilePathInfo>> list = new ArrayList<List<PathFilePathInfo>>(size); + List<List<PathFilePathInfo>> list = new ArrayList<>(size); List<PathFilePathInfo> 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<PathInfo, List<PathFilePathInfo>>(3); + fPathFilePathInfoMap = new HashMap<>(3); PathInfo fileInfo = pInfo.fInfo; List<PathFilePathInfo> list = fileInfo == fMaxMatchInfo ? fMaxMatchInfoList : fPathFilePathInfoMap.get(fileInfo); if (list == null) { - list = new ArrayList<PathFilePathInfo>(); + list = new ArrayList<>(); fPathFilePathInfoMap.put(fileInfo, list); if (fMaxMatchInfo == null) { fMaxMatchInfo = fileInfo; @@ -342,7 +342,7 @@ public class CDataDiscoveredInfoCalculator { private HashSet<String> calcExtsSet() { if (fExtsSet == null) - fExtsSet = new HashSet<String>(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<ExtsSet, ExtsSetSettings>(); + fExtsSetToExtsSetSettingsMap = new HashMap<>(); } ExtsSetSettings cur = fExtsSetToExtsSetSettingsMap.get(setting.fExtsSet); @@ -497,7 +497,7 @@ public class CDataDiscoveredInfoCalculator { } public RcSetSettings[] getChildren(final boolean includeCurrent) { - final List<Object> list = new ArrayList<Object>(); + final List<Object> 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<String, ExtsSetSettings>(); + 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<ExtsSet, ExtsSetSettings>(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<ILangSettingInfo> list = rcInfo.fLangInfoList; if (list == null) { - list = new ArrayList<ILangSettingInfo>(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<RcSettingInfo> list = new ArrayList<RcSettingInfo>(pfpis.length); + List<RcSettingInfo> 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<ILangSettingInfo>(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<ILangSettingInfo>(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<IRcSettingInfo> resultList = new ArrayList<IRcSettingInfo>(); + List<IRcSettingInfo> 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<ILangSettingInfo>(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<ILangSettingInfo>(setting.fExtsSetToExtsSetSettingsMap.size()); + rcInfo.fLangInfoList = new ArrayList<>(setting.fExtsSetToExtsSetSettingsMap.size()); resultList.add(rcInfo); Collection<ExtsSetSettings> extSettings = setting.fExtsSetToExtsSetSettingsMap.values(); @@ -1015,7 +1015,7 @@ public class CDataDiscoveredInfoCalculator { private static HashMap<ExtsSet, ExtsSetSettings> createExtsSetSettingsMap(CFolderData data) { CLanguageData[] lDatas = data.getLanguageDatas(); - HashMap<ExtsSet, ExtsSetSettings> map = new HashMap<ExtsSet, ExtsSetSettings>(lDatas.length); + HashMap<ExtsSet, ExtsSetSettings> map = new HashMap<>(lDatas.length); ExtsSetSettings settings; if (lDatas.length != 0) { @@ -1032,7 +1032,7 @@ public class CDataDiscoveredInfoCalculator { private static PathFilePathInfo[] createOrderedInfo(Map<IResource, PathInfo> map) { ListIndexStore store = new ListIndexStore(10); - HashMap<PathInfo, PathInfo> infoMap = new HashMap<PathInfo, PathInfo>(); + HashMap<PathInfo, PathInfo> infoMap = new HashMap<>(); // LinkedHashMap result; Set<Entry<IResource, PathInfo>> 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<String, String> syms = info.getSymbols(); - List<IPathEntry> entries = new ArrayList<IPathEntry>(includes.length + syms.size()); + List<IPathEntry> 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<String, Boolean>(); - discoveredSymbols = new LinkedHashMap<String, SymbolEntry>(); + discoveredPaths = new LinkedHashMap<>(); + discoveredSymbols = new LinkedHashMap<>(); } @Override @@ -77,12 +77,12 @@ public class DiscoveredPathInfo implements IPerProjectDiscoveredPathInfo, IDisco @Override public LinkedHashMap<String, Boolean> getIncludeMap() { - return new LinkedHashMap<String, Boolean>(discoveredPaths); + return new LinkedHashMap<>(discoveredPaths); } @Override public synchronized void setIncludeMap(LinkedHashMap<String, Boolean> paths) { - discoveredPaths = SafeStringInterner.safeIntern(new LinkedHashMap<String, Boolean>(paths)); + discoveredPaths = SafeStringInterner.safeIntern(new LinkedHashMap<>(paths)); activePaths = null; } @@ -104,12 +104,12 @@ public class DiscoveredPathInfo implements IPerProjectDiscoveredPathInfo, IDisco @Override public LinkedHashMap<String, SymbolEntry> getSymbolMap() { - return new LinkedHashMap<String, SymbolEntry>(discoveredSymbols); + return new LinkedHashMap<>(discoveredSymbols); } @Override public synchronized void setSymbolMap(LinkedHashMap<String, SymbolEntry> symbols) { - discoveredSymbols = SafeStringInterner.safeIntern(new LinkedHashMap<String, SymbolEntry>(symbols)); + discoveredSymbols = SafeStringInterner.safeIntern(new LinkedHashMap<>(symbols)); activeSymbols = null; } @@ -125,14 +125,14 @@ public class DiscoveredPathInfo implements IPerProjectDiscoveredPathInfo, IDisco private List<Path> getActivePathList() { if (activePaths == null) { - activePaths = new ArrayList<Path>(); + activePaths = new ArrayList<>(); } return activePaths; } private Map<String, String> getActiveSymbolsMap() { if (activeSymbols == null) { - activeSymbols = new HashMap<String, String>(); + 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<IProject, DiscoveredInfoHolder> fDiscoveredInfoHolderMap = new HashMap<IProject, DiscoveredInfoHolder>(); + private Map<IProject, DiscoveredInfoHolder> fDiscoveredInfoHolderMap = new HashMap<>(); private List<IDiscoveredInfoListener> listeners = Collections .synchronizedList(new ArrayList<IDiscoveredInfoListener>()); @@ -60,7 +60,7 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC private static final int INFO_REMOVED = 2; private static class DiscoveredInfoHolder { - Map<InfoContext, IDiscoveredPathInfo> fInfoMap = new HashMap<InfoContext, IDiscoveredPathInfo>(); + Map<InfoContext, IDiscoveredPathInfo> 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<PathEntryContainerChanged> changeDelta = new ArrayList<PathEntryContainerChanged>( + List<PathEntryContainerChanged> 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<IProject, Reference<Document>> fDocumentCache = new HashMap<IProject, Reference<Document>>(); + private final Map<IProject, Reference<Document>> 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>(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<IPathEntry> entries = new ArrayList<IPathEntry>(); + ArrayList<IPathEntry> 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<String> scSymbolsSymbolEntryMap2List(Map<String, SymbolEntry> sumSymbols, boolean active) { Set<Entry<String, SymbolEntry>> symbols = sumSymbols.entrySet(); - List<String> rv = new ArrayList<String>(symbols.size()); + List<String> rv = new ArrayList<>(symbols.size()); for (Entry<String, SymbolEntry> 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<String, String> scSymbolEntryMap2Map(Map<String, SymbolEntry> sumSymbols) { - Map<String, String> rv = new HashMap<String, String>(); + Map<String, String> rv = new HashMap<>(); Set<String> 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<String> pathKeyList = new ArrayList<String>(sumPaths.keySet()); + ArrayList<String> pathKeyList = new ArrayList<>(sumPaths.keySet()); String temp1 = pathKeyList.get(index1); String temp2 = pathKeyList.get(index2); pathKeyList.set(index1, temp2); pathKeyList.set(index2, temp1); - LinkedHashMap<String, SymbolEntry> newSumPaths = new LinkedHashMap<String, SymbolEntry>(sumPaths.size()); + LinkedHashMap<String, SymbolEntry> 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<String> allTokens = new ArrayList<String>(); + ArrayList<String> 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<String[]> commands = new ArrayList<String[]>(); - ArrayList<String> tokens = new ArrayList<String>(); + ArrayList<String[]> commands = new ArrayList<>(); + ArrayList<String> 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<IPath>(); - fErrors = new ArrayList<Problem>(); + 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<CCommandDSC> cmdList = new CopyOnWriteArrayList<CCommandDSC>(); + List<CCommandDSC> cmdList = new CopyOnWriteArrayList<>(); cmdList.add(cmd); - Map<ScannerInfoTypes, List<CCommandDSC>> sc = new HashMap<ScannerInfoTypes, List<CCommandDSC>>(1); + Map<ScannerInfoTypes, List<CCommandDSC>> 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<Map<String, List<String>>> directoryCommandList = directoryCommandListMap.get(workingDir); if (directoryCommandList == null) { - directoryCommandList = new CopyOnWriteArrayList<Map<String, List<String>>>(); + directoryCommandList = new CopyOnWriteArrayList<>(); directoryCommandListMap.put(workingDir, directoryCommandList); ++workingDirsN; } @@ -77,10 +77,10 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars return; } } - command21FileListMap = new HashMap<String, List<String>>(1); + command21FileListMap = new HashMap<>(1); directoryCommandList.add(command21FileListMap); ++commandsN; - List<String> fileList = new CopyOnWriteArrayList<String>(); + List<String> 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<KVStringPair> dirafter = new CopyOnWriteArrayList<KVStringPair>(); - CopyOnWriteArrayList<String> includes = new CopyOnWriteArrayList<String>(); + CopyOnWriteArrayList<KVStringPair> dirafter = new CopyOnWriteArrayList<>(); + CopyOnWriteArrayList<String> 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<String>(); + 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<CCommandDSC> getCCommandDSCList() { - return new CopyOnWriteArrayList<CCommandDSC>(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<String>(); - includes = new ArrayList<String>(); - quoteIncludes = new ArrayList<String>(); + symbols = new ArrayList<>(); + includes = new ArrayList<>(); + quoteIncludes = new ArrayList<>(); } else if (line.startsWith(COMMAND_ID_END)) { - Map<ScannerInfoTypes, List<String>> scannerInfo = new HashMap<ScannerInfoTypes, List<String>>(); + Map<ScannerInfoTypes, List<String>> 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<String> includes = new CopyOnWriteArrayList<String>(); - List<String> symbols = new CopyOnWriteArrayList<String>(); - List<String> targetSpecificOptions = new CopyOnWriteArrayList<String>(); + List<String> includes = new CopyOnWriteArrayList<>(); + List<String> symbols = new CopyOnWriteArrayList<>(); + List<String> 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<String> translatedIncludes = new LinkedList<String>(); + List<String> translatedIncludes = new LinkedList<>(); translatedIncludes.addAll(includes); if (includes.size() > 0) { if (fUtil != null) { @@ -188,11 +188,11 @@ public class GCCScannerInfoConsoleParser extends AbstractGCCBOPConsoleParser { } } - CopyOnWriteArrayList<String> translatedIncludesToPut = new CopyOnWriteArrayList<String>(translatedIncludes); + CopyOnWriteArrayList<String> translatedIncludesToPut = new CopyOnWriteArrayList<>(translatedIncludes); // Contribute discovered includes and symbols to the ScannerInfoCollector if (translatedIncludesToPut.size() > 0 || symbols.size() > 0) { - Map<ScannerInfoTypes, List<String>> scannerInfo = new HashMap<ScannerInfoTypes, List<String>>(); + Map<ScannerInfoTypes, List<String>> 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<String> symbols = new ArrayList<String>(); - protected List<String> includes = new ArrayList<String>(); + protected List<String> symbols = new ArrayList<>(); + protected List<String> 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<ScannerInfoTypes, List<String>> scannerInfo = new HashMap<ScannerInfoTypes, List<String>>(); + Map<ScannerInfoTypes, List<String>> 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<String, IFile>(); - fCollectedFiles = new ArrayList<IResource>(); - fNameConflicts = new ArrayList<String>(); + fFilesInProject = new HashMap<>(); + fCollectedFiles = new ArrayList<>(); + fNameConflicts = new ArrayList<>(); collectFiles(getProject(), fCollectedFiles); @@ -188,7 +188,7 @@ public class ScannerInfoConsoleParserUtility extends AbstractGCCBOPConsoleParser } public List<String> translateRelativePaths(IFile file, String fileName, List<String> includes) { - List<String> translatedIncludes = new ArrayList<String>(includes.size()); + List<String> 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<KVStringPair>(); + compilerCommand = new ArrayList<>(); discovered = false; this.cppFileType = cppFileType; - symbols = new ArrayList<String>(); - includes = new ArrayList<String>(); - quoteIncludes = new ArrayList<String>(); + 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<String> getImacrosFile() { - List<String> imacrosFiles = new ArrayList<String>(); + List<String> imacrosFiles = new ArrayList<>(); for (Iterator<KVStringPair> 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<String> getIncludeFile() { - List<String> includeFiles = new ArrayList<String>(); + List<String> includeFiles = new ArrayList<>(); for (Iterator<KVStringPair> 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<String> symbols = new ArrayList<String>(); - ArrayList<String> includes = new ArrayList<String>(); - ArrayList<String> quoteincludes = new ArrayList<String>(); + ArrayList<String> symbols = new ArrayList<>(); + ArrayList<String> includes = new ArrayList<>(); + ArrayList<String> quoteincludes = new ArrayList<>(); for (Iterator<KVStringPair> options = compilerCommand.iterator(); options.hasNext();) { KVStringPair optionPair = options.next(); String key = optionPair.getKey(); @@ -410,7 +410,7 @@ public class CCommandDSC { } public static List<String> makeRelative(IProject project, List<String> paths) { - List<String> list = new ArrayList<String>(paths.size()); + List<String> list = new ArrayList<>(paths.size()); for (Iterator<String> 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<String> makeAbsolute(IProject project, List<String> paths) { - List<String> list = new ArrayList<String>(paths.size()); + List<String> list = new ArrayList<>(paths.size()); for (Iterator<String> 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<String> translatedIncludePaths = new ArrayList<String>(); + List<String> translatedIncludePaths = new ArrayList<>(); for (Iterator<String> 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<String, Boolean>(1); + values = new LinkedHashMap<>(1); } values.put(SafeStringInterner.safeIntern(value), Boolean.valueOf(active)); } @@ -88,7 +88,7 @@ public class SymbolEntry { * @return List */ private List<String> get(boolean format, boolean subset, boolean active) { - List<String> rv = new ArrayList<String>(values.size()); + List<String> 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<String> getValuesOnly(boolean active) { - List<String> rv = new ArrayList<String>(values.size()); + List<String> 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<IConsoleParser> parsers = new ArrayList<IConsoleParser>(); + List<IConsoleParser> 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<String> envList = new ArrayList<String>(); + ArrayList<String> 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<Integer, CCommandDSC> commandIdCommandMap; // map of all commands public ScannerInfoData() { - commandIdCommandMap = new LinkedHashMap<Integer, CCommandDSC>(); // [commandId, command] - fileToCommandIdMap = new HashMap<IFile, Integer>(); // [file, commandId] - commandIdToFilesMap = new HashMap<Integer, Set<IFile>>(); // [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<Integer> commandIds = new ArrayList<Integer>(commandIdCommandMap.keySet()); + List<Integer> 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<IFile, Integer>(); - siChangedForCommandIdList = new ArrayList<Integer>(); + siChangedForFileMap = new HashMap<>(); + siChangedForCommandIdList = new ArrayList<>(); - freeCommandIdPool = new TreeSet<Integer>(); + 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<CCommandDSC> existingCommands = new ArrayList<CCommandDSC>(sid.commandIdCommandMap.values()); + List<CCommandDSC> 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<IFile> fileSet = sid.commandIdToFilesMap.get(commandId); if (fileSet == null) { - fileSet = new HashSet<IFile>(); + 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<IResource>(siChangedForFileMap.keySet()); + changedResources = new ArrayList<>(siChangedForFileMap.keySet()); siChangedForFileMap.clear(); } siChangedForCommandIdList.clear(); @@ -480,7 +480,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC */ @Override public List<CCommandDSC> getCollectedScannerInfo(Object resource, ScannerInfoTypes type) { - List<CCommandDSC> rv = new ArrayList<CCommandDSC>(); + List<CCommandDSC> 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<IPath> result = new ArrayList<IPath>(includepaths.length + quotepaths.length); + ArrayList<IPath> 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<String> symbols = cmd.getSymbols(); - Map<String, String> definedSymbols = new HashMap<String, String>(symbols.size()); + Map<String, String> 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<IResource, PathInfo> calculatePathInfoMap() { assert Thread.holdsLock(fLock); - Map<IResource, PathInfo> map = new HashMap<IResource, PathInfo>(sid.fileToCommandIdMap.size() + 1); + Map<IResource, PathInfo> map = new HashMap<>(sid.fileToCommandIdMap.size() + 1); Set<Entry<IFile, Integer>> entrySet = sid.fileToCommandIdMap.entrySet(); for (Entry<IFile, Integer> 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<String> symbols = cmd.getSymbols(); - Map<String, String> definedSymbols = new HashMap<String, String>(symbols.size()); + Map<String, String> 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<String> allIncludes = new ArrayList<String>(); + List<String> allIncludes = new ArrayList<>(); Set<Integer> 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<String>(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<String> discovered) { - List<Path> allIncludes = new ArrayList<Path>(discovered.size()); + List<Path> 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<String, String> getAllSymbols() { assert Thread.holdsLock(fLock); - Map<String, String> symbols = new HashMap<String, String>(); + Map<String, String> symbols = new HashMap<>(); Set<Integer> 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<ScannerInfoTypes, List<String>>(); + discoveredSI = new HashMap<>(); // discoveredIncludes = new ArrayList(); // discoveredSymbols = new ArrayList(); // discoveredTSO = new ArrayList(); // - sumDiscoveredIncludes = new ArrayList<String>(); - sumDiscoveredSymbols = new LinkedHashMap<String, SymbolEntry>(); + sumDiscoveredIncludes = new ArrayList<>(); + sumDiscoveredSymbols = new LinkedHashMap<>(); } /* (non-Javadoc) @@ -151,7 +151,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn List<String> discovered = discoveredSI.get(siType); if (discovered == null) { - discovered = new ArrayList<String>(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<IResource> resourceDelta = new ArrayList<IResource>(1); + List<IResource> 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<String> persistedKeyList = new ArrayList<String>(persistedIncludes.keySet()); + ArrayList<String> persistedKeyList = new ArrayList<>(persistedIncludes.keySet()); addedIncludes = addItemsWithOrder(persistedKeyList, finalSumIncludes, true); LinkedHashMap<String, Boolean> newPersistedIncludes; if (addedIncludes) { - newPersistedIncludes = new LinkedHashMap<String, Boolean>(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<String, SymbolEntry> persistedSymbols = discPathInfo.getSymbolMap(); // Step 3. Merge scanner config from steps 1 and 2 - LinkedHashMap<String, SymbolEntry> candidateSymbols = new LinkedHashMap<String, SymbolEntry>( + LinkedHashMap<String, SymbolEntry> 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<IPathEntry> newEntries = new ArrayList<IPathEntry>(Arrays.asList(entries)); + List<IPathEntry> 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<IMarker> exactMarkers = new ArrayList<IMarker>(); + List<IMarker> 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<String> idSet = new HashSet<String>(fMap.size() - 1); + Set<String> 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<InfoContext, IScannerConfigBuilderInfo2> fMap = new HashMap<InfoContext, IScannerConfigBuilderInfo2>(); + protected HashMap<InfoContext, IScannerConfigBuilderInfo2> 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<String, ProfileOptions> defaultProfiles = new ConcurrentHashMap<String, ProfileOptions>(); + protected static Map<String, ProfileOptions> defaultProfiles = new ConcurrentHashMap<>(); /** Map from profile ID -> ProfileOptions */ - protected Map<String, ProfileOptions> profileOptionsMap = new LinkedHashMap<String, ProfileOptions>(); + protected Map<String, ProfileOptions> 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<String, ProviderOptions>(base.providerOptionsMap); + this.providerOptionsMap = new LinkedHashMap<>(base.providerOptionsMap); for (Map.Entry<String, ProviderOptions> 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<String, ProviderOptions>(); + newProfOpts.providerOptionsMap = new LinkedHashMap<>(); for (Map.Entry<String, ProviderOptions> e : providerOptionsMap.entrySet()) newProfOpts.providerOptionsMap.put(e.getKey(), e.getValue().clone()); } @@ -597,7 +597,7 @@ public class ScannerConfigInfoFactory2 { */ @Override public List<String> getProfileIdList() { - return new ArrayList<String>(profileOptionsMap.keySet()); + return new ArrayList<>(profileOptionsMap.keySet()); } /* (non-Javadoc) @@ -666,7 +666,7 @@ public class ScannerConfigInfoFactory2 { @Override public List<String> getProviderIdList() { ProfileOptions po = profileOptionsMap.get(selectedProfile); - return (po != null) ? new ArrayList<String>(po.providerOptionsMap.keySet()) : new ArrayList<String>(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<String, ProfileOptions.ProviderOptions>(); + 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<String, ProfileOptions.ProviderOptions>(1); + po.providerOptionsMap = new LinkedHashMap<>(1); po.providerOptionsMap.put(providerId, ppo); - profileOptionsMap = new LinkedHashMap<String, ProfileOptions>(1); + profileOptionsMap = new LinkedHashMap<>(1); profileOptionsMap.put(profileId, po); // store migrated data @@ -1012,7 +1012,7 @@ public class ScannerConfigInfoFactory2 { .getSCProfileConfiguration(profileId); List<String> providerIds = configuredProfile.getSIProviderIds(); int providerCounter = 0; - po.providerOptionsMap = new LinkedHashMap<String, ProfileOptions.ProviderOptions>(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<String> providerIds = new ArrayList<String>(po.providerOptionsMap.keySet()); + List<String> 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<String> profileIds = ScannerConfigProfileManager.getInstance().getProfileIds(context); - profileOptionsMap = new LinkedHashMap<String, ProfileOptions>(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<String> providerIds = configuredProfile.getSIProviderIds(); - po.providerOptionsMap = new LinkedHashMap<String, ProfileOptions.ProviderOptions>(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<String, ScannerInfoProvider> scannerInfoProviders = new LinkedHashMap<String, ScannerInfoProvider>(); + private Map<String, ScannerInfoProvider> scannerInfoProviders = new LinkedHashMap<>(); private Boolean supportsContext; @@ -296,7 +296,7 @@ public class ScannerConfigProfile { * @return Returns the list of providerIds */ public List<String> getSIProviderIds() { - return new ArrayList<String>(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<IProject, Map<InfoContext, Object>>(); + projectToProfileInstanceMap = new HashMap<>(); } private static final ScannerConfigProfileManager instance = new ScannerConfigProfileManager(); @@ -92,7 +92,7 @@ public final class ScannerConfigProfileManager { synchronized (fLock) { Map<InfoContext, Object> map = projectToProfileInstanceMap.get(project); if (map == null && create) { - map = new HashMap<InfoContext, Object>(); + 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<SCProfileInstance>(profileInstance)); + map.put(context, new SoftReference<>(profileInstance)); } return profileInstance; } @@ -158,7 +158,7 @@ public final class ScannerConfigProfileManager { public List<String> getProfileIds() { synchronized (fLock) { if (profileIds == null) { - profileIds = new ArrayList<String>(); + 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<String>(); + contextAwareProfileIds = new ArrayList<>(); List<String> 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<String, String> map = new HashMap<String, String>(items.length); + Map<String, String> 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<String, EnvironmentVariable> getNativeEnvironment() { @SuppressWarnings({ "unchecked", "rawtypes" }) Map<String, String> stringVars = (Hashtable) EnvironmentReader.getEnvVars(); - HashMap<String, EnvironmentVariable> vars = new HashMap<String, EnvironmentVariable>(); + HashMap<String, EnvironmentVariable> vars = new HashMap<>(); for (Iterator<String> 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<String, EnvironmentVariable> envVars = new TreeMap<String, EnvironmentVariable>(comparator); + TreeMap<String, EnvironmentVariable> envVars = new TreeMap<>(comparator); envVars.putAll((Map<String, EnvironmentVariable>) 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<FieldSummary> fieldList = new ArrayList<FieldSummary>(); - protected List<Text> controlList = new ArrayList<Text>(); - protected List<Validator> validators = new ArrayList<Validator>(); - protected Map<Object, String> valueMap = new HashMap<Object, String>(); + protected List<FieldSummary> fieldList = new ArrayList<>(); + protected List<Text> controlList = new ArrayList<>(); + protected List<Validator> validators = new ArrayList<>(); + protected Map<Object, String> 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<IMakeTarget> makeTargetsList = new ArrayList<IMakeTarget>(filenames.length); + List<IMakeTarget> 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<IMakeTarget> makeTargetsList = new ArrayList<IMakeTarget>(elements.size()); + List<IMakeTarget> 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<String> names = new ArrayList<String>(selectedElements.size()); + List<String> 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>(); + makeTargetData = new ArrayList<>(); } /** @@ -175,7 +175,7 @@ public class MakeTargetTransferData { */ public IMakeTarget[] createMakeTargets(IProject project) { IMakeTargetManager makeTargetManager = MakeCorePlugin.getDefault().getTargetManager(); - ArrayList<IMakeTarget> makeTargets = new ArrayList<IMakeTarget>(makeTargetData.size()); + ArrayList<IMakeTarget> 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<IMakeTarget> makeTargets = new ArrayList<IMakeTarget>(lines.length); + List<IMakeTarget> 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<ITargetRule> targets = new ArrayList<ITargetRule>(list.size()); + List<ITargetRule> 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<IDirective> list = new ArrayList<IDirective>(directives.length); + List<IDirective> 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<String, String[]> prefixesMap = new HashMap<String, String[]>(types.length); + Map<String, String[]> 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<IReconcilingParticipant> fReconcilingParticipants = new ArrayList<IReconcilingParticipant>(); + private ArrayList<IReconcilingParticipant> 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<Object> list = ((IStructuredSelection) sel).toList(); if (list.size() > 0) { - List<IInclude> includes = new ArrayList<IInclude>(list.size()); + List<IInclude> 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<MakefileProjectionAnnotation, Position> computeAdditions(IParent parent) { - Map<MakefileProjectionAnnotation, Position> map = new HashMap<MakefileProjectionAnnotation, Position>(); + Map<MakefileProjectionAnnotation, Position> 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<MakefileProjectionAnnotation, Position> additions = new HashMap<MakefileProjectionAnnotation, Position>(); - List<MakefileProjectionAnnotation> deletions = new ArrayList<MakefileProjectionAnnotation>(); - List<MakefileProjectionAnnotation> updates = new ArrayList<MakefileProjectionAnnotation>(); + Map<MakefileProjectionAnnotation, Position> additions = new HashMap<>(); + List<MakefileProjectionAnnotation> deletions = new ArrayList<>(); + List<MakefileProjectionAnnotation> updates = new ArrayList<>(); Map<MakefileProjectionAnnotation, Position> updated = computeAdditions((IParent) fInput); Map<IDirective, List<MakefileProjectionAnnotation>> previous = createAnnotationMap(model); @@ -306,8 +306,8 @@ public class ProjectionMakefileUpdater implements IProjectionListener { return; } - List<MakefileProjectionAnnotation> newDeletions = new ArrayList<MakefileProjectionAnnotation>(); - List<MakefileProjectionAnnotation> newChanges = new ArrayList<MakefileProjectionAnnotation>(); + List<MakefileProjectionAnnotation> newDeletions = new ArrayList<>(); + List<MakefileProjectionAnnotation> newChanges = new ArrayList<>(); Iterator<MakefileProjectionAnnotation> deletionIterator = deletions.iterator(); outer: while (deletionIterator.hasNext()) { @@ -369,7 +369,7 @@ public class ProjectionMakefileUpdater implements IProjectionListener { } private Map<IDirective, List<MakefileProjectionAnnotation>> createAnnotationMap(IAnnotationModel model) { - Map<IDirective, List<MakefileProjectionAnnotation>> map = new HashMap<IDirective, List<MakefileProjectionAnnotation>>(); + Map<IDirective, List<MakefileProjectionAnnotation>> 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<MakefileProjectionAnnotation> list = map.get(directive.getElement()); if (list == null) { - list = new ArrayList<MakefileProjectionAnnotation>(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<IEditorInput, IMakefile>(); + 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<Control, String> fCheckBoxes = new HashMap<Control, String>(); + Map<Control, String> 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<Control, String> fTextFields = new HashMap<Control, String>(); + Map<Control, String> 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<Text, String[]> fNumberFields = new HashMap<Text, String[]>(); + private Map<Text, String[]> 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<HighlightingColorListItem> fHighlightingColorList = new ArrayList<HighlightingColorListItem>(7); + private final List<HighlightingColorListItem> 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<OverlayKey> overlayKeys = new ArrayList<OverlayKey>(); + ArrayList<OverlayKey> 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<DiscoveredElement> fChildren = new ArrayList<DiscoveredElement>(); + private ArrayList<DiscoveredElement> 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<DiscoveredElement>(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<RGB, Color> fColorTable = new HashMap<RGB, Color>(10); + protected Map<RGB, Color> 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<String, Token> fTokenMap = new HashMap<String, Token>(); + private Map<String, Token> fTokenMap = new HashMap<>(); private String[] fPropertyNamesColor; /** * Preference keys for boolean preferences which are <code>true</code>, 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<IRule> rules = new ArrayList<IRule>(); + List<IRule> 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<ICompletionProposal> proposalList = new ArrayList<ICompletionProposal>(); + List<ICompletionProposal> 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<ICompletionProposal> createCompletionProposals(WordPartDetector wordPart, IAutomaticVariable[] autoVars) { - ArrayList<ICompletionProposal> proposalList = new ArrayList<ICompletionProposal>(autoVars.length); + ArrayList<ICompletionProposal> 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<ICompletionProposal> createCompletionProposals(WordPartDetector wordPart, IMacroDefinition[] macros) { - ArrayList<ICompletionProposal> proposalList = new ArrayList<ICompletionProposal>(macros.length); + ArrayList<ICompletionProposal> 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<ICompletionProposal> createCompletionProposals(WordPartDetector wordPart, IBuiltinFunction[] builtinFuns) { - ArrayList<ICompletionProposal> proposalList = new ArrayList<ICompletionProposal>(builtinFuns.length); + ArrayList<ICompletionProposal> 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<ICompletionProposal> createCompletionProposals(WordPartDetector wordPart, ITargetRule[] targets) { - ArrayList<ICompletionProposal> proposalList = new ArrayList<ICompletionProposal>(targets.length); + ArrayList<ICompletionProposal> 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<String> contextList = new ArrayList<String>(); - ArrayList<IContextInformation> contextInformationList = new ArrayList<IContextInformation>(); + ArrayList<String> contextList = new ArrayList<>(); + ArrayList<IContextInformation> 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<EndOfLineRule> rules = new ArrayList<EndOfLineRule>(); + List<EndOfLineRule> 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<Object> children = new ArrayList<Object>(); + ArrayList<Object> 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<Object> children = new ArrayList<Object>(); + ArrayList<Object> 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<Object> list = new ArrayList<Object>(); + List<Object> 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<IProject> affectedProjects = new HashSet<IProject>(); + Set<IProject> 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<IProject> affectedProjects = new HashSet<IProject>(); + Set<IProject> 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<IProject> projects = new ArrayList<IProject>(); + List<IProject> 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<IProject> projects = new ArrayList<IProject>(elems.length); + ArrayList<IProject> 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<IProject> result = new Vector<IProject>(); + Vector<IProject> 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<String, DiscoveryProfilePageConfiguration>(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<String> getDiscoveryProfileIdList() { - return new ArrayList<String>(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<DiscoveredElement>(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<DiscoveredElement>(); + 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<String, Boolean> includes = new LinkedHashMap<String, Boolean>(); - LinkedHashMap<String, SymbolEntry> symbols = new LinkedHashMap<String, SymbolEntry>(); + LinkedHashMap<String, Boolean> includes = new LinkedHashMap<>(); + LinkedHashMap<String, SymbolEntry> 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<IResource> resourceDelta = new ArrayList<IResource>(1); + List<IResource> 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<DiscoveredElement> elements = new ArrayList<DiscoveredElement>(); + ArrayList<DiscoveredElement> 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<Object> selElements = fDiscoveredContainerList.getSelectedElements(); - List<Object> revSelElements = new ArrayList<Object>(selElements); + List<Object> revSelElements = new ArrayList<>(selElements); Collections.reverse(revSelElements); for (Iterator<Object> 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<DiscoveredElement> newSelection = new ArrayList<DiscoveredElement>(); + List<DiscoveredElement> newSelection = new ArrayList<>(); List<Object> 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<IPathEntry> newEntries = new ArrayList<IPathEntry>(Arrays.asList(entries)); + List<IPathEntry> 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<IResource> changedResources = new ArrayList<IResource>(); + List<IResource> 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<IResource> resources = new LinkedHashSet<IResource>(); + Collection<IResource> 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<IProject>(); + projects = new ArrayList<>(); } protected IProject loadProject(String name) throws CoreException { @@ -263,7 +263,7 @@ public abstract class AbstractBuilderTest extends TestCase { } private List<IMarker> getAllMarkers() throws CoreException { - List<IMarker> markers = new ArrayList<IMarker>(); + List<IMarker> 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<? extends Object> set1 = new LinkedHashSet<Object>(Arrays.asList(expected)); - LinkedHashSet<? extends Object> set2 = new LinkedHashSet<Object>(Arrays.asList(actual)); + LinkedHashSet<? extends Object> set1 = new LinkedHashSet<>(Arrays.asList(expected)); + LinkedHashSet<? extends Object> set2 = new LinkedHashSet<>(Arrays.asList(actual)); LinkedHashSet<? extends Object> set1Copy = new LinkedHashSet<Object>(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<String> testArray = mergeContinuationLines(getContents(testFile)); ArrayList<String> benchmarkArray = mergeContinuationLines(getContents(benchmarkFile)); - Set<String> testNotMatchingLines = new TreeSet<String>(); - Set<String> benchNotMatchingLines = new TreeSet<String>(); - Set<String> extraLines = new TreeSet<String>(); + Set<String> testNotMatchingLines = new TreeSet<>(); + Set<String> benchNotMatchingLines = new TreeSet<>(); + Set<String> 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<String>(Arrays.asList(testLine.split(DELIMITERS))) + String[] testMacros = new TreeSet<>(Arrays.asList(testLine.split(DELIMITERS))) .toArray(new String[0]); - String[] benchMacros = new TreeSet<String>(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<String> getContents(IPath fullPath) { - ArrayList<String> lines = new ArrayList<String>(); + ArrayList<String> 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<ITool> list = new ArrayList<ITool>(); + List<ITool> 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<IPath, ExpectedChange> fExpectedChanges = new Hashtable<IPath, ExpectedChange>(); + private Hashtable<IPath, ExpectedChange> 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<IResource> fIgnoreResources = new HashSet<IResource>(); + private Set<IResource> 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<IResource, IResourceDelta> h = new Hashtable<IResource, IResourceDelta>(affectedChildren.length + 1); + Hashtable<IResource, IResourceDelta> 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<IPath, IPath> resourcePaths = new Hashtable<IPath, IPath>(); + Hashtable<IPath, IPath> resourcePaths = new Hashtable<>(); Enumeration<IPath> 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<String> fileExts = new TreeSet<String>(); + Set<String> 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<String> expectedExts = new TreeSet<String>( + Set<String> 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<IResource> buildOutputResources = new ArrayList<IResource>(); + List<IResource> 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<Runnable> fRunnables = new ArrayList<Runnable>(); + private List<Runnable> 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<String> fProjList = new ArrayList<String>(); + List<String> 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<IBuildIOType, IBuildIOType> inMap = new HashMap<IBuildIOType, IBuildIOType>(); - Map<IBuildIOType, IBuildIOType> outMap = new HashMap<IBuildIOType, IBuildIOType>(); + Map<IBuildIOType, IBuildIOType> inMap = new HashMap<>(); + Map<IBuildIOType, IBuildIOType> 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<IBuildResource, IBuildResource> map = new HashMap<IBuildResource, IBuildResource>(); + Map<IBuildResource, IBuildResource> 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<IBuildIOType, IBuildIOType> outMap = new HashMap<IBuildIOType, IBuildIOType>(); + Map<IBuildIOType, IBuildIOType> 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<IBuildStep> stepSet = new HashSet<IBuildStep>(); + Set<IBuildStep> stepSet = new HashSet<>(); for (Entry<IBuildIOType, IBuildIOType> entry : outMap.entrySet()) { IBuildIOType type = entry.getKey(); @@ -785,8 +785,8 @@ public class BuildDescriptionModelTests extends TestCase { return false; if (resourcesMatch(rcs, oRcs, rcMap)) { - Map<IBuildIOType, IBuildIOType> inMap = new HashMap<IBuildIOType, IBuildIOType>(); - Map<IBuildIOType, IBuildIOType> outMap = new HashMap<IBuildIOType, IBuildIOType>(); + Map<IBuildIOType, IBuildIOType> inMap = new HashMap<>(); + Map<IBuildIOType, IBuildIOType> 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<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> 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<OptionStringValue> list = new ArrayList<OptionStringValue>(); + ArrayList<OptionStringValue> 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<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>(Arrays.asList(entries)); + ArrayList<ICLanguageSettingEntry> 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<OptionStringValue> list = new ArrayList<OptionStringValue>( + ArrayList<OptionStringValue> 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<OptionStringValue> list = new ArrayList<OptionStringValue>( + ArrayList<OptionStringValue> 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<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>(); + ArrayList<ICLanguageSettingEntry> 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<ICLanguageSettingEntry>(); + 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<IProject>(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<IProject>(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<String> names = new ArrayList<String>(); + ArrayList<String> 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<String> names = new ArrayList<String>(); + ArrayList<String> 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<IResource> modRes = new ArrayList<IResource>(); + ArrayList<IResource> 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<IResource> dependencies = new ArrayList<IResource>(); + ArrayList<IResource> 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<IPath> outs = new ArrayList<IPath>(); + ArrayList<IPath> 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<String> expectedOSListarr = new ArrayList<String>(); + List<String> 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<String> expectedEnumList1arr = new ArrayList<String>(); + List<String> 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<String> expectedOSListarr = new ArrayList<String>(); + List<String> 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<String> expectedOSListarr = new ArrayList<String>(); + List<String> 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<String> expectedEnumList1arr = new ArrayList<String>(); + List<String> 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<IProject>(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<IProject>(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<IFile> files = new ArrayList<IFile>(); + List<IFile> 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<String> res1 = new ArrayList<String>(Arrays.asList(resArr1)); + List<String> 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<String> res2 = new ArrayList<String>(res1.size()); + ArrayList<String> 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<String> ar = new ArrayList<String>(0); + ArrayList<String> 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<IProject>(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<IProject>(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<IProject> projectList = new ArrayList<IProject>(projectZips.length); + ArrayList<IProject> 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<IProject> projectList = new ArrayList<IProject>(projectZips.length); + ArrayList<IProject> 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<String, String>(); + 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<IManagedConfigElement> ret = new ArrayList<IManagedConfigElement>(children.length); + List<IManagedConfigElement> 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<IHoldsOptions> set = new HashSet<IHoldsOptions>(); + HashSet<IHoldsOptions> 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<IToolChain> incomp = new HashSet<IToolChain>(Arrays.asList(allSys)); + HashSet<IToolChain> incomp = new HashSet<>(Arrays.asList(allSys)); incomp.removeAll(Arrays.asList(ctcs)); assertTrue(incomp.contains(incompatibleTc)); IBuilder[] cbs = cfgM.getCompatibleBuilders(); - Set<IHoldsOptions> bSet = new HashSet<IHoldsOptions>(); + Set<IHoldsOptions> 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<IBuilder> incompB = new HashSet<IBuilder>(Arrays.asList(allSysB)); + HashSet<IBuilder> 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<IHoldsOptions> filterSupportedToolChains(IFolderInfo foInfo, IToolChain tc) { - HashSet<IHoldsOptions> set = new HashSet<IHoldsOptions>(); + HashSet<IHoldsOptions> 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<? extends IHoldsOptions> s1 = new HashSet<IHoldsOptions>(c1); HashSet<? extends IHoldsOptions> s1c = new HashSet<IHoldsOptions>(s1); - HashSet<IHoldsOptions> s2 = new HashSet<IHoldsOptions>(c2); + HashSet<IHoldsOptions> s2 = new HashSet<>(c2); s1.removeAll(s2); s2.removeAll(s1c); @@ -267,7 +267,7 @@ public class ToolChainModificationTests extends TestCase { private Collection<IHoldsOptions> filterPropsSupported(FolderInfo foInfo, ToolChain tc, IToolChain[] tcs, Collection<IHoldsOptions> c) { if (c == null) - c = new ArrayList<IHoldsOptions>(); + 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<IHoldsOptions> filterPropsSupported(IConfiguration cfg, IBuilder[] bs, Collection<IHoldsOptions> c) { if (c == null) - c = new ArrayList<IHoldsOptions>(); + 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<ITool> replacement = new HashSet<ITool>(); + Set<ITool> 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<ITool>(); + 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<String> languages = new ArrayList<String>(); + List<String> languages = new ArrayList<>(); languages.add(LANGUAGE_ID); - Map<String, String> properties = new HashMap<String, String>(); + Map<String, String> properties = new HashMap<>(); properties.put(ATTR_PARAMETER, CUSTOM_COMMAND_1); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> 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<String> languages = new ArrayList<String>(); + List<String> languages = new ArrayList<>(); languages.add(LANGUAGE_ID); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> 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<String, String> properties = new HashMap<String, String>(); + Map<String, String> 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<ICLanguageSettingEntry> entries2 = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> 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<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> 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<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> 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<String, String> refs = cfgDescription.getReferenceInfo(); assertEquals(1, refs.size()); - Set<String> referencedProjectsNames = new LinkedHashSet<String>(refs.keySet()); + Set<String> 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<String> languages = new ArrayList<String>(); + List<String> languages = new ArrayList<>(); languages.add(LANGUAGE_ID); - Map<String, String> properties = new HashMap<String, String>(); + Map<String, String> properties = new HashMap<>(); properties.put(ATTR_PARAMETER, CUSTOM_PARAMETER); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> 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<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> 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<ICLanguageSettingEntry> expected = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> 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<ICLanguageSettingEntry> expected = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> 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<ICLanguageSettingEntry> expected = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> 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<ICLanguageSettingEntry> expected = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> 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<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> 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<IProjectType> projectTypes = new ArrayList<IProjectType>(); - private static List<String> projectTypeNames = new ArrayList<String>(); + private static List<IProjectType> projectTypes = new ArrayList<>(); + private static List<String> 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<IProject> projList = new LinkedList<IProject>(); + private List<IProject> 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<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> 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<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> 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<ICLanguageSettingEntry> list1, List<ICLanguageSettingEntry> list2) { - Set<ICLanguageSettingEntry> set1 = new LinkedHashSet<ICLanguageSettingEntry>(list1); + Set<ICLanguageSettingEntry> set1 = new LinkedHashSet<>(list1); set1.removeAll(list2); - Set<ICLanguageSettingEntry> set2 = new LinkedHashSet<ICLanguageSettingEntry>(list2); + Set<ICLanguageSettingEntry> 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<Object> list = new ArrayList<Object>(); + List<Object> 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<Object>(); + 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<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> 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<IPath, CResourceData> rcDataMap = new HashMap<IPath, CResourceData>(); + Map<IPath, CResourceData> 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<String> getAllScannerDiscoveryProfileIds(IToolChain toolchain) { Assert.isNotNull(toolchain); - Set<String> profiles = new TreeSet<String>(); + Set<String> profiles = new TreeSet<>(); if (toolchain != null) { String toolchainProfileId = null; @@ -201,7 +201,7 @@ public class CfgScannerConfigUtil { throw new UnsupportedOperationException(msg); } - Set<String> profiles = new TreeSet<String>(); + Set<String> 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<String> profiles = new TreeSet<String>(); + Set<String> 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<ILangSettingInfo>(); + fLangInfoList = new ArrayList<>(); fLangInfoList.add(info); } } @@ -130,9 +130,9 @@ public class PerFileSettingsCalculator { } public void add(int index, PathFilePathInfo value) { - List<PathFilePathInfo> list = checkResize(index) ? new ArrayList<PathFilePathInfo>() : fStore[index]; + List<PathFilePathInfo> list = checkResize(index) ? new ArrayList<>() : fStore[index]; if (list == null) { - list = new ArrayList<PathFilePathInfo>(); + list = new ArrayList<>(); fStore[index] = list; } @@ -157,7 +157,7 @@ public class PerFileSettingsCalculator { public List<PathFilePathInfo>[] getLists() { int size = fMaxIndex + 1; - List<List<PathFilePathInfo>> list = new ArrayList<List<PathFilePathInfo>>(size); + List<List<PathFilePathInfo>> list = new ArrayList<>(size); List<PathFilePathInfo> 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<PathInfo, List<PathFilePathInfo>>(3); + fPathFilePathInfoMap = new HashMap<>(3); PathInfo fileInfo = pInfo.fInfo; List<PathFilePathInfo> list = fileInfo == fMaxMatchInfo ? fMaxMatchInfoList : fPathFilePathInfoMap.get(fileInfo); if (list == null) { - List<PathFilePathInfo> emptyList = new ArrayList<PathFilePathInfo>(); + List<PathFilePathInfo> emptyList = new ArrayList<>(); fPathFilePathInfoMap.put(fileInfo, emptyList); if (fMaxMatchInfo == null) { fMaxMatchInfo = fileInfo; @@ -342,7 +342,7 @@ public class PerFileSettingsCalculator { private HashSet<String> calcExtsSet() { if (fExtsSet == null) - fExtsSet = new HashSet<String>(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<ExtsSet, ExtsSetSettings>(); + fExtsSetToExtsSetSettingsMap = new HashMap<>(); } ExtsSetSettings cur = fExtsSetToExtsSetSettingsMap.get(setting.fExtsSet); @@ -507,7 +507,7 @@ public class PerFileSettingsCalculator { // } public RcSetSettings[] getChildren(final boolean includeCurrent) { - final List<RcSetSettings> list = new ArrayList<RcSetSettings>(); + final List<RcSetSettings> 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<String, ExtsSetSettings>(); + 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<ExtsSet, ExtsSetSettings>(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<ILangSettingInfo> list = rcInfo.fLangInfoList; if (list == null) { - list = new ArrayList<ILangSettingInfo>(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<IRcSettingInfo> list = new ArrayList<IRcSettingInfo>(pfpis.length); + List<IRcSettingInfo> 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<ILangSettingInfo>(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<ILangSettingInfo>(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<IRcSettingInfo> resultList = new ArrayList<IRcSettingInfo>(); + List<IRcSettingInfo> 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<ILangSettingInfo>(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<ILangSettingInfo>(setting.fExtsSetToExtsSetSettingsMap.size()); + rcInfo.fLangInfoList = new ArrayList<>(setting.fExtsSetToExtsSetSettingsMap.size()); resultList.add(rcInfo); Collection<ExtsSetSettings> values = setting.fExtsSetToExtsSetSettingsMap.values(); @@ -1008,7 +1008,7 @@ public class PerFileSettingsCalculator { private static HashMap<ExtsSet, ExtsSetSettings> createExtsSetSettingsMap(CFolderData data) { CLanguageData[] lDatas = data.getLanguageDatas(); - HashMap<ExtsSet, ExtsSetSettings> map = new HashMap<ExtsSet, ExtsSetSettings>(lDatas.length); + HashMap<ExtsSet, ExtsSetSettings> 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<PathInfo, PathInfo> infoMap = new HashMap<PathInfo, PathInfo>(); + HashMap<PathInfo, PathInfo> infoMap = new HashMap<>(); // LinkedHashMap result; Set<Entry<IResource, PathInfo>> 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<IScannerConfigBuilderInfo2Set>(container); + fContainer = new SoftReference<>(container); } return container; } private Map<CfgInfoContext, IScannerConfigBuilderInfo2> createMap() { - HashMap<CfgInfoContext, IScannerConfigBuilderInfo2> map = new HashMap<CfgInfoContext, IScannerConfigBuilderInfo2>(); + HashMap<CfgInfoContext, IScannerConfigBuilderInfo2> map = new HashMap<>(); try { IScannerConfigBuilderInfo2Set container = getContainer(); @@ -314,7 +314,7 @@ public class CfgScannerConfigInfoFactory2 { private Map<CfgInfoContext, IScannerConfigBuilderInfo2> getConfigInfoMap( Map<InfoContext, IScannerConfigBuilderInfo2> baseMap) { - Map<CfgInfoContext, IScannerConfigBuilderInfo2> map = new HashMap<CfgInfoContext, IScannerConfigBuilderInfo2>(); + Map<CfgInfoContext, IScannerConfigBuilderInfo2> map = new HashMap<>(); for (Entry<InfoContext, IScannerConfigBuilderInfo2> 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<IBuildStep> fVisitedSteps = new HashSet<IBuildStep>(); + private Set<IBuildStep> 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<IBuildStep> set = new HashSet<IBuildStep>(); + Set<IBuildStep> 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<IBuildResource> list = new ArrayList<IBuildResource>(); + List<IBuildResource> 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<Object[]> failList = new ArrayList<Object[]>(); + List<Object[]> 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<IConsoleParser> parsers = new ArrayList<IConsoleParser>(); + List<IConsoleParser> parsers = new ArrayList<>(); if (!isOnlyClean) { ICConfigurationDescription cfgDescription = ManagedBuildManager .getDescriptionForConfiguration(configuration); @@ -199,7 +199,7 @@ public class ExternalBuildRunner extends AbstractBuildRunner { } protected Map<String, String> getEnvironment(IBuilder builder) throws CoreException { - Map<String, String> envMap = new HashMap<String, String>(); + Map<String, String> 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<String, String> env) { // Convert into env strings - List<String> strings = new ArrayList<String>(env.size()); + List<String> strings = new ArrayList<>(env.size()); for (Entry<String, String> 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<IConsoleParser> parsers = new ArrayList<IConsoleParser>(); + List<IConsoleParser> 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<MatchKey<Tool>, List<Tool>> fSortedTools; private static HashMap<MatchKey<Builder>, List<Builder>> fSortedBuilders; - private static Map<IProject, IManagedBuildInfo> fInfoMap = new HashMap<IProject, IManagedBuildInfo>(); + private static Map<IProject, IManagedBuildInfo> 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<String, IProjectType>(); + projectTypeMap = new TreeMap<>(); } return projectTypeMap; } @@ -393,7 +393,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ protected static Map<String, IConfiguration> getExtensionConfigurationMap() { if (extensionConfigurationMap == null) { - extensionConfigurationMap = new HashMap<String, IConfiguration>(); + extensionConfigurationMap = new HashMap<>(); } return extensionConfigurationMap; } @@ -403,7 +403,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ protected static Map<String, IResourceConfiguration> getExtensionResourceConfigurationMap() { if (extensionResourceConfigurationMap == null) { - extensionResourceConfigurationMap = new HashMap<String, IResourceConfiguration>(); + extensionResourceConfigurationMap = new HashMap<>(); } return extensionResourceConfigurationMap; } @@ -418,7 +418,7 @@ public class ManagedBuildManager extends AbstractCExtension { } if (extensionToolChainMap == null) { - extensionToolChainMap = new TreeMap<String, ToolChain>(); + extensionToolChainMap = new TreeMap<>(); } return extensionToolChainMap; } @@ -443,7 +443,7 @@ public class ManagedBuildManager extends AbstractCExtension { } catch (BuildException e) { } if (extensionToolMap == null) { - extensionToolMap = new TreeMap<String, Tool>(); + extensionToolMap = new TreeMap<>(); } return extensionToolMap; } @@ -464,7 +464,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ protected static Map<String, ITargetPlatform> getExtensionTargetPlatformMap() { if (extensionTargetPlatformMap == null) { - extensionTargetPlatformMap = new HashMap<String, ITargetPlatform>(); + extensionTargetPlatformMap = new HashMap<>(); } return extensionTargetPlatformMap; } @@ -478,7 +478,7 @@ public class ManagedBuildManager extends AbstractCExtension { } catch (BuildException e) { } if (extensionBuilderMap == null) { - extensionBuilderMap = new TreeMap<String, Builder>(); + extensionBuilderMap = new TreeMap<>(); } return extensionBuilderMap; } @@ -499,7 +499,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ protected static Map<String, IOption> getExtensionOptionMap() { if (extensionOptionMap == null) { - extensionOptionMap = new HashMap<String, IOption>(); + extensionOptionMap = new HashMap<>(); } return extensionOptionMap; } @@ -509,7 +509,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ protected static Map<String, IOptionCategory> getExtensionOptionCategoryMap() { if (extensionOptionCategoryMap == null) { - extensionOptionCategoryMap = new HashMap<String, IOptionCategory>(); + extensionOptionCategoryMap = new HashMap<>(); } return extensionOptionCategoryMap; } @@ -519,7 +519,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ protected static Map<String, IInputType> getExtensionInputTypeMap() { if (extensionInputTypeMap == null) { - extensionInputTypeMap = new HashMap<String, IInputType>(); + extensionInputTypeMap = new HashMap<>(); } return extensionInputTypeMap; } @@ -529,7 +529,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ protected static Map<String, IOutputType> getExtensionOutputTypeMap() { if (extensionOutputTypeMap == null) { - extensionOutputTypeMap = new HashMap<String, IOutputType>(); + extensionOutputTypeMap = new HashMap<>(); } return extensionOutputTypeMap; } @@ -539,7 +539,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ protected static Map<String, ITarget> getExtensionTargetMap() { if (extensionTargetMap == null) { - extensionTargetMap = new HashMap<String, ITarget>(); + 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<IProjectType>(); + 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<IManagedBuildDefinitionsStartup>( + 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<IManagedConfigElement>(); + startUpConfigElements = new ArrayList<>(); startUpConfigElements.add(element); } } else { @@ -3043,7 +3043,7 @@ public class ManagedBuildManager extends AbstractCExtension { */ private static Map<IResource, List<IScannerInfoChangeListener>> getBuildModelListeners() { if (buildModelListeners == null) { - buildModelListeners = new HashMap<IResource, List<IScannerInfoChangeListener>>(); + buildModelListeners = new HashMap<>(); } return buildModelListeners; } @@ -3053,7 +3053,7 @@ public class ManagedBuildManager extends AbstractCExtension { throw new IllegalStateException(); if (configElementMap == null) { - configElementMap = new HashMap<IBuildObject, IManagedConfigElement>(); + configElementMap = new HashMap<>(); } return configElementMap; } @@ -3507,7 +3507,7 @@ public class ManagedBuildManager extends AbstractCExtension { public static Map<String, IConfigurationElement> getConversionElements(IBuildObject buildObj) { - Map<String, IConfigurationElement> conversionTargets = new HashMap<String, IConfigurationElement>(); + Map<String, IConfigurationElement> 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<IToolChain> result = new ArrayList<IToolChain>(); + List<IToolChain> 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<IConfiguration> list = new ArrayList<IConfiguration>(); + List<IConfiguration> 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<ToolChain> list = findIdenticalElements((ToolChain) tChain, fToolChainSorter); - LinkedHashSet<IConfiguration> result = new LinkedHashSet<IConfiguration>(); + LinkedHashSet<IConfiguration> 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 <T extends BuildObject & IMatchKeyProvider<T>> HashMap<MatchKey<T>, List<T>> getSortedElements( Collection<T> elements) { - HashMap<MatchKey<T>, List<T>> map = new HashMap<MatchKey<T>, List<T>>(); + HashMap<MatchKey<T>, List<T>> map = new HashMap<>(); for (T p : elements) { MatchKey<T> key = p.getMatchKey(); if (key == null) @@ -4143,7 +4143,7 @@ public class ManagedBuildManager extends AbstractCExtension { List<T> list = map.get(key); if (list == null) { - list = new ArrayList<T>(); + 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<MatchKey<ToolChain>, List<ToolChain>> all = getSortedToolChains(); - List<IToolChain> result = new ArrayList<IToolChain>(); + List<IToolChain> result = new ArrayList<>(); for (List<ToolChain> 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<T>(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<IConfiguration> result = new ArrayList<IConfiguration>(); + List<IConfiguration> 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<IProject, IConfiguration[]> sortConfigs(IConfiguration cfgs[]) { - Map<IProject, Set<IConfiguration>> cfgSetMap = new HashMap<IProject, Set<IConfiguration>>(); + Map<IProject, Set<IConfiguration>> cfgSetMap = new HashMap<>(); for (IConfiguration cfg : cfgs) { IProject proj = cfg.getOwner().getProject(); Set<IConfiguration> set = cfgSetMap.get(proj); if (set == null) { - set = new HashSet<IConfiguration>(); + set = new HashSet<>(); cfgSetMap.put(proj, set); } set.add(cfg); } - Map<IProject, IConfiguration[]> cfgArrayMap = new HashMap<IProject, IConfiguration[]>(); + Map<IProject, IConfiguration[]> cfgArrayMap = new HashMap<>(); if (cfgSetMap.size() != 0) { Set<Entry<IProject, Set<IConfiguration>>> entrySet = cfgSetMap.entrySet(); for (Entry<IProject, Set<IConfiguration>> entry : entrySet) { @@ -4584,7 +4584,7 @@ public class ManagedBuildManager extends AbstractCExtension { String builderName = command.getBuilderName(); Map<String, String> newArgs = null; if (buildKind != IncrementalProjectBuilder.CLEAN_BUILD) { - newArgs = new HashMap<String, String>(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<ICommand> vec = new Vector<ICommand>(Arrays.asList(commands)); + Vector<ICommand> 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<String> newNatures = new ArrayList<String>(Arrays.asList(prevNatures)); + List<String> 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<IProject>(); + fProjSet = new HashSet<>(); fProjSet.add(project); break; @@ -155,9 +155,9 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase { if (oldIds == null) return true; - Set<String> oldSet = new HashSet<String>(Arrays.asList(oldIds)); - Set<String> oldSetCopy = new HashSet<String>(oldSet); - Set<String> newSet = new HashSet<String>(Arrays.asList(newIds)); + Set<String> oldSet = new HashSet<>(Arrays.asList(oldIds)); + Set<String> oldSetCopy = new HashSet<>(oldSet); + Set<String> 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<String, String>(env); + fEnv = new HashMap<>(env); fCWD = cwd; } @@ -62,7 +62,7 @@ public class BuildCommand implements IBuildCommand { @Override public Map<String, String> getEnvironment() { if (fEnv != null) - return new HashMap<String, String>(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<ITool, BuildStep> fToolToMultiStepMap = new HashMap<ITool, BuildStep>(); + private Map<ITool, BuildStep> fToolToMultiStepMap = new HashMap<>(); private BuildStep fOrderedMultiActions[]; /** Map from Location URI to BuildResource */ - private Map<URI, BuildResource> fLocationToRcMap = new HashMap<URI, BuildResource>(); + private Map<URI, BuildResource> fLocationToRcMap = new HashMap<>(); - private Map<String, Set<BuildIOType>> fVarToAddlInSetMap = new HashMap<String, Set<BuildIOType>>(); + private Map<String, Set<BuildIOType>> fVarToAddlInSetMap = new HashMap<>(); - private List<BuildStep> fStepList = new ArrayList<BuildStep>(); + private List<BuildStep> fStepList = new ArrayList<>(); private BuildStep fTargetStep; @@ -125,8 +125,8 @@ public class BuildDescription implements IBuildDescription { private BuildStep fInputStep; private BuildStep fOutputStep; - private Map<String, ToolOrderEstimation> fToolOrderMap = new HashMap<String, ToolOrderEstimation>(); - private Set<ITool> fToolInProcesSet = new HashSet<ITool>(); + private Map<String, ToolOrderEstimation> fToolOrderMap = new HashMap<>(); + private Set<ITool> fToolInProcesSet = new HashSet<>(); private ITool fOrderedTools[]; private ICSourceEntry[] fSourceEntries; @@ -143,7 +143,7 @@ public class BuildDescription implements IBuildDescription { private class ToolInfoHolder { Map<String, List<ToolAndType>> fExtToToolAndTypeListMap; - Map<String, BuildGroup> fInTypeToGroupMap = new HashMap<String, BuildGroup>(); + Map<String, BuildGroup> fInTypeToGroupMap = new HashMap<>(); } class ToolAndType { @@ -489,7 +489,7 @@ public class BuildDescription implements IBuildDescription { } private Map<String, List<ToolAndType>> initToolAndTypeMap(IFolderInfo foInfo) { - Map<String, List<ToolAndType>> extToToolAndTypeListMap = new HashMap<String, List<ToolAndType>>(); + Map<String, List<ToolAndType>> 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<ToolAndType> list = extToToolAndTypeListMap.get(ext); if (list == null) { - list = new ArrayList<ToolAndType>(); + 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<ToolAndType> list = extToToolAndTypeListMap.get(ext); if (list == null) { - list = new ArrayList<ToolAndType>(); + 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<Entry<URI, BuildResource>> set = fLocationToRcMap.entrySet(); - List<BuildResource> list = new ArrayList<BuildResource>(); + List<BuildResource> list = new ArrayList<>(); for (Entry<URI, BuildResource> 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<BuildResource> list = new ArrayList<BuildResource>(); + List<BuildResource> 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<IBuildResource> list = new ArrayList<IBuildResource>(); + List<IBuildResource> 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<String, String> calculateEnvironment() { IBuildEnvironmentVariable variables[] = ManagedBuildManager.getEnvironmentVariableProvider().getVariables(fCfg, true, true); - Map<String, String> map = new HashMap<String, String>(); + Map<String, String> 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<String> inputs = new ArrayList<String>(); + List<String> 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<BuildIOType> set = fVarToAddlInSetMap.get(var); if (set == null) { - set = new HashSet<BuildIOType>(); + 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<IPath> depSet = new HashSet<IPath>(); + Set<IPath> 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<String> libs = new Vector<String>(); + Vector<String> 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<String> objs = new Vector<String>(); + Vector<String> 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<ITool> set = new HashSet<ITool>(); + Set<ITool> 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<ITool> set = new HashSet<ITool>(); + Set<ITool> 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<BuildStep> fActions = new HashSet<BuildStep>(); + private Set<BuildStep> 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<BuildResource> fResources = new ArrayList<BuildResource>(); + private List<BuildResource> 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<ProcessLauncher>(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<String> list = new ArrayList<String>(); + List<String> list = new ArrayList<>(); Set<Entry<String, String>> entrySet = map.entrySet(); for (Entry<String, String> 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<BuildIOType> fDepArgs = new ArrayList<BuildIOType>(); + private List<BuildIOType> 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<IBuildStep> set = new HashSet<IBuildStep>(); + Set<IBuildStep> set = new HashSet<>(); for (Iterator<BuildIOType> 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<BuildIOType> fInputTypes = new ArrayList<BuildIOType>(); - private List<BuildIOType> fOutputTypes = new ArrayList<BuildIOType>(); + private List<BuildIOType> fInputTypes = new ArrayList<>(); + private List<BuildIOType> 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<BuildIOType> types = input ? fInputTypes : fOutputTypes; - List<BuildIOType> list = new ArrayList<BuildIOType>(); + List<BuildIOType> 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<BuildIOType> list = input ? fInputTypes : fOutputTypes; - Set<IBuildResource> set = new HashSet<IBuildResource>(); + Set<IBuildResource> 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<IBuildCommand> list = new ArrayList<IBuildCommand>(); + List<IBuildCommand> 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<IBuildCommand> list = new ArrayList<IBuildCommand>(); + List<IBuildCommand> 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<String> list = new ArrayList<String>(); + List<String> 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<BuildResource> list = new ArrayList<BuildResource>(); + List<BuildResource> 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<String> list = new ArrayList<String>(rcs.length); + List<String> 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<String> list = new ArrayList<String>(); + List<String> list = new ArrayList<>(); Set<Entry<String, String>> entrySet = map.entrySet(); for (Entry<String, String> 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<Integer, Set<String>>(); + 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<String> set = fStateToPathListMap.get(iState); if (set == null) { - set = new HashSet<String>(); + 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<Integer, Set<String>> map = new HashMap<Integer, Set<String>>(); + HashMap<Integer, Set<String>> map = new HashMap<>(); for (@SuppressWarnings("rawtypes") Entry entry : props.entrySet()) { Integer i = stateToInt((String) entry.getValue()); Set<String> list = map.get(i); if (list == null) { - list = new HashSet<String>(); + 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<IBuildStep> set = new HashSet<IBuildStep>(); + Set<IBuildStep> 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<IBuildStep, StepBuilder> fStepToStepBuilderMap = new HashMap<IBuildStep, StepBuilder>(); + private Map<IBuildStep, StepBuilder> 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<IPath> fDirPathSet = new HashSet<IPath>(); + private Set<IPath> 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<BuildQueueElement> unsorted = new HashSet<BuildQueueElement>(); - protected HashMap<IBuildStep, BuildQueueElement> queueHash = new HashMap<IBuildStep, BuildQueueElement>(); - protected LinkedList<BuildQueueElement> queue = new LinkedList<BuildQueueElement>(); + protected HashSet<BuildQueueElement> unsorted = new HashSet<>(); + protected HashMap<IBuildStep, BuildQueueElement> queueHash = new HashMap<>(); + protected LinkedList<BuildQueueElement> 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<ActiveBuildStep> active = new Vector<ActiveBuildStep>(Math.min(maxProcesses, 10), 10); + Vector<ActiveBuildStep> 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<String, ConfigurationBuildState> fCfgIdToStateMap = new HashMap<String, ConfigurationBuildState>(); + private Map<String, ConfigurationBuildState> 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<IConfigurationBuildState> list = new ArrayList<IConfigurationBuildState>(props.size()); + List<IConfigurationBuildState> list = new ArrayList<>(props.size()); Set<Object> 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<String, IBuildProperty> fPropertiesMap = new HashMap<String, IBuildProperty>(); + private HashMap<String, IBuildProperty> fPropertiesMap = new HashMap<>(); private ArrayList<String> fInexistentProperties; public BuildProperties() { @@ -40,7 +40,7 @@ public class BuildProperties implements IBuildProperties { addProperty(prop); } catch (CoreException e) { if (fInexistentProperties == null) - fInexistentProperties = new ArrayList<String>(); + 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<String>(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<String, IBuildPropertyType> fPropertyTypeMap = new HashMap<String, IBuildPropertyType>(); + private Map<String, IBuildPropertyType> fPropertyTypeMap = new HashMap<>(); @Override public IBuildPropertyType getPropertyType(String id) { @@ -136,13 +136,13 @@ public class BuildPropertyManager implements IBuildPropertyManager { private List<IConfigurationElement> getTypeElList(boolean create) { if (fTypeCfgElements == null && create) - fTypeCfgElements = new ArrayList<IConfigurationElement>(); + fTypeCfgElements = new ArrayList<>(); return fTypeCfgElements; } private List<IConfigurationElement> getValueElList(boolean create) { if (fValueCfgElements == null && create) - fValueCfgElements = new ArrayList<IConfigurationElement>(); + 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<String, BuildPropertyValue> fValuesMap = new HashMap<String, BuildPropertyValue>(); + private Map<String, BuildPropertyValue> 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<String>(); + 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<String, Set<String>> getReferencedProperties() { if (fRefPropsMap == null) { - fRefPropsMap = new HashMap<String, Set<String>>(); + 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<IBuildPropertyType> list = new ArrayList<IBuildPropertyType>(types.length); + List<IBuildPropertyType> 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<IBuildPropertyValue> list = new ArrayList<IBuildPropertyValue>(values.length); + List<IBuildPropertyValue> 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<ITool> list = new ArrayList<ITool>(); + List<ITool> 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<ITool> calcDependentTools(ITool tools[], ITool tool, List<ITool> list) { if (list == null) - list = new ArrayList<ITool>(); + 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<OptionStringValue> values = new ArrayList<OptionStringValue>(); + List<OptionStringValue> 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<ITool> retTools = new ArrayList<ITool>(); + List<ITool> 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<ICSettingEntry> list = new ArrayList<ICSettingEntry>(entries.length); + List<ICSettingEntry> 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<ICSettingEntry> list = new ArrayList<ICSettingEntry>(entries.length); + List<ICSettingEntry> 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<String> list = new ArrayList<String>(tok.countTokens()); + List<String> 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<String, String> getCustomBuildPropertiesMap() { if (customBuildProperties == null) { - customBuildProperties = new HashMap<String, String>(); + customBuildProperties = new HashMap<>(); } return customBuildProperties; } @Override public void setEnvironment(Map<String, String> env) throws CoreException { - customizedEnvironment = new HashMap<String, String>(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<Builder>(this); + return new MatchKey<>(this); } @Override @@ -2667,7 +2667,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider public Set<String> contributeErrorParsers(Set<String> set) { if (getErrorParserIds() != null) { if (set == null) - set = new HashSet<String>(); + 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<String> set) { Set<String> oldSet = contributeErrorParsers(null); if (oldSet == null) - oldSet = new HashSet<String>(); + 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<String, String> createBuildArgs(IConfiguration cfgs[]) { - Map<String, String> map = new HashMap<String, String>(); + Map<String, String> 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<IConfiguration> list = new ArrayList<IConfiguration>(ids.length); + List<IConfiguration> 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<IBuilder> list = new ArrayList<IBuilder>(cfgs.length); + List<IBuilder> 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<IBuilder> list = new ArrayList<IBuilder>(cfgs.length); + List<IBuilder> 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<IProject, Set<String>> fMap = new HashMap<IProject, Set<String>>(); + Map<IProject, Set<String>> fMap = new HashMap<>(); public Set<String> getCfgIdSet(IProject project, boolean create) { Set<String> set = fMap.get(project); if (set == null && create) { - set = new HashSet<String>(); + set = new HashSet<>(); fMap.put(project, set); } return set; @@ -326,7 +326,7 @@ public class CommonBuilder extends ACBuilder { }; OtherConfigVerifier(IBuilder builders[], IConfiguration allCfgs[]) { - Set<IConfiguration> buildCfgSet = new HashSet<IConfiguration>(); + Set<IConfiguration> 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<IPath> list = new ArrayList<IPath>(builders.length); + List<IPath> 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<IConfiguration> cfgList = new ArrayList<IConfiguration>(cfgs.length); + List<IConfiguration> cfgList = new ArrayList<>(cfgs.length); for (IConfiguration cfg : cfgs) { IProject project = cfg.getOwner().getProject(); Set<String> set = fBuildSet.getCfgIdSet(project, true); @@ -593,7 +593,7 @@ public class CommonBuilder extends ACBuilder { } private IConfiguration[] getReferencedConfigs(IBuilder[] builders) { - Set<IConfiguration> set = new HashSet<IConfiguration>(); + Set<IConfiguration> 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<IProject> getProjectsSet(IConfiguration[] cfgs) { if (cfgs.length == 0) - return new HashSet<IProject>(0); + return new HashSet<>(0); - Set<IProject> set = new HashSet<IProject>(); + Set<IProject> 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<String> fConsoleMessages = new ArrayList<String>(); + private final List<String> 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<IPath> srcPathList = new ArrayList<IPath>(); - excludeList = new ArrayList<IPath>(); + List<IPath> 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<IPath, ICSourceEntry> map = new LinkedHashMap<IPath, ICSourceEntry>(); + Map<IPath, ICSourceEntry> 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<IPath> srcPathList = new ArrayList<IPath>(); - excludeList = new ArrayList<IPath>(); + List<IPath> 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<IPath, Map<String, String>> toolIdMap = new HashMap<IPath, Map<String, String>>(); + Map<IPath, Map<String, String>> 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<String>(); + 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<String> ids = new ArrayList<String>(); + List<String> 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<ICSettingEntry> entries = new LinkedHashSet<ICSettingEntry>( + Set<ICSettingEntry> 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<String> oldSet = contributeErrorParsers(null, false); if (oldSet == null) - oldSet = new LinkedHashSet<String>(); + 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<String> objs = new Vector<String>(); + Vector<String> 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<String> libs = new Vector<String>(); + Vector<String> 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<ICSettingEntry> list = new ArrayList<ICSettingEntry>(entries.length + 1); + List<ICSettingEntry> 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<String> list = new ArrayList<String>(); + List<String> 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<String> list = new ArrayList<String>(); + List<String> 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<String> list = new ArrayList<String>(); + List<String> 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<IToolReference> allToolRefs = new Vector<IToolReference>(target.getLocalToolReferences()); + List<IToolReference> 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<ITool> tools = new Vector<ITool>(localTools.length); + Vector<ITool> 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<IToolReference> getLocalToolReferences() { if (toolReferences == null) { - toolReferences = new ArrayList<IToolReference>(); + 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<ITool> validTools = new ArrayList<ITool>(); + List<ITool> 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<OptionReference> getOptionReferences(ITool tool) { - List<OptionReference> references = new ArrayList<OptionReference>(); + List<OptionReference> 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<IConfiguration> oldSet = new HashSet<IConfiguration>(Arrays.asList(cfgs)); - Set<IConfiguration> updatedSet = new HashSet<IConfiguration>(Arrays.asList(updatedCfgs)); - Set<IConfiguration> oldSetCopy = new HashSet<IConfiguration>(oldSet); + Set<IConfiguration> oldSet = new HashSet<>(Arrays.asList(cfgs)); + Set<IConfiguration> updatedSet = new HashSet<>(Arrays.asList(updatedCfgs)); + Set<IConfiguration> 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<Tool> tools = new Vector<Tool>(localTools.length); + Vector<Tool> 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<CLanguageData> list = new ArrayList<CLanguageData>(); + List<CLanguageData> 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<String, String> typeIdsToMap(String[] ids, IBuildObjectProperties props) { - Map<String, String> map = new HashMap<String, String>(ids.length); + Map<String, String> 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<String, String> propsToMap(IBuildProperty props[]) { - Map<String, String> map = new HashMap<String, String>(props.length); + Map<String, String> 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<String> list = new ArrayList<String>(); + List<String> 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<String> list = new ArrayList<String>(); + List<String> 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<String> list = new ArrayList<String>(); + List<String> 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<String, String> requiredMap = new HashMap<String, String>(); - Map<String, String> unsupportedMap = new HashMap<String, String>(); - Set<String> undefinedSet = new HashSet<String>(); + Map<String, String> requiredMap = new HashMap<>(); + Map<String, String> unsupportedMap = new HashMap<>(); + Set<String> 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<String> getRequiredUnspecifiedProperties() { IBuildObjectProperties props = null; - Set<String> set = new HashSet<String>(); + Set<String> 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<ITool> set = new HashSet<ITool>(Arrays.asList(tools2)); - List<ITool[]> list = new ArrayList<ITool[]>(tools1.length); + HashSet<ITool> set = new HashSet<>(Arrays.asList(tools2)); + List<ITool[]> 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<Object, ITool> createRealToExtToolMap(ITool[] tools, boolean extValues) { - LinkedHashMap<Object, ITool> map = new LinkedHashMap<Object, ITool>(); + LinkedHashMap<Object, ITool> map = new LinkedHashMap<>(); for (ITool t : tools) { Tool realTool = (Tool) ManagedBuildManager.getRealTool(t); MatchKey<Tool> key = realTool.getMatchKey(); @@ -993,7 +993,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { if (!isRoot()) return; - Set<String> set = new HashSet<String>(); + Set<String> 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<String> extsSet = new HashSet<String>(Arrays.asList(exts)); + Set<String> 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<String> getToolOutputVars(ITool tool) { - Set<String> set = new HashSet<String>(); + Set<String> 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<ITool> set = new HashSet<ITool>(); + HashSet<ITool> set = new HashSet<>(); set.addAll(Arrays.asList(newTools)); - List<ITool[]> result = new ArrayList<ITool[]>(); + List<ITool[]> result = new ArrayList<>(); for (Iterator<ITool> iter = set.iterator(); iter.hasNext();) { ITool t = iter.next(); iter.remove(); HashSet<ITool> tmp = (HashSet<ITool>) set.clone(); - List<ITool> list = new ArrayList<ITool>(); + List<ITool> list = new ArrayList<>(); for (Iterator<ITool> 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<String> set1 = new HashSet<String>(Arrays.asList(ext1)); - Set<String> result = new HashSet<String>(); + Set<String> set1 = new HashSet<>(Arrays.asList(ext1)); + Set<String> 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<String, String> unspecifiedRequiredProps = new HashMap<String, String>(); - Map<String, String> unspecifiedProps = new HashMap<String, String>(); - Set<String> undefinedSet = new HashSet<String>(); + Map<String, String> unspecifiedRequiredProps = new HashMap<>(); + Map<String, String> unspecifiedProps = new HashMap<>(); + Set<String> undefinedSet = new HashSet<>(); IConfiguration cfg = getParent(); ITool[] nonManagedTools = null; if (cfg.isManagedBuildOn() && cfg.supportsBuild(true)) { - List<ITool> list = new ArrayList<ITool>(); + List<ITool> 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<IStatus> getGenerationProblems() { if (generationProblems == null) { - generationProblems = new Vector<IStatus>(); + generationProblems = new Vector<>(); } return generationProblems; } @@ -778,7 +778,7 @@ public class GeneratedMakefileBuilder extends ACBuilder { * @return */ protected String[] getMakeTargets(int buildType) { - List<String> args = new ArrayList<String>(); + List<String> 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<IResource> getResourcesToBuild() { if (resourcesToBuild == null) { - resourcesToBuild = new ArrayList<IResource>(); + 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<String> envList = new ArrayList<String>(); + ArrayList<String> 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<String> makeArgs = new ArrayList<String>(); + ArrayList<String> 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<IProject, List<IFile>> arrangeFilesByProject(List<IFile> files) { - Map<IProject, List<IFile>> projectMap = new HashMap<IProject, List<IFile>>(); + Map<IProject, List<IFile>> projectMap = new HashMap<>(); for (IFile file : files) { IProject project = file.getProject(); List<IFile> filesInProject = projectMap.get(project); if (filesInProject == null) { - filesInProject = new ArrayList<IFile>(); + 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<IBuildStep> dependentSteps = new HashSet<IBuildStep>(); + Set<IBuildStep> 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<IBuildStep> dependentSteps = new HashSet<IBuildStep>(); + Set<IBuildStep> 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<String> projectsToImport = new HashSet<String>(); + protected final Set<String> projectsToImport = new HashSet<>(); /** Tree of projects to recursively import */ - protected final Set<String> projectTreeToImport = new HashSet<String>(); + protected final Set<String> projectTreeToImport = new HashSet<>(); /** Set of project names to build */ - protected final Set<String> projectRegExToBuild = new HashSet<String>(); + protected final Set<String> projectRegExToBuild = new HashSet<>(); /** Set of project names to clean */ - protected final Set<String> projectRegExToClean = new HashSet<String>(); + protected final Set<String> projectRegExToClean = new HashSet<>(); protected boolean buildAll = false; protected boolean cleanAll = false; protected boolean disableIndexer = false; /** List of Tool Option values being set */ - protected List<ToolOption> toolOptions = new ArrayList<ToolOption>(); + protected List<ToolOption> toolOptions = new ArrayList<>(); /** Map from configuration ID -> Set of SavedToolOptions */ - protected Map<String, Set<SavedToolOption>> savedToolOptions = new HashMap<String, Set<SavedToolOption>>(); + protected Map<String, Set<SavedToolOption>> savedToolOptions = new HashMap<>(); protected boolean markerTypesDefault = true; protected boolean markerTypesAll = false; protected Set<String> markerTypes = new HashSet<>(); @@ -245,7 +245,7 @@ public class HeadlessBuilder implements IApplication { // Build this configuration for this project Set<ICConfigurationDescription> set = cfgMap.get(project); if (set == null) - set = new HashSet<ICConfigurationDescription>(); + 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<IProject, Set<ICConfigurationDescription>> configsToBuild = new HashMap<IProject, Set<ICConfigurationDescription>>(); + Map<IProject, Set<ICConfigurationDescription>> 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<String> listValue = new ArrayList<String>(); + List<String> listValue = new ArrayList<>(); switch (toolOption.operation) { case ToolOption.APPEND: listValue.addAll((List<String>) 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<ICSettingEntry> additionalSettings = new ArrayList<ICSettingEntry>(); + static List<ICSettingEntry> additionalSettings = new ArrayList<>(); public HeadlessBuilderExternalSettingsProvider() { } @@ -91,7 +91,7 @@ public class HeadlessBuilderExternalSettingsProvider extends CExternalSettingPro if (desc == null) continue; for (ICConfigurationDescription cfg : desc.getConfigurations()) { - ArrayList<String> extSettingIds = new ArrayList<String>( + ArrayList<String> extSettingIds = new ArrayList<>( Arrays.asList(cfg.getExternalSettingsProviderIds())); for (Iterator<String> 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<String, IOption> map = null; if (this.superClass == null) { - map = new LinkedHashMap<String, IOption>(); // 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<String> getCategoryIds() { if (categoryIds == null) { - categoryIds = new Vector<String>(); + categoryIds = new Vector<>(); } return categoryIds; } public void addChildCategory(IOptionCategory category) { if (childOptionCategories == null) - childOptionCategories = new ArrayList<IOptionCategory>(); + childOptionCategories = new ArrayList<>(); childOptionCategories.add(category); } @@ -431,7 +431,7 @@ public abstract class HoldsOptions extends BuildObject */ private Map<String, IOptionCategory> getCategoryMap() { if (categoryMap == null) { - categoryMap = new HashMap<String, IOptionCategory>(); + categoryMap = new HashMap<>(); } return categoryMap; } @@ -452,7 +452,7 @@ public abstract class HoldsOptions extends BuildObject */ private Map<String, Option> getOptionMap() { if (optionMap == null) { - optionMap = new LinkedHashMap<String, Option>(); + optionMap = new LinkedHashMap<>(); } return optionMap; } @@ -718,7 +718,7 @@ public abstract class HoldsOptions extends BuildObject @Override public String[] getRequiredTypeIds() { - List<String> list = new ArrayList<String>(); + List<String> 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<String> list = new ArrayList<String>(); + List<String> 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<String> list = new ArrayList<String>(); + List<String> 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<String> list = new ArrayList<String>(); + List<String> 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<String> list = new ArrayList<String>(); + List<String> 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<IContentType> types = new ArrayList<IContentType>(); + List<IContentType> 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<IPath> deps = new ArrayList<IPath>(); + List<IPath> 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<IPath> ins = new ArrayList<IPath>(); + List<IPath> 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<InputOrder> getInputOrderList() { if (inputOrderList == null) { - inputOrderList = new Vector<InputOrder>(); + inputOrderList = new Vector<>(); } return inputOrderList; } @@ -925,7 +925,7 @@ public class InputType extends BuildObject implements IInputType { */ private Vector<AdditionalInput> getAdditionalInputList() { if (additionalInputList == null) { - additionalInputList = new Vector<AdditionalInput>(); + 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<String>(); + dependencyExtensions = new ArrayList<>(); } } } @@ -1096,7 +1096,7 @@ public class InputType extends BuildObject implements IInputType { private List<String> getDependencyExtensionsList() { if (dependencyExtensions == null) { - dependencyExtensions = new ArrayList<String>(); + dependencyExtensions = new ArrayList<>(); } return dependencyExtensions; } @@ -1441,7 +1441,7 @@ public class InputType extends BuildObject implements IInputType { setRebuildState(true); } } else { - List<String> list = new ArrayList<String>(); + List<String> 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<String> list = new ArrayList<String>(); + List<String> 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<String> list = new ArrayList<String>(); + List<String> 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<IContentType> list = new ArrayList<IContentType>(); + List<IContentType> 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<String> configNames = new ArrayList<String>(); + ArrayList<String> 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<String> getIncludePathEntries() { // Extract the resolved paths from the project (if any) - ArrayList<String> paths = new ArrayList<String>(); + ArrayList<String> paths = new ArrayList<>(); if (cProject != null) { try { IPathEntry[] entries = cProject.getResolvedPathEntries(); @@ -426,7 +426,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { } private HashMap<String, String> getMacroPathEntries() { - HashMap<String, String> macros = new HashMap<String, String>(); + HashMap<String, String> macros = new HashMap<>(); if (cProject != null) { try { IPathEntry[] entries = cProject.getResolvedPathEntries(); @@ -1003,7 +1003,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { @Deprecated private Map<String, ITarget> getTargetMap() { if (targetMap == null) { - targetMap = new HashMap<String, ITarget>(); + targetMap = new HashMap<>(); } return targetMap; } @@ -1016,7 +1016,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { @Deprecated public List<ITarget> getTargets() { if (targetList == null) { - targetList = new ArrayList<ITarget>(); + targetList = new ArrayList<>(); } return targetList; } @@ -1106,7 +1106,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { * @return IPathEntry[] */ public IPathEntry[] getManagedBuildValues() { - List<IPathEntry> entries = new ArrayList<IPathEntry>(); + List<IPathEntry> 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<IPathEntry> entries = new ArrayList<IPathEntry>(); + List<IPathEntry> 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<IPathEntry> getOptionValues(int entryType, boolean builtIns) { - List<IPathEntry> entries = new ArrayList<IPathEntry>(); + List<IPathEntry> entries = new ArrayList<>(); IConfiguration cfg = getDefaultConfiguration(); // process config toolchain's options @@ -1286,7 +1286,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { protected List<IPathEntry> addPaths(List<IPathEntry> entries, String[] values, IPath resPath, int context, Object obj, int type) { if (values != null && values.length > 0) { - List<String> list = new ArrayList<String>(); + List<String> 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<IManagedConfigElement>(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<ICStorageElement> children = new ArrayList<ICStorageElement>(); + List<ICStorageElement> 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<Configuration> getConfigurationCollection() { synchronized (configMap) { - return new ArrayList<Configuration>(configMap.values()); + return new ArrayList<>(configMap.values()); } } @@ -658,7 +658,7 @@ public class ManagedProject extends BuildObject @Override public String[] getRequiredTypeIds() { - List<String> result = new ArrayList<String>(); + List<String> 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<String> result = new ArrayList<String>(); + List<String> 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<String> result = new ArrayList<String>(); + List<String> 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<MapStorageElement> fChildren = new ArrayList<MapStorageElement>(); + private List<MapStorageElement> fChildren = new ArrayList<>(); private String fValue; public MapStorageElement(String name, MapStorageElement parent) { fName = name; fParent = parent; - fMap = new HashMap<String, String>(); + fMap = new HashMap<>(); } public MapStorageElement(Map<String, String> map, MapStorageElement parent) { fName = map.get(getMapKey(NAME_KEY)); fValue = map.get(getMapKey(VALUE_KEY)); - fMap = new HashMap<String, String>(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<String> childrenStrList = new ArrayList<String>(size); + List<String> childrenStrList = new ArrayList<>(size); for (int i = 0; i < size; i++) { MapStorageElement child = fChildren.get(i); Map<String, String> childStrMap = child.toStringMap(); @@ -143,7 +143,7 @@ public class MapStorageElement implements ICStorageElement { @Override public ICStorageElement[] getChildrenByName(String name) { - List<ICStorageElement> children = new ArrayList<ICStorageElement>(); + List<ICStorageElement> 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<String, String> decodeMap(String value) { List<String> list = decodeList(value); - HashMap<String, String> map = new HashMap<String, String>(); + HashMap<String, String> 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<String> decodeList(String value) { - List<String> list = new ArrayList<String>(); + List<String> 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<String> list = new ArrayList<String>(fMap.size()); + List<String> list = new ArrayList<>(fMap.size()); Set<Entry<String, String>> entrySet = fMap.entrySet(); for (Entry<String, String> 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<String, String> fUnsupportedProperties = new HashMap<String, String>(); - private HashMap<String, String> fUnsupportedRequiredProperties = new HashMap<String, String>(); - private HashSet<String> fUndefinedProperties = new HashSet<String>(); + private HashMap<String, String> fUnsupportedProperties = new HashMap<>(); + private HashMap<String, String> fUnsupportedRequiredProperties = new HashMap<>(); + private HashSet<String> 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<IResourceInfo> ri = new ArrayList<IResourceInfo>(); + ArrayList<IResourceInfo> 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<ISettingsChangeListener> fListeners; private NotificationManager() { - fListeners = new CopyOnWriteArrayList<ISettingsChangeListener>(); + 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<OptionStringValue>(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<String>(option.applicableValuesList); - commandsMap = new HashMap<String, String>(option.commandsMap); - namesMap = new HashMap<String, String>(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<OptionStringValue> list = new ArrayList<OptionStringValue>( + ArrayList<OptionStringValue> list = new ArrayList<>( (ArrayList<OptionStringValue>) option.value); value = list; } if (option.defaultValue != null) { @SuppressWarnings("unchecked") - ArrayList<OptionStringValue> list = new ArrayList<OptionStringValue>( + ArrayList<OptionStringValue> list = new ArrayList<>( (ArrayList<OptionStringValue>) 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<String>(); + 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<OptionStringValue> vList = new ArrayList<OptionStringValue>(); - List<OptionStringValue> biList = new ArrayList<OptionStringValue>(); + List<OptionStringValue> vList = new ArrayList<>(); + List<OptionStringValue> 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<String, String> getCommandMap() { if (commandsMap == null) { - commandsMap = new HashMap<String, String>(); + commandsMap = new HashMap<>(); } return commandsMap; } @@ -1516,7 +1516,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest */ private Map<String, String> getNameMap() { if (namesMap == null) { - namesMap = new HashMap<String, String>(); + namesMap = new HashMap<>(); } return namesMap; } @@ -1794,7 +1794,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest return null; } - List<String> valueList = new ArrayList<String>(list.size()); + List<String> 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<OptionStringValue> lvList = new ArrayList<OptionStringValue>(list.size()); + List<OptionStringValue> 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<OptionStringValue>(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<String>(); + 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<String>(); + 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<OptionStringValue>(); - builtIns = new ArrayList<OptionStringValue>(); + 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<IOption.ITreeOption>(); + 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<IOption.ITreeOption>(); + 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<IOption.ITreeOption>(); + 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<OptionCategory>(); + 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<String> valueList = new ArrayList<String>(); + List<String> 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<String> valueList = new ArrayList<String>(); + List<String> 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<String> getBuiltInList() { if (builtIns == null) { - builtIns = new ArrayList<String>(); + builtIns = new ArrayList<>(); } return builtIns; } @Override public String[] getBuiltIns() { - List<String> answer = new ArrayList<String>(); + List<String> 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<String>(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<Configuration> getConfigurationList() { if (configList == null) { - configList = new ArrayList<Configuration>(); + configList = new ArrayList<>(); } return configList; } @@ -296,7 +296,7 @@ public class ProjectType extends BuildObject */ private Map<String, IConfiguration> getConfigurationMap() { if (configMap == null) { - configMap = new HashMap<String, IConfiguration>(); + configMap = new HashMap<>(); } return configMap; } @@ -768,7 +768,7 @@ public class ProjectType extends BuildObject @Override public String[] getRequiredTypeIds() { - List<String> result = new ArrayList<String>(); + List<String> result = new ArrayList<>(); List<Configuration> 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<String> result = new ArrayList<String>(); + List<String> result = new ArrayList<>(); List<Configuration> 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<String> result = new ArrayList<String>(); + List<String> result = new ArrayList<>(); List<Configuration> 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<String, Object>(); + 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<IProject, IManagedBuildInfo> fRmProjectToBuildInfoMap = new HashMap<IProject, IManagedBuildInfo>(); + private Map<IProject, IManagedBuildInfo> fRmProjectToBuildInfoMap = new HashMap<>(); private class ResourceConfigurationChecker implements IResourceDeltaVisitor { private IResourceDelta fRootDelta; - private HashMap<IProject, IManagedBuilderMakefileGenerator> fBuildFileGeneratorMap = new HashMap<IProject, IManagedBuilderMakefileGenerator>(); - private HashSet<IPath> fValidatedFilesSet = new HashSet<IPath>(); - private HashSet<IProject> fModifiedProjects = new HashSet<IProject>(); + private HashMap<IProject, IManagedBuilderMakefileGenerator> fBuildFileGeneratorMap = new HashMap<>(); + private HashSet<IPath> fValidatedFilesSet = new HashSet<>(); + private HashSet<IProject> 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<String, String> idMap = superClassIdMap.get(otherRcInfo.getPath()); if (idMap == null) { - idMap = new HashMap<String, String>(); + 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<ITool> getToolList() { if (toolList == null) { - toolList = new ArrayList<ITool>(); + toolList = new ArrayList<>(); } return toolList; } @@ -480,7 +480,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo { */ private Map<String, ITool> getToolMap() { if (toolMap == null) { - toolMap = new HashMap<String, ITool>(); + 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<CLanguageData> list = new ArrayList<CLanguageData>(); + List<CLanguageData> 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<IResourceInfo> getRcInfoList(final int kind, final boolean includeCurrent) { - final List<IResourceInfo> list = new ArrayList<IResourceInfo>(); + final List<IResourceInfo> 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<String, SupportedProperty> fSupportedProperties = new HashMap<String, SupportedProperty>(); + private HashMap<String, SupportedProperty> fSupportedProperties = new HashMap<>(); private class SupportedProperty { private boolean fIsRequired; - private Set<String> fValues = new HashSet<String>(); + private Set<String> fValues = new HashSet<>(); private String fId; SupportedProperty(String id) { @@ -118,7 +118,7 @@ public class SupportedProperties implements IBuildPropertiesRestriction { // if(type == null) // continue; - Set<String> set = new HashSet<String>(); + Set<String> 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<String> list = new ArrayList<String>(fSupportedProperties.size()); + List<String> list = new ArrayList<>(fSupportedProperties.size()); Collection<SupportedProperty> 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<String>(); + 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<String>(); + 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<IConfigurationV2> getConfigurationList() { if (configList == null) { - configList = new ArrayList<IConfigurationV2>(); + configList = new ArrayList<>(); } return configList; } @@ -420,7 +420,7 @@ public class Target extends BuildObject implements ITarget { */ private Map<String, IConfigurationV2> getConfigurationMap() { if (configMap == null) { - configMap = new HashMap<String, IConfigurationV2>(); + 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<String> list = new ArrayList<String>(tok.countTokens()); + List<String> 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<ToolReference> getLocalToolReferences() { if (toolReferences == null) { - toolReferences = new ArrayList<ToolReference>(); + toolReferences = new ArrayList<>(); } return toolReferences; } @@ -557,7 +557,7 @@ public class Target extends BuildObject implements ITarget { } protected List<OptionReference> getOptionReferences(ITool tool) { - List<OptionReference> references = new ArrayList<OptionReference>(); + List<OptionReference> 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<ITool> getToolList() { if (toolList == null) { - toolList = new ArrayList<ITool>(); + toolList = new ArrayList<>(); } return toolList; } @@ -669,7 +669,7 @@ public class Target extends BuildObject implements ITarget { */ private Map<String, ITool> getToolMap() { if (toolMap == null) { - toolMap = new HashMap<String, ITool>(); + toolMap = new HashMap<>(); } return toolMap; } @@ -698,7 +698,7 @@ public class Target extends BuildObject implements ITarget { */ @Override public ITool[] getTools() { - Vector<ITool> toolArray = new Vector<ITool>(); + Vector<ITool> 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<IToolReference> targetToolRefs = new Vector<IToolReference>(); + Vector<IToolReference> 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<String>(targetPlatform.osList); + osList = new ArrayList<>(targetPlatform.osList); } if (targetPlatform.archList != null) { - archList = new ArrayList<String>(targetPlatform.archList); + archList = new ArrayList<>(targetPlatform.archList); } if (targetPlatform.binaryParserList != null) { - binaryParserList = new ArrayList<String>(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<String>(); + 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<String>(); + 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<String>(); + 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<String>(); + 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<String>(); + 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<String>(); + 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<String>(); + 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<String>(); + 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<String>(); + 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<IInputType, CLanguageData> typeToDataMap = new HashMap<IInputType, CLanguageData>(2); + private HashMap<IInputType, CLanguageData> typeToDataMap = new HashMap<>(2); private boolean fDataMapInited; private List<Tool> identicalList; - private HashMap<String, PathInfoCache> discoveredInfoMap = new HashMap<String, PathInfoCache>(2); + private HashMap<String, PathInfoCache> 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<String>(tool.inputExtensions); + inputExtensions = new ArrayList<>(tool.inputExtensions); } if (tool.interfaceExtensions != null) { - interfaceExtensions = new ArrayList<String>(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<IEnvVarBuildPath>(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<String>(tool.inputExtensions); + inputExtensions = new ArrayList<>(tool.inputExtensions); } if (interfaceExtensions == null && tool.interfaceExtensions != null) { - interfaceExtensions = new ArrayList<String>(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<IEnvVarBuildPath>(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<OutputType> list = new ArrayList<OutputType>(types.length); + List<OutputType> 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<InputType> list = new ArrayList<InputType>(types.length); + List<InputType> 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<InputType> getInputTypeList() { if (inputTypeList == null) { - inputTypeList = new Vector<InputType>(); + inputTypeList = new Vector<>(); } return inputTypeList; } @@ -1587,7 +1587,7 @@ public class Tool extends HoldsOptions */ private Map<String, InputType> getInputTypeMap() { if (inputTypeMap == null) { - inputTypeMap = new HashMap<String, InputType>(); + inputTypeMap = new HashMap<>(); } return inputTypeMap; } @@ -1602,7 +1602,7 @@ public class Tool extends HoldsOptions */ private Vector<OutputType> getOutputTypeList() { if (outputTypeList == null) { - outputTypeList = new Vector<OutputType>(); + outputTypeList = new Vector<>(); } return outputTypeList; } @@ -1612,7 +1612,7 @@ public class Tool extends HoldsOptions */ private Map<String, OutputType> getOutputTypeMap() { if (outputTypeMap == null) { - outputTypeMap = new HashMap<String, OutputType>(); + 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<String> list = new ArrayList<String>(tok.countTokens()); + List<String> list = new ArrayList<>(tok.countTokens()); while (tok.hasMoreElements()) { list.add(tok.nextToken()); } @@ -1740,7 +1740,7 @@ public class Tool extends HoldsOptions public Set<String> contributeErrorParsers(Set<String> set) { if (getErrorParserIds() != null) { if (set == null) - set = new HashSet<String>(); + 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<String> getInputExtensions() { String[] exts = getPrimaryInputExtensions(); - List<String> extList = new ArrayList<String>(); + List<String> 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<String>(); + inputExtensions = new ArrayList<>(); } } return inputExtensions; @@ -1776,7 +1776,7 @@ public class Tool extends HoldsOptions private List<String> getInputExtensionsList() { if (inputExtensions == null) { - inputExtensions = new ArrayList<String>(); + 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<String> allExts = new ArrayList<String>(); + List<String> 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<IPath> allDeps = new ArrayList<IPath>(); + List<IPath> 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<IPath> inputs = new ArrayList<IPath>(); + List<IPath> 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<IPath> allRes = new ArrayList<IPath>(); + List<IPath> 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<String> allExts = new ArrayList<String>(); + List<String> 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<String>(); + interfaceExtensions = new ArrayList<>(); } } } @@ -2008,7 +2008,7 @@ public class Tool extends HoldsOptions private List<String> getInterfaceExtensionsList() { if (interfaceExtensions == null) { - interfaceExtensions = new ArrayList<String>(); + 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<String> allExts = new ArrayList<String>(); + List<String> 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<String> flags = new ArrayList<String>(); + ArrayList<String> 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<IEnvVarBuildPath>(); + envVarBuildPathList = new ArrayList<>(); envVarBuildPathList.add(path); } @@ -3564,7 +3564,7 @@ public class Tool extends HoldsOptions } private List<IInputType> getLanguageInputTypes() { - List<IInputType> list = new ArrayList<IInputType>(); + List<IInputType> 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<Tool>(this); + return new MatchKey<>(this); } @Override @@ -3858,7 +3858,7 @@ public class Tool extends HoldsOptions supported = props.getSupportedTypeIds(); } else { BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator(); - List<String> list = new ArrayList<String>(); + List<String> 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<String> list = new ArrayList<String>(); + List<String> 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<String> oldSet = contributeErrorParsers(null); if (oldSet == null) - oldSet = new HashSet<String>(); + 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<IOption> list = new ArrayList<IOption>(); + List<IOption> 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<Object> filterSet = new HashSet<Object>(); + Set<Object> filterSet = new HashSet<>(); for (IOption op : getOptionsOfType(opType)) { filterSet.addAll((List<Object>) 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<String>(toolChain.osList); + osList = new ArrayList<>(toolChain.osList); } if (toolChain.archList != null) { - archList = new ArrayList<String>(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<String, String> idMap = superIdMap.get(otherRcInfo.getPath()); if (idMap == null) { - idMap = new HashMap<String, String>(); + 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<String>(); + 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<String>(); + 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<String>(); + 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<String>(); + 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<Tool> list = new ArrayList<Tool>(tools.length); + List<Tool> 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<ITool> retTools = new ArrayList<ITool>(); + List<ITool> 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<Tool> getToolList() { if (toolList == null) { - toolList = new ArrayList<Tool>(); + toolList = new ArrayList<>(); } return toolList; } @@ -1095,7 +1095,7 @@ public class ToolChain extends HoldsOptions */ private Map<String, Tool> getToolMap() { if (toolMap == null) { - toolMap = new HashMap<String, Tool>(); + 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<String> list = new ArrayList<String>(tok.countTokens()); + List<String> 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<String> list = new ArrayList<String>(tok.countTokens()); + List<String> 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<String>(); + 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<String>(); + 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<String>(); + archList = new ArrayList<>(); } else { archList.clear(); } @@ -2284,7 +2284,7 @@ public class ToolChain extends HoldsOptions return null; if (!isExtensionToolChain) return null; - return new MatchKey<ToolChain>(this); + return new MatchKey<>(this); } @Override @@ -2339,7 +2339,7 @@ public class ToolChain extends HoldsOptions public String[] getRequiredTypeIds(boolean checkTools) { SupportedProperties props = findSupportedProperties(); - List<String> result = new ArrayList<String>(); + List<String> 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<String> result = new ArrayList<String>(); + List<String> 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<String> result = new ArrayList<String>(); + List<String> 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<String> oldSet = contributeErrorParsers(info, null, false); if (oldSet == null) - oldSet = new HashSet<String>(); + 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<String>(); + unusedChildrenSet = new HashSet<>(); else { - unusedChildrenSet = new HashSet<String>(); + 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<ITool> resultingList = new ArrayList<ITool>(); + List<ITool> 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<ToolInfo> resultingList = new ArrayList<ToolInfo>(); - List<ToolInfo> addedList = new ArrayList<ToolInfo>(7); - List<ToolInfo> remainedList = new ArrayList<ToolInfo>(7); - List<ToolInfo> removedList = new ArrayList<ToolInfo>(7); - List<ITool> removedToolsList = new ArrayList<ITool>(7); + List<ToolInfo> resultingList = new ArrayList<>(); + List<ToolInfo> addedList = new ArrayList<>(7); + List<ToolInfo> remainedList = new ArrayList<>(7); + List<ToolInfo> removedList = new ArrayList<>(7); + List<ITool> 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<ITool, ConverterInfo> calculateConverterTools(IResourceInfo rcInfo, ToolInfo[] removed, ToolInfo[] added, List<ToolInfo> remainingRemoved, List<ToolInfo> remainingAdded) { if (remainingAdded == null) - remainingAdded = new ArrayList<ToolInfo>(added.length); + remainingAdded = new ArrayList<>(added.length); if (remainingRemoved == null) - remainingRemoved = new ArrayList<ToolInfo>(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<ITool, ConverterInfo> resultMap = new HashMap<ITool, ConverterInfo>(); + Map<ITool, ConverterInfo> resultMap = new HashMap<>(); for (Iterator<ToolInfo> 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<ITool> getResultingToolList(List<ITool> list) { if (list == null) - list = new ArrayList<ITool>(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<IModificationStatus> statusList = new ArrayList<IModificationStatus>(); + List<IModificationStatus> statusList = new ArrayList<>(); ToolInfo[][] conflictInfos = calculateConflictingTools(fResultingTools); ITool[][] conflicting = toToolArray(conflictInfos, true); - Map<String, String> unspecifiedRequiredProps = new HashMap<String, String>(); - Map<String, String> unspecifiedProps = new HashMap<String, String>(); - Set<String> undefinedSet = new HashSet<String>(); + Map<String, String> unspecifiedRequiredProps = new HashMap<>(); + Map<String, String> unspecifiedProps = new HashMap<>(); + Set<String> undefinedSet = new HashSet<>(); IConfiguration cfg = fRcInfo.getParent(); ITool[] nonManagedTools = null; if (cfg.isManagedBuildOn() && cfg.supportsBuild(true)) { - List<ITool> list = new ArrayList<ITool>(); + List<ITool> 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<ITool, ToolInfo> map = createInitialToolToToolInfoMap(infos); - ITool[] tools = new ArrayList<ITool>(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<ITool, ToolInfo> createInitialToolToToolInfoMap(ToolInfo[] infos) { - Map<ITool, ToolInfo> map = new LinkedHashMap<ITool, ToolInfo>(); + Map<ITool, ToolInfo> 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<ToolInfo> set = new HashSet<ToolInfo>(); + HashSet<ToolInfo> set = new HashSet<>(); set.addAll(Arrays.asList(infos)); - List<ToolInfo[]> result = new ArrayList<ToolInfo[]>(); + List<ToolInfo[]> result = new ArrayList<>(); for (Iterator<ToolInfo> iter = set.iterator(); iter.hasNext();) { ToolInfo ti = iter.next(); ITool t = ti.getInitialTool(); iter.remove(); @SuppressWarnings("unchecked") HashSet<ToolInfo> tmp = (HashSet<ToolInfo>) set.clone(); - List<ITool> list = new ArrayList<ITool>(); + List<ITool> list = new ArrayList<>(); for (Iterator<ToolInfo> 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<String> set1 = new HashSet<String>(Arrays.asList(ext1)); - Set<String> result = new HashSet<String>(); + Set<String> set1 = new HashSet<>(Arrays.asList(ext1)); + Set<String> 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<String> getInputExtensions() { String[] exts = getPrimaryInputExtensions(); - List<String> extList = new ArrayList<String>(); + List<String> 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<String> getOutputsList() { - ArrayList<String> answer = new ArrayList<String>(); + ArrayList<String> 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<OptionReference> getOptionReferenceList() { if (optionReferences == null) { - optionReferences = new ArrayList<OptionReference>(); + 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<EmptyEntryInfo> emptyEntryInfos = new ArrayList<EmptyEntryInfo>(); + List<EmptyEntryInfo> 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<EmptyEntryInfo> emptyValuesInfos) { IOption options[] = fLangData.getOptionsForKind(getKind()); if (options.length > 0) { - List<UserEntryInfo> entryList = new ArrayList<UserEntryInfo>(); + List<UserEntryInfo> 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<UserEntryInfo> sequense = isMultiple ? new ArrayList<UserEntryInfo>(rVes.length) + List<UserEntryInfo> 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<String> list = (List<String>) option.getValue(); if (list.size() != 0) { if (set == null) - set = new HashSet<String>(); + set = new HashSet<>(); set.addAll(list); } } @@ -709,7 +709,7 @@ public class BuildEntryStorage extends AbstractEntryStorage { if (emptyEntryInfos == null || emptyEntryInfos.size() == 0) return infos; - LinkedList<UserEntryInfo> list = new LinkedList<UserEntryInfo>(); + LinkedList<UserEntryInfo> 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<UserEntryInfo> list = new ArrayList<UserEntryInfo>(infos.length); + List<UserEntryInfo> 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<String>(); + 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<BuildEntryStorage> fKindToEntryStore = new KindBasedStore<BuildEntryStorage>(); + private KindBasedStore<BuildEntryStorage> fKindToEntryStore = new KindBasedStore<>(); /** Indicates that the option array stores have been inited */ private volatile boolean fOptionStoreInited; - private KindBasedStore<IOption[]> fKindToOptionArrayStore = new KindBasedStore<IOption[]>(); - private KindBasedStore<IOption[]> fKindToUndefOptionArrayStore = new KindBasedStore<IOption[]>(); + private KindBasedStore<IOption[]> fKindToOptionArrayStore = new KindBasedStore<>(); + private KindBasedStore<IOption[]> 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<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> 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<Integer, List<IOption>> kindToOptionList = new HashMap<Integer, List<IOption>>(); + Map<Integer, List<IOption>> 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<Integer, List<IOption>> kindToOptionList = new HashMap<Integer, List<IOption>>(); + Map<Integer, List<IOption>> 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<String> newSrc = new ArrayList<String>(ids.length); - List<String> newHeaders = new ArrayList<String>(ids.length); + List<String> newSrc = new ArrayList<>(ids.length); + List<String> 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<String> fFileVarsSet = new HashSet<String>( + private static final Set<String> fFileVarsSet = new HashSet<>( Arrays.asList(MbsMacroSupplier.getInstance().getMacroNames(IBuildMacroProvider.CONTEXT_FILE))); - private static final Set<String> fOptionVarsSet = new HashSet<String>( + private static final Set<String> fOptionVarsSet = new HashSet<>( Arrays.asList(MbsMacroSupplier.getInstance().getMacroNames(IBuildMacroProvider.CONTEXT_OPTION))); - private static final Set<String> fToolVarsSet = new HashSet<String>( + private static final Set<String> 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<Object, ILanguageDescriptor[]> map) { IToolChain tch = info.getToolChain(); - Map<String, ILanguageDescriptor> langMap = new HashMap<String, ILanguageDescriptor>(); + Map<String, ILanguageDescriptor> 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<String> landTypes = new HashSet<String>(Arrays.asList(cTypeIds)); + Set<String> landTypes = new HashSet<>(Arrays.asList(cTypeIds)); landTypes.removeAll(Arrays.asList(srcIds)); landTypes.removeAll(Arrays.asList(hIds)); if (landTypes.size() != 0) { - List<String> srcList = new ArrayList<String>(); + List<String> 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<String, ILanguageDescriptor> langMap, Map<Object, ILanguageDescriptor[]> cTypeToLangMap) { ITool extTool = ManagedBuildManager.getExtensionTool(PREF_TOOL_ID); - List<ILanguageDescriptor> list = new ArrayList<ILanguageDescriptor>(langMap.values()); + List<ILanguageDescriptor> 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<String> natureSet = new HashSet<String>(Arrays.asList(eDes.getNatureIds())); + Set<String> 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<String> natureSet = new HashSet<String>(Arrays.asList(eDes.getNatureIds())); + Set<String> 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<ICommand> list = new ArrayList<ICommand>(Arrays.asList(cmds)); + List<ICommand> list = new ArrayList<>(Arrays.asList(cmds)); ICommand makeBuilderCmd = null; for (Iterator<ICommand> iter = list.iterator(); iter.hasNext();) { ICommand cmd = iter.next(); @@ -365,7 +365,7 @@ public class ProjectConverter implements ICProjectConverter { Map<String, String> fromMap = fromTarget.getEnvironment(); if (fromMap != null) - toTarget.setEnvironment(new HashMap<String, String>(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<IPathEntry> list = new ArrayList<IPathEntry>(Arrays.asList(entries)); + List<IPathEntry> list = new ArrayList<>(Arrays.asList(entries)); for (Iterator<IPathEntry> 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<String, String> map = new HashMap<String, String>(projPaths.length); + Map<String, String> 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<String> set = new HashSet<String>(Arrays.asList(natureIds)); + Set<String> 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<String, Map<String, Boolean>> fRcMap = new HashMap<String, Map<String, Boolean>>(); + private Map<String, Map<String, Boolean>> fRcMap = new HashMap<>(); private boolean fProjectOnly; public ResourcePropertyHolder(boolean projectOnly) { @@ -88,7 +88,7 @@ class ResourcePropertyHolder extends ResourceChangeHandlerBase { String key = keyForResource(rc); Map<String, Boolean> map = fRcMap.get(key); if (map == null && create) { - map = new HashMap<String, Boolean>(); + 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<String, Boolean> fMap = new HashMap<String, Boolean>(); + private HashMap<String, Boolean> 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<String> list = new ArrayList<String>(fMap.size()); + ArrayList<String> list = new ArrayList<>(fMap.size()); Set<Entry<String, Boolean>> entrySet = fMap.entrySet(); for (Entry<String, Boolean> 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<String, Set<String>> getReferencedProperties(Map<String, Set<String>> map) { IBooleanExpression children[] = getChildren(); if (map == null) - map = new HashMap<String, Set<String>>(); + 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<String> set = map.get(prop); if (set == null) { - set = new HashSet<String>(); + 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<String> list = new ArrayList<String>(); + List<String> 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<String> list = new ArrayList<String>(); + List<String> list = new ArrayList<>(); for (ITool tool : tools) { IEnvVarBuildPath pathDescriptors[] = tool.getEnvVarBuildPaths(); @@ -237,7 +237,7 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider */ private List<IEnvironmentBuildPathsChangeListener> getListeners() { if (fListeners == null) - fListeners = new ArrayList<IEnvironmentBuildPathsChangeListener>(); + 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<IBuildEnvironmentVariable> variables = new ArrayList<IBuildEnvironmentVariable>(2); + List<IBuildEnvironmentVariable> 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<String> list = new ArrayList<String>(); + List<String> 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<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> 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<ICdtVariableSupplier> list = new ArrayList<ICdtVariableSupplier>(suppliers.length); + List<ICdtVariableSupplier> 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<String> set = new HashSet<String>(); + Set<String> 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<String> getCaseInsensitiveReferencedNames() { if (fCaseInsensitiveReferencedNames == null) - fCaseInsensitiveReferencedNames = new HashSet<String>(); + 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<ICdtVariable> fMacrosList = new ArrayList<ICdtVariable>(); + private List<ICdtVariable> 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<String, String> fValues = new HashMap<String, String>(); - private HashMap<String, String> fAllValues = new HashMap<String, String>(); + private HashMap<String, String> fValues = new HashMap<>(); + private HashMap<String, String> 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<IPathEntry>(); + entries = new Vector<>(); } protected void addDefinedSymbols(Map<String, String> 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<IBuilder, BuilderCompatibilityInfoElement>(); - fInCompatibleBuilders = new HashMap<IBuilder, BuilderCompatibilityInfoElement>(); + 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<IBuilder> l = new ArrayList<IBuilder>(fCompatibleBuilders.size()); + List<IBuilder> l = new ArrayList<>(fCompatibleBuilders.size()); IConfiguration cfg = getResourceInfo().getParent(); Set<IBuilder> 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<IRealBuildObjectAssociation, Conflict>(); + fConflictStorage = new PerTypeMapStorage<>(); if (fConflictMatchList != null && fConflictMatchList.size() != 0) { int size = fConflictMatchList.size(); - PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> result = new PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>>(); + PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> 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<IPath> set = cur.get(bo); if (set == null) { - set = new TreeSet<IPath>(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<Conflict> list = new ArrayList<Conflict>(); + List<Conflict> list = new ArrayList<>(); for (int i = 0; i < types.length; i++) { Map<IRealBuildObjectAssociation, Conflict> map = fConflictStorage.getMap(types[i], false); if (map == null) @@ -143,7 +143,7 @@ public class ConflictSet { private static List<Conflict> getConflicts(Map<IRealBuildObjectAssociation, Conflict> map, List<Conflict> list) { if (list == null) - list = new ArrayList<Conflict>(); + list = new ArrayList<>(); Collection<Conflict> 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<IPath> getToolApplicabilityPathSet(Tool realTool, boolean isProject) { if (fApplPathSet == null) { - Set<IPath> s = new HashSet<IPath>(1); + Set<IPath> 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<IPath> fFileInfoPaths = new HashSet<IPath>(); - private Set<IPath> fFolderInfoPaths = new HashSet<IPath>(); - private Map<Tool, Set<IPath>> fToolPathMap = new HashMap<Tool, Set<IPath>>(); + private Set<IPath> fFileInfoPaths = new HashSet<>(); + private Set<IPath> fFolderInfoPaths = new HashSet<>(); + private Map<Tool, Set<IPath>> fToolPathMap = new HashMap<>(); } public static class ToolChainCompatibilityInfoElement { @@ -143,7 +143,7 @@ public class FolderInfoModification extends ToolListModification implements IFol initCompatibilityInfo(); FolderInfo foInfo = (FolderInfo) getResourceInfo(); - List<ToolChain> l = new ArrayList<ToolChain>(fCompatibleToolChains.size()); + List<ToolChain> l = new ArrayList<>(fCompatibleToolChains.size()); Set<ToolChain> 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<ToolChain, ToolChainCompatibilityInfoElement>(); - fInCompatibleToolChains = new HashMap<ToolChain, ToolChainCompatibilityInfoElement>(); + 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<String>(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<Tool> getExtensionConflictToolSet(Tool tool, Tool[] tools) { String exts[] = tool.getPrimaryInputExtensions(); - Set<String> extsSet = new HashSet<String>(Arrays.asList(exts)); + Set<String> extsSet = new HashSet<>(Arrays.asList(exts)); Set<Tool> 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<Tool>(); + 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<IPath> set = new HashSet<IPath>(); + Set<IPath> 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<IRealBuildObjectAssociation> getRealBuildObjects(Collection<IRealBuildObjectAssociation> set) { if (set == null) - set = new HashSet<IRealBuildObjectAssociation>(); + 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<IPath> { SortedMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> result = next != null ? map.subMap(start, next) : map.tailMap(start); if (copy) - result = new TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>>(result); + result = new TreeMap<>(result); return result; } @@ -92,14 +92,14 @@ public class PathComparator implements Comparator<IPath> { IPath next = getNext(path); SortedSet<IPath> result = next != null ? set.subSet(start, next) : set.tailSet(start); if (copy) - result = new TreeSet<IPath>(result); + result = new TreeSet<>(result); return result; } public static SortedSet<IPath> getDirectChildPathSet(SortedSet<IPath> set, IPath path) { //all children SortedSet<IPath> children = getChildPathSet(set, path, false, false); - SortedSet<IPath> result = new TreeSet<IPath>(INSTANCE); + SortedSet<IPath> 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<IPath> { //all children SortedMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> children = getChildPathMap(map, path, false, false); - SortedMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> result = new TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>>( + SortedMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> result = new TreeMap<>( INSTANCE); for (Iterator<Map.Entry<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>>> 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 <V> - the type of values in the map */ public class PerTypeMapStorage<K extends IRealBuildObjectAssociation, V> implements Cloneable { - private ObjectTypeBasedStorage<Map<K, V>> fStorage = new ObjectTypeBasedStorage<Map<K, V>>(); + private ObjectTypeBasedStorage<Map<K, V>> fStorage = new ObjectTypeBasedStorage<>(); public Map<K, V> getMap(int type, boolean create) { Map<K, V> map = fStorage.get(type); @@ -39,7 +39,7 @@ public class PerTypeMapStorage<K extends IRealBuildObjectAssociation, V> impleme protected Map<K, V> createMap(Map<K, V> map) { if (map == null) { - return new HashMap<K, V>(); + return new HashMap<>(); } @SuppressWarnings("unchecked") Map<K, V> clone = (Map<K, V>) ((HashMap<K, V>) 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<T> implements Cloneable { - private ObjectTypeBasedStorage<Set<T>> fStorage = new ObjectTypeBasedStorage<Set<T>>(); + private ObjectTypeBasedStorage<Set<T>> fStorage = new ObjectTypeBasedStorage<>(); public Set<T> getSet(int type, boolean create) { Set<T> set = fStorage.get(type); @@ -30,7 +30,7 @@ public class PerTypeSetStorage<T> implements Cloneable { protected Set<T> createSet(Set<T> set) { if (set == null) - return new LinkedHashSet<T>(); + return new LinkedHashSet<>(); @SuppressWarnings("unchecked") Set<T> clone = (Set<T>) ((LinkedHashSet<T>) 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<IRealBuildObjectAssociation, Set<IPath>> createChildObjectsRealToolToPathSet( FolderInfo foInfo, Map<IRealBuildObjectAssociation, Set<IPath>> toolChainMap, Map<IRealBuildObjectAssociation, Set<IPath>> toolsMap, boolean addSkipPaths) { - PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage = new PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>>(); + PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage = new PerTypeMapStorage<>(); IToolChain tc = foInfo.getToolChain(); IToolChain rTc = ManagedBuildManager.getRealToolChain(tc); @@ -98,7 +98,7 @@ public class TcModificationUtil { public static PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> createParentObjectsRealToolToPathSet( final FolderInfo foInfo) { - PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage = new PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>>(); + PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> 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<IRealBuildObjectAssociation, Set<IPath>> map = storage.getMap(IRealBuildObjectAssociation.OBJECT_BUILDER, true); - Set<IPath> pathSet = new TreeSet<IPath>(PathComparator.INSTANCE); + Set<IPath> 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<IPath>(PathComparator.INSTANCE); + pathSet = new TreeSet<>(PathComparator.INSTANCE); pathSet.add(p); map.put(realCfg, pathSet); if (!foInfo.isRoot()) { - Set<IResourceInfo> allRcInfos = new HashSet<IResourceInfo>(Arrays.asList(cfg.getResourceInfos())); + Set<IResourceInfo> 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<IRealBuildObjectAssociation, Set<IPath>> createRealToolToPathSet(IConfiguration cfg, PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> skipMapStorage, boolean addSkipPaths) { - PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage = new PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>>(); + PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage = new PerTypeMapStorage<>(); FolderInfo rf = (FolderInfo) cfg.getRootFolderInfo(); IPath p = rf.getPath(); @@ -171,7 +171,7 @@ public class TcModificationUtil { } else { Map<IRealBuildObjectAssociation, Set<IPath>> map = storage .getMap(IRealBuildObjectAssociation.OBJECT_BUILDER, true); - Set<IPath> pathSet = new TreeSet<IPath>(PathComparator.INSTANCE); + Set<IPath> pathSet = new TreeSet<>(PathComparator.INSTANCE); pathSet.add(p); map.put((Builder) realBuilder, pathSet); } @@ -188,7 +188,7 @@ public class TcModificationUtil { } else { Map<IRealBuildObjectAssociation, Set<IPath>> map = storage .getMap(IRealBuildObjectAssociation.OBJECT_CONFIGURATION, true); - Set<IPath> pathSet = new TreeSet<IPath>(PathComparator.INSTANCE); + Set<IPath> 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<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> result = new TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>>( + TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> result = new TreeMap<>( PathComparator.INSTANCE); @SuppressWarnings("unchecked") TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> clone = (TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>>) initialMap @@ -234,10 +234,10 @@ public class TcModificationUtil { .clone(); storage = clone2; } else { - storage = new PerTypeSetStorage<IRealBuildObjectAssociation>(); + storage = new PerTypeSetStorage<>(); } } else if (resStorage == null || resStorage.isEmpty(true)) { - storage = new PerTypeSetStorage<IRealBuildObjectAssociation>(); + storage = new PerTypeSetStorage<>(); for (int i = 0; i < types.length; i++) { Set<IRealBuildObjectAssociation> set = initStorage.getSet(types[i], false); if (set != null && set.size() != 0) { @@ -247,7 +247,7 @@ public class TcModificationUtil { } else { Set<IRealBuildObjectAssociation> tcInitSet, resSet, setToStore; Set<IRealBuildObjectAssociation> bInitSet = null, tInitSet = null; - storage = new PerTypeSetStorage<IRealBuildObjectAssociation>(); + 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<IRealBuildObjectAssociation>(); + tInitSet = new LinkedHashSet<>(); TcModificationUtil.getRealObjectsSet((Tool[]) tc.getTools(), tInitSet); if (path.segmentCount() == 0) { - bInitSet = new LinkedHashSet<IRealBuildObjectAssociation>(); + bInitSet = new LinkedHashSet<>(); IBuilder builder = tc.getBuilder(); if (builder != null) { bInitSet.add((Builder) ManagedBuildManager.getRealBuilder(builder)); @@ -312,7 +312,7 @@ public class TcModificationUtil { PerTypeSetStorage<IRealBuildObjectAssociation> initStorage = entry.getValue(); if (!initStorage.isEmpty(true)) { - PerTypeSetStorage<IRealBuildObjectAssociation> storage = new PerTypeSetStorage<IRealBuildObjectAssociation>(); + PerTypeSetStorage<IRealBuildObjectAssociation> storage = new PerTypeSetStorage<>(); for (int i = 0; i < types.length; i++) { Set<IRealBuildObjectAssociation> set = initStorage.getSet(types[i], false); @@ -387,7 +387,7 @@ public class TcModificationUtil { public static Set<IRealBuildObjectAssociation> getRealObjectsSet(IRealBuildObjectAssociation[] objs, Set<IRealBuildObjectAssociation> set) { if (set == null) - set = new LinkedHashSet<IRealBuildObjectAssociation>(); + 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<? extends IRealBuildObjectAssociation, ? extends IRealBuildObjectAssociation> getRealToObjectsMap( IRealBuildObjectAssociation[] objs, Map<IRealBuildObjectAssociation, IRealBuildObjectAssociation> map) { if (map == null) - map = new LinkedHashMap<IRealBuildObjectAssociation, IRealBuildObjectAssociation>(); + 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<IPath> set = map.get(bo); if (set == null) { - set = new TreeSet<IPath>(PathComparator.INSTANCE); + set = new TreeSet<>(PathComparator.INSTANCE); map.put(bo, set); } return set; @@ -453,7 +453,7 @@ public class TcModificationUtil { public static <K, V> List<V> getArrayList(Map<K, List<V>> map, K obj) { List<V> list = map.get(obj); if (list == null) { - list = new ArrayList<V>(); + list = new ArrayList<>(); map.put(obj, list); } return list; @@ -528,7 +528,7 @@ public class TcModificationUtil { Set<IPath> objPaths = map.get(bo); if (objPaths == null) { - objPaths = new TreeSet<IPath>(PathComparator.INSTANCE); + objPaths = new TreeSet<>(PathComparator.INSTANCE); map.put(bo, objPaths); } @@ -538,7 +538,7 @@ public class TcModificationUtil { public static <T extends IRealBuildObjectAssociation> void addPath(Map<T, Set<IPath>> map, T bo, IPath path) { Set<IPath> objPaths = map.get(bo); if (objPaths == null) { - objPaths = new TreeSet<IPath>(PathComparator.INSTANCE); + objPaths = new TreeSet<>(PathComparator.INSTANCE); map.put(bo, objPaths); } @@ -572,7 +572,7 @@ public class TcModificationUtil { public static TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> createPathMap( PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage) { int[] types = ObjectTypeBasedStorage.getSupportedObjectTypes(); - TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> result = new TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>>( + TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> 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<IRealBuildObjectAssociation> oset = result.get(path); if (oset == null) { - oset = new PerTypeSetStorage<IRealBuildObjectAssociation>(); + 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<IRealBuildObjectAssociation>(); + 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<ConflictMatch> conflictList = new ArrayList<ConflictMatch>(); - Map<IRealBuildObjectAssociation, List<ConflictMatch>> objToConflictMatchMap = new HashMap<IRealBuildObjectAssociation, List<ConflictMatch>>(); + List<ConflictMatch> conflictList = new ArrayList<>(); + Map<IRealBuildObjectAssociation, List<ConflictMatch>> 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<IObjectSet> remainingList = new ArrayList<IObjectSet>(Arrays.asList(oss)); + List<IObjectSet> 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<IRealBuildObjectAssociation> skipSet2 = skip != null ? (Set<IRealBuildObjectAssociation>) skip.getSet(type, false) : null; - Set<IRealBuildObjectAssociation> matchingObjects = new HashSet<IRealBuildObjectAssociation>(); + Set<IRealBuildObjectAssociation> 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<ITool, List<ITool>>(); + fMap = new HashMap<>(); } // public class ValueIter { @@ -173,7 +173,7 @@ public class ToolListMap implements Cloneable { // } protected List<ITool> newList(int size) { - return new ArrayList<ITool>(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<String> fInputExtsSet = new HashSet<String>(); + private HashSet<String> fInputExtsSet = new HashSet<>(); private ResourceInfo fRcInfo; - private LinkedHashMap<Tool, IToolModification> fProjCompInfoMap = new LinkedHashMap<Tool, IToolModification>(); - private HashMap<Tool, IToolModification> fSysCompInfoMap = new HashMap<Tool, IToolModification>(); + private LinkedHashMap<Tool, IToolModification> fProjCompInfoMap = new LinkedHashMap<>(); + private HashMap<Tool, IToolModification> fSysCompInfoMap = new HashMap<>(); private Tool[] fAllSysTools; private HashSet<ITool> fFilteredOutSysTools; // private LinkedHashMap fRealToToolMap = new LinkedHashMap(); @@ -197,8 +197,8 @@ public abstract class ToolListModification implements IToolListModification { IRealBuildObjectAssociation.OBJECT_TOOL, (PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>>) storage); - fCompatibleTools = new HashMap<Tool, ToolCompatibilityInfoElement>(); - fInCompatibleTools = new HashMap<Tool, ToolCompatibilityInfoElement>(); + fCompatibleTools = new HashMap<>(); + fInCompatibleTools = new HashMap<>(); Tool sysTools[] = getTools(false, true); @SuppressWarnings("unchecked") Map<Tool, List<ConflictMatch>> conflictMap = (Map<Tool, List<ConflictMatch>>) conflicts.fObjToConflictListMap; @@ -247,7 +247,7 @@ public abstract class ToolListModification implements IToolListModification { fOperations = new ModificationOperation[0]; } } else { - List<ModificationOperation> opList = new ArrayList<ModificationOperation>( + List<ModificationOperation> opList = new ArrayList<>( fCompatibleTools.size() + 1); Set<Tool> 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<Tool, IToolModification> projMap = getMap(true); - List<ModificationOperation> opList = new ArrayList<ModificationOperation>(projMap.size()); + List<ModificationOperation> 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<Tool> getAddCompatibleSysTools() { if (fAddCapableTools == null) { - fAddCapableTools = new HashSet<Tool>(Arrays.asList(getAllSysTools())); + fAddCapableTools = new HashSet<>(Arrays.asList(getAllSysTools())); PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> 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<ITool> set = new HashSet<ITool>(Arrays.asList(allSys)); + HashSet<ITool> 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<ITool> list = new ArrayList<ITool>(); + List<ITool> 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<ITool, ITool> createRealToToolMap(/*boolean includeFilteredOut*/) { - HashMap<ITool, ITool> map = new HashMap<ITool, ITool>(); + HashMap<ITool, ITool> map = new HashMap<>(); Set<Entry<Tool, IToolModification>> entries = fProjCompInfoMap.entrySet(); for (Entry<Tool, IToolModification> 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<TypeToStringAssociation> fTypeAssociationStorage = new ObjectTypeBasedStorage<TypeToStringAssociation>(); - private static Map<String, TypeToStringAssociation> fStringAssociationStorage = new HashMap<String, TypeToStringAssociation>(); + private static ObjectTypeBasedStorage<TypeToStringAssociation> fTypeAssociationStorage = new ObjectTypeBasedStorage<>(); + private static Map<String, TypeToStringAssociation> 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<String>(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<String> set = new HashSet<String>(); + HashSet<String> 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<PatternTypeKey, PatternElement> patternMap = new HashMap<PatternTypeKey, PatternElement>(); + Map<PatternTypeKey, PatternElement> 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<MatchObjectElement, IObjectSet> fMatchObjectMap = new HashMap<MatchObjectElement, IObjectSet>(); + private Map<MatchObjectElement, IObjectSet> fMatchObjectMap = new HashMap<>(); private PerTypeMapStorage<IRealBuildObjectAssociation, Set<IRealBuildObjectAssociation>> fObjToChildSuperClassMap; private StarterJob fStarter; private boolean fIsStartInited; @@ -106,7 +106,7 @@ public class RulesManager { fConflictDefinitions = new ConflictDefinition[0]; } else { IExtension[] extensions = extensionPoint.getExtensions(); - List<ConflictDefinition> conflictDefs = new ArrayList<ConflictDefinition>(); + List<ConflictDefinition> 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<IRealBuildObjectAssociation> objectsSet = new HashSet<IRealBuildObjectAssociation>(); + HashSet<IRealBuildObjectAssociation> 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<IRealBuildObjectAssociation> list = new ArrayList<IRealBuildObjectAssociation>(); + List<IRealBuildObjectAssociation> 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<IRealBuildObjectAssociation> processPattern(int objType, PatternElement el, Set<IRealBuildObjectAssociation> set) { if (set == null) - set = new HashSet<IRealBuildObjectAssociation>(); + set = new HashSet<>(); String ids[] = el.getIds(); if (el.getSearchType() == PatternElement.TYPE_SEARCH_EXTENSION_OBJECT) { @@ -237,7 +237,7 @@ public class RulesManager { private Set<IRealBuildObjectAssociation> getChildSuperClassRealSet(IRealBuildObjectAssociation obj, IRealBuildObjectAssociation[] all) { if (fObjToChildSuperClassMap == null) - fObjToChildSuperClassMap = new PerTypeMapStorage<IRealBuildObjectAssociation, Set<IRealBuildObjectAssociation>>(); + fObjToChildSuperClassMap = new PerTypeMapStorage<>(); if (all == null) all = TcModificationUtil.getExtensionObjects(obj.getType()); @@ -256,7 +256,7 @@ public class RulesManager { private static Set<IRealBuildObjectAssociation> createChildSuperClassRealSet(IRealBuildObjectAssociation obj, IRealBuildObjectAssociation[] all, Set<IRealBuildObjectAssociation> set) { if (set == null) - set = new HashSet<IRealBuildObjectAssociation>(); + 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<String> options = new ArrayList<String>(); + List<String> 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<String> languageIds = getLanguageScope(); if (languageIds == null) { - languageIds = new ArrayList<String>(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<ICLanguageSettingEntry>(); + 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<IConsoleParser> parsers = new ArrayList<IConsoleParser>(); + List<IConsoleParser> 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<IEnvironmentVariable> vars = new ArrayList<IEnvironmentVariable>( + List<IEnvironmentVariable> 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<String, String> createEnvironmentMap(ICConfigurationDescription cfgDescription) { - Map<String, String> envMap = new HashMap<String, String>(); + Map<String, String> 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<String, String> environmentMap) { - Set<String> envp = new HashSet<String>(); + Set<String> envp = new HashSet<>(); for (Entry<String, String> 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<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); List<String> 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<IResource> findPathInFolder(IPath path, IContainer folder) { - List<IResource> paths = new ArrayList<IResource>(); + List<IResource> 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<String> referencedProjectsNames = new LinkedHashSet<String>(); + Set<String> referencedProjectsNames = new LinkedHashSet<>(); if (currentCfgDescription != null) { Map<String, String> 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<String> fileExts = new HashSet<String>(); + Set<String> 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<String> makeList(String line) { - List<String> list = new ArrayList<String>(); + List<String> 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<String, ITool> toolMap = new HashMap<String, ITool>(); + private Map<String, ITool> 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<String> options = new Vector<String>(); + Vector<String> 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<String, List<IPath>> buildSrcVars = new HashMap<String, List<IPath>>(); + private final HashMap<String, List<IPath>> buildSrcVars = new HashMap<>(); // Map of output file build variable names to a List of output file Path's - private final HashMap<String, List<IPath>> buildOutVars = new HashMap<String, List<IPath>>(); + private final HashMap<String, List<IPath>> buildOutVars = new HashMap<>(); // Map of dependency file build variable names to a List of GnuDependencyGroupInfo objects - private final HashMap<String, GnuDependencyGroupInfo> buildDepVars = new HashMap<String, GnuDependencyGroupInfo>(); - private final LinkedHashMap<String, String> topBuildOutVars = new LinkedHashMap<String, String>(); + private final HashMap<String, GnuDependencyGroupInfo> buildDepVars = new HashMap<>(); + private final LinkedHashMap<String, String> 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<String> depExts = new Vector<String>(); // Vector of dependency file extensions + Vector<String> 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<String> depExts = new Vector<String>(); // Vector of dependency file extensions + Vector<String> 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<String, List<String>> outputMacros = new HashMap<String, List<String>>(); + HashMap<String, List<String>> outputMacros = new HashMap<>(); // Add the predefined LIBS, USER_OBJS macros // Add the libraries this project depends on - valueList = new ArrayList<String>(); + 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<String>(); + 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<String> handledInputExtensions = new HashSet<String>(); + HashSet<String> 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<String> outputVarsAdditionsList = new ArrayList<String>(); + List<String> 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<String> subDirList = new ArrayList<String>(); + List<String> 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<String> managedProjectOutputs = new Vector<String>(refConfigs.length); + Vector<String> 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<String> inputs = new Vector<String>(); - Vector<String> dependencies = new Vector<String>(); - Vector<String> outputs = new Vector<String>(); - Vector<String> enumeratedPrimaryOutputs = new Vector<String>(); - Vector<String> enumeratedSecondaryOutputs = new Vector<String>(); - Vector<String> outputVariables = new Vector<String>(); - Vector<String> additionalTargets = new Vector<String>(); + Vector<String> inputs = new Vector<>(); + Vector<String> dependencies = new Vector<>(); + Vector<String> outputs = new Vector<>(); + Vector<String> enumeratedPrimaryOutputs = new Vector<>(); + Vector<String> enumeratedSecondaryOutputs = new Vector<>(); + Vector<String> outputVariables = new Vector<>(); + Vector<String> 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<String> addlOutputs = new Vector<String>(); + Vector<String> 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<String> calculateSecondaryOutputs(IOutputType[] secondaryOutputs) { ToolInfoHolder h = (ToolInfoHolder) toolInfos.getValue(); ITool[] buildTools = h.buildTools; - Vector<String> buildVars = new Vector<String>(); + Vector<String> 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<String, String> buildVarToRuleStringMap = new LinkedHashMap<String, String>(); + LinkedHashMap<String, String> 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<IPath> generatedOutputs = new Vector<IPath>(); // IPath's - build directory relative - Vector<IPath> generatedDepFiles = new Vector<IPath>(); // IPath's - build directory relative or absolute + Vector<IPath> generatedOutputs = new Vector<>(); // IPath's - build directory relative + Vector<IPath> 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<IPath> ruleOutputs = new Vector<IPath>(); - Vector<IPath> enumeratedPrimaryOutputs = new Vector<IPath>(); // IPaths relative to the top build directory - Vector<IPath> enumeratedSecondaryOutputs = new Vector<IPath>(); // IPaths relative to the top build directory + Vector<IPath> ruleOutputs = new Vector<>(); + Vector<IPath> enumeratedPrimaryOutputs = new Vector<>(); // IPaths relative to the top build directory + Vector<IPath> 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<String> inputs = new Vector<String>(); + Vector<String> 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<IPath> addlOutputs = new Vector<IPath>(); + Vector<IPath> 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<IPath> allRes = new ArrayList<IPath>(); + List<IPath> 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<String> outputList = new ArrayList<String>(); + List<String> 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<IPath> deps = new Vector<IPath>(); + Vector<IPath> 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<String>(); + 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<String> bufferTokens = new Vector<String>(Arrays.asList(inBufferString.split("\\s"))); //$NON-NLS-1$ - Vector<String> deps = new Vector<String>(bufferTokens.size()); + Vector<String> bufferTokens = new Vector<>(Arrays.asList(inBufferString.split("\\s"))); //$NON-NLS-1$ + Vector<String> deps = new Vector<>(bufferTokens.size()); Iterator<String> 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<String> handledDepsInputExtensions = new HashSet<String>(); - HashSet<String> handledOutsInputExtensions = new HashSet<String>(); + HashSet<String> handledDepsInputExtensions = new HashSet<>(); + HashSet<String> 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<String>(); + fileList = new Vector<>(); } fileList.add(path.toString()); } @@ -4045,7 +4045,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { */ protected Vector<String> getRuleList() { if (ruleList == null) { - ruleList = new Vector<String>(); + ruleList = new Vector<>(); } return ruleList; } @@ -4058,7 +4058,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { */ protected Vector<String> getDepLineList() { if (depLineList == null) { - depLineList = new Vector<String>(); + depLineList = new Vector<>(); } return depLineList; } @@ -4071,7 +4071,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { */ protected Vector<String> getDepRuleList() { if (depRuleList == null) { - depRuleList = new Vector<String>(); + depRuleList = new Vector<>(); } return depRuleList; } @@ -4358,21 +4358,21 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { */ private Vector<IResource> getDeletedDirList() { if (deletedDirList == null) { - deletedDirList = new Vector<IResource>(); + deletedDirList = new Vector<>(); } return deletedDirList; } private Vector<IResource> getDeletedFileList() { if (deletedFileList == null) { - deletedFileList = new Vector<IResource>(); + deletedFileList = new Vector<>(); } return deletedFileList; } private List<IPath> getDependencyMakefiles(ToolInfoHolder h) { if (h.dependencyMakefiles == null) { - h.dependencyMakefiles = new ArrayList<IPath>(); + h.dependencyMakefiles = new ArrayList<>(); } return h.dependencyMakefiles; } @@ -4401,7 +4401,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { */ private Vector<IResource> getInvalidDirList() { if (invalidDirList == null) { - invalidDirList = new Vector<IResource>(); + invalidDirList = new Vector<>(); } return invalidDirList; } @@ -4411,7 +4411,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { */ private Collection<IContainer> getModifiedList() { if (modifiedList == null) - modifiedList = new LinkedHashSet<IContainer>(); + modifiedList = new LinkedHashSet<>(); return modifiedList; } @@ -4420,7 +4420,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { */ private Collection<IContainer> getSubdirList() { if (subdirList == null) - subdirList = new LinkedHashSet<IContainer>(); + 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<String> commandInputs = new Vector<String>(); - private Vector<String> enumeratedInputs = new Vector<String>(); - private Vector<String> commandOutputs = new Vector<String>(); - private Vector<String> enumeratedPrimaryOutputs = new Vector<String>(); - private Vector<String> enumeratedSecondaryOutputs = new Vector<String>(); - private Vector<String> outputVariables = new Vector<String>(); - private Vector<String> commandDependencies = new Vector<String>(); - private Vector<String> additionalTargets = new Vector<String>(); + private Vector<String> commandInputs = new Vector<>(); + private Vector<String> enumeratedInputs = new Vector<>(); + private Vector<String> commandOutputs = new Vector<>(); + private Vector<String> enumeratedPrimaryOutputs = new Vector<>(); + private Vector<String> enumeratedSecondaryOutputs = new Vector<>(); + private Vector<String> outputVariables = new Vector<>(); + private Vector<String> commandDependencies = new Vector<>(); + private Vector<String> 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<String> myCommandInputs = new Vector<String>(); // Inputs for the tool command line - Vector<String> myCommandDependencies = new Vector<String>(); // Dependencies for the make rule - Vector<String> myEnumeratedInputs = new Vector<String>(); // Complete list of individual inputs + Vector<String> myCommandInputs = new Vector<>(); // Inputs for the tool command line + Vector<String> myCommandDependencies = new Vector<>(); // Dependencies for the make rule + Vector<String> myEnumeratedInputs = new Vector<>(); // Complete list of individual inputs IInputType[] inTypes = tool.getInputTypes(); if (inTypes != null && inTypes.length > 0) { for (IInputType type : inTypes) { - Vector<String> itCommandInputs = new Vector<String>(); // Inputs for the tool command line for this input-type - Vector<String> itCommandDependencies = new Vector<String>(); // Dependencies for the make rule for this input-type - Vector<String> itEnumeratedInputs = new Vector<String>(); // Complete list of individual inputs for this input-type + Vector<String> itCommandInputs = new Vector<>(); // Inputs for the tool command line for this input-type + Vector<String> itCommandDependencies = new Vector<>(); // Dependencies for the make rule for this input-type + Vector<String> 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<String> inputs = new ArrayList<String>(); + List<String> 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<String> handledInputExtensions = new HashSet<String>(); + HashSet<String> 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<String> handledInputExtensions, boolean lastChance) { boolean done = true; - Vector<String> myCommandOutputs = new Vector<String>(); - Vector<String> myEnumeratedPrimaryOutputs = new Vector<String>(); - Vector<String> myEnumeratedSecondaryOutputs = new Vector<String>(); - HashMap<String, List<IPath>> myOutputMacros = new HashMap<String, List<IPath>>(); + Vector<String> myCommandOutputs = new Vector<>(); + Vector<String> myEnumeratedPrimaryOutputs = new Vector<>(); + Vector<String> myEnumeratedSecondaryOutputs = new Vector<>(); + HashMap<String, List<IPath>> myOutputMacros = new HashMap<>(); // The next two fields are used together - Vector<String> myBuildVars = new Vector<String>(); - Vector<Vector<String>> myBuildVarsValues = new Vector<Vector<String>>(); + Vector<String> myBuildVars = new Vector<>(); + Vector<Vector<String>> 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<String> typeEnumeratedOutputs = new Vector<String>(); + Vector<String> 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<String> outputs = new ArrayList<String>(); + List<String> 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<IPath> outputPaths = new ArrayList<IPath>(); + List<IPath> 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<IPath>(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<IPath> outputPaths = new ArrayList<IPath>(); + List<IPath> 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 <code>make</code>. if (multOfType) { // This case is not handled - a nameProvider or outputNames must be specified - List<String> errList = new ArrayList<String>(); + List<String> 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<IPath> outputs = new ArrayList<IPath>(); + List<IPath> outputs = new ArrayList<>(); outputs.add(Path.fromOSString(fileName)); if (myOutputMacros.containsKey(variable)) { List<IPath> currList = myOutputMacros.get(variable); @@ -802,7 +802,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo { String depsMacroEntry = calculateSourceMacro(makeGen, extensionName, depExt, IManagedBuilderMakefileGenerator.WILDCARD); - List<IPath> depsList = new ArrayList<IPath>(); + List<IPath> 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<String> handledInputExtensions, ToolInfoHolder h, boolean lastChance) { // Get the dependencies for this tool invocation boolean done = true; - Vector<String> myCommandDependencies = new Vector<String>(); - Vector<String> myAdditionalTargets = new Vector<String>(); + Vector<String> myCommandDependencies = new Vector<>(); + Vector<String> myAdditionalTargets = new Vector<>(); //Vector myEnumeratedDependencies = new Vector(); - HashMap<String, List<IPath>> myOutputMacros = new HashMap<String, List<IPath>>(); + HashMap<String, List<IPath>> 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<IPath> list = new ArrayList<IPath>(); + List<IPath> 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<String> idTokens = new Vector<String>(Arrays.asList(oldId.split(REGEXP_SEPARATOR))); + Vector<String> 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<String> oldIdVector = new Vector<String>(Arrays.asList(idTokens)); + Vector<String> 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<String> newIdVector = new Vector<String>(idTokens.length + 2); + Vector<String> 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<String> values = new Vector<String>(); + Vector<String> 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<String> idTokens = new Vector<String>(Arrays.asList(oldId.split(REGEXP_SEPARATOR))); + Vector<String> 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<String> idTokens = new Vector<String>(Arrays.asList(oldId.split(REGEXP_SEPARATOR))); + Vector<String> 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<String, IConfiguration> getConfigIdMap() { if (configIdMap == null) { - configIdMap = new HashMap<String, IConfiguration>(); + 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<String> values = new Vector<String>(); + Vector<String> 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<Map<String, UpdateManagedProjectManager>> fThreadInfo = new ThreadLocal<Map<String, UpdateManagedProjectManager>>(); + static private ThreadLocal<Map<String, UpdateManagedProjectManager>> 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<String, UpdateManagedProjectManager> getManagerMap(boolean create) { Map<String, UpdateManagedProjectManager> map = fThreadInfo.get(); if (map == null && create) { - map = new HashMap<String, UpdateManagedProjectManager>(); + 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<IConfiguration, IConfiguration>(); + original2newConfigs = new HashMap<>(); ICConfigurationDescription active = null; for (IConfiguration cfg : configs) { if (cfg != null) { @@ -180,7 +180,7 @@ public class ProjectCreatedActions { } public Set<IConfiguration> getNewConfigurations(Collection<IConfiguration> originalConfigs) { - Set<IConfiguration> result = new HashSet<IConfiguration>(); + Set<IConfiguration> 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<IConfiguration> matchingConfigs = new ArrayList<IConfiguration>(); + List<IConfiguration> 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<IConfiguration> invertedConfigs = new ArrayList<IConfiguration>(Arrays.asList(allConfigs)); + List<IConfiguration> 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<String, String> getDefinedSymbols() { // Return the defined symbols for the default configuration - HashMap<String, String> symbols = new HashMap<String, String>(); + HashMap<String, String> 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<String> getPathList() { if (pathList == null) { - pathList = new ArrayList<String>(); + pathList = new ArrayList<>(); } return pathList; } @@ -123,7 +123,7 @@ public class MakeScannerInfo implements IScannerInfo { protected List<String> getSymbolList() { if (symbolList == null) { - symbolList = new ArrayList<String>(); + 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<String> includes = new ArrayList<String>(); - ArrayList<String> symbols = new ArrayList<String>(); + ArrayList<String> includes = new ArrayList<>(); + ArrayList<String> 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<IPathEntry> cPaths = new ArrayList<IPathEntry>(Arrays.asList(entries)); + List<IPathEntry> cPaths = new ArrayList<>(Arrays.asList(entries)); Iterator<IPathEntry> 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<String> ls = new ArrayList<String>(10); + ArrayList<String> 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<String, String> macros = new HashMap<String, String>(template.getValueStore()); + Map<String, String> 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<TestToolchain> toolchainSet = new ArrayList<TestToolchain>(); + List<TestToolchain> 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<TestToolchain> toolchainSet = new ArrayList<TestToolchain>(); + List<TestToolchain> 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<TestToolchain> toolchainSet = new ArrayList<TestToolchain>(); + List<TestToolchain> 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<TestToolchain> toolchainSet = new ArrayList<TestToolchain>(); + List<TestToolchain> 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<TestToolchain> toolchainSet = new ArrayList<TestToolchain>(); + List<TestToolchain> 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<TestToolchain> toolchainSet = new ArrayList<TestToolchain>(); + List<TestToolchain> 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<TestToolchain> toolchainSet = new ArrayList<TestToolchain>(); + List<TestToolchain> 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<TestToolchain> toolchainSet = new ArrayList<TestToolchain>(); + List<TestToolchain> 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<TestToolchain> toolchainSet = new ArrayList<TestToolchain>(); + List<TestToolchain> 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<IProject> getProjectsToBuild(List<IFile> selectedFiles) { - Set<IProject> projectsToBuild = new HashSet<IProject>(); + Set<IProject> 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<String, IConfigurationElement> getConversionElements() { if (conversionElements == null) { - conversionElements = new HashMap<String, IConfigurationElement>(); + 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<String> set2 = new TreeSet<String>(); - private Set<String> set3 = new TreeSet<String>(); - private Set<String> set4 = new TreeSet<String>(); + private Set<String> set2 = new TreeSet<>(); + private Set<String> set3 = new TreeSet<>(); + private Set<String> 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<String, FieldEditor> fieldsMap = new HashMap<String, FieldEditor>(); + private Map<String, FieldEditor> 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<String, CustomFieldEditorDescriptor> customFieldEditorDescriptorIndex; - private Map<FieldEditor, Composite> fieldEditorsToParentMap = new HashMap<FieldEditor, Composite>(); + private Map<FieldEditor, Composite> 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<IHoldsOptions> lst = new ArrayList<IHoldsOptions>(); + ArrayList<IHoldsOptions> 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<String> enumValidList = new Vector<String>(); + Vector<String> 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<String, CustomFieldEditorDescriptor>(); + 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<String> enumValidList = new Vector<String>(); + Vector<String> 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<ITreeOption> childrenList = new ArrayList<ITreeOption>(Arrays.asList(children)); + List<ITreeOption> childrenList = new ArrayList<>(Arrays.asList(children)); // Check if any of the children has empty name List<ITreeOption> toRemove = null; for (ITreeOption child : children) { if (child.getName() == null || child.getName().trim().length() == 0) { if (toRemove == null) { - toRemove = new ArrayList<ITreeOption>(); + 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<String> set1 = new TreeSet<String>(); - private Set<String> set2 = new TreeSet<String>(); - private Set<String> set3 = new TreeSet<String>(); - private Set<String> set4 = new TreeSet<String>(); + private Set<String> set1 = new TreeSet<>(); + private Set<String> set2 = new TreeSet<>(); + private Set<String> set3 = new TreeSet<>(); + private Set<String> 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<ITool> list = new ArrayList<ITool>(); + List<ITool> 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<String, String>(); - userObjsMap = new HashMap<IOption, String>(); + stringOptionsMap = new HashMap<>(); + userObjsMap = new HashMap<>(); } /* (non-Javadoc) @@ -188,7 +188,7 @@ public class BuildToolSettingUI extends AbstractToolSettingUI { */ private Vector<String> getDefaultOptionNames() { if (defaultOptionNames == null) { - defaultOptionNames = new Vector<String>(); + 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<String> getOptionVector(String rawOptionString) { - Vector<String> tokens = new Vector<String>(Arrays.asList(rawOptionString.split("\\s"))); //$NON-NLS-1$ - Vector<String> output = new Vector<String>(tokens.size()); + Vector<String> tokens = new Vector<>(Arrays.asList(rawOptionString.split("\\s"))); //$NON-NLS-1$ + Vector<String> output = new Vector<>(tokens.size()); Iterator<String> 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<String> optionsList = new ArrayList<String>(); + List<String> 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<String> list = new ArrayList<String>(); + ArrayList<String> 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<String> optsList = new ArrayList<String>(optionsArr); + ArrayList<String> 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<String> newList = new ArrayList<String>(); + ArrayList<String> 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<String> fIncorrectlyDefinedMacrosNames = new HashSet<String>(); + private Set<String> 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<ICdtVariable> lst = new ArrayList<ICdtVariable>(_vars.length); + List<ICdtVariable> 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<ICdtVariable> list = new ArrayList<ICdtVariable>(_vars.length); + ArrayList<ICdtVariable> 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<String> contextProfiles = null; if (page.isForPrefs()) { // for preference page get all profiles - contextProfiles = new TreeSet<String>(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<String>(profilesList); + contextProfiles = new TreeSet<>(profilesList); } else { contextProfiles = CfgScannerConfigUtil.getAllScannerDiscoveryProfileIds(toolchain); } @@ -486,7 +486,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf } } - visibleProfilesList = new ArrayList<String>(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<DiscoveryProfilePageConfiguration>(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<CfgInfoContext> checkChanges() { if (cbi == null || baseInfoMap == null) - return new ArrayList<CfgInfoContext>(0); + return new ArrayList<>(0); Map<CfgInfoContext, IScannerConfigBuilderInfo2> cfgInfoMap = cbi.getInfoMap(); - HashMap<InfoContext, Object> baseCopy = new HashMap<InfoContext, Object>(baseInfoMap); - List<CfgInfoContext> list = new ArrayList<CfgInfoContext>(); + HashMap<InfoContext, Object> baseCopy = new HashMap<>(baseInfoMap); + List<CfgInfoContext> list = new ArrayList<>(); for (Map.Entry<CfgInfoContext, IScannerConfigBuilderInfo2> 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<String> list = new ArrayList<String>(); + ArrayList<String> 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<IConfiguration> lst = new ArrayList<IConfiguration>(); + ArrayList<IConfiguration> 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<String, IConfiguration>(); + 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<String> lst = new ArrayList<String>(imported.keySet()); + ArrayList<String> 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<String, IConfiguration>(); + 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<String> lst = new ArrayList<String>(importedDef.keySet()); + ArrayList<String> 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<RefreshExclusionContributor>(fContrManager.getContributors()); + fExclusionContributors = new LinkedList<>(fContrManager.getContributors()); } public RefreshPolicyExceptionDialog(Shell parent, IResource resource, java.util.List<RefreshExclusion> 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<IResource, List<RefreshExclusion>> resourceMap = fConfigurationToResourcesToExclusionsMap .get(configName); if (resourceMap == null) { - resourceMap = new HashMap<IResource, List<RefreshExclusion>>(); + resourceMap = new HashMap<>(); resourceMap.put(fProject, new ArrayList<RefreshExclusion>()); fConfigurationToResourcesToExclusionsMap.put(configName, resourceMap); } @@ -111,7 +111,7 @@ public class RefreshPolicyTab extends AbstractCBuildPropertyTab { private HashMap<String, HashMap<IResource, List<RefreshExclusion>>> copyHashMap( HashMap<String, HashMap<IResource, List<RefreshExclusion>>> source) { - HashMap<String, HashMap<IResource, List<RefreshExclusion>>> target = new HashMap<String, HashMap<IResource, List<RefreshExclusion>>>(); + HashMap<String, HashMap<IResource, List<RefreshExclusion>>> target = new HashMap<>(); if (source.isEmpty()) return target; @@ -122,13 +122,13 @@ public class RefreshPolicyTab extends AbstractCBuildPropertyTab { String configName = config_iterator.next(); HashMap<IResource, List<RefreshExclusion>> source_resourceMap = source.get(configName); - HashMap<IResource, List<RefreshExclusion>> target_resourceMap = new HashMap<IResource, List<RefreshExclusion>>(); + HashMap<IResource, List<RefreshExclusion>> target_resourceMap = new HashMap<>(); Iterator<IResource> resource_iterator = source_resourceMap.keySet().iterator(); while (resource_iterator.hasNext()) { IResource source_resource = resource_iterator.next(); List<RefreshExclusion> source_exclusions = source_resourceMap.get(source_resource); - List<RefreshExclusion> target_exclusions = new LinkedList<RefreshExclusion>(); + List<RefreshExclusion> 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<IResource, List<RefreshExclusion>> resourceMap = getResourcesToExclusionsMap(configName); List<RefreshExclusion> exclusions = resourceMap.get(resource); if (exclusions == null) { - exclusions = new LinkedList<RefreshExclusion>(); + 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<Object> children = new ArrayList<Object>(exclusion_instances); + List<Object> 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<RefreshExclusion> exclusions = getExclusions(getConfigName(), parent.resourceToRefresh); if (exclusions == null) { - exclusions = new LinkedList<RefreshExclusion>(); + 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<Object> filteredChildren = new ArrayList<Object>(Arrays.asList(super.getChildren(element))); + ArrayList<Object> filteredChildren = new ArrayList<>(Arrays.asList(super.getChildren(element))); Iterator<IResource> 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<IToolChain> list = new ArrayList<IToolChain>(); + ArrayList<IToolChain> 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<IBuilder> list = new ArrayList<IBuilder>(); + ArrayList<IBuilder> 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<ITool> list = new ArrayList<ITool>(); + ArrayList<ITool> 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<ToolListElement> elementList = new ArrayList<ToolListElement>(); + List<ToolListElement> 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<ToolListElement> elementList = new ArrayList<ToolListElement>(); + List<ToolListElement> 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<ToolListElement>(); + 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<ITool>(); - removed = new ArrayList<ITool>(); - left = new ArrayList<ITool>(); - right = new ArrayList<ITool>(); + 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<String> conflictTools = new ArrayList<String>(); + List<String> 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<String, List<AbstractToolSettingUI>>(); + configToPageListMap = new HashMap<>(); settingsStore = ToolSettingsPrefStore.getDefault(); // Create the sash form @@ -674,7 +674,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe return null; List<AbstractToolSettingUI> pages = configToPageListMap.get(getCfg().getId()); if (pages == null) { - pages = new ArrayList<AbstractToolSettingUI>(); + 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 <tt>t2</tt> */ private Map<ITool, ITool> getToolCorrespondence(ITool[] t1, ITool[] t2) { - Map<ITool, ITool> result = new java.util.LinkedHashMap<ITool, ITool>(); - Map<ITool, List<ITool>> realT1Tools = new java.util.LinkedHashMap<ITool, List<ITool>>(); + Map<ITool, ITool> result = new java.util.LinkedHashMap<>(); + Map<ITool, List<ITool>> 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<ITool>(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<CfgHolder> out = new ArrayList<CfgHolder>(table.getItemCount()); + ArrayList<CfgHolder> 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<CfgHolder> out = new ArrayList<CfgHolder>(); + ArrayList<CfgHolder> 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<CfgHolder> ls = new ArrayList<CfgHolder>(its.length); + ArrayList<CfgHolder> 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<IConfiguration> lst = new ArrayList<IConfiguration>(its.length); + ArrayList<IConfiguration> 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<String, IToolChain> full_tcs = new TreeMap<String, IToolChain>(); + protected SortedMap<String, IToolChain> 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<String> preferredTCs = new ArrayList<String>(); + private List<String> preferredTCs = new ArrayList<>(); protected static final class EntryInfo { private SortedMap<String, IToolChain> tcs; @@ -172,7 +172,7 @@ public class MBSWizardHandler extends CWizardHandler { ICDTCommonProjectWizard wz = (ICDTCommonProjectWizard) wizard; String[] langIDs = wz.getLanguageIDs(); if (langIDs.length > 0) { - List<Template> lstTemplates = new ArrayList<Template>(); + List<Template> lstTemplates = new ArrayList<>(); for (String id : langIDs) { lstTemplates.addAll(Arrays .asList(TemplateEngineUI.getDefault().getTemplates(projectTypeId, null, id))); @@ -263,7 +263,7 @@ public class MBSWizardHandler extends CWizardHandler { Set<String> full = tcs.keySet(); if (entryDescriptor == null) return full; - Set<String> out = new LinkedHashSet<String>(full.size()); + Set<String> out = new LinkedHashSet<>(full.size()); for (String s : full) if (isToolChainAcceptable(s)) out.add(s); @@ -280,7 +280,7 @@ public class MBSWizardHandler extends CWizardHandler { */ public SortedMap<String, IToolChain> getToolChains() { Set<String> toolChainNames = this.tc_filter(); - SortedMap<String, IToolChain> toolChainMap = new TreeMap<String, IToolChain>(); + SortedMap<String, IToolChain> toolChainMap = new TreeMap<>(); for (String toolChainName : toolChainNames) { IToolChain tc = tcs.get(toolChainName); @@ -386,7 +386,7 @@ public class MBSWizardHandler extends CWizardHandler { public Map<String, String> getMainPageData() { WizardNewProjectCreationPage page = (WizardNewProjectCreationPage) getNewProjectCreationPage(); - Map<String, String> data = new HashMap<String, String>(); + Map<String, String> data = new HashMap<>(); String projName = page.getProjectName(); projName = projName != null ? projName.trim() : EMPTY_STR; data.put("projectName", projName); //$NON-NLS-1$ @@ -506,7 +506,7 @@ public class MBSWizardHandler extends CWizardHandler { else if (natures.length == 1) MBSCustomPageManager.addPageProperty(MBSCustomPageManager.PAGE_ID, MBSCustomPageManager.NATURE, natures[0]); else { - TreeSet<String> x = new TreeSet<String>(); + TreeSet<String> x = new TreeSet<>(); for (String nature : natures) x.add(nature); MBSCustomPageManager.addPageProperty(MBSCustomPageManager.PAGE_ID, MBSCustomPageManager.NATURE, x); @@ -519,8 +519,8 @@ public class MBSWizardHandler extends CWizardHandler { getProjectType().getId()); IToolChain[] tcs = getSelectedToolChains(); - ArrayList<IToolChain> x = new ArrayList<IToolChain>(); - TreeSet<String> y = new TreeSet<String>(); + ArrayList<IToolChain> x = new ArrayList<>(); + TreeSet<String> y = new TreeSet<>(); if (tcs != null) { int n = tcs.length; for (int i = 0; i < n; i++) { @@ -655,7 +655,7 @@ public class MBSWizardHandler extends CWizardHandler { if (template == null) return; - List<IConfiguration> configs = new ArrayList<IConfiguration>(); + List<IConfiguration> configs = new ArrayList<>(); for (CfgHolder cfg : cfgs) { configs.add(cfg.getConfiguration()); } diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ManagedBuildWizard.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ManagedBuildWizard.java index d64279b5eae..bdbe320fda4 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ManagedBuildWizard.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ManagedBuildWizard.java @@ -54,7 +54,7 @@ public class ManagedBuildWizard extends AbstractCWizard { IBuildPropertyValue[] vs = bpt.getSupportedValues(); Arrays.sort(vs, BuildListComparator.getInstance()); - ArrayList<EntryDescriptor> items = new ArrayList<EntryDescriptor>(); + ArrayList<EntryDescriptor> items = new ArrayList<>(); // new style project types for (int i = 0; i < vs.length; i++) { IToolChain[] tcs = ManagedBuildManager.getExtensionsToolChains(MBSWizardHandler.ARTIFACT, vs[i].getId(), diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExistingPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExistingPage.java index 6f9db2d2e2e..d7d30430e3e 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExistingPage.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExistingPage.java @@ -61,7 +61,7 @@ public class NewMakeProjFromExistingPage extends WizardPage { Button langcpp; IWorkspaceRoot root; List tcList; - Map<String, IToolChain> tcMap = new HashMap<String, IToolChain>(); + Map<String, IToolChain> tcMap = new HashMap<>(); /** * True if the user entered a non-empty string in the project name field. In that state, we avoid @@ -292,7 +292,7 @@ public class NewMakeProjFromExistingPage extends WizardPage { */ private void updateTcWidget(boolean supportedOnly) { updateTcMap(supportedOnly); - ArrayList<String> names = new ArrayList<String>(tcMap.keySet()); + ArrayList<String> names = new ArrayList<>(tcMap.keySet()); Collections.sort(names); tcList.removeAll(); diff --git a/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixCreateParameter.java b/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixCreateParameter.java index 196867893c8..42c9a3f77dc 100644 --- a/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixCreateParameter.java +++ b/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixCreateParameter.java @@ -74,8 +74,8 @@ public class QuickFixCreateParameter extends AbstractAstRewriteQuickFix { if (declarations.length == 0) { return; } - HashMap<ITranslationUnit, IASTTranslationUnit> cachedASTs = new HashMap<ITranslationUnit, IASTTranslationUnit>(); - HashMap<ITranslationUnit, ASTRewrite> cachedRewrites = new HashMap<ITranslationUnit, ASTRewrite>(); + HashMap<ITranslationUnit, IASTTranslationUnit> cachedASTs = new HashMap<>(); + HashMap<ITranslationUnit, ASTRewrite> cachedRewrites = new HashMap<>(); for (IIndexName iname : declarations) { ITranslationUnit declTU = CxxAstUtils.getTranslationUnitFromIndexName(iname); if (declTU == null) { diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AbstractClassInstantiationChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AbstractClassInstantiationChecker.java index 7b69ab1dd73..7f7e8c104f5 100644 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AbstractClassInstantiationChecker.java +++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AbstractClassInstantiationChecker.java @@ -56,7 +56,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics; */ public class AbstractClassInstantiationChecker extends AbstractIndexAstChecker { public static final String ER_ID = "org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation"; //$NON-NLS-1$ - private final HashMap<ICPPClassType, ICPPMethod[]> pureVirtualMethodsCache = new HashMap<ICPPClassType, ICPPMethod[]>(); + private final HashMap<ICPPClassType, ICPPMethod[]> pureVirtualMethodsCache = new HashMap<>(); @Override public void initPreferences(IProblemWorkingCopy problem) { diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/ClassMembersInitializationChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/ClassMembersInitializationChecker.java index 5eb22b30f1e..6542744abcb 100644 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/ClassMembersInitializationChecker.java +++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/ClassMembersInitializationChecker.java @@ -79,7 +79,7 @@ public class ClassMembersInitializationChecker extends AbstractIndexAstChecker { class OnEachClass extends ASTVisitor { // NOTE: Classes can be nested and even can be declared in constructors of the other classes - private final Stack<Set<IField>> constructorsStack = new Stack<Set<IField>>(); + private final Stack<Set<IField>> constructorsStack = new Stack<>(); private boolean skipConstructorsWithFCalls = skipConstructorsWithFCalls(); OnEachClass() { diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/NonVirtualDestructor.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/NonVirtualDestructor.java index 4cc19d4cb0b..68f44b1513b 100644 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/NonVirtualDestructor.java +++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/NonVirtualDestructor.java @@ -43,7 +43,7 @@ public class NonVirtualDestructor extends AbstractIndexAstChecker { public static final String PROBLEM_ID = "org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem"; //$NON-NLS-1$ // Prevent stack overflow in case: class A: public A {}; - private static HashSet<ICPPClassType> checkedClassTypes = new HashSet<ICPPClassType>(); + private static HashSet<ICPPClassType> checkedClassTypes = new HashSet<>(); @Override public void processAst(IASTTranslationUnit ast) { diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/UnusedSymbolInFileScopeChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/UnusedSymbolInFileScopeChecker.java index bf6a7f36372..1a32fb61fd7 100644 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/UnusedSymbolInFileScopeChecker.java +++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/UnusedSymbolInFileScopeChecker.java @@ -74,11 +74,11 @@ public class UnusedSymbolInFileScopeChecker extends AbstractIndexAstChecker { private static final String[] USAGE_ATTRIBUTES = new String[] { "__unused__", "unused", "constructor", //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ "destructor" }; //$NON-NLS-1$ - private Map<IBinding, IASTDeclarator> externFunctionDeclarations = new HashMap<IBinding, IASTDeclarator>(); - private Map<IBinding, IASTDeclarator> staticFunctionDeclarations = new HashMap<IBinding, IASTDeclarator>(); - private Map<IBinding, IASTDeclarator> staticFunctionDefinitions = new HashMap<IBinding, IASTDeclarator>(); - private Map<IBinding, IASTDeclarator> externVariableDeclarations = new HashMap<IBinding, IASTDeclarator>(); - private Map<IBinding, IASTDeclarator> staticVariableDeclarations = new HashMap<IBinding, IASTDeclarator>(); + private Map<IBinding, IASTDeclarator> externFunctionDeclarations = new HashMap<>(); + private Map<IBinding, IASTDeclarator> staticFunctionDeclarations = new HashMap<>(); + private Map<IBinding, IASTDeclarator> staticFunctionDefinitions = new HashMap<>(); + private Map<IBinding, IASTDeclarator> externVariableDeclarations = new HashMap<>(); + private Map<IBinding, IASTDeclarator> staticVariableDeclarations = new HashMap<>(); private Set<IBinding> declarationsWithUsageAttributes = new HashSet<>(); private IProblemWorkingCopy unusedVariableProblem = null; @@ -376,7 +376,7 @@ public class UnusedSymbolInFileScopeChecker extends AbstractIndexAstChecker { } private void reportProblems() { - List<IASTDeclarator> funcDeclarators = new ArrayList<IASTDeclarator>(); + List<IASTDeclarator> funcDeclarators = new ArrayList<>(); funcDeclarators.addAll(externFunctionDeclarations.values()); funcDeclarators.addAll(staticFunctionDeclarations.values()); for (IASTDeclarator symbol : funcDeclarators) { @@ -387,7 +387,7 @@ public class UnusedSymbolInFileScopeChecker extends AbstractIndexAstChecker { } } - List<IASTDeclarator> varDeclarators = new ArrayList<IASTDeclarator>(); + List<IASTDeclarator> varDeclarators = new ArrayList<>(); varDeclarators.addAll(externVariableDeclarations.values()); varDeclarators.addAll(staticVariableDeclarations.values()); for (IASTDeclarator symbol : varDeclarators) { @@ -398,7 +398,7 @@ public class UnusedSymbolInFileScopeChecker extends AbstractIndexAstChecker { } } - List<IASTDeclarator> staticFuncDeclarators = new ArrayList<IASTDeclarator>(); + List<IASTDeclarator> staticFuncDeclarators = new ArrayList<>(); staticFuncDeclarators.addAll(staticFunctionDefinitions.values()); for (IASTDeclarator symbol : staticFuncDeclarators) { IASTName astName = getAstName(symbol); diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/fs/CFormatStringParser.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/fs/CFormatStringParser.java index 22ed7aa3a75..98e4f0701d2 100644 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/fs/CFormatStringParser.java +++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/fs/CFormatStringParser.java @@ -86,7 +86,7 @@ public class CFormatStringParser { this.argumentPattern = Pattern.compile(STRING_FORMAT_PATTERN); this.argumentMatcher = this.argumentPattern.matcher(argument); this.vulnerablePattern = Pattern.compile(VULNERABLE_PATTERN); - this.vulnerableArguments = new ConcurrentLinkedQueue<VulnerableFormatStringArgument>(); + this.vulnerableArguments = new ConcurrentLinkedQueue<>(); extractVulnerableArguments(); } diff --git a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/externaltool/ArgsSeparator.java b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/externaltool/ArgsSeparator.java index 7acb86c54f0..df629a1fe2a 100644 --- a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/externaltool/ArgsSeparator.java +++ b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/externaltool/ArgsSeparator.java @@ -36,7 +36,7 @@ public class ArgsSeparator { } ParserState state = ParserState.NORMAL; StringBuilder current = new StringBuilder(); - List<String> args = new ArrayList<String>(); + List<String> args = new ArrayList<>(); boolean lastTokenInQuotes = false; char previous = 0; for (char c : s.toCharArray()) { diff --git a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/CxxModelsCache.java b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/CxxModelsCache.java index 32746f423fa..9d60649c53b 100644 --- a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/CxxModelsCache.java +++ b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/CxxModelsCache.java @@ -51,7 +51,7 @@ public class CxxModelsCache implements ICodanDisposable { CxxModelsCache(ITranslationUnit tu) { this.tu = tu; this.file = tu != null ? (IFile) tu.getResource() : null; - cfgmap = new WeakHashMap<IASTFunctionDefinition, IControlFlowGraph>(0); + cfgmap = new WeakHashMap<>(0); } CxxModelsCache(IASTTranslationUnit ast) { diff --git a/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CheckerTestCase.java b/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CheckerTestCase.java index 6a9c151a93e..7f89a01f939 100644 --- a/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CheckerTestCase.java +++ b/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CheckerTestCase.java @@ -135,7 +135,7 @@ public class CheckerTestCase extends CodanTestCase { public void checkNoErrorsOfKind(String problemId) { if (markers != null && markers.length > 0) { - List<IMarker> filtered = new ArrayList<IMarker>(markers.length); + List<IMarker> filtered = new ArrayList<>(markers.length); for (IMarker m : markers) { if (CodanProblemMarker.getProblemId(m).equals(problemId)) { filtered.add(m); diff --git a/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CodanFastCxxAstTestCase.java b/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CodanFastCxxAstTestCase.java index 978fd73055a..1bc0de9fec9 100644 --- a/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CodanFastCxxAstTestCase.java +++ b/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CodanFastCxxAstTestCase.java @@ -147,7 +147,7 @@ public abstract class CodanFastCxxAstTestCase extends TestCase { } } - private ArrayList<ProblemInstance> codanproblems = new ArrayList<CodanFastCxxAstTestCase.ProblemInstance>(); + private ArrayList<ProblemInstance> codanproblems = new ArrayList<>(); void runCodan(String code) { tu = parse(code); diff --git a/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CodanTestCase.java b/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CodanTestCase.java index 626a90f518a..1e926828042 100644 --- a/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CodanTestCase.java +++ b/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CodanTestCase.java @@ -45,13 +45,13 @@ import org.eclipse.core.runtime.Plugin; */ @SuppressWarnings("nls") public class CodanTestCase extends BaseTestCase { - ArrayList<File> tempFiles = new ArrayList<File>(); + ArrayList<File> tempFiles = new ArrayList<>(); protected File tmpDir; protected ICProject cproject; protected File currentFile; protected ICElement currentCElem; protected IFile currentIFile; - protected ArrayList<Integer> errLines = new ArrayList<Integer>(); + protected ArrayList<Integer> errLines = new ArrayList<>(); /** * diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanCorePlugin.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanCorePlugin.java index c5342d84899..c2f6ab49421 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanCorePlugin.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanCorePlugin.java @@ -195,7 +195,7 @@ public class CodanCorePlugin extends Plugin { if (bundle != null) { BundleContext context = bundle.getBundleContext(); if (context != null) { - ServiceTracker<DebugOptions, DebugOptions> tracker = new ServiceTracker<DebugOptions, DebugOptions>( + ServiceTracker<DebugOptions, DebugOptions> tracker = new ServiceTracker<>( context, DebugOptions.class.getName(), null); try { tracker.open(); diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractChecker.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractChecker.java index adfff49ab39..eb3de93f39c 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractChecker.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractChecker.java @@ -80,7 +80,7 @@ public abstract class AbstractChecker implements IChecker { * @since 2.0 */ public List<IProblem> getProblemsByMainId(String id, IResource file) { - ArrayList<IProblem> list = new ArrayList<IProblem>(); + ArrayList<IProblem> list = new ArrayList<>(); IProblemProfile resourceProfile = CheckersRegistry.getInstance().getResourceProfile(file); IProblem[] problems = resourceProfile.getProblems(); for (int i = 0; i < problems.length; i++) { diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/FileScopeProblemPreference.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/FileScopeProblemPreference.java index f30cb20fe80..066a66d8eb1 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/FileScopeProblemPreference.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/FileScopeProblemPreference.java @@ -176,7 +176,7 @@ public class FileScopeProblemPreference extends AbstractProblemPreference { checkKeyword(tokenizer, keyword); checkChar(tokenizer, '='); checkChar(tokenizer, '>'); - ArrayList<IPath> list = new ArrayList<IPath>(); + ArrayList<IPath> list = new ArrayList<>(); int token; try { checkChar(tokenizer, '('); diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/ListProblemPreference.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/ListProblemPreference.java index 6ed92ddd659..dccef8edea8 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/ListProblemPreference.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/ListProblemPreference.java @@ -31,7 +31,7 @@ public class ListProblemPreference extends AbstractProblemPreference * of all elements. */ public static final String COMMON_DESCRIPTOR_KEY = "#"; //$NON-NLS-1$ - protected ArrayList<Object> list = new ArrayList<Object>(); + protected ArrayList<Object> list = new ArrayList<>(); protected IProblemPreference childDescriptor; /** @@ -196,7 +196,7 @@ public class ListProblemPreference extends AbstractProblemPreference @Override public Object clone() { ListProblemPreference list1 = (ListProblemPreference) super.clone(); - list1.list = new ArrayList<Object>(); + list1.list = new ArrayList<>(); list1.setChildDescriptor((IProblemPreference) getChildDescriptor().clone()); for (Iterator<Object> iterator = list.iterator(); iterator.hasNext();) { Object value = iterator.next(); diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/MapProblemPreference.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/MapProblemPreference.java index 0ef0cbc6154..85737b0055e 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/MapProblemPreference.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/MapProblemPreference.java @@ -131,7 +131,7 @@ public class MapProblemPreference extends AbstractProblemPreference public Object clone() { MapProblemPreference map = (MapProblemPreference) super.clone(); synchronized (hash) { - map.hash = Collections.synchronizedMap(new LinkedHashMap<String, IProblemPreference>(hash)); + map.hash = Collections.synchronizedMap(new LinkedHashMap<>(hash)); } // now we have to clone the values too for (Entry<String, IProblemPreference> entry : map.hash.entrySet()) { @@ -255,7 +255,7 @@ public class MapProblemPreference extends AbstractProblemPreference @Override public Object getValue() { synchronized (hash) { - LinkedHashMap<String, Object> map = new LinkedHashMap<String, Object>(); + LinkedHashMap<String, Object> map = new LinkedHashMap<>(); for (Iterator<IProblemPreference> iterator = hash.values().iterator(); iterator.hasNext();) { IProblemPreference pref = iterator.next(); map.put(pref.getKey(), pref.getValue()); diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckerInvocationContext.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckerInvocationContext.java index deeed714134..f32ccd030e1 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckerInvocationContext.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckerInvocationContext.java @@ -34,7 +34,7 @@ public class CheckerInvocationContext implements ICheckerInvocationContext { */ public CheckerInvocationContext(IResource resource) { this.resource = resource; - objectStorage = new HashMap<Class<?>, Object>(); + objectStorage = new HashMap<>(); } @Override diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java index 7d50dd60b81..c31a1f080d0 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java @@ -64,13 +64,13 @@ public class CheckersRegistry implements Iterable<IChecker>, ICheckersRegistry { private static final String CATEGORY_ELEMENT = "category"; //$NON-NLS-1$ private static final Object DEFAULT = "DEFAULT"; //$NON-NLS-1$ public static final String CLONE_SUFFIX = ".COPY"; //$NON-NLS-1$ - private Collection<IChecker> checkers = new ArrayList<IChecker>(); + private Collection<IChecker> checkers = new ArrayList<>(); private static CheckersRegistry instance; private static boolean initialized = false; - private final Map<Object, IProblemProfile> profiles = new HashMap<Object, IProblemProfile>(); - private final Map<IChecker, Collection<IProblem>> problemList = new HashMap<IChecker, Collection<IProblem>>(); - private final Map<String, IChecker> problemCheckerMapping = new HashMap<String, IChecker>(); - private final List<ICheckerEnablementVerifier> checkerEnablementVerifiers = new ArrayList<ICheckerEnablementVerifier>(); + private final Map<Object, IProblemProfile> profiles = new HashMap<>(); + private final Map<IChecker, Collection<IProblem>> problemList = new HashMap<>(); + private final Map<String, IChecker> problemCheckerMapping = new HashMap<>(); + private final List<ICheckerEnablementVerifier> checkerEnablementVerifiers = new ArrayList<>(); private CheckersRegistry() { instance = this; @@ -301,7 +301,7 @@ public class CheckersRegistry implements Iterable<IChecker>, ICheckersRegistry { public void addRefProblem(IChecker c, IProblem p) { Collection<IProblem> plist = problemList.get(c); if (plist == null) { - plist = new ArrayList<IProblem>(); + plist = new ArrayList<>(); problemList.put(c, plist); } plist.add(p); diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersTimeStats.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersTimeStats.java index 94ecf856c6d..f65a8177af4 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersTimeStats.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersTimeStats.java @@ -60,7 +60,7 @@ public class CheckersTimeStats { } } - private Map<String, TimeRecord> records = new HashMap<String, TimeRecord>(); + private Map<String, TimeRecord> records = new HashMap<>(); /** * @param id - checker id diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanApplication.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanApplication.java index 12672a22efa..238af82ec25 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanApplication.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanApplication.java @@ -35,7 +35,7 @@ import org.eclipse.osgi.util.NLS; * @noinstantiate This class is not intended to be instantiated by clients. */ public class CodanApplication implements IApplication { - private Collection<String> projects = new ArrayList<String>(); + private Collection<String> projects = new ArrayList<>(); private boolean verbose; private boolean all; diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/ConnectorNode.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/ConnectorNode.java index bb9317989a5..d53c042e52b 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/ConnectorNode.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/ConnectorNode.java @@ -23,7 +23,7 @@ import org.eclipse.cdt.codan.core.model.cfg.IJumpNode; * TODO: add description */ public class ConnectorNode extends AbstractSingleOutgoingNode implements IConnectorNode { - protected ArrayList<IBasicBlock> incoming = new ArrayList<IBasicBlock>(2); + protected ArrayList<IBasicBlock> incoming = new ArrayList<>(2); protected ConnectorNode() { super(); diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/ControlFlowGraph.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/ControlFlowGraph.java index bae7880dab6..ecffbd3ab9a 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/ControlFlowGraph.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/ControlFlowGraph.java @@ -34,7 +34,7 @@ import org.eclipse.cdt.codan.core.model.cfg.IStartNode; */ public class ControlFlowGraph implements IControlFlowGraph { private List<IExitNode> exitNodes; - private List<IBasicBlock> deadNodes = new ArrayList<IBasicBlock>(); + private List<IBasicBlock> deadNodes = new ArrayList<>(); private IStartNode start; public ControlFlowGraph(IStartNode start, Collection<IExitNode> exitNodes) { @@ -55,11 +55,11 @@ public class ControlFlowGraph implements IControlFlowGraph { public void setExitNodes(Collection<IExitNode> exitNodes) { if (this.exitNodes != null) throw new IllegalArgumentException("Cannot modify already exiting connector"); //$NON-NLS-1$ - this.exitNodes = Collections.unmodifiableList(new ArrayList<IExitNode>(exitNodes)); + this.exitNodes = Collections.unmodifiableList(new ArrayList<>(exitNodes)); } public void setUnconnectedNodes(Collection<IBasicBlock> nodes) { - this.deadNodes = Collections.unmodifiableList(new ArrayList<IBasicBlock>(nodes)); + this.deadNodes = Collections.unmodifiableList(new ArrayList<>(nodes)); } /* @@ -126,7 +126,7 @@ public class ControlFlowGraph implements IControlFlowGraph { */ @Override public Collection<IBasicBlock> getNodes() { - Collection<IBasicBlock> result = new LinkedHashSet<IBasicBlock>(); + Collection<IBasicBlock> result = new LinkedHashSet<>(); getNodes(getStartNode(), result); getDeadNodes(result); return result; @@ -150,13 +150,13 @@ public class ControlFlowGraph implements IControlFlowGraph { } public Collection<IBasicBlock> getDeadNodes() { - Collection<IBasicBlock> result = new LinkedHashSet<IBasicBlock>(); + Collection<IBasicBlock> result = new LinkedHashSet<>(); getDeadNodes(result); return result; } private void getDeadNodes(Collection<IBasicBlock> result) { - Collection<IBasicBlock> liveNodes = new LinkedHashSet<IBasicBlock>(); + Collection<IBasicBlock> liveNodes = new LinkedHashSet<>(); getNodes(getStartNode(), liveNodes); for (Iterator<IBasicBlock> iterator = deadNodes.iterator(); iterator.hasNext();) { diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/DecisionNode.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/DecisionNode.java index a55a59ba23c..ec7a9604113 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/DecisionNode.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/DecisionNode.java @@ -25,7 +25,7 @@ import org.eclipse.cdt.codan.core.model.cfg.IDecisionNode; * @see IDecisionNode */ public class DecisionNode extends AbstractSingleIncomingNode implements IDecisionNode { - private List<IBasicBlock> next = new ArrayList<IBasicBlock>(2); + private List<IBasicBlock> next = new ArrayList<>(2); private IConnectorNode conn; protected DecisionNode() { diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblemCategory.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblemCategory.java index 8951f69574e..d6bab54fb26 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblemCategory.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblemCategory.java @@ -28,7 +28,7 @@ import org.eclipse.cdt.codan.core.model.IProblemProfile; public class CodanProblemCategory extends CodanProblemElement implements IProblemCategory, Cloneable { private String id; private String name; - private ArrayList<IProblemElement> list = new ArrayList<IProblemElement>(); + private ArrayList<IProblemElement> list = new ArrayList<>(); public CodanProblemCategory(String id, String name) { this.id = id; @@ -89,7 +89,7 @@ public class CodanProblemCategory extends CodanProblemElement implements IProble * @return list of categories */ public static IProblemCategory[] findProblemCategories(IProblemCategory c, String id) { - ArrayList<IProblemCategory> list = new ArrayList<IProblemCategory>(); + ArrayList<IProblemCategory> list = new ArrayList<>(); Object[] children = c.getChildren(); for (Object object : children) { if (object instanceof IProblemCategory) { @@ -131,7 +131,7 @@ public class CodanProblemCategory extends CodanProblemElement implements IProble @Override public Object clone() { CodanProblemCategory catClone = (CodanProblemCategory) super.clone(); - catClone.list = new ArrayList<IProblemElement>(); + catClone.list = new ArrayList<>(); for (Iterator<IProblemElement> iterator = this.list.iterator(); iterator.hasNext();) { IProblemElement child = iterator.next(); IProblemElement childClone = (IProblemElement) child.clone(); diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/ProblemProfile.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/ProblemProfile.java index f602900b23d..e75a16dccdc 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/ProblemProfile.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/ProblemProfile.java @@ -42,7 +42,7 @@ public class ProblemProfile implements IProblemProfile, Cloneable { @Override public IProblem[] getProblems() { - Collection<IProblem> problems = new ArrayList<IProblem>(); + Collection<IProblem> problems = new ArrayList<>(); collectProblems(getRoot(), problems); return problems.toArray(new IProblem[problems.size()]); } diff --git a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/cppcheck/CppcheckChecker.java b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/cppcheck/CppcheckChecker.java index 13f63c5a1e0..1a00757ec2b 100644 --- a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/cppcheck/CppcheckChecker.java +++ b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/cppcheck/CppcheckChecker.java @@ -35,7 +35,7 @@ public class CppcheckChecker extends AbstractExternalToolBasedChecker { private static final String ERROR_PROBLEM_ID; // key: severity (error, warning, etc.) - value : problem ID associated to severity - private static final Map<Severity, String> PROBLEM_IDS = new HashMap<Severity, String>(); + private static final Map<Severity, String> PROBLEM_IDS = new HashMap<>(); static { ERROR_PROBLEM_ID = addProblemId(Severity.ERROR); diff --git a/codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java b/codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java index 5f2b8356962..a89a4d08106 100644 --- a/codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java +++ b/codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java @@ -137,7 +137,7 @@ public class ControlFlowGraphView extends ViewPart { IBasicBlock iBasicBlock = iter.next(); dead.add(iBasicBlock); } - ArrayList<Object> all = new ArrayList<Object>(); + ArrayList<Object> all = new ArrayList<>(); all.addAll(blocks); // labeled statements disjoined from the rest for (IBasicBlock node : cfg.getNodes()) { @@ -148,7 +148,7 @@ public class ControlFlowGraphView extends ViewPart { all.add(dead); return all.toArray(); } else if (parent instanceof IDecisionNode) { - ArrayList<IBasicBlock> blocks = new ArrayList<IBasicBlock>(); + ArrayList<IBasicBlock> blocks = new ArrayList<>(); IBasicBlock[] outgoingNodes = ((IDecisionNode) parent).getOutgoingNodes(); for (int i = 0; i < outgoingNodes.length; i++) { IBasicBlock arc = outgoingNodes[i]; @@ -318,7 +318,7 @@ public class ControlFlowGraphView extends ViewPart { } protected void processAst(IASTTranslationUnit ast) { - final ArrayList<IControlFlowGraph> functions = new ArrayList<IControlFlowGraph>(); + final ArrayList<IControlFlowGraph> functions = new ArrayList<>(); ASTVisitor visitor = new ASTVisitor() { { shouldVisitDeclarations = true; diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanProblemMarkerResolutionGenerator.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanProblemMarkerResolutionGenerator.java index 32939d0c832..03406b67e03 100644 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanProblemMarkerResolutionGenerator.java +++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanProblemMarkerResolutionGenerator.java @@ -115,7 +115,7 @@ public class CodanProblemMarkerResolutionGenerator implements IMarkerResolutionG return new IMarkerResolution[0]; Collection<ConditionalResolution> candidates = conditionalResolutions.get(id); - ArrayList<IMarkerResolution> resolutions = new ArrayList<IMarkerResolution>(); + ArrayList<IMarkerResolution> resolutions = new ArrayList<>(); if (candidates != null) { candidates.stream().filter(candidate -> candidate.isApplicableFor(marker)) @@ -191,7 +191,7 @@ public class CodanProblemMarkerResolutionGenerator implements IMarkerResolutionG private static void addResolution(String id, ConditionalResolution res) { Collection<ConditionalResolution> candidates = conditionalResolutions.get(id); if (candidates == null) { - candidates = new ArrayList<ConditionalResolution>(); + candidates = new ArrayList<>(); conditionalResolutions.put(id, candidates); } candidates.add(res); diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/OpenProblemPreferences.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/OpenProblemPreferences.java index cc92f8cace6..11200aa0e0f 100644 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/OpenProblemPreferences.java +++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/OpenProblemPreferences.java @@ -37,7 +37,7 @@ public class OpenProblemPreferences implements IObjectActionDelegate { public void run(IAction action) { if (selection instanceof IStructuredSelection) { IStructuredSelection ss = (IStructuredSelection) selection; - ArrayList<IProblem> list = new ArrayList<IProblem>(); + ArrayList<IProblem> list = new ArrayList<>(); IResource resource = null; for (Iterator<?> iterator = ss.iterator(); iterator.hasNext();) { Object el = iterator.next(); diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java index 734f225f27c..baf6e0daed7 100644 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java +++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java @@ -107,7 +107,7 @@ public class CodanPreferencePage extends FieldEditorOverlayPage implements IWork public void selectionChanged(SelectionChangedEvent event) { if (infoButton != null && event.getSelection() instanceof ITreeSelection) { ITreeSelection s = (ITreeSelection) event.getSelection(); - ArrayList<IProblem> list = new ArrayList<IProblem>(); + ArrayList<IProblem> list = new ArrayList<>(); for (Iterator<?> iterator = s.iterator(); iterator.hasNext();) { Object o = iterator.next(); if (o instanceof IProblem) { @@ -251,7 +251,7 @@ public class CodanPreferencePage extends FieldEditorOverlayPage implements IWork } private static void asynchronouslyUpdateMarkers(final IResource resource) { - final Set<IFile> filesToUpdate = new HashSet<IFile>(); + final Set<IFile> filesToUpdate = new HashSet<>(); final IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow active = workbench.getActiveWorkbenchWindow(); final IWorkbenchPage page = active.getActivePage(); @@ -307,7 +307,7 @@ public class CodanPreferencePage extends FieldEditorOverlayPage implements IWork private static void removeMarkersForDisabledProblems(IResource resource, IProgressMonitor monitor) { CheckersRegistry chegistry = CheckersRegistry.getInstance(); - Set<String> markerTypes = new HashSet<String>(); + Set<String> markerTypes = new HashSet<>(); for (IChecker checker : chegistry) { Collection<IProblem> problems = chegistry.getRefProblems(checker); for (IProblem problem : problems) { diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java index c48e0d08e42..6a47f9da134 100644 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java +++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java @@ -51,7 +51,7 @@ import org.eclipse.ui.preferences.ScopedPreferenceStore; */ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage implements IWorkbenchPropertyPage { // Stores all created field editors - private List<FieldEditor> editors = new ArrayList<FieldEditor>(); + private List<FieldEditor> editors = new ArrayList<>(); // Stores owning element of properties private IAdaptable element; // Additional buttons for property pages diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FileScopePreferencePage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FileScopePreferencePage.java index 764e76ec83a..2557abcdeee 100644 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FileScopePreferencePage.java +++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FileScopePreferencePage.java @@ -127,13 +127,13 @@ public class FileScopePreferencePage extends PreferencePage { private ListDialogField<String> createListContents(FileScopeProblemPreference entryToEdit, String key, String label, String descriptor, String[] buttonLabels) { ExclusionPatternAdapter adapter = new ExclusionPatternAdapter(); - ListDialogField<String> patternList = new ListDialogField<String>(adapter, buttonLabels, + ListDialogField<String> patternList = new ListDialogField<>(adapter, buttonLabels, new ExclusionInclusionLabelProvider(descriptor)); patternList.setDialogFieldListener(adapter); patternList.setLabelText(label); patternList.enableButton(IDX_EDIT, false); IPath[] pattern = entryToEdit.getAttribute(key); - ArrayList<String> elements = new ArrayList<String>(pattern.length); + ArrayList<String> elements = new ArrayList<>(pattern.length); for (int i = 0; i < pattern.length; i++) { String patternName = pattern[i].toString(); if (patternName.length() > 0) diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/LaunchModesPropertyPage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/LaunchModesPropertyPage.java index fd4e23f2f87..4e83a3db70e 100644 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/LaunchModesPropertyPage.java +++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/LaunchModesPropertyPage.java @@ -46,7 +46,7 @@ public class LaunchModesPropertyPage extends FieldEditorPreferencePage { runInEditor = false; } setPreferenceStore(prefStore); - editors = new ArrayList<FieldEditor>(); + editors = new ArrayList<>(); } @Override diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/views/ProblemDetailsExtensions.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/views/ProblemDetailsExtensions.java index 4f762cf6e61..650462267dd 100644 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/views/ProblemDetailsExtensions.java +++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/views/ProblemDetailsExtensions.java @@ -32,7 +32,7 @@ public class ProblemDetailsExtensions { public static final String ALL = "*";//$NON-NLS-1$ private static final String EXTENSION_POINT_NAME = "codanProblemDetails"; //$NON-NLS-1$ private static boolean extensionsLoaded; - private static HashMap<String, Collection<?>> map = new HashMap<String, Collection<?>>(); + private static HashMap<String, Collection<?>> map = new HashMap<>(); private static synchronized void readExtensions() { if (extensionsLoaded) @@ -109,7 +109,7 @@ public class ProblemDetailsExtensions { public static Collection<AbstractCodanProblemDetailsProvider> getProviders(String id) { readExtensions(); - Collection<AbstractCodanProblemDetailsProvider> providers = new ArrayList<AbstractCodanProblemDetailsProvider>(); + Collection<AbstractCodanProblemDetailsProvider> providers = new ArrayList<>(); Collection<?> collection1 = getCollection(id); Collection<?> collection2 = getCollection(ALL); providers.addAll(resolveProviders(collection1)); diff --git a/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/spawner/EnvironmentReader.java b/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/spawner/EnvironmentReader.java index 8ba9529945d..6e0adcf8a8f 100644 --- a/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/spawner/EnvironmentReader.java +++ b/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/spawner/EnvironmentReader.java @@ -39,7 +39,7 @@ public class EnvironmentReader { } else { envVarsNormalized = envVars; } - rawVars = new ArrayList<String>(); + rawVars = new ArrayList<>(); Map<String, String> envMap = System.getenv(); for (String var : envMap.keySet()) { String value = envMap.get(var); diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserEfsFileMatchingTest.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserEfsFileMatchingTest.java index 0286d70cad9..27c808c29b8 100644 --- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserEfsFileMatchingTest.java +++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserEfsFileMatchingTest.java @@ -96,7 +96,7 @@ public class ErrorParserEfsFileMatchingTest extends TestCase { Assert.assertNotNull(fProject); mockErrorParserId = addErrorParserExtension("MockErrorParser", MockErrorParser.class); } - errorList = new ArrayList<ProblemMarkerInfo>(); + errorList = new ArrayList<>(); } @Override diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserFileMatchingTest.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserFileMatchingTest.java index 32a588f5177..0d7797fd1bd 100644 --- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserFileMatchingTest.java +++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserFileMatchingTest.java @@ -99,7 +99,7 @@ public class ErrorParserFileMatchingTest extends TestCase { Assert.assertNotNull(fProject); mockErrorParserId = addErrorParserExtension("MockErrorParser", MockErrorParser.class); } - errorList = new ArrayList<ProblemMarkerInfo>(); + errorList = new ArrayList<>(); } @Override diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserManagerTest.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserManagerTest.java index e9cc8dc7133..60b1e601d2f 100644 --- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserManagerTest.java +++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserManagerTest.java @@ -96,7 +96,7 @@ public class ErrorParserManagerTest extends TestCase { desc.setAutoBuilding(false); workspace.setDescription(desc); - errorList = new ArrayList<ProblemMarkerInfo>(); + errorList = new ArrayList<>(); cProject = createProject("errorparsersanity"); markerGenerator = new IMarkerGenerator() { @Override diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GenericErrorParserTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GenericErrorParserTests.java index c4e6282622b..d7f3eeba67b 100644 --- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GenericErrorParserTests.java +++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GenericErrorParserTests.java @@ -222,7 +222,7 @@ public abstract class GenericErrorParserTests extends TestCase { numWarnings = 0; numInfos = 0; uniqFiles = new ArrayList(0); - descriptions = new ArrayList<String>(0); + descriptions = new ArrayList<>(0); fFileNameComparator = new FileNameComparator(); } } diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/RegexErrorParserTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/RegexErrorParserTests.java index 68cb5cad54a..1ac765f5d2b 100644 --- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/RegexErrorParserTests.java +++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/RegexErrorParserTests.java @@ -91,7 +91,7 @@ public class RegexErrorParserTests extends TestCase { protected void setUp() throws Exception { fProject = ResourceHelper.createCDTProject(TEST_PROJECT_NAME); assertNotNull(fProject); - errorList = new ArrayList<ProblemMarkerInfo>(); + errorList = new ArrayList<>(); } @Override diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/RefreshScopeTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/RefreshScopeTests.java index eb0861a06db..eec00efd37b 100644 --- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/RefreshScopeTests.java +++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/RefreshScopeTests.java @@ -225,7 +225,7 @@ public class RefreshScopeTests extends TestCase { RefreshScopeManager manager = RefreshScopeManager.getInstance(); manager.clearAllData(); - HashMap<IResource, List<RefreshExclusion>> config1_resourceMap = new HashMap<IResource, List<RefreshExclusion>>(); + HashMap<IResource, List<RefreshExclusion>> config1_resourceMap = new HashMap<>(); config1_resourceMap.put(fFolder1, new LinkedList<RefreshExclusion>()); config1_resourceMap.put(fFolder2, new LinkedList<RefreshExclusion>()); manager.setResourcesToExclusionsMap(fProject, config1, config1_resourceMap); diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/StorableCdtVariablesTest.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/StorableCdtVariablesTest.java index 75ff556d43b..71645992666 100644 --- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/StorableCdtVariablesTest.java +++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/StorableCdtVariablesTest.java @@ -67,7 +67,7 @@ public class StorableCdtVariablesTest extends TestCase { } { ICdtVariable[] vars = supplier.getMacros(desc); - List<String> macroStrings = new ArrayList<String>(); + List<String> macroStrings = new ArrayList<>(); for (ICdtVariable var : vars) { macroStrings.add(var.getName() + '=' + var.getStringValue()); } @@ -85,7 +85,7 @@ public class StorableCdtVariablesTest extends TestCase { } { ICdtVariable[] vars = supplier.getMacros(desc); - List<String> macroStrings = new ArrayList<String>(); + List<String> macroStrings = new ArrayList<>(); for (ICdtVariable var : vars) { macroStrings.add(var.getName() + '=' + var.getStringValue()); } diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/WeakHashSetTest.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/WeakHashSetTest.java index f128e32bd64..ddddf7ad052 100644 --- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/WeakHashSetTest.java +++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/WeakHashSetTest.java @@ -59,7 +59,7 @@ public class WeakHashSetTest extends TestCase { */ public void testHashSetBasic() { // create sample objects - WeakHashSet<MockClass> weakSet = new WeakHashSet<MockClass>(); + WeakHashSet<MockClass> weakSet = new WeakHashSet<>(); MockClass a1 = new MockClass("a"); MockClass a2 = new MockClass("a"); @@ -103,7 +103,7 @@ public class WeakHashSetTest extends TestCase { * Note that regular {@link WeakHashSet} would fail the test. */ public void testHashSetSyncronization() throws Exception { - final WeakHashSet<Integer> weakSet = new WeakHashSetSynchronized<Integer>(1); + final WeakHashSet<Integer> weakSet = new WeakHashSetSynchronized<>(1); Thread[] threads = new Thread[5000]; for (int i = 0; i < threads.length; i++) { diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsExtensionsTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsExtensionsTests.java index a3232678a00..ead0274c84a 100644 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsExtensionsTests.java +++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsExtensionsTests.java @@ -114,7 +114,7 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase { { // test provider defined as an extension List<ILanguageSettingsProvider> providers = LanguageSettingsManager.getWorkspaceProviders(); - List<String> ids = new ArrayList<String>(); + List<String> ids = new ArrayList<>(); for (ILanguageSettingsProvider provider : providers) { ids.add(provider.getId()); } @@ -153,7 +153,7 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase { assertNull(provider.getSettingEntries(null, FILE_0, LANG_ID)); // benchmarks matching extension point definition - List<ICLanguageSettingEntry> entriesExt = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entriesExt = new ArrayList<>(); entriesExt.add(new CIncludePathEntry("/usr/include/", ICSettingEntry.BUILTIN | ICSettingEntry.LOCAL | ICSettingEntry.RESOLVED | ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.UNDEFINED)); entriesExt.add(new CMacroEntry("TEST_DEFINE", "100", 0)); @@ -193,7 +193,7 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase { assertNull(provider.getLanguageScope()); // benchmarks matching extension point definition - List<ICLanguageSettingEntry> entriesExt = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entriesExt = new ArrayList<>(); entriesExt.add(new CIncludePathEntry("/usr/include/", ICSettingEntry.BUILTIN)); // retrieve entries from extension point @@ -229,9 +229,9 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase { */ public void testBaseProvider() throws Exception { // define benchmarks - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); - List<String> languages = new ArrayList<String>(2); + List<String> languages = new ArrayList<>(2); languages.add("bogus.language.id"); languages.add(LANG_ID); @@ -264,16 +264,16 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase { */ public void testBaseProviderConfigure() throws Exception { // sample entries - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("/usr/include/", 0)); - List<String> languages = new ArrayList<String>(); + List<String> languages = new ArrayList<>(); languages.add(LANG_ID); // create LanguageSettingsBaseProvider LanguageSettingsBaseProvider provider1 = new LanguageSettingsBaseProvider(); LanguageSettingsBaseProvider provider2 = new LanguageSettingsBaseProvider(); { // configure provider1 - Map<String, String> properties = new HashMap<String, String>(); + Map<String, String> properties = new HashMap<>(); properties.put("key1", "value1"); properties.put("key2", null); properties.put("key3", ""); @@ -293,7 +293,7 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase { } { // configure provider2 - Map<String, String> properties = new HashMap<String, String>(); + Map<String, String> properties = new HashMap<>(); properties.put("key1", "value1"); provider2.configureProvider(PROVIDER_0, PROVIDER_NAME_0, languages, entries, properties); assertEquals(PROVIDER_0, provider2.getId()); @@ -314,7 +314,7 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase { public void testBaseProviderCantReconfigure() throws Exception { // create LanguageSettingsBaseProvider LanguageSettingsBaseProvider provider = new LanguageSettingsBaseProvider(); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("/usr/include/", 0)); // configure it provider.configureProvider("test.id", "test.name", null, entries, null); @@ -347,7 +347,7 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase { assertEquals(null, provider.getLanguageScope()); assertEquals("", provider.getProperty(EXTENSION_SERIALIZABLE_PROVIDER_MISSING_PARAMETER)); - List<ICLanguageSettingEntry> expected = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> expected = new ArrayList<>(); expected.add(EXTENSION_EDITABLE_PROVIDER_ENTRY); assertEquals(expected, provider.getSettingEntries(null, null, null)); } diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsListenersTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsListenersTests.java index 858a4274b48..062014dafd3 100644 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsListenersTests.java +++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsListenersTests.java @@ -157,7 +157,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { // create a provider ILanguageSettingsProvider mockProvider = new MockListenerRegisterer(PROVIDER_1, PROVIDER_NAME_1); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(mockProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription) @@ -210,7 +210,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { { // create a provider 1 ILanguageSettingsProvider mockProvider = new MockListenerRegisterer(PROVIDER_1, PROVIDER_NAME_1); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(mockProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription1).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription1) @@ -220,7 +220,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { { // create a provider 2 ILanguageSettingsProvider mockProvider = new MockListenerRegisterer(PROVIDER_1, PROVIDER_NAME_1); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(mockProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription2).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription2) @@ -271,7 +271,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { // add global provider ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager .getWorkspaceProvider(EXTENSION_REGISTERER_PROVIDER_ID); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(workspaceProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription) @@ -326,7 +326,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { { // add global provider to configuration 1 - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(workspaceProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription1).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription1) @@ -335,7 +335,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { } { // add global provider to configuration 2 - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(workspaceProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription2).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription2) @@ -389,7 +389,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { { // add global provider to configuration 1 - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(workspaceProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription1).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription1) @@ -398,7 +398,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { } { // add global provider to configuration 2 - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(workspaceProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription2).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription2) @@ -426,7 +426,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { { // remove global provider from configuration 1 - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); ((ILanguageSettingsProvidersKeeper) cfgDescription1).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription1) .getLanguageSettingProviders(); @@ -463,7 +463,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { // add global provider ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager .getWorkspaceProvider(EXTENSION_REGISTERER_PROVIDER_ID); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(workspaceProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription) @@ -491,7 +491,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { // add global provider ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager .getWorkspaceProvider(EXTENSION_REGISTERER_PROVIDER_ID); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(workspaceProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription) @@ -534,7 +534,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { // add global provider which is not engaged ILanguageSettingsProvider provider = new MockListenerRegisterer(PROVIDER_CUSTOM_GLOBAL, PROVIDER_CUSTOM_GLOBAL_NAME); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>( + List<ILanguageSettingsProvider> providers = new ArrayList<>( workspaceProvidersOriginal); providers.add(provider); LanguageSettingsManager.setWorkspaceProviders(providers); @@ -542,7 +542,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { } { // remove global provider and restore original list - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>( + List<ILanguageSettingsProvider> providers = new ArrayList<>( workspaceProvidersOriginal); LanguageSettingsManager.setWorkspaceProviders(providers); assertEquals(0, MockListenerRegisterer.getCount(PROVIDER_CUSTOM_GLOBAL)); @@ -577,7 +577,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper); // add global provider - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(workspaceProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription) @@ -594,14 +594,14 @@ public class LanguageSettingsListenersTests extends BaseTestCase { // add global provider ILanguageSettingsProvider provider = new MockListenerRegisterer(PROVIDER_CUSTOM_GLOBAL, PROVIDER_CUSTOM_GLOBAL_NAME); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider); LanguageSettingsManager.setWorkspaceProviders(providers); assertEquals(1, MockListenerRegisterer.getCount(PROVIDER_CUSTOM_GLOBAL)); } { // remove global provider - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>( + List<ILanguageSettingsProvider> providers = new ArrayList<>( workspaceProvidersOriginal); LanguageSettingsManager.setWorkspaceProviders(providers); assertEquals(0, MockListenerRegisterer.getCount(PROVIDER_CUSTOM_GLOBAL)); @@ -636,7 +636,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper); // clear providers - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription) .getLanguageSettingProviders(); @@ -665,7 +665,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { // create a provider and add to cfgDescription ILanguageSettingsProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(mockProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription) @@ -700,7 +700,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper); // clear providers - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription) .getLanguageSettingProviders(); @@ -730,10 +730,10 @@ public class LanguageSettingsListenersTests extends BaseTestCase { // create a provider and add entries MockLanguageSettingsEditableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(SAMPLE_LSE); mockProvider.setSettingEntries(cfgDescription, project, null, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(mockProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription) @@ -774,7 +774,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper); // create a provider and add to cfgDescription - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1)); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription) @@ -804,7 +804,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { String cfgDescriptionId = cfgDescription.getId(); // Add entries - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(SAMPLE_LSE); List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription) .getLanguageSettingProviders(); @@ -848,7 +848,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper); // create a provider and add to cfgDescription - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1)); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription) @@ -882,7 +882,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { String cfgDescriptionId = cfgDescription.getId(); // Add entries - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(SAMPLE_LSE); List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription) .getLanguageSettingProviders(); @@ -915,7 +915,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { String cfgDescriptionId = cfgDescription.getId(); // Add same entries - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(SAMPLE_LSE); List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription) .getLanguageSettingProviders(); @@ -957,7 +957,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper); // clear providers - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription) .getLanguageSettingProviders(); @@ -993,7 +993,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { ((MockLanguageSettingsEditableProvider) rawProvider).clear(); assertEquals(null, wspProvider.getSettingEntries(cfgDescription, project, null)); // add the provider to cfgDescription - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(wspProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription) @@ -1028,7 +1028,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper); // clear providers - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription) .getLanguageSettingProviders(); @@ -1064,13 +1064,13 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertTrue(rawProvider instanceof MockLanguageSettingsEditableProvider); ((MockLanguageSettingsEditableProvider) rawProvider).clear(); // add entries - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(SAMPLE_LSE); ((MockLanguageSettingsEditableProvider) rawProvider).setSettingEntries(cfgDescription, project, null, entries); assertEquals(SAMPLE_LSE, wspProvider.getSettingEntries(cfgDescription, project, null).get(0)); // add the provider to cfgDescription - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(wspProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription) @@ -1123,7 +1123,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { ((MockLanguageSettingsEditableProvider) rawProvider).clear(); assertEquals(null, wspProvider.getSettingEntries(cfgDescription, project, null)); // add the provider to cfgDescription - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(wspProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription) @@ -1144,7 +1144,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertTrue(rawProvider instanceof MockLanguageSettingsEditableProvider); ((MockLanguageSettingsEditableProvider) rawProvider).clear(); // add entries - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(SAMPLE_LSE); ((MockLanguageSettingsEditableProvider) rawProvider).setSettingEntries(null, project, null, entries); assertEquals(SAMPLE_LSE, wspProvider.getSettingEntries(null, project, null).get(0)); @@ -1279,7 +1279,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper); // add mock provider to cfgDescription - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); MockLanguageSettingsEditableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1); providers.add(mockProvider); @@ -1315,7 +1315,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertEquals(1, providers.size()); MockLanguageSettingsEditableProvider mockProvider = (MockLanguageSettingsEditableProvider) providers.get(0); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(SAMPLE_LSE); mockProvider.setSettingEntries(cfgDescription, project, null, entries); mockProvider.serializeLanguageSettings(cfgDescription); @@ -1355,7 +1355,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper); // add mock provider to cfgDescription - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); MockLanguageSettingsEditableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1); providers.add(mockProvider); @@ -1391,7 +1391,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertEquals(1, providers.size()); MockLanguageSettingsEditableProvider mockProvider = (MockLanguageSettingsEditableProvider) providers.get(0); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(SAMPLE_LSE); mockProvider.setSettingEntries(cfgDescription, null, null, entries); mockProvider.serializeLanguageSettings(cfgDescription); @@ -1432,7 +1432,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper); // add mock provider to cfgDescription - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); MockLanguageSettingsEditableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1); providers.add(mockProvider); @@ -1468,7 +1468,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertEquals(1, providers.size()); MockLanguageSettingsEditableProvider mockProvider = (MockLanguageSettingsEditableProvider) providers.get(0); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(SAMPLE_LSE); mockProvider.setSettingEntries(cfgDescription, folder, null, entries); mockProvider.serializeLanguageSettings(cfgDescription); @@ -1509,7 +1509,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper); // add mock provider to cfgDescription - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); MockLanguageSettingsEditableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1); providers.add(mockProvider); @@ -1545,7 +1545,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertEquals(1, providers.size()); MockLanguageSettingsEditableProvider mockProvider = (MockLanguageSettingsEditableProvider) providers.get(0); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(SAMPLE_LSE); mockProvider.setSettingEntries(cfgDescription, file, null, entries); mockProvider.serializeLanguageSettings(cfgDescription); @@ -1589,7 +1589,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper); // add mock provider to cfgDescription - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); MockLanguageSettingsEditableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1); providers.add(mockProvider); @@ -1625,7 +1625,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase { assertEquals(1, providers.size()); MockLanguageSettingsEditableProvider mockProvider = (MockLanguageSettingsEditableProvider) providers.get(0); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(SAMPLE_LSE); mockProvider.setSettingEntries(cfgDescription, folder, null, entries); mockProvider.setSettingEntries(cfgDescription, file1, null, entries); diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsManagerTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsManagerTests.java index 83071da50c0..687b151cac3 100644 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsManagerTests.java +++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsManagerTests.java @@ -67,7 +67,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase { */ class MockConfigurationDescription extends CModelMock.DummyCConfigurationDescription implements ILanguageSettingsProvidersKeeper { - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); String[] defaultProvidersIds = null; public MockConfigurationDescription(String id) { @@ -76,7 +76,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase { @Override public void setLanguageSettingProviders(List<? extends ILanguageSettingsProvider> providers) { - this.providers = new ArrayList<ILanguageSettingsProvider>(providers); + this.providers = new ArrayList<>(providers); } @Override @@ -159,7 +159,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase { // set providers ILanguageSettingsProvider provider1 = new MockProvider(PROVIDER_1, PROVIDER_NAME_1, null); ILanguageSettingsProvider provider2 = new MockProvider(PROVIDER_2, PROVIDER_NAME_2, null); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider1); providers.add(provider2); cfgDescription.setLanguageSettingProviders(providers); @@ -197,7 +197,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase { MockProvider dupe1 = new MockProvider(PROVIDER_0, PROVIDER_NAME_1, null); MockProvider dupe2 = new MockProvider(PROVIDER_0, PROVIDER_NAME_2, null); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(dupe1); providers.add(dupe2); @@ -218,7 +218,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase { // set impolite provider returning null by getSettingEntries() ILanguageSettingsProvider providerNull = new MockProvider(PROVIDER_1, PROVIDER_NAME_1, null); { - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(providerNull); cfgDescription.setLanguageSettingProviders(providers); } @@ -245,7 +245,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase { } }); { - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(providerNull); cfgDescription.setLanguageSettingProviders(providers); } @@ -292,10 +292,10 @@ public class LanguageSettingsManagerTests extends BaseTestCase { public void testProvider_Basic() throws Exception { final MockConfigurationDescription modelCfgDescription = new MockConfigurationDescription(CFG_ID); - final List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + final List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); // define provider returning entries when configuration id matches and null otherwise ILanguageSettingsProvider providerYes = new MockProvider(PROVIDER_0, PROVIDER_NAME_0, null) { @Override @@ -347,18 +347,18 @@ public class LanguageSettingsManagerTests extends BaseTestCase { MockConfigurationDescription cfgDescription = new MockConfigurationDescription(CFG_ID); // create couple of providers - List<ICLanguageSettingEntry> entries1 = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries1 = new ArrayList<>(); entries1.add(new CIncludePathEntry("value1", 1)); entries1.add(new CIncludePathEntry("value2", 2)); - List<ICLanguageSettingEntry> entries2 = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries2 = new ArrayList<>(); entries2.add(new CIncludePathEntry("value1", 1)); entries2.add(new CIncludePathEntry("value2", 2)); entries2.add(new CIncludePathEntry("value3", 2)); ILanguageSettingsProvider provider1 = new MockProvider(PROVIDER_1, PROVIDER_NAME_1, entries1); ILanguageSettingsProvider provider2 = new MockProvider(PROVIDER_2, PROVIDER_NAME_2, entries2); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider1); providers.add(provider2); cfgDescription.setLanguageSettingProviders(providers); @@ -412,9 +412,9 @@ public class LanguageSettingsManagerTests extends BaseTestCase { assertNotNull(emptySettingsPath); // store the entries in parent folder - final List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + final List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); ILanguageSettingsProvider provider = new MockProvider(PROVIDER_0, PROVIDER_NAME_0, null) { @Override public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, @@ -423,7 +423,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase { return entries; } if (rc != null && rc.equals(emptySettingsPath)) { - return new ArrayList<ICLanguageSettingEntry>(0); + return new ArrayList<>(0); } return null; } @@ -480,9 +480,9 @@ public class LanguageSettingsManagerTests extends BaseTestCase { assertNotNull(emptySettingsPath); // store the entries as default entries - final List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + final List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); ILanguageSettingsProvider provider = new MockProvider(PROVIDER_0, PROVIDER_NAME_0, null) { @Override public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, @@ -515,7 +515,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase { MockConfigurationDescription cfgDescription = new MockConfigurationDescription(CFG_ID); // contribute the entries - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); entries.add(new CMacroEntry("MACRO0", "value0", 0)); entries.add(new CIncludePathEntry("path1", 0)); @@ -523,7 +523,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase { entries.add(new CIncludePathEntry("path2", 0)); ILanguageSettingsProvider provider0 = new MockProvider(PROVIDER_0, PROVIDER_NAME_0, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider0); cfgDescription.setLanguageSettingProviders(providers); @@ -549,13 +549,13 @@ public class LanguageSettingsManagerTests extends BaseTestCase { MockConfigurationDescription cfgDescription = new MockConfigurationDescription(CFG_ID); // contribute the entries - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path", ICSettingEntry.BUILTIN)); entries.add(new CIncludePathEntry("path", ICSettingEntry.UNDEFINED)); entries.add(new CIncludePathEntry("path", 0)); ILanguageSettingsProvider provider0 = new MockProvider(PROVIDER_0, PROVIDER_NAME_0, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider0); cfgDescription.setLanguageSettingProviders(providers); @@ -573,12 +573,12 @@ public class LanguageSettingsManagerTests extends BaseTestCase { MockConfigurationDescription cfgDescription = new MockConfigurationDescription(CFG_ID); // contribute the entries - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path", ICSettingEntry.UNDEFINED)); entries.add(new CIncludePathEntry("path", 0)); ILanguageSettingsProvider provider0 = new MockProvider(PROVIDER_0, PROVIDER_NAME_0, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider0); cfgDescription.setLanguageSettingProviders(providers); @@ -595,14 +595,14 @@ public class LanguageSettingsManagerTests extends BaseTestCase { MockConfigurationDescription cfgDescription = new MockConfigurationDescription(CFG_ID); // contribute the entries - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); CIncludePathEntry localIncludeEntry = new CIncludePathEntry("path-local", ICSettingEntry.LOCAL); CIncludePathEntry systemIncludeEntry = new CIncludePathEntry("path-system", 0); entries.add(localIncludeEntry); entries.add(systemIncludeEntry); ILanguageSettingsProvider provider0 = new MockProvider(PROVIDER_0, PROVIDER_NAME_0, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider0); cfgDescription.setLanguageSettingProviders(providers); @@ -639,10 +639,10 @@ public class LanguageSettingsManagerTests extends BaseTestCase { MockConfigurationDescription cfgDescription = new MockConfigurationDescription(CFG_ID); // contribute the entries - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); // contribute the higher ranked entries - List<ICLanguageSettingEntry> entriesHigh = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entriesHigh = new ArrayList<>(); entriesHigh.add(new CIncludePathEntry("path0", ICSettingEntry.RESOLVED)); entriesHigh.add(new CIncludePathEntry("path1", 0)); entriesHigh.add(new CIncludePathEntry("path2", ICSettingEntry.UNDEFINED)); @@ -650,7 +650,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase { providers.add(highRankProvider); // contribute the lower ranked entries - List<ICLanguageSettingEntry> entriesLow = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entriesLow = new ArrayList<>(); entriesLow.add(new CIncludePathEntry("path0", ICSettingEntry.BUILTIN)); entriesLow.add(new CIncludePathEntry("path1", ICSettingEntry.UNDEFINED)); entriesLow.add(new CIncludePathEntry("path2", 0)); @@ -680,7 +680,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase { MockConfigurationDescription cfgDescription = new MockConfigurationDescription(CFG_ID); // contribute the entries - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); entries.add(new CMacroEntry("MACRO0", "value0", 0)); entries.add(new CIncludePathEntry("path1", 0)); @@ -690,7 +690,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase { entries.add(new CIncludeFileEntry("include-path-file", 0)); ILanguageSettingsProvider provider0 = new MockProvider(PROVIDER_0, PROVIDER_NAME_0, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider0); cfgDescription.setLanguageSettingProviders(providers); @@ -735,7 +735,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase { } { // set test provider - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(workspaceProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); } @@ -797,7 +797,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase { { // set new entries to the raw provider - List<ICLanguageSettingEntry> newEntries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> newEntries = new ArrayList<>(); newEntries.add(new CIncludePathEntry("path0", 0)); newEntries.add(new CIncludePathEntry("path1", 0)); ((LanguageSettingsSerializableProvider) rawProvider).setSettingEntries(null, null, null, newEntries); @@ -834,14 +834,14 @@ public class LanguageSettingsManagerTests extends BaseTestCase { } // define new entries for the raw provider - List<ICLanguageSettingEntry> newEntries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> newEntries = new ArrayList<>(); newEntries.add(new CIncludePathEntry("path0", 0)); newEntries.add(new CIncludePathEntry("path1", 0)); newEntries.add(new CIncludePathEntry("path2", 0)); { // replace raw provider - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); LanguageSettingsSerializableProvider newRawProvider = new LanguageSettingsSerializableProvider( EXTENSION_EDITABLE_PROVIDER_ID, PROVIDER_NAME_0); newRawProvider.setSettingEntries(null, null, null, newEntries); @@ -868,7 +868,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase { assertNotSame(provider, rawProvider); // attempt to "replace" with workspace provider (which is a wrapper around raw provider), should be NOOP - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider); LanguageSettingsManager.setWorkspaceProviders(providers); ILanguageSettingsProvider newRawProvider = LanguageSettingsManager.getRawProvider(provider); diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsPersistenceProjectTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsPersistenceProjectTests.java index 682ef3dc6d7..9ff5fd507b6 100644 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsPersistenceProjectTests.java +++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsPersistenceProjectTests.java @@ -82,7 +82,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { @Override public void setLanguageSettingProviders(List<? extends ILanguageSettingsProvider> providers) { - this.providers = new ArrayList<ILanguageSettingsProvider>(providers); + this.providers = new ArrayList<>(providers); } @Override @@ -227,7 +227,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { // create new provider list LanguageSettingsSerializableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_0, PROVIDER_NAME_0); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(originalProviders); + List<ILanguageSettingsProvider> providers = new ArrayList<>(originalProviders); providers.add(mockProvider); assertTrue(originalSize != providers.size()); @@ -254,7 +254,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { // try to write to it providers try { - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); ((ILanguageSettingsProvidersKeeper) cfgDescriptionReadOnly).setLanguageSettingProviders(providers); fail("WriteAccessException was expected but it was not throw."); } catch (WriteAccessException e) { @@ -271,7 +271,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { } } - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); { @@ -290,7 +290,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { PROVIDER_NAME_1); LanguageSettingsManager.setStoringEntriesInProjectArea(mockProvider, true); mockProvider.setSettingEntries(cfgDescriptionWritable, null, null, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(mockProvider); ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable) @@ -368,7 +368,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { * Persist and reload a customized provider defined in the workspace. */ public void testWorkspacePersistence_ModifiedExtensionProvider() throws Exception { - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); { @@ -417,7 +417,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { * Check persistence of unmodified extension provider in the workspace. */ public void testWorkspacePersistence_UnmodifiedExtensionProvider() throws Exception { - List<ICLanguageSettingEntry> extensionEntries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> extensionEntries = new ArrayList<>(); extensionEntries.add(EXTENSION_SERIALIZABLE_PROVIDER_ENTRY); { // test initial state of the extension provider @@ -451,7 +451,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { // replace entries assertTrue(rawProvider instanceof LanguageSettingsSerializableProvider); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); ((LanguageSettingsSerializableProvider) rawProvider).setSettingEntries(null, null, null, entries); @@ -479,7 +479,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { } { // save workspace provider (as opposed to raw provider) - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); ILanguageSettingsProvider provider = LanguageSettingsManager .getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID); providers.add(provider); @@ -513,7 +513,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { // replace extension provider ILanguageSettingsProvider provider = new MockLanguageSettingsSerializableProvider( EXTENSION_BASE_PROVIDER_ID, PROVIDER_NAME_0); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider); // note that this will also serialize workspace providers LanguageSettingsManager.setWorkspaceProviders(providers); @@ -572,7 +572,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { public void testProjectPersistence_SerializableProviderDOM() throws Exception { Element rootElement = null; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); { @@ -590,7 +590,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { serializableProvider.setSettingEntries(null, null, null, entries); LanguageSettingsManager.setStoringEntriesInProjectArea(serializableProvider, true); - ArrayList<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + ArrayList<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(serializableProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -634,7 +634,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { public void testProjectPersistence_UserProviderDOM() throws Exception { Element rootElement = null; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); { @@ -653,7 +653,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { serializableProvider.setSettingEntries(null, null, null, entries); LanguageSettingsManager.setStoringEntriesInProjectArea(serializableProvider, true); - ArrayList<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + ArrayList<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(serializableProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -698,9 +698,9 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { public void testProjectPersistence_TwoConfigurationsDOM() throws Exception { Element rootElement = null; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); - List<ICLanguageSettingEntry> entries2 = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries2 = new ArrayList<>(); entries2.add(new CIncludePathEntry("path2", 0)); { @@ -722,7 +722,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { PROVIDER_0, PROVIDER_NAME_0); LanguageSettingsManager.setStoringEntriesInProjectArea(provider1, true); provider1.setSettingEntries(null, null, null, entries); - ArrayList<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + ArrayList<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider1); ((ILanguageSettingsProvidersKeeper) cfgDescription1).setLanguageSettingProviders(providers); } @@ -737,7 +737,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { PROVIDER_0, PROVIDER_NAME_0); LanguageSettingsManager.setStoringEntriesInProjectArea(provider2, true); provider2.setSettingEntries(null, null, null, entries2); - ArrayList<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + ArrayList<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider2); ((ILanguageSettingsProvidersKeeper) cfgDescription2).setLanguageSettingProviders(providers); } @@ -840,7 +840,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { public void testProjectPersistence_SubclassedSerializableProviderDOM() throws Exception { Element rootElement = null; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); { @@ -858,7 +858,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { serializableProvider.setSettingEntries(null, null, null, entries); LanguageSettingsManager.setStoringEntriesInProjectArea(serializableProvider, true); - ArrayList<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + ArrayList<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(serializableProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -915,7 +915,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper); // populate with provider defined as extension - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(providerExt); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -973,7 +973,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { MockLanguageSettingsSerializableProvider providerOverride = new MockLanguageSettingsSerializableProvider( idExt, PROVIDER_NAME_0); LanguageSettingsManager.setStoringEntriesInProjectArea(providerOverride, true); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(providerOverride); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -1016,10 +1016,10 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { public void testProjectPersistence_MixedProvidersDOM() throws Exception { Element rootElement = null; - List<ICLanguageSettingEntry> entries_31 = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries_31 = new ArrayList<>(); entries_31.add(new CIncludePathEntry("path0", 0)); - List<ICLanguageSettingEntry> entries_32 = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries_32 = new ArrayList<>(); entries_32.add(new CIncludePathEntry("path2", 0)); ILanguageSettingsProvider providerExt; @@ -1048,7 +1048,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { LanguageSettingsManager.setStoringEntriesInProjectArea(mockProvider2, true); mockProvider2.setSettingEntries(null, null, null, entries_32); - ArrayList<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + ArrayList<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(providerExt); providers.add(mockProvider1); providers.add(mockProvider2); @@ -1112,7 +1112,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { IFile xmlStorageFilePrj = project.getFile(LANGUAGE_SETTINGS_PROJECT_XML); String xmlPrjOutOfTheWay; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); { @@ -1131,7 +1131,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { PROVIDER_NAME_0); LanguageSettingsManager.setStoringEntriesInProjectArea(mockProvider, true); mockProvider.setSettingEntries(cfgDescriptionWritable, null, null, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(mockProvider); ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable) @@ -1270,7 +1270,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { Element prjStorageElement = null; Element wspStorageElement = null; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); { @@ -1289,7 +1289,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { // do not store entries inside project LanguageSettingsManager.setStoringEntriesInProjectArea(serializableProvider, false); - ArrayList<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + ArrayList<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(serializableProvider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -1350,7 +1350,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { String xmlStorageFileWspLocation; String xmlWspOutOfTheWay; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); { @@ -1369,7 +1369,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { PROVIDER_NAME_0); LanguageSettingsManager.setStoringEntriesInProjectArea(mockProvider, false); mockProvider.setSettingEntries(cfgDescriptionWritable, null, null, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(mockProvider); ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable).setLanguageSettingProviders(providers); List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable) @@ -1543,7 +1543,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { assertNotNull(cfgDescription); assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper); - ArrayList<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + ArrayList<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(providerExt); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -1600,7 +1600,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { assertNotNull(cfgDescription); assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper); - ArrayList<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + ArrayList<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(providerExt); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -1654,8 +1654,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase { * Test serialization of global providers exactly equal extension in workspace area. */ public void testWorkspacePersistence_ProviderExtensionCopy() throws Exception { - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); { // get extension provider diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsProviderReferencedProjectsTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsProviderReferencedProjectsTests.java index dca7af1c990..cf6b679525d 100644 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsProviderReferencedProjectsTests.java +++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsProviderReferencedProjectsTests.java @@ -122,7 +122,7 @@ public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCas ICConfigurationDescription cfgDescription = cfgDescriptions[0]; Map<String, String> refs = cfgDescription.getReferenceInfo(); assertEquals(1, refs.size()); - Set<String> referencedProjectsNames = new LinkedHashSet<String>(refs.keySet()); + Set<String> referencedProjectsNames = new LinkedHashSet<>(refs.keySet()); assertEquals(projectReferenced.getName(), referencedProjectsNames.toArray()[0]); } @@ -184,7 +184,7 @@ public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCas assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderNonRef.getId()); assertTrue(userProviderNonRef instanceof LanguageSettingsGenericProvider); // add sample entries - ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + ArrayList<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(nonRefEntry); ((LanguageSettingsGenericProvider) userProviderNonRef).setSettingEntries(null, null, null, entries); } @@ -207,7 +207,7 @@ public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCas assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderRef.getId()); assertTrue(userProviderRef instanceof LanguageSettingsGenericProvider); // add sample entries - ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + ArrayList<ICLanguageSettingEntry> entries = new ArrayList<>(); CIncludePathEntry refEntryNotExported = CDataUtil.createCIncludePathEntry("referenced-not-exported", 0); entries.add(refEntry); entries.add(refEntryNotExported); @@ -276,7 +276,7 @@ public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCas assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderRef.getId()); assertTrue(userProviderRef instanceof LanguageSettingsGenericProvider); // add sample entries - ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + ArrayList<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(entryExportedA); entries.add(entryNotExportedA); ((LanguageSettingsGenericProvider) userProviderRef).setSettingEntries(null, null, null, entries); @@ -296,7 +296,7 @@ public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCas assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderRef.getId()); assertTrue(userProviderRef instanceof LanguageSettingsGenericProvider); // add sample entries - ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + ArrayList<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(entryExportedB); entries.add(entryNotExportedB); ((LanguageSettingsGenericProvider) userProviderRef).setSettingEntries(null, null, null, entries); diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsScannerInfoProviderTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsScannerInfoProviderTests.java index 3c6ac45f6d1..a33b3fbb76c 100644 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsScannerInfoProviderTests.java +++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsScannerInfoProviderTests.java @@ -255,7 +255,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { CIncludeFileEntry includeFileEntry = new CIncludeFileEntry(includeFile, 0); CMacroFileEntry macroFileEntry = new CMacroFileEntry(macroFile, 0); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(includePathEntry); entries.add(includeLocalPathEntry); entries.add(macroEntry); @@ -264,7 +264,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { // add provider to the configuration ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -320,7 +320,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { CIncludePathEntry includeLocalPathEntry2 = new CIncludePathEntry(incFolder2, ICSettingEntry.LOCAL); // #include "..." CIncludePathEntry includePathEntry2 = new CIncludePathEntry(incFolder2, 0); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(includePathEntry); entries.add(includeLocalPathEntry); // reverse order for incPath2 @@ -329,7 +329,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { // add provider to the configuration ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -371,12 +371,12 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { IFolder frameworkFolder = ResourceHelper.createFolder(project, "Fmwk"); CIncludePathEntry frameworkPathEntry = new CIncludePathEntry(frameworkFolder, ICSettingEntry.FRAMEWORKS_MAC); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(frameworkPathEntry); // add provider to the configuration ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -418,7 +418,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { CIncludePathEntry includePathEntry2 = new CIncludePathEntry(incFolder, 0); CIncludePathEntry includeLocalPathEntry2 = new CIncludePathEntry(incFolder, ICSettingEntry.LOCAL); // #include "..." - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(includePathEntry); entries.add(includeLocalPathEntry); entries.add(includePathEntry2); @@ -426,7 +426,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { // add provider to the configuration ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -488,7 +488,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { ICSettingEntry.VALUE_WORKSPACE_PATH); CIncludePathEntry incFilesystemEntry = new CIncludePathEntry(incFilesystem, 0); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(incWorkspaceEntry_1); entries.add(incWorkspaceEntry_2); entries.add(incWorkspaceEntry_3); @@ -497,7 +497,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { // add provider to the configuration ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -546,12 +546,12 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { // no-drive-letter folder defined by absolute path on the filesystem IPath incFilesystem = ResourceHelper.createWorkspaceFolder("includeFilesystem").setDevice(null); CIncludePathEntry incFilesystemEntry = new CIncludePathEntry(incFilesystem, 0); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(incFilesystemEntry); // add provider to the configuration ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -601,14 +601,14 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { CIncludePathEntry incProjNameEntry = new CIncludePathEntry(new Path("${ProjName}"), 0); CIncludePathEntry incProjNameMarkedResolvedEntry = new CIncludePathEntry( new Path("${ProjName}" + markedResolved), ICSettingEntry.RESOLVED); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(incRelativeEntry); entries.add(incProjNameEntry); entries.add(incProjNameMarkedResolvedEntry); // add provider to the configuration ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -682,7 +682,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { CIncludePathEntry incRelativeEntry_dot_slash = new CIncludePathEntry(new Path(relativePath_dot_slash), ICSettingEntry.LOCAL); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(incRelativeEntry_dot); entries.add(incRelativeEntry_dot_slash); entries.add(incRelativeEntry_dot_slash_path); @@ -693,7 +693,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { // add provider to the configuration ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -758,12 +758,12 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { // contribute the entries CIncludePathEntry incRelativeEntry = new CIncludePathEntry(envPathStr, 0); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(incRelativeEntry); // add provider to the configuration ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -819,7 +819,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { IFolder incFolder = ResourceHelper.createFolder(project, "include"); CIncludePathEntry includePathEntry = new CIncludePathEntry(incFolder, 0); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(includePathEntry); // add provider for parent folder @@ -827,7 +827,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { assertNull(provider.getSettingEntries(cfgDescription, file, null)); assertEquals(includePathEntry, provider.getSettingEntries(cfgDescription, parentFolder, null).get(0)); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -865,12 +865,12 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { // contribute the entries CIncludePathEntry incRelativeEntry = new CIncludePathEntry(envPathStr, ICSettingEntry.RESOLVED); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(incRelativeEntry); // add provider to the configuration ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); @@ -897,7 +897,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { ICLanguageSetting[] langSettings = rcDes.getLanguageSettings(); assertNotNull(langSettings); - List<String> languageIds = new ArrayList<String>(); + List<String> languageIds = new ArrayList<>(); for (ICLanguageSetting ls : langSettings) { String langId = ls.getLanguageId(); if (langId != null && !languageIds.contains(langId)) { @@ -926,7 +926,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { IResource rc, String languageId) { if (langId == null || langId.equals(languageId)) return entries; - return new ArrayList<ICLanguageSettingEntry>(); + return new ArrayList<>(); } } @@ -956,17 +956,17 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase { CIncludePathEntry incEntryA = new CIncludePathEntry(incFolderA, 0); CIncludePathEntry incEntryB = new CIncludePathEntry(incFolderB, 0); CIncludePathEntry incEntryC = new CIncludePathEntry(incFolderC, 0); - List<ICLanguageSettingEntry> entries1 = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries1 = new ArrayList<>(); entries1.add(incEntryA); entries1.add(incEntryB); - List<ICLanguageSettingEntry> entries2 = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries2 = new ArrayList<>(); entries2.add(incEntryC); entries2.add(incEntryB); // add providers to the configuration ILanguageSettingsProvider provider1 = new MockProviderLang(PROVIDER_ID, PROVIDER_NAME, langId1, entries1); ILanguageSettingsProvider provider2 = new MockProviderLang(PROVIDER_ID_2, PROVIDER_NAME, langId2, entries2); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider1); providers.add(provider2); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsSerializableProviderTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsSerializableProviderTests.java index 115cbd80d0a..0eba63f364f 100644 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsSerializableProviderTests.java +++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsSerializableProviderTests.java @@ -108,9 +108,9 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { */ public void testProvider_SettersGetters() throws Exception { // benchmark data - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); - List<String> languages = new ArrayList<String>(); + List<String> languages = new ArrayList<>(); languages.add(LANG_ID); // create a provider @@ -170,11 +170,11 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { LanguageSettingsManager.setStoringEntriesInProjectArea(provider, true); provider.setProperty(ATTR_PARAMETER, VALUE_PARAMETER); - List<String> languageScope = new ArrayList<String>(); + List<String> languageScope = new ArrayList<>(); languageScope.add(LANG_ID); provider.setLanguageScope(languageScope); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 1)); provider.setSettingEntries(null, null, null, entries); @@ -219,11 +219,11 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { LanguageSettingsManager.setStoringEntriesInProjectArea(provider, true); provider.setProperty(ATTR_PARAMETER, VALUE_PARAMETER); - List<String> languageScope = new ArrayList<String>(); + List<String> languageScope = new ArrayList<>(); languageScope.add(LANG_ID); provider.setLanguageScope(languageScope); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 1)); provider.setSettingEntries(null, null, null, entries); @@ -268,11 +268,11 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { LanguageSettingsManager.setStoringEntriesInProjectArea(provider, true); provider.setProperty(ATTR_PARAMETER, VALUE_PARAMETER); - List<String> languageScope = new ArrayList<String>(); + List<String> languageScope = new ArrayList<>(); languageScope.add(LANG_ID); provider.setLanguageScope(languageScope); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 1)); provider.setSettingEntries(null, null, null, entries); @@ -396,7 +396,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { * Test serialization of language scope. */ public void testLanguagesDOM() throws Exception { - List<String> expectedLanguageIds = new ArrayList<String>(); + List<String> expectedLanguageIds = new ArrayList<>(); expectedLanguageIds.add(LANG_ID); expectedLanguageIds.add(LANG_ID_1); @@ -433,11 +433,11 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { */ public void testLanguageScopeDOM() throws Exception { // benchmark entries - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); // define the scope - List<String> expectedLanguageIds = new ArrayList<String>(); + List<String> expectedLanguageIds = new ArrayList<>(); expectedLanguageIds.add(LANG_ID); expectedLanguageIds.add(LANG_ID_1); @@ -521,7 +521,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { public void testNullConfigurationDOM() throws Exception { // provider/configuration/language/resource/settingEntry Element elementProvider; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); { // create a provider and serialize its settings @@ -552,7 +552,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { public void testNullLanguageDOM() throws Exception { // provider/configuration/language/resource/settingEntry Element elementProvider; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); { // create a provider and serialize its settings @@ -582,9 +582,9 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { */ public void testNullLanguageScopeDOM() throws Exception { // define benchmark entries - List<ICLanguageSettingEntry> entriesNullLanguage = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entriesNullLanguage = new ArrayList<>(); entriesNullLanguage.add(new CIncludePathEntry("path_null", 0)); - List<ICLanguageSettingEntry> entriesLanguage = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entriesLanguage = new ArrayList<>(); entriesLanguage.add(new CIncludePathEntry("path", 0)); Element elementProvider; @@ -660,7 +660,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { public void testNullResourceDOM() throws Exception { // provider/configuration/language/resource/settingEntry Element elementProvider; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); { // create a provider and serialize its settings @@ -691,7 +691,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { public void testNullConfigurationLanguageDOM() throws Exception { // provider/configuration/language/resource/settingEntry Element elementProvider; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); { // create a provider and serialize its settings @@ -723,7 +723,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { public void testNullConfigurationResourceDOM() throws Exception { // provider/configuration/language/resource/settingEntry Element elementProvider; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); { // create a provider and serialize its settings @@ -755,7 +755,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { public void testNullLanguageResourceDOM() throws Exception { // provider/configuration/language/resource/settingEntry Element elementProvider; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); { // create a provider and serialize its settings @@ -787,7 +787,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { public void testNullConfigurationLanguageResourceFlagDOM() throws Exception { // provider/configuration/language/resource/settingEntry Element elementProvider; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); int flag = 0; entries.add(new CIncludePathEntry("path0", flag)); { @@ -821,7 +821,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { */ public void testCIncludePathEntryDOM() throws Exception { Element elementProvider; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 1)); { // create a provider and serialize its settings @@ -856,7 +856,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { */ public void testCIncludeFileEntryDOM() throws Exception { Element elementProvider; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludeFileEntry("a-path", 1)); { // create a provider and serialize its settings @@ -890,7 +890,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { */ public void testCMacroEntryDOM() throws Exception { Element elementProvider; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CMacroEntry("MACRO0", "value0", 1)); { // create a provider and serialize its settings @@ -924,7 +924,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { */ public void testCMacroFileEntryDOM() throws Exception { Element elementProvider; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CMacroFileEntry("a-path", 1)); { // create a provider and serialize its settings @@ -958,7 +958,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { */ public void testCLibraryPathEntryDOM() throws Exception { Element elementProvider; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CLibraryPathEntry("a-path", 1)); { // create a provider and serialize its settings @@ -992,7 +992,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { */ public void testCLibraryFileEntryDOM() throws Exception { Element elementProvider; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CLibraryFileEntry("a-path", 1)); { // create a provider and serialize its settings @@ -1026,7 +1026,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { */ public void testMixedSettingEntriesDOM() throws Exception { Element elementProvider; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 1)); entries.add(new CIncludePathEntry("path1", 1)); entries.add(new CMacroEntry("MACRO0", "value0", 1)); @@ -1058,7 +1058,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { */ public void testEntryFlagsDOM() throws Exception { Element elementProvider; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY | ICSettingEntry.LOCAL | ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED | ICSettingEntry.UNDEFINED @@ -1097,9 +1097,9 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { public void testLanguageAndNullDOM() throws Exception { Element elementProvider = null; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); - List<ICLanguageSettingEntry> entries2 = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries2 = new ArrayList<>(); entries2.add(new CIncludePathEntry("path2", 0)); { @@ -1135,9 +1135,9 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { public void testTwoLanguagesDOM() throws Exception { Element elementProvider = null; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); - List<ICLanguageSettingEntry> entries2 = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries2 = new ArrayList<>(); entries2.add(new CIncludePathEntry("path2", 0)); { @@ -1183,9 +1183,9 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { Element elementProvider = null; - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); - List<ICLanguageSettingEntry> entries2 = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries2 = new ArrayList<>(); entries2.add(new CIncludePathEntry("path2", 0)); { @@ -1235,7 +1235,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { PROVIDER_NAME_1); // store the entries in parent folder - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path0", 0)); provider.setSettingEntries(null, parentFolder, LANG_ID, entries); provider.setSettingEntries(null, emptySettingsPath, LANG_ID, new ArrayList<ICLanguageSettingEntry>()); @@ -1276,16 +1276,16 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { */ public void testEquals() throws Exception { // create sample entries - List<ICLanguageSettingEntry> sampleEntries_1 = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> sampleEntries_1 = new ArrayList<>(); sampleEntries_1.add(new CMacroEntry("MACRO0", "value0", 1)); sampleEntries_1.add(new CIncludePathEntry("path0", 1)); sampleEntries_1.add(new CIncludePathEntry("path1", 1)); - List<ICLanguageSettingEntry> sampleEntries_2 = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> sampleEntries_2 = new ArrayList<>(); sampleEntries_2.add(new CIncludePathEntry("path0", 1)); // create sample languages - List<String> sampleLanguages = new ArrayList<String>(); + List<String> sampleLanguages = new ArrayList<>(); sampleLanguages.add(LANG_ID); // create a model provider @@ -1317,7 +1317,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { assertTrue(provider1.hashCode() == provider2.hashCode()); assertTrue(provider1.equals(provider2)); // replace languages - List<String> sampleLanguages2 = new ArrayList<String>(); + List<String> sampleLanguages2 = new ArrayList<>(); sampleLanguages2.add(LANG_ID_1); provider2.setLanguageScope(sampleLanguages2); assertFalse(provider1.hashCode() == provider2.hashCode()); @@ -1359,7 +1359,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { assertTrue(provider1.hashCode() == provider2.hashCode()); assertTrue(provider1.equals(provider2)); // replace entries - List<ICLanguageSettingEntry> changedEntries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> changedEntries = new ArrayList<>(); changedEntries.add(new CMacroEntry("MACROX", "valueX", 1)); provider2.setSettingEntries(MOCK_CFG, MOCK_RC, LANG_ID, changedEntries); assertFalse(provider1.hashCode() == provider2.hashCode()); @@ -1374,7 +1374,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { assertTrue(provider1.hashCode() == provider2.hashCode()); assertTrue(provider1.equals(provider2)); // replace default entries - List<ICLanguageSettingEntry> changedEntries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> changedEntries = new ArrayList<>(); changedEntries.add(new CIncludePathEntry("pathX", 1)); provider2.setSettingEntries(null, null, LANG_ID, changedEntries); assertFalse(provider1.hashCode() == provider2.hashCode()); @@ -1450,15 +1450,15 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { */ public void testClone() throws Exception { // define sample data - List<ICLanguageSettingEntry> sampleEntries_1 = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> sampleEntries_1 = new ArrayList<>(); sampleEntries_1.add(new CIncludePathEntry("path0", 1)); sampleEntries_1.add(new CIncludePathEntry("path1", 1)); sampleEntries_1.add(new CMacroEntry("MACRO0", "value0", 1)); - List<ICLanguageSettingEntry> sampleEntries_2 = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> sampleEntries_2 = new ArrayList<>(); sampleEntries_2.add(new CIncludePathEntry("path0", 1)); - List<String> sampleLanguages = new ArrayList<String>(); + List<String> sampleLanguages = new ArrayList<>(); sampleLanguages.add(LANG_ID); // create a model provider @@ -1520,7 +1520,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { */ public void testCloneShallow() throws Exception { // define sample data - List<String> sampleLanguages = new ArrayList<String>(); + List<String> sampleLanguages = new ArrayList<>(); sampleLanguages.add(LANG_ID); // create a model provider @@ -1541,7 +1541,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { assertEquals(false, LanguageSettingsManager.isStoringEntriesInProjectArea(provider1)); LanguageSettingsManager.setStoringEntriesInProjectArea(provider1, true); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); entries.add(new CIncludePathEntry("path", 1)); provider1.setSettingEntries(null, null, null, entries); @@ -1578,7 +1578,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { CLibraryFileEntry libraryFileEntry2 = new CLibraryFileEntry("file2", 0); // place entries in unsorted list - List<ICLanguageSettingEntry> unsortedEntries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> unsortedEntries = new ArrayList<>(); unsortedEntries.add(macroEntry1); unsortedEntries.add(macroFileEntry1); unsortedEntries.add(macroEntry2); @@ -1635,7 +1635,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { CLibraryFileEntry libraryFileEntry2 = new CLibraryFileEntry("file_A", 0); // place entries in unsorted list - List<ICLanguageSettingEntry> unsortedEntries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> unsortedEntries = new ArrayList<>(); // macros will be sorted by name unsortedEntries.add(macroEntry2); unsortedEntries.add(macroEntry1); @@ -1687,7 +1687,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase { CMacroEntry macroEntry3 = new CMacroEntry("MACRO_3", null, 0); // place entries in unsorted list - List<ICLanguageSettingEntry> unsortedEntries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> unsortedEntries = new ArrayList<>(); // macros will be sorted by name and keep order for the same name unsortedEntries.add(macroEntry2A); unsortedEntries.add(macroEntry3); diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/MockListenerRegisterer.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/MockListenerRegisterer.java index e2111b05977..f3edf1fb737 100644 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/MockListenerRegisterer.java +++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/MockListenerRegisterer.java @@ -38,7 +38,7 @@ public class MockListenerRegisterer extends LanguageSettingsSerializableProvider } } - private List<ListenerCount> register = new ArrayList<ListenerCount>(); + private List<ListenerCount> register = new ArrayList<>(); public void registerListener(MockListenerRegisterer listener) { for (ListenerCount lc : register) { diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/TranslationUnitTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/TranslationUnitTests.java index 955989c44f7..c7778bdbe29 100644 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/TranslationUnitTests.java +++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/TranslationUnitTests.java @@ -78,7 +78,7 @@ public class TranslationUnitTests extends TranslationUnitBaseTest { * Simple sanity tests for the getElement() call */ public void testGetElement() throws Exception { - Deque<String> missing = new ArrayDeque<String>(); + Deque<String> missing = new ArrayDeque<>(); ITranslationUnit tu = CProjectHelper.findTranslationUnit(testProject, "exetest.c"); for (int x = 0; x < expectedStringList.length; x++) { diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CConfigurationDescriptionExportSettings.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CConfigurationDescriptionExportSettings.java index 09416a40c61..a5a3751e864 100644 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CConfigurationDescriptionExportSettings.java +++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CConfigurationDescriptionExportSettings.java @@ -79,11 +79,11 @@ public class CConfigurationDescriptionExportSettings extends BaseTestCase { assertEquals(extSettings.length, 1); checkEquivContents(extSettings[0].getEntries(), entries); - List<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>(Arrays.asList(entries)); + List<ICLanguageSettingEntry> list = new ArrayList<>(Arrays.asList(entries)); list.remove(3); list.remove(2); checkEquivContents(extSettings[0].getEntries(ICSettingEntry.MACRO), list.toArray()); - list = new ArrayList<ICLanguageSettingEntry>(Arrays.asList(entries)); + list = new ArrayList<>(Arrays.asList(entries)); list.remove(0); list.remove(0); checkEquivContents(extSettings[0].getEntries(ICSettingEntry.INCLUDE_PATH), list.toArray()); @@ -93,11 +93,11 @@ public class CConfigurationDescriptionExportSettings extends BaseTestCase { assertEquals(extSettings.length, 1); checkEquivContents(extSettings[0].getEntries(), entries); - list = new ArrayList<ICLanguageSettingEntry>(Arrays.asList(entries)); + list = new ArrayList<>(Arrays.asList(entries)); list.remove(3); list.remove(2); checkEquivContents(extSettings[0].getEntries(ICSettingEntry.MACRO), list.toArray()); - list = new ArrayList<ICLanguageSettingEntry>(Arrays.asList(entries)); + list = new ArrayList<>(Arrays.asList(entries)); list.remove(0); list.remove(0); checkEquivContents(extSettings[0].getEntries(ICSettingEntry.INCLUDE_PATH), list.toArray()); @@ -110,7 +110,7 @@ public class CConfigurationDescriptionExportSettings extends BaseTestCase { assertFalse(Arrays.asList(macros).contains(entries[1])); assertFalse(Arrays.asList(includes).contains(entries[2])); assertFalse(Arrays.asList(includes).contains(entries[3])); - Map<String, String> map = new HashMap<String, String>(); + Map<String, String> map = new HashMap<>(); map.put(projectName5, ""); dess[0].setReferenceInfo(map); ICLanguageSettingEntry updatedMacros[] = ls.getSettingEntries(ICSettingEntry.MACRO); diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CProjectDescriptionDeltaTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CProjectDescriptionDeltaTests.java index fec70dc650c..9e55ac3dca8 100644 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CProjectDescriptionDeltaTests.java +++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CProjectDescriptionDeltaTests.java @@ -94,7 +94,7 @@ public class CProjectDescriptionDeltaTests extends BaseTestCase { } private static List<ICDescriptionDelta> findDeltas(ICDescriptionDelta delta, int type) { - List<ICDescriptionDelta> list = new ArrayList<ICDescriptionDelta>(); + List<ICDescriptionDelta> list = new ArrayList<>(); if ((delta.getChangeFlags() & type) != 0) { list.add(delta); } @@ -598,7 +598,7 @@ public class CProjectDescriptionDeltaTests extends BaseTestCase { assertNotNull(cfgDescription); // Modification SOURCE_ADDED - List<ICSourceEntry> sourceEntries = new ArrayList<ICSourceEntry>( + List<ICSourceEntry> sourceEntries = new ArrayList<>( Arrays.asList(cfgDescription.getSourceEntries())); ICSourceEntry testSourceEntry = new CSourceEntry(project.getFullPath().append("test_src"), null, ICSettingEntry.RESOLVED); @@ -648,7 +648,7 @@ public class CProjectDescriptionDeltaTests extends BaseTestCase { ICConfigurationDescription cfgDescription = prjDescription.getConfigurations()[0]; assertNotNull(cfgDescription); - List<ICSourceEntry> sourceEntries = new ArrayList<ICSourceEntry>( + List<ICSourceEntry> sourceEntries = new ArrayList<>( Arrays.asList(cfgDescription.getSourceEntries())); sourceEntries.add(testSourceEntry); cfgDescription.setSourceEntries(sourceEntries.toArray(new ICSourceEntry[0])); @@ -819,7 +819,7 @@ public class CProjectDescriptionDeltaTests extends BaseTestCase { // Modification CFG_REF_ADDED String testKey = "key"; String testValue = "value"; - Map<String, String> refs = new HashMap<String, String>(); + Map<String, String> refs = new HashMap<>(); refs.put(testKey, testValue); cfgDescription.setReferenceInfo(refs); @@ -867,7 +867,7 @@ public class CProjectDescriptionDeltaTests extends BaseTestCase { ICConfigurationDescription cfgDescription = prjDescription.getConfigurations()[0]; assertNotNull(cfgDescription); - Map<String, String> refs = new HashMap<String, String>(); + Map<String, String> refs = new HashMap<>(); refs.put(testKey, testValue); cfgDescription.setReferenceInfo(refs); mngr.setProjectDescription(project, prjDescription); @@ -1027,7 +1027,7 @@ public class CProjectDescriptionDeltaTests extends BaseTestCase { // Modification LANGUAGE_SETTINGS_PROVIDERS ILanguageSettingsProvider provider = new LanguageSettingsSerializableProvider("test.id", "test.name"); - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); providers.add(provider); ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers); diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CProjectDescriptionStorageTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CProjectDescriptionStorageTests.java index 07dfa8fc3a5..2f895030f48 100644 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CProjectDescriptionStorageTests.java +++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CProjectDescriptionStorageTests.java @@ -465,7 +465,7 @@ public class CProjectDescriptionStorageTests extends BaseTestCase { */ private static class OurResourceChangeListener implements IResourceChangeListener { boolean changeDetected; - private Set<IPath> filesToWatch = new HashSet<IPath>(); + private Set<IPath> filesToWatch = new HashSet<>(); @Override public synchronized void resourceChanged(IResourceChangeEvent event) { diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/ExternalSettingsProviderTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/ExternalSettingsProviderTests.java index b32f161bae1..2a352d69877 100644 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/ExternalSettingsProviderTests.java +++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/ExternalSettingsProviderTests.java @@ -356,7 +356,7 @@ public class ExternalSettingsProviderTests extends BaseTestCase { des = model.getProjectDescription(project, false); cfgDes = des.getConfigurations()[0]; ICFolderDescription root = cfgDes.getRootFolderDescription(); - HashMap<String, ICLanguageSetting> languageSettingsById = new HashMap<String, ICLanguageSetting>(); + HashMap<String, ICLanguageSetting> languageSettingsById = new HashMap<>(); for (ICLanguageSetting s : root.getLanguageSettings()) { languageSettingsById.put(s.getLanguageId(), s); } @@ -388,7 +388,7 @@ public class ExternalSettingsProviderTests extends BaseTestCase { des = model.getProjectDescription(project, false); cfgDes = des.getConfigurations()[0]; root = cfgDes.getRootFolderDescription(); - languageSettingsById = new HashMap<String, ICLanguageSetting>(); + languageSettingsById = new HashMap<>(); for (ICLanguageSetting s : root.getLanguageSettings()) { languageSettingsById.put(s.getLanguageId(), s); } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPAttributeTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPAttributeTests.java index 48be53ec17e..4ac1c542fc0 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPAttributeTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPAttributeTests.java @@ -113,7 +113,7 @@ public class AST2CPPAttributeTests extends AST2TestBase { shouldVisitAttributes = true; } - private List<IASTAttributeSpecifier> specifiers = new ArrayList<IASTAttributeSpecifier>(); + private List<IASTAttributeSpecifier> specifiers = new ArrayList<>(); public List<IASTAttributeSpecifier> getAttributes() { return specifiers; diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2SpecTestBase.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2SpecTestBase.java index cd08241332b..bf22f18a414 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2SpecTestBase.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2SpecTestBase.java @@ -175,8 +175,8 @@ public class AST2SpecTestBase extends AST2TestBase { shouldVisitNames = true; } - public List<IASTName> nameList = new ArrayList<IASTName>(); - public List<String> problemBindings = new ArrayList<String>(); + public List<IASTName> nameList = new ArrayList<>(); + public List<String> problemBindings = new ArrayList<>(); public int numNullBindings = 0; @Override diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/CharArrayMapTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/CharArrayMapTest.java index f3412ab002e..a996799ed43 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/CharArrayMapTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/CharArrayMapTest.java @@ -68,7 +68,7 @@ public class CharArrayMapTest extends TestCase { private static long timeMap(char[][] keys) { long start = System.currentTimeMillis(); - CharArrayMap<Integer> map = new CharArrayMap<Integer>(keys.length); + CharArrayMap<Integer> map = new CharArrayMap<>(keys.length); for (int i = 0; i < keys.length; i++) { map.put(keys[i], i); } @@ -98,7 +98,7 @@ public class CharArrayMapTest extends TestCase { char[] key3 = "third key".toCharArray(); char[] key4 = "forth key".toCharArray(); - CharArrayMap<Integer> map = new CharArrayMap<Integer>(); + CharArrayMap<Integer> map = new CharArrayMap<>(); assertTrue(map.isEmpty()); assertEquals(0, map.size()); @@ -125,7 +125,7 @@ public class CharArrayMapTest extends TestCase { assertTrue(map.containsValue(3)); assertTrue(map.containsValue(4)); - Set<Integer> values = new HashSet<Integer>(); + Set<Integer> values = new HashSet<>(); values.add(1); values.add(2); values.add(3); @@ -178,7 +178,7 @@ public class CharArrayMapTest extends TestCase { "metallica".toCharArray(), "in flames".toCharArray(), "lamb of god".toCharArray(), "carcass".toCharArray() }; - CharArrayMap<Integer> map = new CharArrayMap<Integer>(); + CharArrayMap<Integer> map = new CharArrayMap<>(); assertTrue(map.isEmpty()); assertEquals(0, map.size()); @@ -200,7 +200,7 @@ public class CharArrayMapTest extends TestCase { assertTrue(map.containsValue(i)); } - Set<Integer> values = new HashSet<Integer>(); + Set<Integer> values = new HashSet<>(); for (int i = 0; i < keys.length; i++) { values.add(i); } @@ -267,7 +267,7 @@ public class CharArrayMapTest extends TestCase { public void testProperFail() { char[] hello = "hello".toCharArray(); - CharArrayMap<Integer> map = new CharArrayMap<Integer>(); + CharArrayMap<Integer> map = new CharArrayMap<>(); Integer value = 9; try { diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/prefix/CompletionTestBase.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/prefix/CompletionTestBase.java index 3ecb8f8d815..9bd10dbe9d2 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/prefix/CompletionTestBase.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/prefix/CompletionTestBase.java @@ -140,7 +140,7 @@ public class CompletionTestBase extends BaseTestCase { } protected List<IBinding> proposeBindings(IASTCompletionNode completionNode, boolean isPrefix) { - List<IBinding> proposals = new ArrayList<IBinding>(); + List<IBinding> proposals = new ArrayList<>(); boolean handleMacros = false; IASTName[] names = completionNode.getNames(); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/RewriteTester.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/RewriteTester.java index d3ac75ce15c..1d4bbdeaba7 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/RewriteTester.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/RewriteTester.java @@ -64,10 +64,10 @@ public class RewriteTester extends TestSuite { private static ArrayList<RewriteBaseTest> createTests(BufferedReader inputReader) throws Exception { String line; - List<TestSourceFile> files = new ArrayList<TestSourceFile>(); + List<TestSourceFile> files = new ArrayList<>(); TestSourceFile actFile = null; MatcherState matcherState = MatcherState.skip; - ArrayList<RewriteBaseTest> testCases = new ArrayList<RewriteBaseTest>(); + ArrayList<RewriteBaseTest> testCases = new ArrayList<>(); String testName = null; String className = null; boolean bevorFirstTest = true; @@ -77,7 +77,7 @@ public class RewriteTester extends TestSuite { if (!bevorFirstTest) { RewriteBaseTest test = createTestClass(className, testName, files); testCases.add(test); - files = new ArrayList<TestSourceFile>(); + files = new ArrayList<>(); className = null; testName = null; } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/astwriter/SourceRewriteTester.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/astwriter/SourceRewriteTester.java index e537e6c0ef6..384f4f0add7 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/astwriter/SourceRewriteTester.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/astwriter/SourceRewriteTester.java @@ -91,7 +91,7 @@ public class SourceRewriteTester extends TestSuite { private static ArrayList<RewriteBaseTest> createTests(BufferedReader inputReader) throws Exception { ASTWriterTestSourceFile file = null; MatcherState matcherState = MatcherState.skip; - ArrayList<RewriteBaseTest> testCases = new ArrayList<RewriteBaseTest>(); + ArrayList<RewriteBaseTest> testCases = new ArrayList<>(); String line; while ((line = inputReader.readLine()) != null) { diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/comenthandler/CommentHandlingTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/comenthandler/CommentHandlingTest.java index 549742c906c..68f0ad65715 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/comenthandler/CommentHandlingTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/comenthandler/CommentHandlingTest.java @@ -143,7 +143,7 @@ public class CommentHandlingTest extends RewriteBaseTest { } private String getCommentMapResult(Map<IASTNode, List<IASTComment>> map) { - TreeSet<IASTNode> keyTree = new TreeSet<IASTNode>(new NodeOffsetComparator()); + TreeSet<IASTNode> keyTree = new TreeSet<>(new NodeOffsetComparator()); keyTree.addAll(map.keySet()); StringBuilder output = new StringBuilder(); for (IASTNode actNode : keyTree) { diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/PreprocessorTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/PreprocessorTests.java index c7cb3b143ce..c048701ad1f 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/PreprocessorTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/PreprocessorTests.java @@ -1283,7 +1283,7 @@ public class PreprocessorTests extends PreprocessorTestsBase { public void testC99_6_7_5_3_5_Bug104869() throws Exception { initializeScanner(); // read in expected tokens - List<IToken> expect = new ArrayList<IToken>(); + List<IToken> expect = new ArrayList<>(); IToken t = fScanner.nextToken(); while (t.getType() != IToken.tDECR) { expect.add(t); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBugsTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBugsTests.java index a4578fdf5e9..6389b0884d0 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBugsTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBugsTests.java @@ -2424,8 +2424,8 @@ public class IndexBugsTests extends BaseTestCase { } // Collect files and folders - final Set<IFile> files = new HashSet<IFile>(); - final Set<IFolder> folders = new HashSet<IFolder>(); + final Set<IFile> files = new HashSet<>(); + final Set<IFolder> folders = new HashSet<>(); folders.add(root); root.accept(new IResourceVisitor() { @Override diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCompositeTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCompositeTests.java index 0c812759568..f0e678d6ed6 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCompositeTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCompositeTests.java @@ -83,7 +83,7 @@ public class IndexCompositeTests extends BaseTestCase { // class B {}; public void testPairDisjointContent() throws Exception { CharSequence[] contents = getContentsForTest(2); - List<ICProject> projects = new ArrayList<ICProject>(); + List<ICProject> projects = new ArrayList<>(); try { ProjectBuilder pb = new ProjectBuilder("projB_" + getName(), true); @@ -139,7 +139,7 @@ public class IndexCompositeTests extends BaseTestCase { // namespace X { class A2 {}; B2 b; C2 c; } public void testTripleLinear() throws Exception { CharSequence[] contents = getContentsForTest(3); - List<ICProject> projects = new ArrayList<ICProject>(); + List<ICProject> projects = new ArrayList<>(); try { ProjectBuilder pb = new ProjectBuilder("projC_" + getName(), true); @@ -255,7 +255,7 @@ public class IndexCompositeTests extends BaseTestCase { // void foo(C1 c) {} public void testTripleUpwardV() throws Exception { CharSequence[] contents = getContentsForTest(3); - List<ICProject> projects = new ArrayList<ICProject>(); + List<ICProject> projects = new ArrayList<>(); try { ProjectBuilder pb = new ProjectBuilder("projB_" + getName(), true); @@ -353,7 +353,7 @@ public class IndexCompositeTests extends BaseTestCase { // namespace X { class A2 {}; } public void testTripleDownwardV() throws Exception { CharSequence[] contents = getContentsForTest(3); - List<ICProject> projects = new ArrayList<ICProject>(); + List<ICProject> projects = new ArrayList<>(); try { ProjectBuilder pb = new ProjectBuilder("projC_" + getName(), true); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateTests.java index 6ceee77a9f9..188ff789288 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateTests.java @@ -1503,7 +1503,7 @@ public class IndexUpdateTests extends IndexTestBase { //} public void testDependentProjectGetsUpdated_Bug310837() throws Exception { CharSequence[] contents = getContentsForTest(2); - List<ICProject> projects = new ArrayList<ICProject>(); + List<ICProject> projects = new ArrayList<>(); try { ProjectBuilder projectABuilder = new ProjectBuilder("projA_" + getName(), true); diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/FileManager.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/FileManager.java index 2eba23a7e06..d61b1e25a76 100644 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/FileManager.java +++ b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/FileManager.java @@ -36,7 +36,7 @@ public class FileManager { HashSet<IFile> fileHandles; public FileManager() { - fileHandles = new HashSet<IFile>(); + fileHandles = new HashSet<>(); } public void addFile(IFile file) { diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/Main.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/Main.java index b91171cfd75..c4aa1f9c4f7 100644 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/Main.java +++ b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/Main.java @@ -414,7 +414,7 @@ public class Main { * @exception Exception thrown if a problem occurs during launching */ public static void main(String argString) throws Exception { - List<String> list = new ArrayList<String>(5); + List<String> list = new ArrayList<>(5); for (StringTokenizer tokens = new StringTokenizer(argString, " "); tokens.hasMoreElements();) list.add((String) tokens.nextElement()); main(list.toArray(new String[list.size()])); diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/NewMain.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/NewMain.java index 18e90e520f2..e73344924dd 100644 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/NewMain.java +++ b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/NewMain.java @@ -53,7 +53,7 @@ public class NewMain extends Main { * a scrapbook (i.e., swip-and-doit facility). */ public static void main(String argString) throws Exception { - List<String> list = new ArrayList<String>(5); + List<String> list = new ArrayList<>(5); for (StringTokenizer tokens = new StringTokenizer(argString, " "); tokens.hasMoreElements();) list.add((String) tokens.nextElement()); main(list.toArray(new String[list.size()])); diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/ResourceHelper.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/ResourceHelper.java index 3d5ca50c19a..e665e994f93 100644 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/ResourceHelper.java +++ b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/ResourceHelper.java @@ -72,8 +72,8 @@ public class ResourceHelper { private final static IProgressMonitor NULL_MONITOR = new NullProgressMonitor(); private static final int MAX_RETRY = 5; - private final static Set<String> externalFilesCreated = new HashSet<String>(); - private final static Set<IResource> resourcesCreated = new HashSet<IResource>(); + private final static Set<String> externalFilesCreated = new HashSet<>(); + private final static Set<IResource> resourcesCreated = new HashSet<>(); /** * Creates CDT project in a specific path in workspace and opens it. diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/TestSourceReader.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/TestSourceReader.java index 4111030de09..5fe92d9187d 100644 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/TestSourceReader.java +++ b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/TestSourceReader.java @@ -152,7 +152,7 @@ public class TestSourceReader { BufferedReader br = new BufferedReader(new InputStreamReader(in)); try { // Read the java file collecting comments until we encounter the test method. - List<StringBuilder> contents = new ArrayList<StringBuilder>(); + List<StringBuilder> contents = new ArrayList<>(); StringBuilder content = new StringBuilder(); for (String line = br.readLine(); line != null; line = br.readLine()) { line = line.replaceFirst("^\\s*", ""); // Replace leading whitespace, preserve trailing diff --git a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/TypeSearchScope.java b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/TypeSearchScope.java index 0e8c3ca06fe..8c892b30d1d 100644 --- a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/TypeSearchScope.java +++ b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/TypeSearchScope.java @@ -34,10 +34,10 @@ import org.eclipse.core.runtime.Path; */ public class TypeSearchScope implements ITypeSearchScope { - private Set<IPath> fPathSet = new HashSet<IPath>(); - private Set<IPath> fContainerSet = new HashSet<IPath>(); - private Set<ICProject> fProjectSet = new HashSet<ICProject>(); - private Set<ICProject> fEnclosingProjectSet = new HashSet<ICProject>(); + private Set<IPath> fPathSet = new HashSet<>(); + private Set<IPath> fContainerSet = new HashSet<>(); + private Set<ICProject> fProjectSet = new HashSet<>(); + private Set<ICProject> fEnclosingProjectSet = new HashSet<>(); private boolean fWorkspaceScope = false; // cached arrays diff --git a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/TypeUtil.java b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/TypeUtil.java index 3ccdb651794..212f4c0dd06 100644 --- a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/TypeUtil.java +++ b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/TypeUtil.java @@ -110,7 +110,7 @@ public class TypeUtil { * exception occurs while accessing its corresponding resource */ public static ICElement[] getTypes(ITranslationUnit tu) throws CModelException { - List<ICElement> typeList = new ArrayList<ICElement>(); + List<ICElement> typeList = new ArrayList<>(); ICElement[] children = tu.getChildren(); for (int i = 0; i < children.length; ++i) { if (isDeclaringType(children[i])) @@ -131,8 +131,8 @@ public class TypeUtil { */ public static ICElement[] getAllTypes(ITranslationUnit tu) throws CModelException { ICElement[] types = getTypes(tu); - ArrayList<ICElement> allTypes = new ArrayList<ICElement>(types.length); - ArrayList<ICElement> typesToTraverse = new ArrayList<ICElement>(types.length); + ArrayList<ICElement> allTypes = new ArrayList<>(types.length); + ArrayList<ICElement> typesToTraverse = new ArrayList<>(types.length); for (ICElement type : types) { typesToTraverse.add(type); } @@ -158,7 +158,7 @@ public class TypeUtil { * @return the immediate member types declared by this type */ public static ICElement[] getTypes(ICElement elem) throws CModelException { - List<ICElement> typeList = new ArrayList<ICElement>(); + List<ICElement> typeList = new ArrayList<>(); if (isDeclaringType(elem) && elem instanceof IParent) { ICElement[] children = ((IParent) elem).getChildren(); for (int i = 0; i < children.length; ++i) { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/ProjectLanguageConfiguration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/ProjectLanguageConfiguration.java index b26fe8b42a4..14afe485448 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/ProjectLanguageConfiguration.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/ProjectLanguageConfiguration.java @@ -54,8 +54,8 @@ public class ProjectLanguageConfiguration { * language mappings defined. */ public ProjectLanguageConfiguration() { - fConfigurationContentTypeMappings = new TreeMap<String, Map<String, String>>(); - fFileConfigurationMappings = new TreeMap<String, Map<String, String>>(); + fConfigurationContentTypeMappings = new TreeMap<>(); + fFileConfigurationMappings = new TreeMap<>(); } /** @@ -114,7 +114,7 @@ public class ProjectLanguageConfiguration { String configurationId = getId(configuration); Map<String, String> contentTypeMappings = fConfigurationContentTypeMappings.get(configurationId); if (contentTypeMappings == null) { - contentTypeMappings = new TreeMap<String, String>(); + contentTypeMappings = new TreeMap<>(); fConfigurationContentTypeMappings.put(configurationId, contentTypeMappings); } contentTypeMappings.put(contentType, language); @@ -161,7 +161,7 @@ public class ProjectLanguageConfiguration { public void addFileMapping(ICConfigurationDescription configuration, String filePath, String language) { Map<String, String> configurationMappings = fFileConfigurationMappings.get(filePath); if (configurationMappings == null) { - configurationMappings = new TreeMap<String, String>(); + configurationMappings = new TreeMap<>(); fFileConfigurationMappings.put(filePath, configurationMappings); } String configurationId = getId(configuration); @@ -245,12 +245,12 @@ public class ProjectLanguageConfiguration { */ public void setFileMappings(IFile file, Map<String, String> mappings) { fFileConfigurationMappings.put(file.getProjectRelativePath().toPortableString(), - new TreeMap<String, String>(mappings)); + new TreeMap<>(mappings)); } private Map<String, Map<String, String>> copyLanguageMappings(Map<String, Map<String, String>> mappings, boolean isReadOnly) { - Map<String, Map<String, String>> result = new TreeMap<String, Map<String, String>>(); + Map<String, Map<String, String>> result = new TreeMap<>(); Iterator<Entry<String, Map<String, String>>> entries = mappings.entrySet().iterator(); while (entries.hasNext()) { Entry<String, Map<String, String>> entry = entries.next(); @@ -258,7 +258,7 @@ public class ProjectLanguageConfiguration { if (isReadOnly) { map = Collections.unmodifiableMap(map); } else { - map = new TreeMap<String, String>(map); + map = new TreeMap<>(map); } result.put(entry.getKey(), map); } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/WorkspaceLanguageConfiguration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/WorkspaceLanguageConfiguration.java index c3a9991d43e..807885e59b0 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/WorkspaceLanguageConfiguration.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/WorkspaceLanguageConfiguration.java @@ -35,7 +35,7 @@ public class WorkspaceLanguageConfiguration { * language mappings defined. */ public WorkspaceLanguageConfiguration() { - fMappings = new TreeMap<String, String>(); + fMappings = new TreeMap<>(); } /** @@ -62,7 +62,7 @@ public class WorkspaceLanguageConfiguration { * @param mappings */ public void setWorkspaceMappings(Map<String, String> mappings) { - fMappings = new TreeMap<String, String>(mappings); + fMappings = new TreeMap<>(mappings); } /** diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsBaseProvider.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsBaseProvider.java index 9003a70a820..3f9ee6728be 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsBaseProvider.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsBaseProvider.java @@ -42,7 +42,7 @@ public class LanguageSettingsBaseProvider extends AbstractExecutableExtensionBas protected List<String> languageScope = null; /** Provider-specific properties */ - protected Map<String, String> properties = new HashMap<String, String>(); + protected Map<String, String> properties = new HashMap<>(); /** List of entries defined by this provider. */ private List<ICLanguageSettingEntry> entries = null; @@ -78,7 +78,7 @@ public class LanguageSettingsBaseProvider extends AbstractExecutableExtensionBas public LanguageSettingsBaseProvider(String id, String name, List<String> languages, List<ICLanguageSettingEntry> entries) { super(id, name); - this.languageScope = languages != null ? new ArrayList<String>(languages) : null; + this.languageScope = languages != null ? new ArrayList<>(languages) : null; this.entries = getPooledList(entries); } @@ -97,10 +97,10 @@ public class LanguageSettingsBaseProvider extends AbstractExecutableExtensionBas public LanguageSettingsBaseProvider(String id, String name, List<String> languages, List<ICLanguageSettingEntry> entries, Map<String, String> properties) { super(id, name); - this.languageScope = languages != null ? new ArrayList<String>(languages) : null; + this.languageScope = languages != null ? new ArrayList<>(languages) : null; this.entries = getPooledList(entries); if (properties != null) - this.properties = new HashMap<String, String>(properties); + this.properties = new HashMap<>(properties); } /** @@ -130,10 +130,10 @@ public class LanguageSettingsBaseProvider extends AbstractExecutableExtensionBas setId(id); setName(name); - this.languageScope = languages != null ? new ArrayList<String>(languages) : null; + this.languageScope = languages != null ? new ArrayList<>(languages) : null; this.entries = getPooledList(entries); if (properties != null) - this.properties = new HashMap<String, String>(properties); + this.properties = new HashMap<>(properties); } /** @@ -272,7 +272,7 @@ public class LanguageSettingsBaseProvider extends AbstractExecutableExtensionBas return false; } else { // The trouble to ensure default properties are equal to missing ones. - Set<String> keys = new HashSet<String>(properties.keySet()); + Set<String> keys = new HashSet<>(properties.keySet()); keys.addAll(other.properties.keySet()); for (String key : keys) { String value = properties.get(key); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsManager.java index 784382f7465..2fc760c77ad 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsManager.java @@ -229,7 +229,7 @@ public class LanguageSettingsManager { languageSettings = ((ICFolderDescription) rcDescription).getLanguageSettings(); } - List<String> languageIds = new ArrayList<String>(); + List<String> languageIds = new ArrayList<>(); if (languageSettings != null) { for (ICLanguageSetting languageSetting : languageSettings) { if (languageSetting != null) { @@ -255,7 +255,7 @@ public class LanguageSettingsManager { * Never returns {@code null} but empty list if no languages can be found. */ public static List<String> getLanguages(IResource resource, ICConfigurationDescription cfgDescription) { - List<String> languageIds = new ArrayList<String>(); + List<String> languageIds = new ArrayList<>(); IPath prjRelPath = resource.getProjectRelativePath(); if (resource instanceof IFile) { String langId = null; @@ -397,7 +397,7 @@ public class LanguageSettingsManager { * @since 5.5 */ public static List<ILanguageSettingsProvider> createLanguageSettingsProviders(String[] ids) { - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); for (String id : ids) { ILanguageSettingsProvider provider = null; if (!isPreferShared(id)) { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsSerializableProvider.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsSerializableProvider.java index 71509923e23..a11e4a7903e 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsSerializableProvider.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsSerializableProvider.java @@ -223,7 +223,7 @@ public class LanguageSettingsSerializableProvider extends LanguageSettingsBasePr */ public Element serializeAttributes(Element parentElement) { // Keeps pairs: key, value. See JavaDoc XmlUtil.appendElement(Node, String, String[]). - List<String> attributes = new ArrayList<String>(); + List<String> attributes = new ArrayList<>(); attributes.add(ATTR_ID); attributes.add(getId()); @@ -346,7 +346,7 @@ public class LanguageSettingsSerializableProvider extends LanguageSettingsBasePr */ private void loadLanguageScopeElement(Node parentNode) { if (languageScope == null) { - languageScope = new ArrayList<String>(); + languageScope = new ArrayList<>(); } String id = XmlUtil.determineAttributeValue(parentNode, ATTR_ID); languageScope.add(id); @@ -435,8 +435,8 @@ public class LanguageSettingsSerializableProvider extends LanguageSettingsBasePr private LanguageSettingsSerializableProvider cloneShallowInternal() throws CloneNotSupportedException { LanguageSettingsSerializableProvider clone = (LanguageSettingsSerializableProvider) super.clone(); if (languageScope != null) - clone.languageScope = new ArrayList<String>(languageScope); - clone.properties = new HashMap<String, String>(properties); + clone.languageScope = new ArrayList<>(languageScope); + clone.properties = new HashMap<>(properties); clone.fStorage = new LanguageSettingsSerializableStorage(); return clone; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsStorage.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsStorage.java index 6ba0f67f3b3..d533e2e6c24 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsStorage.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsStorage.java @@ -37,14 +37,14 @@ public class LanguageSettingsStorage implements Cloneable { /** Storage to keep settings entries. */ protected Map<String, // languageId Map<String, // resource project path - List<ICLanguageSettingEntry>>> fStorage = new HashMap<String, Map<String, List<ICLanguageSettingEntry>>>(); + List<ICLanguageSettingEntry>>> fStorage = new HashMap<>(); /** * Pool of LSE lists implemented as WeakHashSet. That allows to gain memory savings * at the expense of CPU time. WeakHashSet handles garbage collection when a list is not * referenced anywhere else. See JavaDoc {@link java.lang.ref.WeakReference} about weak reference objects. */ - private static WeakHashSet<List<ICLanguageSettingEntry>> listPool = new WeakHashSetSynchronized<List<ICLanguageSettingEntry>>(); + private static WeakHashSet<List<ICLanguageSettingEntry>> listPool = new WeakHashSetSynchronized<>(); /** * Returns the list of setting entries for the given resource and language. @@ -108,7 +108,7 @@ public class LanguageSettingsStorage implements Cloneable { if (entries != null) { Map<String, List<ICLanguageSettingEntry>> langMap = fStorage.get(languageId); if (langMap == null) { - langMap = new HashMap<String, List<ICLanguageSettingEntry>>(); + langMap = new HashMap<>(); fStorage.put(languageId, langMap); } List<ICLanguageSettingEntry> sortedEntries = getPooledList(sortEntries(entries), false); @@ -148,7 +148,7 @@ public class LanguageSettingsStorage implements Cloneable { * of the provider, so the set can contain {@code null}. */ public Set<String> getLanguages() { - return new HashSet<String>(fStorage.keySet()); + return new HashSet<>(fStorage.keySet()); } /** @@ -162,9 +162,9 @@ public class LanguageSettingsStorage implements Cloneable { public Set<String> getResourcePaths(String languageId) { Map<String, List<ICLanguageSettingEntry>> rcPathsMap = fStorage.get(languageId); if (rcPathsMap == null) { - return new HashSet<String>(); + return new HashSet<>(); } - return new HashSet<String>(rcPathsMap.keySet()); + return new HashSet<>(rcPathsMap.keySet()); } /** @@ -189,7 +189,7 @@ public class LanguageSettingsStorage implements Cloneable { } if (copy) { - entries = new ArrayList<ICLanguageSettingEntry>(entries); + entries = new ArrayList<>(entries); } pooledList = Collections.unmodifiableList(entries); return listPool.add(pooledList); @@ -222,13 +222,13 @@ public class LanguageSettingsStorage implements Cloneable { @Override public LanguageSettingsStorage clone() throws CloneNotSupportedException { LanguageSettingsStorage storageClone = (LanguageSettingsStorage) super.clone(); - storageClone.fStorage = new HashMap<String, Map<String, List<ICLanguageSettingEntry>>>(); + storageClone.fStorage = new HashMap<>(); synchronized (fStorage) { Set<Entry<String, Map<String, List<ICLanguageSettingEntry>>>> entrySetLang = fStorage.entrySet(); for (Entry<String, Map<String, List<ICLanguageSettingEntry>>> entryLang : entrySetLang) { String langId = entryLang.getKey(); Map<String, List<ICLanguageSettingEntry>> mapRc = entryLang.getValue(); - Map<String, List<ICLanguageSettingEntry>> mapRcClone = new HashMap<String, List<ICLanguageSettingEntry>>(); + Map<String, List<ICLanguageSettingEntry>> mapRcClone = new HashMap<>(); Set<Entry<String, List<ICLanguageSettingEntry>>> entrySetRc = mapRc.entrySet(); for (Entry<String, List<ICLanguageSettingEntry>> entryRc : entrySetRc) { String rcProjectPath = entryRc.getKey(); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/ScannerDiscoveryLegacySupport.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/ScannerDiscoveryLegacySupport.java index 9a6c6fb9e2c..e9307f90d9c 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/ScannerDiscoveryLegacySupport.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/ScannerDiscoveryLegacySupport.java @@ -282,7 +282,7 @@ public class ScannerDiscoveryLegacySupport { @SuppressWarnings("nls") public static String getDeprecatedLegacyProfiles(String id) { if (legacyProfiles == null) { - legacyProfiles = new HashMap<String, String>(); + legacyProfiles = new HashMap<>(); // InputTypes legacyProfiles.put("cdt.managedbuild.tool.gnu.c.compiler.input", diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CoreModelUtil.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CoreModelUtil.java index c100e8681d9..41da830fcd1 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CoreModelUtil.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CoreModelUtil.java @@ -695,7 +695,7 @@ public class CoreModelUtil { public static ICConfigurationDescription[] getReferencedConfigurationDescriptions(ICConfigurationDescription cfgDes, boolean writable) { - List<ICConfigurationDescription> result = new ArrayList<ICConfigurationDescription>(); + List<ICConfigurationDescription> result = new ArrayList<>(); if (cfgDes != null) { Map<String, String> map = cfgDes.getReferenceInfo(); @@ -749,7 +749,7 @@ public class CoreModelUtil { */ public static ICConfigurationDescription[] getReferencingConfigurationDescriptions( ICConfigurationDescription cfgDes, boolean writable) { - List<ICConfigurationDescription> result = new ArrayList<ICConfigurationDescription>(); + List<ICConfigurationDescription> result = new ArrayList<>(); if (cfgDes != null) { CoreModel core = CoreModel.getDefault(); @@ -784,7 +784,7 @@ public class CoreModelUtil { public static String[] getBinaryParserIds(ICConfigurationDescription[] cfgs) { if (cfgs == null || cfgs.length == 0) return null; - ArrayList<String> pids = new ArrayList<String>(); + ArrayList<String> pids = new ArrayList<>(); for (ICConfigurationDescription cfg : cfgs) { ICTargetPlatformSetting tps = cfg.getTargetPlatformSetting(); String[] ids = tps.getBinaryParserIds(); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/LanguageManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/LanguageManager.java index 514b5626316..a963a4b0f4f 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/LanguageManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/LanguageManager.java @@ -64,10 +64,10 @@ public class LanguageManager { private static final String ATTRIBUTE_ID = "id"; //$NON-NLS-1$ private static LanguageManager instance; - private Map<String, ILanguage> fLanguageCache = new HashMap<String, ILanguage>(); - private Map<String, IPDOMLinkageFactory> fPDOMLinkageFactoryCache = new HashMap<String, IPDOMLinkageFactory>(); - private Map<String, ILanguage> fContentTypeToLanguageCache = new HashMap<String, ILanguage>(); - private Map<IProject, ProjectLanguageConfiguration> fLanguageConfigurationCache = new HashMap<IProject, ProjectLanguageConfiguration>(); + private Map<String, ILanguage> fLanguageCache = new HashMap<>(); + private Map<String, IPDOMLinkageFactory> fPDOMLinkageFactoryCache = new HashMap<>(); + private Map<String, ILanguage> fContentTypeToLanguageCache = new HashMap<>(); + private Map<IProject, ProjectLanguageConfiguration> fLanguageConfigurationCache = new HashMap<>(); private boolean fIsFullyCached; private HashMap<String, ILanguageDescriptor> fIdToLanguageDescriptorCache;//= new HashMap(); private HashMap<String, List<ILanguageDescriptor>> fContentTypeToDescriptorListCache; @@ -99,7 +99,7 @@ public class LanguageManager { } private HashMap<String, ILanguageDescriptor> createDescriptorCache() { - HashMap<String, ILanguageDescriptor> map = new HashMap<String, ILanguageDescriptor>(); + HashMap<String, ILanguageDescriptor> map = new HashMap<>(); IConfigurationElement[] configs = Platform.getExtensionRegistry() .getConfigurationElementsFor(LANGUAGE_EXTENSION_POINT_ID); for (int j = 0; j < configs.length; ++j) { @@ -120,7 +120,7 @@ public class LanguageManager { } public Map<String, ILanguageDescriptor[]> getContentTypeIdToLanguageDescriptionsMap() { - HashMap<String, ILanguageDescriptor[]> map = new HashMap<String, ILanguageDescriptor[]>(); + HashMap<String, ILanguageDescriptor[]> map = new HashMap<>(); Map<String, List<ILanguageDescriptor>> cache = getContentTypeToDescriptorCache(); for (Entry<String, List<ILanguageDescriptor>> entry : cache.entrySet()) { @@ -135,7 +135,7 @@ public class LanguageManager { } private HashMap<String, List<ILanguageDescriptor>> createContentTypeToDescriptorCache() { - HashMap<String, List<ILanguageDescriptor>> map = new HashMap<String, List<ILanguageDescriptor>>(); + HashMap<String, List<ILanguageDescriptor>> map = new HashMap<>(); Map<String, ILanguageDescriptor> dc = getDescriptorCache(); List<ILanguageDescriptor> list; @@ -146,7 +146,7 @@ public class LanguageManager { id = type.getId(); list = map.get(id); if (list == null) { - list = new ArrayList<ILanguageDescriptor>(); + list = new ArrayList<>(); map.put(id, list); } list.add(des); @@ -230,7 +230,7 @@ public class LanguageManager { */ @Deprecated public ArrayList<String> getAllContentTypes() { - ArrayList<String> allTypes = new ArrayList<String>(); + ArrayList<String> allTypes = new ArrayList<>(); allTypes.add(CCorePlugin.CONTENT_TYPE_ASMSOURCE); allTypes.add(CCorePlugin.CONTENT_TYPE_CHEADER); allTypes.add(CCorePlugin.CONTENT_TYPE_CSOURCE); @@ -264,7 +264,7 @@ public class LanguageManager { } private Set<String> collectContentTypeIds() { - HashSet<String> allTypes = new HashSet<String>(); + HashSet<String> allTypes = new HashSet<>(); allTypes.add(CCorePlugin.CONTENT_TYPE_ASMSOURCE); allTypes.add(CCorePlugin.CONTENT_TYPE_CHEADER); allTypes.add(CCorePlugin.CONTENT_TYPE_CSOURCE); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CExternalSetting.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CExternalSetting.java index 0fd02f1d175..1da84e73e53 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CExternalSetting.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CExternalSetting.java @@ -22,7 +22,7 @@ import org.eclipse.cdt.core.settings.model.util.KindBasedStore; public final class CExternalSetting implements ICExternalSetting { // private EntryStore fEntryStore = new EntryStore(); - private KindBasedStore<CEntriesSet> fStore = new KindBasedStore<CEntriesSet>(false); + private KindBasedStore<CEntriesSet> fStore = new KindBasedStore<>(false); private String[] fContentTypeIds; private String[] fLanguageIds; private String[] fExtensions; @@ -123,7 +123,7 @@ public final class CExternalSetting implements ICExternalSetting { @Override public ICSettingEntry[] getEntries() { - List<ICSettingEntry> result = new ArrayList<ICSettingEntry>(); + List<ICSettingEntry> result = new ArrayList<>(); int kinds[] = KindBasedStore.getAllEntryKinds(); for (int i = 0; i < kinds.length; i++) { CEntriesSet list = getEntriesSet(kinds[i], false); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/extension/impl/CDefaultConfigurationData.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/extension/impl/CDefaultConfigurationData.java index 97a3e75a60b..8fb734c174b 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/extension/impl/CDefaultConfigurationData.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/extension/impl/CDefaultConfigurationData.java @@ -34,7 +34,7 @@ import org.eclipse.core.runtime.Path; public class CDefaultConfigurationData extends CConfigurationData { protected String fDescription; - private HashMap<IPath, CResourceData> fResourceDataMap = new HashMap<IPath, CResourceData>(); + private HashMap<IPath, CResourceData> fResourceDataMap = new HashMap<>(); protected CFolderData fRootFolderData; protected String fName; protected String fId; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/extension/impl/CDefaultFolderData.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/extension/impl/CDefaultFolderData.java index 28d9339c445..61949266b7d 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/extension/impl/CDefaultFolderData.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/extension/impl/CDefaultFolderData.java @@ -25,7 +25,7 @@ import org.eclipse.core.runtime.IPath; public class CDefaultFolderData extends CFolderData { protected IPath fPath; // protected boolean fIsExcluded; - protected List<CLanguageData> fLanguageDatas = new ArrayList<CLanguageData>(); + protected List<CLanguageData> fLanguageDatas = new ArrayList<>(); protected String fName; protected String fId; protected CConfigurationData fCfg; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/extension/impl/CResourceDataContainer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/extension/impl/CResourceDataContainer.java index ef9afb0c759..13f653b777c 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/extension/impl/CResourceDataContainer.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/extension/impl/CResourceDataContainer.java @@ -70,7 +70,7 @@ public class CResourceDataContainer { } public List<CResourceData> getRcDataList(final int kind) { - final List<CResourceData> list = new ArrayList<CResourceData>(); + final List<CResourceData> list = new ArrayList<>(); fRcDataContainer.accept(new IPathSettingsContainerVisitor() { @Override diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/AbstractEntryStorage.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/AbstractEntryStorage.java index 35009d6bf46..aa10fed6683 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/AbstractEntryStorage.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/AbstractEntryStorage.java @@ -36,7 +36,7 @@ public abstract class AbstractEntryStorage { public List<ICLanguageSettingEntry> getEntries(List<ICLanguageSettingEntry> list) { SettingsSet settings = initCache(); if (list == null) - list = new ArrayList<ICLanguageSettingEntry>(); + list = new ArrayList<>(); ICLanguageSettingEntry entries[] = settings.getEntries(); list.addAll(Arrays.asList(entries)); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CDataUtil.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CDataUtil.java index 52e14aac75d..80095771920 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CDataUtil.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CDataUtil.java @@ -818,7 +818,7 @@ public class CDataUtil { for (int i = 0; i < includeList.size(); i++) { ICSourceEntry oldEntry = includeList.get(i); - List<IPath> tmp = new ArrayList<IPath>(1); + List<IPath> tmp = new ArrayList<>(1); tmp.add(path); ICSourceEntry newEntry = addExcludePaths(oldEntry, tmp, true); if (newEntry != null) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CEntriesSet.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CEntriesSet.java index ed54f6ce13d..68a8e80ea5d 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CEntriesSet.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CEntriesSet.java @@ -19,7 +19,7 @@ import java.util.List; import org.eclipse.cdt.core.settings.model.ICSettingEntry; public class CEntriesSet { - private LinkedHashMap<Object, ICSettingEntry> fEntriesMap = new LinkedHashMap<Object, ICSettingEntry>(); + private LinkedHashMap<Object, ICSettingEntry> fEntriesMap = new LinkedHashMap<>(); public CEntriesSet() { } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/EntryStore.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/EntryStore.java index c68408c7e55..c72ed3a7564 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/EntryStore.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/EntryStore.java @@ -29,7 +29,7 @@ import org.eclipse.cdt.core.settings.model.ICMacroFileEntry; import org.eclipse.cdt.core.settings.model.ICSettingEntry; public class EntryStore { - private KindBasedStore<ArrayList<ICLanguageSettingEntry>> fStore = new KindBasedStore<ArrayList<ICLanguageSettingEntry>>(); + private KindBasedStore<ArrayList<ICLanguageSettingEntry>> fStore = new KindBasedStore<>(); private boolean fPreserveReadOnly; public EntryStore() { @@ -51,7 +51,7 @@ public class EntryStore { } public ICLanguageSettingEntry[] getEntries() { - List<ICLanguageSettingEntry> result = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> result = new ArrayList<>(); List<ICLanguageSettingEntry> list; for (int k : KindBasedStore.getLanguageEntryKinds()) { list = fStore.get(k); @@ -69,7 +69,7 @@ public class EntryStore { public ICLanguageSettingEntry[] getEntries(int kind) { List<ICLanguageSettingEntry> list = getEntriesList(kind); if (list == null) - list = new ArrayList<ICLanguageSettingEntry>(0); + list = new ArrayList<>(0); switch (kind) { case ICSettingEntry.INCLUDE_PATH: return list.toArray(new ICIncludePathEntry[list.size()]); @@ -91,8 +91,8 @@ public class EntryStore { public List<ICLanguageSettingEntry> getEntriesList(int kind) { List<ICLanguageSettingEntry> list = getEntriesList(kind, false); if (list != null) - return new ArrayList<ICLanguageSettingEntry>(list); - return new ArrayList<ICLanguageSettingEntry>(0); + return new ArrayList<>(list); + return new ArrayList<>(0); } private void setEntriesList(int kind, ArrayList<ICLanguageSettingEntry> list) { @@ -102,7 +102,7 @@ public class EntryStore { private ArrayList<ICLanguageSettingEntry> getEntriesList(int kind, boolean create) { ArrayList<ICLanguageSettingEntry> list = fStore.get(kind); if (list == null && create) { - fStore.put(kind, list = new ArrayList<ICLanguageSettingEntry>()); + fStore.put(kind, list = new ArrayList<>()); } return list; } @@ -130,7 +130,7 @@ public class EntryStore { } public void storeEntries(int kind, List<ICLanguageSettingEntry> list) { - ArrayList<ICLanguageSettingEntry> newList = new ArrayList<ICLanguageSettingEntry>(list); + ArrayList<ICLanguageSettingEntry> newList = new ArrayList<>(list); // newList.addAll(Arrays.asList(entries)); if (fPreserveReadOnly) { List<ICLanguageSettingEntry> oldList = getEntriesList(kind, false); @@ -147,7 +147,7 @@ public class EntryStore { } private Set<ICLanguageSettingEntry> getReadOnlySet(List<ICLanguageSettingEntry> entries) { - Set<ICLanguageSettingEntry> set = new HashSet<ICLanguageSettingEntry>(); + Set<ICLanguageSettingEntry> set = new HashSet<>(); for (ICLanguageSettingEntry entry : entries) { if (entry.isReadOnly()) set.add(entry); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/LanguageSettingEntriesSerializer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/LanguageSettingEntriesSerializer.java index a0610b511f6..558a82fc13d 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/LanguageSettingEntriesSerializer.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/LanguageSettingEntriesSerializer.java @@ -77,7 +77,7 @@ public class LanguageSettingEntriesSerializer { public static List<ICSettingEntry> loadEntriesList(ICStorageElement el, int kindFilter) { ICStorageElement children[] = el.getChildren(); ICStorageElement child; - List<ICSettingEntry> list = new ArrayList<ICSettingEntry>(); + List<ICSettingEntry> list = new ArrayList<>(); ICSettingEntry entry; for (int i = 0; i < children.length; i++) { child = children[i]; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ListComparator.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ListComparator.java index 305aabd6151..9fc4ee17c8f 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ListComparator.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ListComparator.java @@ -50,14 +50,14 @@ public class ListComparator { if (a1 == null || a1.length == 0) return null; if (a2 == null || a2.length == 0) { - List<Object> list = new ArrayList<Object>(a1.length); + List<Object> list = new ArrayList<>(a1.length); for (int i = 0; i < a1.length; i++) { list.add(a1[i]); } return list; } - List<Object> list = new ArrayList<Object>(a1.length); + List<Object> list = new ArrayList<>(a1.length); Object o1; for (int i = 0; i < a1.length; i++) { o1 = a1[i]; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java index 69b0fcab2d5..f17b6f2b0f3 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java @@ -121,7 +121,7 @@ public class PathEntryTranslator { private IProject fProject; private CConfigurationData fCfgData; private PathSettingsContainer fTranslatedFilters; - private Map<IPath, ResourceInfo> fResourceMap = new HashMap<IPath, ResourceInfo>(); + private Map<IPath, ResourceInfo> fResourceMap = new HashMap<>(); private IWorkspaceRoot fRoot = ResourcesPlugin.getWorkspace().getRoot(); private static class VarSubstitutor extends CoreVariableSubstitutor { @@ -171,13 +171,13 @@ public class PathEntryTranslator { public Map<String, String> getRefProjectsMap() { if (fRefProjPaths != null && fRefProjPaths.length != 0) { - Map<String, String> map = new HashMap<String, String>(fRefProjPaths.length); + Map<String, String> map = new HashMap<>(fRefProjPaths.length); for (IPath fRefProjPath : fRefProjPaths) { map.put(fRefProjPath.segment(0), ""); //$NON-NLS-1$ } return map; } - return new HashMap<String, String>(0); + return new HashMap<>(0); } public ICExternalSetting[] getExternalSettings() { @@ -263,14 +263,14 @@ public class PathEntryTranslator { KindBasedStore<List<LangEntryInfo>> fLangEntries; private RcDesInfo(ResourceInfo rcInfo) { - fResolvedEntries = new ArrayList<ResolvedEntry>(); - fLangEntries = new KindBasedStore<List<LangEntryInfo>>(); + fResolvedEntries = new ArrayList<>(); + fLangEntries = new KindBasedStore<>(); } public void add(LangEntryInfo info) { List<LangEntryInfo> list = fLangEntries.get(info.fLangEntry.getKind()); if (list == null) { - list = new ArrayList<LangEntryInfo>(); + list = new ArrayList<>(); fLangEntries.put(info.fLangEntry.getKind(), list); } list.add(info); @@ -546,7 +546,7 @@ public class PathEntryTranslator { if (rcInfo.fRc.getType() == IResource.FILE) { fFilterInfos = new ResourceInfo[0]; } else { - List<ResourceInfo> list = new ArrayList<ResourceInfo>(); + List<ResourceInfo> list = new ArrayList<>(); for (IPath path : paths) { list.addAll(Arrays.asList(processFilter((IContainer) rcInfo.fRc, path))); } @@ -616,7 +616,7 @@ public class PathEntryTranslator { fProject = project; IPath[] exclusions = entry.getExclusionPatterns(); if (exclusions.length != 0) { - fFiltersSet = new HashSet<IPath>(exclusions.length); + fFiltersSet = new HashSet<>(exclusions.length); fFiltersSet.addAll(Arrays.asList(entry.getExclusionPatterns())); } } @@ -631,7 +631,7 @@ public class PathEntryTranslator { public void addFilter(IPath path) { if (fFiltersSet == null) - fFiltersSet = new HashSet<IPath>(); + fFiltersSet = new HashSet<>(); fFiltersSet.add(path); } @@ -802,8 +802,8 @@ public class PathEntryTranslator { private PathEntryCollector(IProject project/*, ICConfigurationDescription cfgDescription*/) { fStorage = PathSettingsContainer.createRootContainer(); fStorage.setValue(this); - fStore = new KindBasedStore<LinkedHashMap<ICSettingEntry, PathEntryComposer>>(false); - fNameKeyMapStore = new KindBasedStore<LinkedHashMap<EntryNameKey, PathEntryComposer>>(false); + fStore = new KindBasedStore<>(false); + fNameKeyMapStore = new KindBasedStore<>(false); fProject = project; } @@ -812,7 +812,7 @@ public class PathEntryTranslator { IProject project/*, ICConfigurationDescription cfgDescription*/) { fStorage = container; fStore = store; - fNameKeyMapStore = new KindBasedStore<LinkedHashMap<EntryNameKey, PathEntryComposer>>(false); + fNameKeyMapStore = new KindBasedStore<>(false); fProject = project; } @@ -837,7 +837,7 @@ public class PathEntryTranslator { if (paths == null || paths.length == 0) { fRefProjMap = null; } else { - fRefProjMap = new LinkedHashMap<IPath, PathEntryComposer>(); + fRefProjMap = new LinkedHashMap<>(); for (IPath path : paths) { PathEntryComposer cs = new PathEntryComposer(path, fProject/*, fCfg*/); IPath composerPath = cs.getPath(); @@ -885,7 +885,7 @@ public class PathEntryTranslator { HashSet<ICSettingEntry> parentSet = getEntriesSetCopy(kind); @SuppressWarnings("unchecked") HashSet<ICSettingEntry> removedParentSet = (HashSet<ICSettingEntry>) parentSet.clone(); - HashSet<ICLanguageSettingEntry> addedThisSet = new HashSet<ICLanguageSettingEntry>(Arrays.asList(entries)); + HashSet<ICLanguageSettingEntry> addedThisSet = new HashSet<>(Arrays.asList(entries)); removedParentSet.removeAll(addedThisSet); addedThisSet.removeAll(parentSet); @@ -926,7 +926,7 @@ public class PathEntryTranslator { private LinkedHashMap<ICSettingEntry, PathEntryComposer> getEntriesMap(int kind, boolean create) { LinkedHashMap<ICSettingEntry, PathEntryComposer> map = fStore.get(kind); if (map == null && create) { - map = new LinkedHashMap<ICSettingEntry, PathEntryComposer>(); + map = new LinkedHashMap<>(); fStore.put(kind, map); } return map; @@ -935,7 +935,7 @@ public class PathEntryTranslator { private LinkedHashMap<EntryNameKey, PathEntryComposer> getEntriesNameKeyMap(int kind, boolean create) { LinkedHashMap<EntryNameKey, PathEntryComposer> map = fNameKeyMapStore.get(kind); if (map == null && create) { - map = new LinkedHashMap<EntryNameKey, PathEntryComposer>(); + map = new LinkedHashMap<>(); fNameKeyMapStore.put(kind, map); } return map; @@ -962,14 +962,14 @@ public class PathEntryTranslator { private HashSet<ICSettingEntry> getEntriesSetCopy(int kind) { Map<ICSettingEntry, PathEntryComposer> map = getEntriesMap(kind, false); if (map != null) { - return new HashSet<ICSettingEntry>(map.keySet()); + return new HashSet<>(map.keySet()); } - return new HashSet<ICSettingEntry>(0); + return new HashSet<>(0); } private List<PathEntryComposer> getCollectedEntriesList(final int kind) { - final List<PathEntryComposer> list = new ArrayList<PathEntryComposer>(); - final Set<PathEntryComposer> set = new HashSet<PathEntryComposer>(); + final List<PathEntryComposer> list = new ArrayList<>(); + final Set<PathEntryComposer> set = new HashSet<>(); fStorage.accept(new IPathSettingsContainerVisitor() { @Override @@ -999,7 +999,7 @@ public class PathEntryTranslator { public List<IPathEntry> getEntries(int peKind, List<IPathEntry> list, int flags, ICConfigurationDescription cfgDescription) { - Set<IPathEntry> set = new LinkedHashSet<IPathEntry>(); + Set<IPathEntry> set = new LinkedHashSet<>(); int sKind = peKindToSettingKind(peKind); List<PathEntryComposer> composerList = null; @@ -1007,7 +1007,7 @@ public class PathEntryTranslator { composerList = getCollectedEntriesList(sKind); } else if (peKind == IPathEntry.CDT_PROJECT) { if (fRefProjMap != null && fRefProjMap.size() != 0) { - composerList = new ArrayList<PathEntryComposer>(fRefProjMap.values()); + composerList = new ArrayList<>(fRefProjMap.values()); } } if (composerList != null) { @@ -1020,7 +1020,7 @@ public class PathEntryTranslator { String name = entry.getName(); Map<String, IPathEntry> map = store.get(peKind); if (map == null) { - map = new HashMap<String, IPathEntry>(); + map = new HashMap<>(); store.put(peKind, map); } if (!map.containsKey(name)) { @@ -1042,7 +1042,7 @@ public class PathEntryTranslator { } if (list == null) { - list = new ArrayList<IPathEntry>(set); + list = new ArrayList<>(set); } else { list.addAll(set); } @@ -1068,7 +1068,7 @@ public class PathEntryTranslator { public List<IPathEntry> getEntries(List<IPathEntry> list, int flags, ICConfigurationDescription cfgDescription) { if (list == null) - list = new ArrayList<IPathEntry>(); + list = new ArrayList<>(); int peKinds[] = PathEntryKyndStore.getSupportedKinds(); for (int peKind : peKinds) { getEntries(peKind, list, flags, cfgDescription); @@ -1162,10 +1162,10 @@ public class PathEntryTranslator { private ReferenceSettingsInfo addPathEntries(ResolvedEntry[] rEntries, int op) { PathSettingsContainer cr = PathSettingsContainer.createRootContainer(); cr.setValue(new RcDesInfo(new ResourceInfo(fProject, true))); - List<IPathEntry> srcList = new ArrayList<IPathEntry>(); - List<IPathEntry> outList = new ArrayList<IPathEntry>(); - List<ResolvedEntry> projList = new ArrayList<ResolvedEntry>(); - List<ResolvedEntry> exportSettingsList = new ArrayList<ResolvedEntry>(); + List<IPathEntry> srcList = new ArrayList<>(); + List<IPathEntry> outList = new ArrayList<>(); + List<ResolvedEntry> projList = new ArrayList<>(); + List<ResolvedEntry> exportSettingsList = new ArrayList<>(); ICSourceEntry srcEntries[] = null; ICOutputEntry outEntries[] = null; ResourceInfo rcInfo; @@ -1224,7 +1224,7 @@ public class PathEntryTranslator { ICExternalSetting extSettings[]; if (exportSettingsList.size() != 0) { extSettings = new ICExternalSetting[1]; - List<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>(exportSettingsList.size()); + List<ICLanguageSettingEntry> list = new ArrayList<>(exportSettingsList.size()); for (int i = 0; i < exportSettingsList.size(); i++) { ResolvedEntry re = exportSettingsList.get(i); ICLanguageSettingEntry le = createLangEntry(re); @@ -1273,7 +1273,7 @@ public class PathEntryTranslator { } private static ICSettingEntry[] replaceUserEntries(ICSettingEntry[] oldEntries, ICSettingEntry[] newUsrEntries) { - Set<ICSettingEntry> set = new LinkedHashSet<ICSettingEntry>(); + Set<ICSettingEntry> set = new LinkedHashSet<>(); Class<?> componentType = null; if (newUsrEntries != null) { @@ -1311,7 +1311,7 @@ public class PathEntryTranslator { switch (op) { case OP_ADD: if (entries != null && entries.length != 0) { - Set<ICSourceEntry> set = new LinkedHashSet<ICSourceEntry>(); + Set<ICSourceEntry> set = new LinkedHashSet<>(); set.addAll(Arrays.asList(oldEntries)); set.addAll(Arrays.asList(entries)); fCfgData.setSourceEntries(set.toArray(new ICSourceEntry[set.size()])); @@ -1319,7 +1319,7 @@ public class PathEntryTranslator { break; case OP_REMOVE: if (entries != null && entries.length != 0) { - Set<ICSourceEntry> set = new HashSet<ICSourceEntry>(); + Set<ICSourceEntry> set = new HashSet<>(); set.addAll(Arrays.asList(oldEntries)); set.removeAll(Arrays.asList(entries)); fCfgData.setSourceEntries(set.toArray(new ICSourceEntry[set.size()])); @@ -1351,7 +1351,7 @@ public class PathEntryTranslator { switch (op) { case OP_ADD: if (entries != null && entries.length != 0) { - Set<ICOutputEntry> set = new LinkedHashSet<ICOutputEntry>(); + Set<ICOutputEntry> set = new LinkedHashSet<>(); set.addAll(Arrays.asList(oldEntries)); set.addAll(Arrays.asList(entries)); bData.setOutputDirectories(set.toArray(new ICOutputEntry[set.size()])); @@ -1359,7 +1359,7 @@ public class PathEntryTranslator { break; case OP_REMOVE: if (entries != null && entries.length != 0) { - Set<ICOutputEntry> set = new HashSet<ICOutputEntry>(); + Set<ICOutputEntry> set = new HashSet<>(); set.addAll(Arrays.asList(oldEntries)); set.removeAll(Arrays.asList(entries)); bData.setOutputDirectories(set.toArray(new ICOutputEntry[set.size()])); @@ -1402,7 +1402,7 @@ public class PathEntryTranslator { private CResourceData[] getResourceDatas() { PathSettingsContainer crs[] = fRcDataHolder.getChildren(true); - List<CResourceData> list = new ArrayList<CResourceData>(crs.length); + List<CResourceData> list = new ArrayList<>(crs.length); for (PathSettingsContainer cur : crs) { list.add((CResourceData) cur.getValue()); } @@ -1478,8 +1478,8 @@ public class PathEntryTranslator { ICLanguageSettingEntry result[]; switch (op) { case OP_ADD: { - Set<ICLanguageSettingEntry> oldSet = new HashSet<ICLanguageSettingEntry>(Arrays.asList(oldEntries)); - Set<ICLanguageSettingEntry> newSet = new HashSet<ICLanguageSettingEntry>(Arrays.asList(newEntries)); + Set<ICLanguageSettingEntry> oldSet = new HashSet<>(Arrays.asList(oldEntries)); + Set<ICLanguageSettingEntry> newSet = new HashSet<>(Arrays.asList(newEntries)); newSet.removeAll(oldSet); if (newSet.size() == 0) { result = oldEntries; @@ -1491,8 +1491,8 @@ public class PathEntryTranslator { break; } case OP_REMOVE: { - Set<ICLanguageSettingEntry> oldSet = new HashSet<ICLanguageSettingEntry>(Arrays.asList(oldEntries)); - Set<ICLanguageSettingEntry> newSet = new HashSet<ICLanguageSettingEntry>(Arrays.asList(newEntries)); + Set<ICLanguageSettingEntry> oldSet = new HashSet<>(Arrays.asList(oldEntries)); + Set<ICLanguageSettingEntry> newSet = new HashSet<>(Arrays.asList(newEntries)); oldSet.removeAll(newSet); if (oldSet.size() == 0) { result = new ICLanguageSettingEntry[0]; @@ -1521,7 +1521,7 @@ public class PathEntryTranslator { RcDesInfo rcDes = (RcDesInfo) cr.getValue(); if (rcDes != null) { List<ResolvedEntry> rEntries = rcDes.fResolvedEntries; - List<LangEntryInfo> curLanfInfos = new ArrayList<LangEntryInfo>(rEntries.size() + langEntryInfoList.size()); + List<LangEntryInfo> curLanfInfos = new ArrayList<>(rEntries.size() + langEntryInfoList.size()); for (ResolvedEntry re : rEntries) { LangEntryInfo li = createLangEntryInfo(re); if (li != null) { @@ -1544,7 +1544,7 @@ public class PathEntryTranslator { } private void filterAndPropagate(PathSettingsContainer cr, List<LangEntryInfo> list) { - list = new ArrayList<LangEntryInfo>(list); + list = new ArrayList<>(list); IPath path = cr.getPath(); for (Iterator<LangEntryInfo> iter = list.iterator(); iter.hasNext();) { LangEntryInfo li = iter.next(); @@ -1613,7 +1613,7 @@ public class PathEntryTranslator { private ResolvedEntry[] getResolvedEntries(PathEntryResolveInfo info) { PathEntryResolveInfoElement els[] = info.getElements(); - List<ResolvedEntry> list = new ArrayList<ResolvedEntry>(); + List<ResolvedEntry> list = new ArrayList<>(); for (PathEntryResolveInfoElement el : els) { getResolvedEntries(el, list); } @@ -1622,7 +1622,7 @@ public class PathEntryTranslator { private List<ResolvedEntry> getResolvedEntries(PathEntryResolveInfoElement el, List<ResolvedEntry> list) { if (list == null) - list = new ArrayList<ResolvedEntry>(); + list = new ArrayList<>(); IPathEntry[] rpEntries = el.getResolvedEntries(); ResolvedEntry resolvedE; @@ -1733,7 +1733,7 @@ public class PathEntryTranslator { private ResourceInfo[] performTranslation(IPath basePath, ResourceInfo[] baseInfos, String seg) { IPath filterFullPath = basePath.append(seg); boolean needsParsing = hasSpecChars(seg); - List<ResourceInfo> list = new ArrayList<ResourceInfo>(); + List<ResourceInfo> list = new ArrayList<>(); char[] segChars = seg.toCharArray(); for (ResourceInfo baseInfo : baseInfos) { IResource baseRc = baseInfo.fRc; @@ -1828,7 +1828,7 @@ public class PathEntryTranslator { } public static IPathEntry[] decodePathEntries(IProject project, ICStorageElement el) { - ArrayList<IPathEntry> pathEntries = new ArrayList<IPathEntry>(); + ArrayList<IPathEntry> pathEntries = new ArrayList<>(); ICStorageElement children[] = el.getChildren(); for (ICStorageElement child : children) { if (child.getName().equals(PATH_ENTRY)) { @@ -2011,7 +2011,7 @@ public class PathEntryTranslator { for (CConfigurationData allData : allDatas) { addOutputEntries(collector, allData); } - final HashSet<ICSettingEntry> exportedSettings = new HashSet<ICSettingEntry>(); + final HashSet<ICSettingEntry> exportedSettings = new HashSet<>(); collector.setRefProjects(refInfo.getReferencedProjectsPaths()); ICExternalSetting[] settings = refInfo.getExternalSettings(); for (ICExternalSetting setting : settings) { @@ -2026,7 +2026,7 @@ public class PathEntryTranslator { if (rcData != null) { PathEntryCollector child = collector.createChild(container.getPath()); for (int kind : kinds) { - Set<ICLanguageSettingEntry> set = new LinkedHashSet<ICLanguageSettingEntry>(); + Set<ICLanguageSettingEntry> set = new LinkedHashSet<>(); if (collectResourceDataEntries(cfgDescription, kind, rcData, set)) { ICLanguageSettingEntry[] entries = set.toArray(new ICLanguageSettingEntry[set.size()]); child.setEntries(kind, entries, exportedSettings); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathSettingsContainer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathSettingsContainer.java index 8685a98ccd3..a9d5e91152c 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathSettingsContainer.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathSettingsContainer.java @@ -145,7 +145,7 @@ public final class PathSettingsContainer { private List<IPathSettingsContainerListener> getListenersList(boolean create) { if (fListeners == null && create) - fListeners = new ArrayList<IPathSettingsContainerListener>(); + fListeners = new ArrayList<>(); return fListeners; } @@ -182,7 +182,7 @@ public final class PathSettingsContainer { } public PathSettingsContainer[] getChildren(final boolean includeThis) { - final List<PathSettingsContainer> list = new ArrayList<PathSettingsContainer>(); + final List<PathSettingsContainer> list = new ArrayList<>(); accept(new IPathSettingsContainerVisitor() { @Override @@ -247,7 +247,7 @@ public final class PathSettingsContainer { PatternNameMap pMap = getPatternChildrenMap(false); if (pMap != null) { if (list == null) - list = new ArrayList<PathSettingsContainer>(); + list = new ArrayList<>(); for (PathSettingsContainer cr : pMap.values()) { if (cr.fValue == INEXISTENT_VALUE) { cr.doGetDirectChildren(list); @@ -260,7 +260,7 @@ public final class PathSettingsContainer { } public Object[] getValues(final boolean includeThis) { - final List<Object> list = new ArrayList<Object>(); + final List<Object> list = new ArrayList<>(); accept(new IPathSettingsContainerVisitor() { @Override diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PatternNameMap.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PatternNameMap.java index ba34583ad79..9dbabb31374 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PatternNameMap.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PatternNameMap.java @@ -172,7 +172,7 @@ public class PatternNameMap { if (hasPatternsMap()) { List<PathSettingsContainer> list; if (val != null) { - list = new ArrayList<PathSettingsContainer>(3); + list = new ArrayList<>(3); list.add(val); } else { list = null; @@ -187,13 +187,13 @@ public class PatternNameMap { strCA = entry.getKey(); if (CoreModelUtil.match(strCA.getCharArray(), nameCharArray, true)) { if (list == null) - list = new ArrayList<PathSettingsContainer>(2); + list = new ArrayList<>(2); list.add(entry.getValue()); } } return list; } else if (val != null) { - List<PathSettingsContainer> list = new ArrayList<PathSettingsContainer>(1); + List<PathSettingsContainer> list = new ArrayList<>(1); list.add(val); return list; } @@ -214,7 +214,7 @@ public class PatternNameMap { PathSettingsContainer oldValue; if (fChildrenMap == null) { - fChildrenMap = new HashMap<String, PathSettingsContainer>(); + fChildrenMap = new HashMap<>(); oldValue = null; } else { oldValue = fChildrenMap.get(name); @@ -227,7 +227,7 @@ public class PatternNameMap { } else if (isPatternName(name)) { StringCharArray strCA = new StringCharArray(name); if (fPatternMap == null) - fPatternMap = new HashMap<StringCharArray, PathSettingsContainer>(); + fPatternMap = new HashMap<>(); fPatternMap.put(strCA, value); } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ResourceChangeHandlerBase.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ResourceChangeHandlerBase.java index ee2a3581067..c8e110e1c15 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ResourceChangeHandlerBase.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ResourceChangeHandlerBase.java @@ -62,7 +62,7 @@ public abstract class ResourceChangeHandlerBase implements IResourceChangeListen private class DeltaVisitor implements IResourceDeltaVisitor { // private IResourceDelta fRootDelta; - private Map<IResource, IResource> fMoveMap = new HashMap<IResource, IResource>(); + private Map<IResource, IResource> fMoveMap = new HashMap<>(); private IResourceMoveHandler fHandler; public DeltaVisitor(IResourceMoveHandler handler, IResourceDelta rootDelta) { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/SettingsSet.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/SettingsSet.java index f7b8e06dfd7..85f4c27028b 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/SettingsSet.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/SettingsSet.java @@ -41,7 +41,7 @@ public class SettingsSet { private Object fContext; private SettingLevel() { - fEntries = new LinkedHashMap<EntryNameKey, EntryInfo>(); + fEntries = new LinkedHashMap<>(); } public boolean isReadOnly() { @@ -88,7 +88,7 @@ public class SettingsSet { public Set<String> getOverrideSet() { if (fOverrideSet != null) return (HashSet<String>) fOverrideSet.clone(); - return new HashSet<String>(); + return new HashSet<>(); } public void addEntries(ICLanguageSettingEntry entries[]) { @@ -116,7 +116,7 @@ public class SettingsSet { public void addOverrideName(String name) { if (fOverrideSet == null) - fOverrideSet = new HashSet<String>(); + fOverrideSet = new HashSet<>(); fOverrideSet.add(name); } @@ -127,7 +127,7 @@ public class SettingsSet { if (fOverrideSet != null) { fOverrideSet.addAll(set); } else if (set.size() != 0) { - fOverrideSet = new HashSet<String>(set); + fOverrideSet = new HashSet<>(set); } } @@ -148,7 +148,7 @@ public class SettingsSet { public Map<EntryNameKey, EntryInfo> clearAndGetMap() { Map<EntryNameKey, EntryInfo> map = fEntries; - fEntries = new LinkedHashMap<EntryNameKey, EntryInfo>(); + fEntries = new LinkedHashMap<>(); fOverrideSet = null; return map; } @@ -168,7 +168,7 @@ public class SettingsSet { } public List<ICLanguageSettingEntry> getEntriesList(boolean includeOverridden) { - List<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> list = new ArrayList<>(); EntryInfo infos[] = getInfos(); for (EntryInfo info : infos) { if (includeOverridden || !info.isOverridden()) @@ -234,7 +234,7 @@ public class SettingsSet { } public void adjustOverrideState() { - Set<String> set = new HashSet<String>(); + Set<String> set = new HashSet<>(); SettingLevel level; for (int i = 0; i < fLevels.length; i++) { level = fLevels[i]; @@ -260,7 +260,7 @@ public class SettingsSet { public ICLanguageSettingEntry[] getEntries(int types) { adjustOverrideState(); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); for (SettingLevel sl : fLevels) { if (isCompatible(sl, types)) getEntries(sl, entries); @@ -366,7 +366,7 @@ public class SettingsSet { } public HashMap<EntryNameKey, Object[]> getEntryLevelMap(int types) { - HashMap<EntryNameKey, Object[]> map = new HashMap<EntryNameKey, Object[]>(); + HashMap<EntryNameKey, Object[]> map = new HashMap<>(); for (int i = 0; i < fLevels.length; i++) { if (isCompatible(fLevels[i], types)) addLevelInfoToMap(fLevels[i], i, map); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ThreadLocalMap.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ThreadLocalMap.java index ff26ae88d38..a320320b14d 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ThreadLocalMap.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ThreadLocalMap.java @@ -17,7 +17,7 @@ import java.util.HashMap; import java.util.Map; public class ThreadLocalMap { - private ThreadLocal<Map<Object, Object>> fLocal = new ThreadLocal<Map<Object, Object>>(); + private ThreadLocal<Map<Object, Object>> fLocal = new ThreadLocal<>(); public Object get(Object key) { Map<Object, Object> map = getMap(false); @@ -45,7 +45,7 @@ public class ThreadLocalMap { private Map<Object, Object> getMap(boolean create) { Map<Object, Object> map = fLocal.get(); if (map == null && create) { - map = new HashMap<Object, Object>(); + map = new HashMap<>(); fLocal.set(map); } return map; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UserAndDiscoveredEntryDataSerializer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UserAndDiscoveredEntryDataSerializer.java index 68fce9de84f..b7a50c67ea4 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UserAndDiscoveredEntryDataSerializer.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UserAndDiscoveredEntryDataSerializer.java @@ -72,7 +72,7 @@ public class UserAndDiscoveredEntryDataSerializer extends CDataSerializer { if (tmp != null) { Set<String> set = lData.getDisabledSet(kind); if (set == null) - set = new HashSet<String>(); + set = new HashSet<>(); set.add(tmp); lData.setDisabledSet(kind, set); } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UserAndDiscoveredEntryLanguageData.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UserAndDiscoveredEntryLanguageData.java index 99b0c684854..beb3bf39683 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UserAndDiscoveredEntryLanguageData.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UserAndDiscoveredEntryLanguageData.java @@ -47,7 +47,7 @@ public abstract class UserAndDiscoveredEntryLanguageData extends EntryStorageBas kind = kinds[i]; set = fDisabledNameSetStore.get(kind); if (set != null) { - set = new HashSet<String>(set); + set = new HashSet<>(set); fDisabledNameSetStore.put(kind, set); } } @@ -108,7 +108,7 @@ public abstract class UserAndDiscoveredEntryLanguageData extends EntryStorageBas } protected void removeInexistent(ICLanguageSettingEntry[] entries, Set<String> set) { - Set<String> copy = new HashSet<String>(set); + Set<String> copy = new HashSet<>(set); for (int i = 0; i < entries.length; i++) { copy.remove(entries[i].getName()); } @@ -123,7 +123,7 @@ public abstract class UserAndDiscoveredEntryLanguageData extends EntryStorageBas } protected void setDisabledDiscoveredNames(int kind, Set<String> disabledNameSet) { - setDisabledSet(kind, disabledNameSet != null ? new HashSet<String>(disabledNameSet) : null); + setDisabledSet(kind, disabledNameSet != null ? new HashSet<>(disabledNameSet) : null); } protected Set<String> getDisabledSet(int kind) { @@ -140,7 +140,7 @@ public abstract class UserAndDiscoveredEntryLanguageData extends EntryStorageBas } } else { if (fDisabledNameSetStore == null) - fDisabledNameSetStore = new KindBasedStore<Set<String>>(); + fDisabledNameSetStore = new KindBasedStore<>(); fDisabledNameSetStore.put(kind, set); } } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UserAndDiscoveredEntryStorage.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UserAndDiscoveredEntryStorage.java index ce53616f1fd..abec6f1dd3a 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UserAndDiscoveredEntryStorage.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UserAndDiscoveredEntryStorage.java @@ -71,7 +71,7 @@ public abstract class UserAndDiscoveredEntryStorage extends AbstractEntryStorage level.addEntries(getUserEntries()); break; case DISCOVERY_ENTRIES_LEVEL: - HashSet<String> set = new HashSet<String>(); + HashSet<String> set = new HashSet<>(); ICLanguageSettingEntry[] entries = getDiscoveredEntries(set); level.addEntries(entries); if (set.size() != 0) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/XmlStorageElement.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/XmlStorageElement.java index 300ab223a4b..54ab28b1a50 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/XmlStorageElement.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/XmlStorageElement.java @@ -39,7 +39,7 @@ public class XmlStorageElement implements ICStorageElement { Element fElement; private ICStorageElement fParent; - private List<XmlStorageElement> fChildList = new ArrayList<XmlStorageElement>(); + private List<XmlStorageElement> fChildList = new ArrayList<>(); private boolean fChildrenCreated; private String[] fAttributeFilters; private String[] fChildFilters; @@ -355,7 +355,7 @@ public class XmlStorageElement implements ICStorageElement { return false; if (attrs.length != 0) { - Set<String> set = new HashSet<String>(Arrays.asList(attrs)); + Set<String> set = new HashSet<>(Arrays.asList(attrs)); set.removeAll(Arrays.asList(otherAttrs)); if (set.size() != 0) return false; @@ -397,7 +397,7 @@ public class XmlStorageElement implements ICStorageElement { public String[] getAttributeNames() { NamedNodeMap nodeMap = fElement.getAttributes(); int length = nodeMap.getLength(); - List<String> list = new ArrayList<String>(length); + List<String> list = new ArrayList<>(length); for (int i = 0; i < length; i++) { Node node = nodeMap.item(i); String name = node.getNodeName(); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/LanguageMappingResolver.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/LanguageMappingResolver.java index 7f6383920c3..aa638356806 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/LanguageMappingResolver.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/LanguageMappingResolver.java @@ -55,7 +55,7 @@ public class LanguageMappingResolver { public static LanguageMapping[] computeLanguage(IProject project, String filePath, ICConfigurationDescription configuration, String contentTypeId, boolean fetchAll) throws CoreException { LanguageManager manager = LanguageManager.getInstance(); - List<LanguageMapping> inheritedLanguages = new LinkedList<LanguageMapping>(); + List<LanguageMapping> inheritedLanguages = new LinkedList<>(); if (project != null) { ProjectLanguageConfiguration mappings = manager.getLanguageConfiguration(project); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/LanguageMappingStore.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/LanguageMappingStore.java index 99238ff6e72..2d61d250bf5 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/LanguageMappingStore.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/LanguageMappingStore.java @@ -95,7 +95,7 @@ public class LanguageMappingStore { } private Map<String, Map<String, String>> decodeProjectContentTypeMappings(ICStorageElement rootElement) { - Map<String, Map<String, String>> decodedMappings = new TreeMap<String, Map<String, String>>(); + Map<String, Map<String, String>> decodedMappings = new TreeMap<>(); ICStorageElement[] mappingElements = rootElement.getChildrenByName(CONTENT_TYPE_MAPPING); for (int j = 0; j < mappingElements.length; j++) { ICStorageElement mapping = mappingElements[j]; @@ -103,7 +103,7 @@ public class LanguageMappingStore { Map<String, String> contentTypeMappings = decodedMappings.get(configuration); if (contentTypeMappings == null) { - contentTypeMappings = new TreeMap<String, String>(); + contentTypeMappings = new TreeMap<>(); decodedMappings.put(configuration, contentTypeMappings); } String contentType = mapping.getAttribute(ATTRIBUTE_CONTENT_TYPE); @@ -122,7 +122,7 @@ public class LanguageMappingStore { } private Map<String, Map<String, String>> decodeFileMappings(ICStorageElement rootElement) throws CoreException { - Map<String, Map<String, String>> decodedMappings = new TreeMap<String, Map<String, String>>(); + Map<String, Map<String, String>> decodedMappings = new TreeMap<>(); ICStorageElement[] mappingElements = rootElement.getChildrenByName(FILE_MAPPING); for (int j = 0; j < mappingElements.length; j++) { ICStorageElement mapping = mappingElements[j]; @@ -130,7 +130,7 @@ public class LanguageMappingStore { Map<String, String> configurationMappings = decodedMappings.get(path); if (configurationMappings == null) { - configurationMappings = new TreeMap<String, String>(); + configurationMappings = new TreeMap<>(); decodedMappings.put(path, configurationMappings); } String configuration = mapping.getAttribute(ATTRIBUTE_CONFIGURATION); @@ -141,7 +141,7 @@ public class LanguageMappingStore { } private Map<String, String> decodeMappings(Element rootElement, String category, String keyName, String valueName) { - Map<String, String> decodedMappings = new TreeMap<String, String>(); + Map<String, String> decodedMappings = new TreeMap<>(); NodeList mappingElements = rootElement.getElementsByTagName(category); for (int j = 0; j < mappingElements.getLength(); j++) { Element mapping = (Element) mappingElements.item(j); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsDelta.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsDelta.java index 5af22399274..60fb2fb8e84 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsDelta.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsDelta.java @@ -64,7 +64,7 @@ public class LanguageSettingsDelta { return paths; } - paths = new TreeSet<String>(); + paths = new TreeSet<>(); LanguageSettingsStorage oldCombinedStorage = combineStorage(oldLanguageSettingsState); LanguageSettingsStorage newCombinedStorage = combineStorage(newLanguageSettingsState); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsExtensionManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsExtensionManager.java index cf204c4383d..2e3fae46944 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsExtensionManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsExtensionManager.java @@ -68,7 +68,7 @@ public class LanguageSettingsExtensionManager { * Extension providers loaded once and used for equality only. * Those who request extension provider will get copy rather than real instance. */ - private static final LinkedHashMap<String, ILanguageSettingsProvider> fExtensionProviders = new LinkedHashMap<String, ILanguageSettingsProvider>(); + private static final LinkedHashMap<String, ILanguageSettingsProvider> fExtensionProviders = new LinkedHashMap<>(); /** * Providers loaded initially via static initializer. @@ -85,7 +85,7 @@ public class LanguageSettingsExtensionManager { * Load language settings providers contributed via the extension point. */ synchronized private static void loadProviderExtensions() { - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); loadProviderExtensions(Platform.getExtensionRegistry(), providers); // sort by name - the providers defined via extensions are kept in separate list sorted by name @@ -168,7 +168,7 @@ public class LanguageSettingsExtensionManager { private static void configureExecutableProvider(ILanguageSettingsProvider provider, IConfigurationElement ce) { String ceId = determineAttributeValue(ce, ATTR_ID); String ceName = determineAttributeValue(ce, ATTR_NAME); - Map<String, String> ceAttributes = new HashMap<String, String>(); + Map<String, String> ceAttributes = new HashMap<>(); List<String> languages = null; List<ICLanguageSettingEntry> entries = null; @@ -182,7 +182,7 @@ public class LanguageSettingsExtensionManager { String langId = determineAttributeValue(ceLang, ATTR_ID); if (langId.length() > 0) { if (languages == null) { - languages = new ArrayList<String>(); + languages = new ArrayList<>(); } languages.add(langId); } @@ -206,7 +206,7 @@ public class LanguageSettingsExtensionManager { entryValue, null, flags); if (entries == null) { - entries = new ArrayList<ICLanguageSettingEntry>(); + entries = new ArrayList<>(); } entries.add(entry); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsProvidersSerializer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsProvidersSerializer.java index 41e9861f44f..194f82d042f 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsProvidersSerializer.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsProvidersSerializer.java @@ -110,9 +110,9 @@ public class LanguageSettingsProvidersSerializer { private static final String VALUE_COPY_OF_EXTENSION = "extension"; //$NON-NLS-1$ /** Cache of true (raw) workspace providers */ - private static Map<String, ILanguageSettingsProvider> rawGlobalWorkspaceProviders = new HashMap<String, ILanguageSettingsProvider>(); + private static Map<String, ILanguageSettingsProvider> rawGlobalWorkspaceProviders = new HashMap<>(); /** Cache of workspace providers wrappers */ - private static Map<String, ILanguageSettingsProvider> globalWorkspaceProviders = new HashMap<String, ILanguageSettingsProvider>(); + private static Map<String, ILanguageSettingsProvider> globalWorkspaceProviders = new HashMap<>(); private static ListenerList<ILanguageSettingsChangeListener> fLanguageSettingsChangeListeners = new ListenerList<>( ListenerList.IDENTITY); @@ -267,7 +267,7 @@ public class LanguageSettingsProvidersSerializer { */ private static class LanguageSettingsChangeEvent implements ILanguageSettingsChangeEvent { private String projectName = null; - private Map<String/*cfg*/, LanguageSettingsDelta> deltaMap = new HashMap<String, LanguageSettingsDelta>(); + private Map<String/*cfg*/, LanguageSettingsDelta> deltaMap = new HashMap<>(); /** * The act of creating event resets internal delta count in configuration state. @@ -337,7 +337,7 @@ public class LanguageSettingsProvidersSerializer { Set<String> paths = delta.getAffectedResourcePaths(); if (!paths.isEmpty()) { IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); - Set<IResource> resources = new HashSet<IResource>(); + Set<IResource> resources = new HashSet<>(); for (String path : paths) { IResource rc = project.findMember(path); if (rc != null) { @@ -428,7 +428,7 @@ public class LanguageSettingsProvidersSerializer { * is passed user defined providers are cleared. */ private static void setWorkspaceProvidersInternal(List<ILanguageSettingsProvider> providers) { - Map<String, ILanguageSettingsProvider> rawNewProviders = new HashMap<String, ILanguageSettingsProvider>(); + Map<String, ILanguageSettingsProvider> rawNewProviders = new HashMap<>(); // add given providers if (providers != null) { @@ -513,9 +513,9 @@ public class LanguageSettingsProvidersSerializer { */ private static List<LanguageSettingsChangeEvent> createLanguageSettingsChangeEvents( List<ILanguageSettingsBroadcastingProvider> providers) { - List<LanguageSettingsChangeEvent> events = new ArrayList<LanguageSettingsChangeEvent>(); + List<LanguageSettingsChangeEvent> events = new ArrayList<>(); - List<String> providerIds = new ArrayList<String>(); + List<String> providerIds = new ArrayList<>(); for (ILanguageSettingsBroadcastingProvider provider : providers) { providerIds.add(provider.getId()); } @@ -552,8 +552,8 @@ public class LanguageSettingsProvidersSerializer { */ public static void serializeLanguageSettingsWorkspace() throws CoreException { URI uriStoreWsp = getStoreInWorkspaceArea(STORAGE_WORKSPACE_LANGUAGE_SETTINGS); - List<ILanguageSettingsBroadcastingProvider> broadcastingWorkspaceProviders = new ArrayList<ILanguageSettingsBroadcastingProvider>(); - List<LanguageSettingsSerializableProvider> serializingWorkspaceProviders = new ArrayList<LanguageSettingsSerializableProvider>(); + List<ILanguageSettingsBroadcastingProvider> broadcastingWorkspaceProviders = new ArrayList<>(); + List<LanguageSettingsSerializableProvider> serializingWorkspaceProviders = new ArrayList<>(); for (ILanguageSettingsProvider provider : rawGlobalWorkspaceProviders.values()) { if (provider instanceof ILanguageSettingsBroadcastingProvider) { broadcastingWorkspaceProviders.add((ILanguageSettingsBroadcastingProvider) provider); @@ -687,8 +687,8 @@ public class LanguageSettingsProvidersSerializer { Element rootElement = doc.getDocumentElement(); NodeList providerNodes = rootElement.getElementsByTagName(ELEM_PROVIDER); - List<String> userDefinedProvidersIds = new ArrayList<String>(providerNodes.getLength()); - providers = new ArrayList<ILanguageSettingsProvider>(providerNodes.getLength()); + List<String> userDefinedProvidersIds = new ArrayList<>(providerNodes.getLength()); + providers = new ArrayList<>(providerNodes.getLength()); for (int i = 0; i < providerNodes.getLength(); i++) { Node providerNode = providerNodes.item(i); @@ -1019,7 +1019,7 @@ public class LanguageSettingsProvidersSerializer { continue; } - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> providers = new ArrayList<>(); String cfgId = XmlUtil.determineAttributeValue(cfgNode, ATTR_ID); NodeList extensionNodes = cfgNode.getChildNodes(); @@ -1208,7 +1208,7 @@ public class LanguageSettingsProvidersSerializer { String[] ids = ((ILanguageSettingsProvidersKeeper) cfgDescription) .getDefaultLanguageSettingsProvidersIds(); if (ids != null) { - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>( + List<ILanguageSettingsProvider> providers = new ArrayList<>( ids.length); for (String id : ids) { if (LanguageSettingsExtensionManager.isPreferShared(id)) { @@ -1267,7 +1267,7 @@ public class LanguageSettingsProvidersSerializer { * @return list of workspace providers. */ public static List<ILanguageSettingsProvider> getWorkspaceProviders() { - ArrayList<ILanguageSettingsProvider> workspaceProviders = new ArrayList<ILanguageSettingsProvider>(); + ArrayList<ILanguageSettingsProvider> workspaceProviders = new ArrayList<>(); for (ILanguageSettingsProvider rawProvider : rawGlobalWorkspaceProviders.values()) { workspaceProviders.add(getWorkspaceProvider(rawProvider.getId())); } @@ -1317,7 +1317,7 @@ public class LanguageSettingsProvidersSerializer { * for a given project description - collecting from all configurations. */ private static List<ICListenerAgent> getListeners(ICProjectDescription prjDescription) { - List<ICListenerAgent> listeners = new ArrayList<ICListenerAgent>(); + List<ICListenerAgent> listeners = new ArrayList<>(); if (prjDescription != null) { for (ICConfigurationDescription cfgDescription : prjDescription.getConfigurations()) { if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) { @@ -1341,7 +1341,7 @@ public class LanguageSettingsProvidersSerializer { * Pick from the list providers which are listeners, i.e. instances of type {@link ICListenerAgent}. */ private static List<ICListenerAgent> selectListeners(Collection<ILanguageSettingsProvider> values) { - List<ICListenerAgent> listeners = new ArrayList<ICListenerAgent>(); + List<ICListenerAgent> listeners = new ArrayList<>(); for (ILanguageSettingsProvider provider : values) { if (provider instanceof ICListenerAgent) listeners.add((ICListenerAgent) provider); @@ -1354,7 +1354,7 @@ public class LanguageSettingsProvidersSerializer { * for a given project description - collecting from all configurations. */ private static List<ListenerAssociation> getListenersAssociations(ICProjectDescription prjDescription) { - List<ListenerAssociation> associations = new ArrayList<ListenerAssociation>(); + List<ListenerAssociation> associations = new ArrayList<>(); if (prjDescription != null) { for (ICConfigurationDescription cfgDescription : prjDescription.getConfigurations()) { if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) { @@ -1552,8 +1552,8 @@ public class LanguageSettingsProvidersSerializer { return null; } - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); - List<String> alreadyAdded = new ArrayList<String>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); + List<String> alreadyAdded = new ArrayList<>(); List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription) .getLanguageSettingProviders(); @@ -1657,7 +1657,7 @@ public class LanguageSettingsProvidersSerializer { * @return newly cloned list. */ public static List<ILanguageSettingsProvider> cloneProviders(List<ILanguageSettingsProvider> baseProviders) { - List<ILanguageSettingsProvider> newProviders = new ArrayList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> newProviders = new ArrayList<>(); for (ILanguageSettingsProvider provider : baseProviders) { if (provider instanceof ILanguageSettingsEditableProvider) { ILanguageSettingsEditableProvider newProvider = LanguageSettingsManager @@ -1668,7 +1668,7 @@ public class LanguageSettingsProvidersSerializer { } newProviders.add(provider); } - return new ArrayList<ILanguageSettingsProvider>(newProviders); + return new ArrayList<>(newProviders); } } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsScannerInfoProvider.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsScannerInfoProvider.java index 5260c67aa46..f19a013f9c4 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsScannerInfoProvider.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsScannerInfoProvider.java @@ -94,11 +94,11 @@ public class LanguageSettingsScannerInfoProvider implements IScannerInfoProvider return DUMMY_SCANNER_INFO; } - LinkedHashSet<ICLanguageSettingEntry> includePathEntries = new LinkedHashSet<ICLanguageSettingEntry>(); - LinkedHashSet<ICLanguageSettingEntry> includePathLocalEntries = new LinkedHashSet<ICLanguageSettingEntry>(); - LinkedHashSet<ICLanguageSettingEntry> includeFileEntries = new LinkedHashSet<ICLanguageSettingEntry>(); - LinkedHashSet<ICLanguageSettingEntry> macroFileEntries = new LinkedHashSet<ICLanguageSettingEntry>(); - LinkedHashSet<ICLanguageSettingEntry> macroEntries = new LinkedHashSet<ICLanguageSettingEntry>(); + LinkedHashSet<ICLanguageSettingEntry> includePathEntries = new LinkedHashSet<>(); + LinkedHashSet<ICLanguageSettingEntry> includePathLocalEntries = new LinkedHashSet<>(); + LinkedHashSet<ICLanguageSettingEntry> includeFileEntries = new LinkedHashSet<>(); + LinkedHashSet<ICLanguageSettingEntry> macroFileEntries = new LinkedHashSet<>(); + LinkedHashSet<ICLanguageSettingEntry> macroEntries = new LinkedHashSet<>(); for (String langId : languageIds) { List<ICLanguageSettingEntry> incSys = LanguageSettingsProvidersSerializer @@ -127,7 +127,7 @@ public class LanguageSettingsScannerInfoProvider implements IScannerInfoProvider String[] includeFiles = convertToLocations(includeFileEntries, cfgDescription); String[] macroFiles = convertToLocations(macroFileEntries, cfgDescription); - Map<String, String> definedMacros = new HashMap<String, String>(); + Map<String, String> definedMacros = new HashMap<>(); for (ICLanguageSettingEntry entry : macroEntries) { ICMacroEntry macroEntry = (ICMacroEntry) entry; String name = macroEntry.getName(); @@ -252,7 +252,7 @@ public class LanguageSettingsScannerInfoProvider implements IScannerInfoProvider */ private String[] convertToLocations(LinkedHashSet<ICLanguageSettingEntry> entriesPath, ICConfigurationDescription cfgDescription) { - List<String> locations = new ArrayList<String>(entriesPath.size()); + List<String> locations = new ArrayList<>(entriesPath.size()); for (ICLanguageSettingEntry entry : entriesPath) { ICPathEntry entryPath = (ICPathEntry) entry; if (entryPath.isValueWorkspacePath()) { @@ -321,7 +321,7 @@ public class LanguageSettingsScannerInfoProvider implements IScannerInfoProvider IProject project = resource.getProject(); List<IScannerInfoChangeListener> list = listenersMap.get(project); if (list == null) { - list = new Vector<IScannerInfoChangeListener>(); + list = new Vector<>(); listenersMap.put(project, list); } if (!list.contains(listener)) { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsSerializableStorage.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsSerializableStorage.java index 8beadf3880a..f022e47201f 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsSerializableStorage.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsSerializableStorage.java @@ -114,7 +114,7 @@ public class LanguageSettingsSerializableStorage extends LanguageSettingsStorage * @param providerNode - parent XML element "provider" where entries are defined. */ public void loadEntries(Element providerNode) { - List<ICLanguageSettingEntry> settings = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> settings = new ArrayList<>(); NodeList nodes = providerNode.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { Node elementNode = nodes.item(i); @@ -176,7 +176,7 @@ public class LanguageSettingsSerializableStorage extends LanguageSettingsStorage langId = null; } - List<ICLanguageSettingEntry> settings = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> settings = new ArrayList<>(); NodeList nodes = parentNode.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { Node elementNode = nodes.item(i); @@ -204,7 +204,7 @@ public class LanguageSettingsSerializableStorage extends LanguageSettingsStorage private void loadResourceElement(Node parentNode, String cfgId, String langId) { String rcProjectPath = XmlUtil.determineAttributeValue(parentNode, ATTR_PROJECT_PATH); - List<ICLanguageSettingEntry> settings = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> settings = new ArrayList<>(); NodeList nodes = parentNode.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { Node elementNode = nodes.item(i); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/PathEntryScannerInfoLanguageSettingsProvider.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/PathEntryScannerInfoLanguageSettingsProvider.java index 7bf729f006a..0c10b459325 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/PathEntryScannerInfoLanguageSettingsProvider.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/PathEntryScannerInfoLanguageSettingsProvider.java @@ -69,10 +69,10 @@ public class PathEntryScannerInfoLanguageSettingsProvider extends LanguageSettin IPath projectPath = cproject.getPath(); // using map of sets to support specific ordering of entries - LinkedHashMap<Integer, Set<IPathEntry>> pathEntriesMap = new LinkedHashMap<Integer, Set<IPathEntry>>(); + LinkedHashMap<Integer, Set<IPathEntry>> pathEntriesMap = new LinkedHashMap<>(); pathEntriesMap.put(IPathEntry.CDT_INCLUDE, new LinkedHashSet<IPathEntry>()); // keep macros sorted - pathEntriesMap.put(IPathEntry.CDT_MACRO, new TreeSet<IPathEntry>(new Comparator<IPathEntry>() { + pathEntriesMap.put(IPathEntry.CDT_MACRO, new TreeSet<>(new Comparator<IPathEntry>() { @Override public int compare(IPathEntry macro1, IPathEntry macro2) { if (macro1 instanceof IMacroEntry && macro2 instanceof IMacroEntry) { @@ -120,7 +120,7 @@ public class PathEntryScannerInfoLanguageSettingsProvider extends LanguageSettin CCorePlugin.log(e); } - Set<ICLanguageSettingEntry> lsEntries = new LinkedHashSet<ICLanguageSettingEntry>(); + Set<ICLanguageSettingEntry> lsEntries = new LinkedHashSet<>(); for (Entry<Integer, Set<IPathEntry>> entrySet : pathEntriesMap.entrySet()) { Set<IPathEntry> pathEntries = entrySet.getValue(); for (IPathEntry pathEntry : pathEntries) { @@ -131,7 +131,7 @@ public class PathEntryScannerInfoLanguageSettingsProvider extends LanguageSettin } } - return LanguageSettingsSerializableStorage.getPooledList(new ArrayList<ICLanguageSettingEntry>(lsEntries)); + return LanguageSettingsSerializableStorage.getPooledList(new ArrayList<>(lsEntries)); } private void collectPathEntry(LinkedHashMap<Integer, Set<IPathEntry>> pathEntriesMap, IPath projectPath, diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/ReferencedProjectsLanguageSettingsProvider.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/ReferencedProjectsLanguageSettingsProvider.java index ccb4a972476..7a6f688bbc5 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/ReferencedProjectsLanguageSettingsProvider.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/ReferencedProjectsLanguageSettingsProvider.java @@ -61,7 +61,7 @@ public class ReferencedProjectsLanguageSettingsProvider extends LanguageSettings try { recursiveCallIndicator.set(true); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); ICConfigurationDescription[] refCfgDescriptions = CoreModelUtil .getReferencedConfigurationDescriptions(cfgDescription, false); for (ICConfigurationDescription refCfgDescription : refCfgDescriptions) { @@ -78,7 +78,7 @@ public class ReferencedProjectsLanguageSettingsProvider extends LanguageSettings } } - return LanguageSettingsStorage.getPooledList(new ArrayList<ICLanguageSettingEntry>(entries)); + return LanguageSettingsStorage.getPooledList(new ArrayList<>(entries)); } finally { recursiveCallIndicator.set(false); } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/ScannerInfoExtensionLanguageSettingsProvider.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/ScannerInfoExtensionLanguageSettingsProvider.java index c5bcf874bcb..408b8e152ac 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/ScannerInfoExtensionLanguageSettingsProvider.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/ScannerInfoExtensionLanguageSettingsProvider.java @@ -42,7 +42,7 @@ public class ScannerInfoExtensionLanguageSettingsProvider extends LanguageSettin @Override public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) { - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> entries = new ArrayList<>(); IScannerInfoProvider scannerInfoProvider = getScannerInfoProvider(cfgDescription); if (scannerInfoProvider != null) { IScannerInfo si = scannerInfoProvider.getScannerInformation(rc); @@ -128,7 +128,7 @@ public class ScannerInfoExtensionLanguageSettingsProvider extends LanguageSettin private void addDefinedSymbols(List<ICLanguageSettingEntry> entries, IScannerInfo si) { Map<String, String> definedSymbols = si.getDefinedSymbols(); if (definedSymbols != null) { - for (Entry<String, String> entry : new TreeMap<String, String>(definedSymbols).entrySet()) { + for (Entry<String, String> entry : new TreeMap<>(definedSymbols).entrySet()) { String name = entry.getKey(); String value = entry.getValue(); entries.add(CDataUtil.createCMacroEntry(name, value, 0)); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/APathEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/APathEntry.java index cc70db9410f..f2ad6204b46 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/APathEntry.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/APathEntry.java @@ -108,8 +108,8 @@ public abstract class APathEntry extends PathEntry { return false; } - Set<String> excludeSet = new HashSet<String>(); - Set<String> otherSet = new HashSet<String>(); + Set<String> excludeSet = new HashSet<>(); + Set<String> otherSet = new HashSet<>(); for (int i = 0; i < excludeLength; i++) { if (exclusionPatterns[i] != otherExcludes[i]) { // compare toStrings instead of IPaths diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/AsmModelBuilder.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/AsmModelBuilder.java index ac29cacc6dd..8ee6b8a08ce 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/AsmModelBuilder.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/AsmModelBuilder.java @@ -61,7 +61,7 @@ public class AsmModelBuilder implements IContributedModelBuilder { private static final Map<String, AsmDirective> fgDirectives; static { - fgDirectives = new HashMap<String, AsmDirective>(); + fgDirectives = new HashMap<>(); fgDirectives.put("globl", AsmDirective.GLOBAL); //$NON-NLS-1$ fgDirectives.put("global", AsmDirective.GLOBAL); //$NON-NLS-1$ fgDirectives.put("ascii", AsmDirective.DATA); //$NON-NLS-1$ @@ -124,8 +124,8 @@ public class AsmModelBuilder implements IContributedModelBuilder { * @throws CModelException */ private void buildModel(final char[] source) throws CModelException { - fGlobals = new HashMap<String, Counter>(); - fLabels = new HashMap<String, Counter>(); + fGlobals = new HashMap<>(); + fLabels = new HashMap<>(); fLastLabel = null; fLastGlobalLabel = null; fLastLabelEndOffset = 0; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Binary.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Binary.java index a05d15d1061..7c4df0ef18c 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Binary.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Binary.java @@ -283,7 +283,7 @@ public class Binary extends Openable implements IBinary { boolean computeChildren(OpenableInfo info, IResource res) throws CModelException { boolean ok = false; if (isObject() || isExecutable() || isSharedLib()) { - Map<IPath, BinaryModule> hash = new HashMap<IPath, BinaryModule>(); + Map<IPath, BinaryModule> hash = new HashMap<>(); IBinaryObject obj = getBinaryObject(); if (obj != null) { // First check if we can get the list of source diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainer.java index 19378534481..291a9eaa181 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainer.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainer.java @@ -45,7 +45,7 @@ public class BinaryContainer extends Openable implements IBinaryContainer { public IBinary[] getBinaries() throws CModelException { sync(); ICElement[] e = getChildren(); - ArrayList<IBinary> list = new ArrayList<IBinary>(e.length); + ArrayList<IBinary> list = new ArrayList<>(e.length); for (ICElement element : e) { if (element instanceof IBinary) { IBinary bin = (IBinary) element; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Buffer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Buffer.java index c88a7cd7eba..ca6e39bc088 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Buffer.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Buffer.java @@ -67,7 +67,7 @@ public class Buffer implements IBuffer { @Override public void addBufferChangedListener(IBufferChangedListener listener) { if (this.changeListeners == null) { - this.changeListeners = new ArrayList<IBufferChangedListener>(5); + this.changeListeners = new ArrayList<>(5); } if (!this.changeListeners.contains(listener)) { this.changeListeners.add(listener); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BufferManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BufferManager.java index 8af4399b4b1..5b43c3f64dc 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BufferManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BufferManager.java @@ -68,7 +68,7 @@ public class BufferManager implements IBufferFactory { */ @Override protected OverflowingLRUCache<K, IBuffer> newInstance(int size, int overflow) { - return new BufferCache<K>(size, overflow); + return new BufferCache<>(size, overflow); } } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CContainerInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CContainerInfo.java index c4cc163d824..ebf9aca82d6 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CContainerInfo.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CContainerInfo.java @@ -46,7 +46,7 @@ public class CContainerInfo extends OpenableInfo { if (nonCResources != null) return nonCResources; - ArrayList<IResource> notChildren = new ArrayList<IResource>(); + ArrayList<IResource> notChildren = new ArrayList<>(); ICElement celement = getElement(); ICProject cproject = celement.getCProject(); // move back to the sourceroot. diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java index c6dc5c8860e..00e7fce0bf7 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java @@ -172,7 +172,7 @@ public abstract class CElement extends PlatformObject implements ICElement { */ protected ICElement[] getSourceElementsAtOffset(int offset) throws CModelException { if (this instanceof ISourceReference && this instanceof Parent) { - ArrayList<Object> list = new ArrayList<Object>(); + ArrayList<Object> list = new ArrayList<>(); ICElement[] children = ((Parent) this).getChildren(); for (ICElement aChild : children) { if (aChild instanceof ISourceReference) { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDelta.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDelta.java index 0e97ccaa5d5..46867c6aafb 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDelta.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDelta.java @@ -356,7 +356,7 @@ public class CElementDelta implements ICElementDelta { if (parent == null) { return null; } - ArrayList<ICElement> parents = new ArrayList<ICElement>(); + ArrayList<ICElement> parents = new ArrayList<>(); while (!parent.equals(fChangedElement)) { parents.add(parent); parent = parent.getParent(); @@ -384,7 +384,7 @@ public class CElementDelta implements ICElementDelta { if (length == 0) { return new ICElementDelta[] {}; } - ArrayList<ICElementDelta> children = new ArrayList<ICElementDelta>(length); + ArrayList<ICElementDelta> children = new ArrayList<>(length); for (int i = 0; i < length; i++) { if (fAffectedChildren[i].getKind() == type) { children.add(fAffectedChildren[i]); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDeltaBuilder.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDeltaBuilder.java index f5b2b3a6e22..8fdfe6f64cc 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDeltaBuilder.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDeltaBuilder.java @@ -245,9 +245,9 @@ public class CElementDeltaBuilder { } private void initialize() { - this.infos = new HashMap<ICElement, CElementInfo>(20); - this.oldPositions = new HashMap<ICElement, ListItem>(20); - this.newPositions = new HashMap<ICElement, ListItem>(20); + this.infos = new HashMap<>(20); + this.oldPositions = new HashMap<>(20); + this.newPositions = new HashMap<>(20); this.putOldPosition(this.cElement, new ListItem(null, null)); this.putNewPosition(this.cElement, new ListItem(null, null)); this.delta = new CElementDelta(cElement); @@ -258,8 +258,8 @@ public class CElementDeltaBuilder { this.delta.fineGrained(); } - this.added = new ArrayList<ICElement>(5); - this.removed = new ArrayList<ICElement>(5); + this.added = new ArrayList<>(5); + this.removed = new ArrayList<>(5); } /** diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementInfo.java index 0e4666f3343..8e0e70f69e0 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementInfo.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementInfo.java @@ -51,7 +51,7 @@ public class CElementInfo { protected CElementInfo(CElement element) { this.element = element; // Array list starts with size = 0 - fChildren = new Vector<ICElement>(0); + fChildren = new Vector<>(0); } protected CElement getElement() { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java index 4974e7f6b7d..a8749c1b251 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java @@ -206,8 +206,8 @@ public class CModelBuilder2 implements IContributedModelBuilder { * @throws DOMException */ private void buildModel(IASTTranslationUnit ast) throws CModelException, DOMException { - fVisibilityStack = new Stack<ASTAccessVisibility>(); - fEqualElements = new HashMap<ISourceReference, int[]>(); + fVisibilityStack = new Stack<>(); + fEqualElements = new HashMap<>(); // includes final IASTPreprocessorIncludeStatement[] includeDirectives = ast.getIncludeDirectives(); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelCache.java index 53203d65610..0e365f14c12 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelCache.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelCache.java @@ -52,10 +52,10 @@ public class CModelCache { protected Map<ICElement, Object> childrenCache; public CModelCache() { - this.projectAndRootCache = new HashMap<ICElement, Object>(PROJ_CACHE_SIZE); - this.folderCache = new HashMap<ICElement, Object>(FOLDER_CACHE_SIZE); - this.fileCache = new ElementCache<Object>(FILE_CACHE_SIZE); - this.childrenCache = new HashMap<ICElement, Object>(CHILDREN_CACHE_SIZE); // average 20 children per openable + this.projectAndRootCache = new HashMap<>(PROJ_CACHE_SIZE); + this.folderCache = new HashMap<>(FOLDER_CACHE_SIZE); + this.fileCache = new ElementCache<>(FILE_CACHE_SIZE); + this.childrenCache = new HashMap<>(CHILDREN_CACHE_SIZE); // average 20 children per openable } public double openableFillingRatio() { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelOperation.java index 7630adaf627..d84956234b2 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelOperation.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelOperation.java @@ -110,7 +110,7 @@ public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMo /* * A per thread stack of java model operations (PerThreadObject of ArrayList). */ - protected final static ThreadLocal<ArrayList<CModelOperation>> operationStacks = new ThreadLocal<ArrayList<CModelOperation>>(); + protected final static ThreadLocal<ArrayList<CModelOperation>> operationStacks = new ThreadLocal<>(); protected CModelOperation() { } @@ -170,7 +170,7 @@ public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMo */ protected void addDelta(ICElementDelta delta) { if (fDeltas == null) - fDeltas = new LinkedList<ICElementDelta>(); + fDeltas = new LinkedList<>(); fDeltas.add(delta); } @@ -558,7 +558,7 @@ public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMo protected ArrayList<CModelOperation> getCurrentOperationStack() { ArrayList<CModelOperation> stack = operationStacks.get(); if (stack == null) { - stack = new ArrayList<CModelOperation>(); + stack = new ArrayList<>(); operationStacks.set(stack); } return stack; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java index fac227a15cf..102c8883045 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java @@ -280,7 +280,7 @@ public class CProject extends Openable implements ICProject { @Override public Map<String, String> getOptions(boolean inheritCCoreOptions) { // initialize to the defaults from CCorePlugin options pool - Map<String, String> options = inheritCCoreOptions ? CCorePlugin.getOptions() : new HashMap<String, String>(5); + Map<String, String> options = inheritCCoreOptions ? CCorePlugin.getOptions() : new HashMap<>(5); IEclipsePreferences preferences = getPreferences(); if (preferences == null) @@ -629,7 +629,7 @@ public class CProject extends Openable implements ICProject { protected boolean computeChildren(OpenableInfo info, IResource res) throws CModelException { List<ISourceRoot> sourceRoots = computeSourceRoots(); - List<ICContainer> children = new ArrayList<ICContainer>(sourceRoots.size()); + List<ICContainer> children = new ArrayList<>(sourceRoots.size()); children.addAll(sourceRoots); boolean projectIsSourceRoot = false; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProjectInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProjectInfo.java index 82c4d57b864..81e121da423 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProjectInfo.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProjectInfo.java @@ -72,7 +72,7 @@ class CProjectInfo extends OpenableInfo { if (nonCResources != null) return nonCResources; - List<IResource> notChildren = new ArrayList<IResource>(); + List<IResource> notChildren = new ArrayList<>(); try { if (res instanceof IContainer) { ICProject cproject = getElement().getCProject(); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ContentTypeProcessor.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ContentTypeProcessor.java index b4c0c6c49a3..66016df44a2 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ContentTypeProcessor.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ContentTypeProcessor.java @@ -324,7 +324,7 @@ public class ContentTypeProcessor extends CModelOperation { } } // Assume a workspace resolver - List<ICProject> list = new ArrayList<ICProject>(cprojects.length); + List<ICProject> list = new ArrayList<>(cprojects.length); for (int i = 0; i < cprojects.length; ++i) { list.add(cprojects[i]); } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CopyResourceElementsOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CopyResourceElementsOperation.java index dd8b8584ea6..a3f1f420afa 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CopyResourceElementsOperation.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CopyResourceElementsOperation.java @@ -60,7 +60,7 @@ public class CopyResourceElementsOperation extends MultiOperation { * copied/moved/renamed. Keyed by elements' project(s), and * values are the corresponding deltas. */ - protected Map<ICProject, CElementDelta> fDeltasPerProject = new HashMap<ICProject, CElementDelta>(1); + protected Map<ICProject, CElementDelta> fDeltasPerProject = new HashMap<>(1); public CopyResourceElementsOperation(ICElement[] src, ICElement[] dst, boolean force) { super(src, dst, force); @@ -208,7 +208,7 @@ public class CopyResourceElementsOperation extends MultiOperation { */ @Override protected void processElements() throws CModelException { - fCreatedElements = new ArrayList<ICElement>(fElementsToProcess.length); + fCreatedElements = new ArrayList<>(fElementsToProcess.length); try { super.processElements(); } catch (CModelException cme) { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DefaultPathEntryStore.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DefaultPathEntryStore.java index 883e0633c2a..a1f6ebd2cdf 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DefaultPathEntryStore.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DefaultPathEntryStore.java @@ -91,7 +91,7 @@ public class DefaultPathEntryStore implements IPathEntryStore, ICDescriptorListe public IPathEntry[] getRawPathEntries() throws CoreException { ICDescriptor cdesc = CCorePlugin.getDefault().getCProjectDescription(fProject, false); if (cdesc != null) { - ArrayList<IPathEntry> pathEntries = new ArrayList<IPathEntry>(); + ArrayList<IPathEntry> pathEntries = new ArrayList<>(); ICStorageElement entry = cdesc.getProjectStorageElement(PATH_ENTRY_ID); for (ICStorageElement childNode : entry.getChildrenByName(PATH_ENTRY)) pathEntries.add(decodePathEntry(fProject, childNode)); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeleteElementsOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeleteElementsOperation.java index 0358ac92ef1..dabe76562c0 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeleteElementsOperation.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeleteElementsOperation.java @@ -65,7 +65,7 @@ public class DeleteElementsOperation extends MultiOperation { * duplicates specified in elements to be processed. */ protected void groupElements() throws CModelException { - fChildrenToRemove = new HashMap<ITranslationUnit, IRegion>(1); + fChildrenToRemove = new HashMap<>(1); int uniqueTUs = 0; for (ICElement e : fElementsToProcess) { ITranslationUnit tu = getTranslationUnitFor(e); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ElementCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ElementCache.java index 7a05694c601..6e92a8040c6 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ElementCache.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ElementCache.java @@ -64,6 +64,6 @@ public class ElementCache<T> extends OverflowingLRUCache<IOpenable, T> { */ @Override protected OverflowingLRUCache<IOpenable, T> newInstance(int size, int overflow) { - return new ElementCache<T>(size, overflow); + return new ElementCache<>(size, overflow); } } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeReference.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeReference.java index 7234d0cbd6d..c9b0e3960df 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeReference.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeReference.java @@ -117,7 +117,7 @@ public class IncludeReference extends Openable implements IIncludeReference { * @see org.eclipse.cdt.internal.core.model.CContainer#computeChildren(org.eclipse.cdt.internal.core.model.OpenableInfo, org.eclipse.core.resources.IResource) */ protected boolean computeChildren(OpenableInfo info, IProgressMonitor pm, IResource res) throws CModelException { - ArrayList<ICElement> vChildren = new ArrayList<ICElement>(); + ArrayList<ICElement> vChildren = new ArrayList<>(); IPath filePath = null; if (fPath != null) { filePath = fPath; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MultiOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MultiOperation.java index 59d8fda1cf7..4e81eee74b7 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MultiOperation.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MultiOperation.java @@ -55,7 +55,7 @@ public abstract class MultiOperation extends CModelOperation { * values are the corresponding insertion point. * @see #processElements() */ - protected Map<ICElement, ICElement> fInsertBeforeElements = new HashMap<ICElement, ICElement>(1); + protected Map<ICElement, ICElement> fInsertBeforeElements = new HashMap<>(1); /** * This table presents the data in <code>fRenamingList</code> in a more @@ -68,7 +68,7 @@ public abstract class MultiOperation extends CModelOperation { */ protected MultiOperation(ICElement[] elementsToProcess, ICElement[] parentElements, boolean force) { super(elementsToProcess, parentElements, force); - fParentElements = new HashMap<ICElement, ICElement>(elementsToProcess.length); + fParentElements = new HashMap<>(elementsToProcess.length); if (elementsToProcess.length == parentElements.length) { for (int i = 0; i < elementsToProcess.length; i++) { fParentElements.put(elementsToProcess[i], parentElements[i]); @@ -142,7 +142,7 @@ public abstract class MultiOperation extends CModelOperation { */ private void initializeRenamings() { if (fRenamingsList != null && fRenamingsList.length == fElementsToProcess.length) { - fRenamings = new HashMap<ICElement, String>(fRenamingsList.length); + fRenamings = new HashMap<>(fRenamingsList.length); for (int i = 0; i < fRenamingsList.length; i++) { if (fRenamingsList[i] != null) { fRenamings.put(fElementsToProcess[i], fRenamingsList[i]); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Parent.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Parent.java index 5b41d0e7d6e..d0e17faee26 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Parent.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Parent.java @@ -68,7 +68,7 @@ public abstract class Parent extends CElement { public List<ICElement> getChildrenOfType(int type) throws CModelException { ICElement[] children = getChildren(); int size = children.length; - ArrayList<ICElement> list = new ArrayList<ICElement>(size); + ArrayList<ICElement> list = new ArrayList<>(size); for (int i = 0; i < size; ++i) { CElement elt = (CElement) children[i]; if (elt.getElementType() == type) { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryContainerUpdatesOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryContainerUpdatesOperation.java index 71af8708272..a47678f25b0 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryContainerUpdatesOperation.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryContainerUpdatesOperation.java @@ -49,7 +49,7 @@ public class PathEntryContainerUpdatesOperation extends CModelOperation { @Override protected void executeOperation() throws CModelException { PathEntryManager pathEntryManager = PathEntryManager.getDefault(); - ArrayList<CElementDelta> list = new ArrayList<CElementDelta>(events.length); + ArrayList<CElementDelta> list = new ArrayList<>(events.length); for (int i = 0; i < events.length; ++i) { PathEntryContainerChanged event = events[i]; ICElement celement = CoreModel.getDefault().create(event.getPath()); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryUtil.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryUtil.java index 853fea14d85..9c065a6d58a 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryUtil.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryUtil.java @@ -339,7 +339,7 @@ public class PathEntryUtil { public static ICModelStatus validatePathEntry(ICProject cProject, IPathEntry[] entries) { // Check duplication. - Set<IPathEntry> entrySet = new HashSet<IPathEntry>(entries.length); + Set<IPathEntry> entrySet = new HashSet<>(entries.length); for (IPathEntry entry : entries) { if (entry != null) { if (entrySet.contains(entry)) { @@ -543,7 +543,7 @@ public class PathEntryUtil { } public static List<IPathEntry> checkForDuplication(List<IPathEntry> pathEntries, int type) { - List<IPathEntry> duplicate = new ArrayList<IPathEntry>(pathEntries.size()); + List<IPathEntry> duplicate = new ArrayList<>(pathEntries.size()); for (int i = 0; i < pathEntries.size(); ++i) { IPathEntry pathEntry = pathEntries.get(i); if (pathEntry.getEntryKind() == type) { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Region.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Region.java index 7afb9cfb840..70208c187e4 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Region.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Region.java @@ -38,7 +38,7 @@ public class Region implements IRegion { * @see IRegion */ public Region() { - fRootElements = new ArrayList<ICElement>(1); + fRootElements = new ArrayList<>(1); } /** @@ -84,7 +84,7 @@ public class Region implements IRegion { * */ private ArrayList<ICElement> getAncestors(ICElement element) { - ArrayList<ICElement> parents = new ArrayList<ICElement>(); + ArrayList<ICElement> parents = new ArrayList<>(); ICElement parent = element.getParent(); while (parent != null) { parents.add(parent); @@ -127,7 +127,7 @@ public class Region implements IRegion { */ private void removeAllChildren(ICElement element) { if (element instanceof IParent) { - ArrayList<ICElement> newRootElements = new ArrayList<ICElement>(); + ArrayList<ICElement> newRootElements = new ArrayList<>(); for (int i = 0, size = fRootElements.size(); i < size; i++) { ICElement currentRoot = fRootElements.get(i); // walk the current root hierarchy diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SetPathEntriesOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SetPathEntriesOperation.java index f234a20f02e..c59adee0512 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SetPathEntriesOperation.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SetPathEntriesOperation.java @@ -73,7 +73,7 @@ public class SetPathEntriesOperation extends CModelOperation { IProjectDescription description = projectResource.getDescription(); IProject[] projectReferences = description.getReferencedProjects(); - HashSet<String> oldReferences = new HashSet<String>(projectReferences.length); + HashSet<String> oldReferences = new HashSet<>(projectReferences.length); for (IProject projectReference : projectReferences) { String projectName = projectReference.getName(); oldReferences.add(projectName); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java index ad529c61f44..9428f320a0a 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java @@ -279,7 +279,7 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I // optional: parameters String[] mementoParams = {}; if (memento.hasMoreTokens()) { - List<String> params = new ArrayList<String>(); + List<String> params = new ArrayList<>(); do { token = memento.nextToken(); if (token.charAt(0) != CEM_PARAMETER) { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Structure.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Structure.java index f1dde496fa8..615814e81b4 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Structure.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Structure.java @@ -26,7 +26,7 @@ import org.eclipse.cdt.core.model.IStructure; import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; public class Structure extends StructureDeclaration implements IStructure { - Map<String, ASTAccessVisibility> superClassesNames = new TreeMap<String, ASTAccessVisibility>(); + Map<String, ASTAccessVisibility> superClassesNames = new TreeMap<>(); public Structure(ICElement parent, int kind, String name) { super(parent, name, kind); @@ -34,7 +34,7 @@ public class Structure extends StructureDeclaration implements IStructure { @Override public IField[] getFields() throws CModelException { - List<ICElement> fields = new ArrayList<ICElement>(); + List<ICElement> fields = new ArrayList<>(); fields.addAll(getChildrenOfType(ICElement.C_FIELD)); return fields.toArray(new IField[fields.size()]); } @@ -55,7 +55,7 @@ public class Structure extends StructureDeclaration implements IStructure { @Override public IMethodDeclaration[] getMethods() throws CModelException { - List<ICElement> methods = new ArrayList<ICElement>(); + List<ICElement> methods = new ArrayList<>(); methods.addAll(getChildrenOfType(ICElement.C_METHOD_DECLARATION)); methods.addAll(getChildrenOfType(ICElement.C_METHOD)); return methods.toArray(new IMethodDeclaration[methods.size()]); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/StructureTemplateHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/StructureTemplateHandle.java index fa5830e56f9..34a032a5565 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/StructureTemplateHandle.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/StructureTemplateHandle.java @@ -63,7 +63,7 @@ public class StructureTemplateHandle extends StructureHandle implements IStructu fTemplate = new Template(classBinding.getName()); ICPPTemplateParameterMap map = classBinding.getTemplateParameterMap(); ICPPTemplateParameter[] tpars = ct.getTemplateParameters(); - List<String> args = new ArrayList<String>(tpars.length); + List<String> args = new ArrayList<>(tpars.length); for (ICPPTemplateParameter par : tpars) { if (par.isParameterPack()) { ICPPTemplateArgument[] pack = map.getPackExpansion(par); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/AbstractCProjectDescriptionStorage.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/AbstractCProjectDescriptionStorage.java index 4a6e8d9bebe..98af3dbeb9d 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/AbstractCProjectDescriptionStorage.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/AbstractCProjectDescriptionStorage.java @@ -78,7 +78,7 @@ public abstract class AbstractCProjectDescriptionStorage { /** Before the description is fully applied / loaded, consumers of CProjectDescriptionEvent and CProjectDescription.applyDatas() * assume that getProjectDescription(...) will return the writable project description in the process of being created / modified... * Cached temporarily in a thread local variable for this very purpose. */ - final private ThreadLocal<ICProjectDescription> currentThreadProjectDescription = new ThreadLocal<ICProjectDescription>(); + final private ThreadLocal<ICProjectDescription> currentThreadProjectDescription = new ThreadLocal<>(); /** * @param type CProjectDescriptionStorageTypeProxy diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDataProviderDescriptor.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDataProviderDescriptor.java index 76648d25e50..090423377a4 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDataProviderDescriptor.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDataProviderDescriptor.java @@ -66,7 +66,7 @@ public class CConfigurationDataProviderDescriptor { StringTokenizer t = new StringTokenizer(value, DELIMITER); int num = t.countTokens(); - List<String> list = new ArrayList<String>(num); + List<String> list = new ArrayList<>(num); for (int i = 0; i < num; i++) { String v = t.nextToken().trim(); if (v.length() != 0) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescription.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescription.java index c3dfbb56970..76f9b4c5a9e 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescription.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescription.java @@ -299,7 +299,7 @@ public class CConfigurationDescription extends CDataProxyContainer @Override public CDataObject[] getChildren() { CConfigurationData data = getConfigurationData(false); - List<CDataObject> list = new ArrayList<CDataObject>(); + List<CDataObject> list = new ArrayList<>(); CResourceData rcDatas[] = data.getResourceDatas(); for (int i = 0; i < rcDatas.length; i++) { list.add(rcDatas[i]); @@ -610,7 +610,7 @@ public class CConfigurationDescription extends CDataProxyContainer return specs.getReferenceInfo(); } catch (CoreException e) { } - return new HashMap<String, String>(0); + return new HashMap<>(0); } @Override diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescriptionCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescriptionCache.java index 000706552b2..1e542c00435 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescriptionCache.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescriptionCache.java @@ -102,7 +102,7 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData private CProjectDescription fParent; private PathSettingsContainer fPathSettingContainer = PathSettingsContainer.createRootContainer(); private ResourceDescriptionHolder fRcHolder = new ResourceDescriptionHolder(fPathSettingContainer, true); - private List<ICSettingObject> fChildList = new ArrayList<ICSettingObject>(); + private List<ICSettingObject> fChildList = new ArrayList<>(); private CConfigurationSpecSettings fSpecSettings; private CConfigurationData fData; private CConfigurationDescriptionCache fBaseCache; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationSpecSettings.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationSpecSettings.java index 302cd4d6724..05b3a6ad49a 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationSpecSettings.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationSpecSettings.java @@ -95,14 +95,14 @@ public class CConfigurationSpecSettings implements ICSettingsStorage, ILanguageS private boolean fIsModified; private HashMap<QualifiedName, Object> fSessionPropertiesMap; private HashMap<String, CConfigExtensionReference[]> fExtMap; - private HashMap<CConfigExtensionReference, CExtensionInfo> fExtInfoMap = new HashMap<CConfigExtensionReference, CExtensionInfo>(); + private HashMap<CConfigExtensionReference, CExtensionInfo> fExtInfoMap = new HashMap<>(); private String fOwnerId; private COwner fOwner; // private CConfigBasedDescriptor fDescriptor; // private Map fExternalSettingsProviderMap; private List<ILanguageSettingsProvider> fLanguageSettingsProviders = null; - private LinkedHashMap<String /*provider*/, LanguageSettingsStorage> lspPersistedState = new LinkedHashMap<String, LanguageSettingsStorage>(); + private LinkedHashMap<String /*provider*/, LanguageSettingsStorage> lspPersistedState = new LinkedHashMap<>(); private String[] defaultLanguageSettingsProvidersIds = null; private class DeltaSet { @@ -466,7 +466,7 @@ public class CConfigurationSpecSettings implements ICSettingsStorage, ILanguageS return CfgExportSettingContainerFactory.getReferenceMap(fCfg); if (fRefMapCache == null) fRefMapCache = CfgExportSettingContainerFactory.getReferenceMap(fCfg); - return new LinkedHashMap<String, String>(fRefMapCache); + return new LinkedHashMap<>(fRefMapCache); // if(fRefInfoMap == null || fRefInfoMap.size() == 0) // return new HashMap(0); // @@ -582,7 +582,7 @@ public class CConfigurationSpecSettings implements ICSettingsStorage, ILanguageS private Map<QualifiedName, Object> getSessionPropertiesMap(boolean create) { if (fSessionPropertiesMap == null && create) - fSessionPropertiesMap = new HashMap<QualifiedName, Object>(); + fSessionPropertiesMap = new HashMap<>(); return fSessionPropertiesMap; } @@ -605,7 +605,7 @@ public class CConfigurationSpecSettings implements ICSettingsStorage, ILanguageS //extension reference info private HashMap<String, CConfigExtensionReference[]> getExtMap() { if (fExtMap == null) - fExtMap = new HashMap<String, CConfigExtensionReference[]>(); + fExtMap = new HashMap<>(); return fExtMap; } @@ -958,26 +958,26 @@ public class CConfigurationSpecSettings implements ICSettingsStorage, ILanguageS if (refs == null || refs.length == 0) { if (extIds == null || extIds.length == 0) return null; - return new DeltaSet(null, new HashSet<String>(Arrays.asList(extIds))); + return new DeltaSet(null, new HashSet<>(Arrays.asList(extIds))); } else if (extIds == null || extIds.length == 0) { Map<String, ICConfigExtensionReference> map = createRefMap(refs); - return new DeltaSet(new HashSet<ICConfigExtensionReference>(map.values()), null); + return new DeltaSet(new HashSet<>(map.values()), null); } - Set<String> idSet = new HashSet<String>(Arrays.asList(extIds)); - Set<String> idSetCopy = new HashSet<String>(idSet); + Set<String> idSet = new HashSet<>(Arrays.asList(extIds)); + Set<String> idSetCopy = new HashSet<>(idSet); Map<String, ICConfigExtensionReference> refsMap = createRefMap(refs); idSet.removeAll(refsMap.keySet()); refsMap.keySet().removeAll(idSetCopy); - Set<ICConfigExtensionReference> extSet = new HashSet<ICConfigExtensionReference>(refsMap.values()); + Set<ICConfigExtensionReference> extSet = new HashSet<>(refsMap.values()); return new DeltaSet(extSet, idSet); } private Map<String, ICConfigExtensionReference> createRefMap(ICConfigExtensionReference refs[]) { - Map<String, ICConfigExtensionReference> refsMap = new HashMap<String, ICConfigExtensionReference>(refs.length); + Map<String, ICConfigExtensionReference> refsMap = new HashMap<>(refs.length); for (ICConfigExtensionReference ref : refs) { refsMap.put(ref.getID(), ref); } @@ -1030,8 +1030,8 @@ public class CConfigurationSpecSettings implements ICSettingsStorage, ILanguageS */ @Override public void setLanguageSettingProviders(List<? extends ILanguageSettingsProvider> providers) { - fLanguageSettingsProviders = new ArrayList<ILanguageSettingsProvider>(0); - Set<String> ids = new HashSet<String>(); + fLanguageSettingsProviders = new ArrayList<>(0); + Set<String> ids = new HashSet<>(); for (ILanguageSettingsProvider provider : providers) { String id = provider.getId(); if (provider == LanguageSettingsProvidersSerializer.getRawWorkspaceProvider(id)) { @@ -1052,7 +1052,7 @@ public class CConfigurationSpecSettings implements ICSettingsStorage, ILanguageS @Override public List<ILanguageSettingsProvider> getLanguageSettingProviders() { List<ILanguageSettingsProvider> providers = isLanguageSettingProvidersLoaded() ? fLanguageSettingsProviders - : new ArrayList<ILanguageSettingsProvider>(0); + : new ArrayList<>(0); return Collections.unmodifiableList(providers); } @@ -1082,7 +1082,7 @@ public class CConfigurationSpecSettings implements ICSettingsStorage, ILanguageS */ public LanguageSettingsDelta dropDelta() { LanguageSettingsDelta languageSettingsDelta = null; - LinkedHashMap<String, LanguageSettingsStorage> newState = new LinkedHashMap<String, LanguageSettingsStorage>(); + LinkedHashMap<String, LanguageSettingsStorage> newState = new LinkedHashMap<>(); for (ILanguageSettingsProvider provider : fLanguageSettingsProviders) { if (LanguageSettingsManager.isWorkspaceProvider(provider)) { provider = LanguageSettingsManager.getRawProvider(provider); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsDeltaProcessor.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsDeltaProcessor.java index 800d151570e..62a77b63470 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsDeltaProcessor.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsDeltaProcessor.java @@ -208,7 +208,7 @@ public class CExternalSettingsDeltaProcessor { private static <T extends ICSettingEntry> List<T> calculateUpdatedEntries(T current[], ICSettingEntry added[], ICSettingEntry removed[]) { - LinkedHashMap<EntryContentsKey, ICSettingEntry> map = new LinkedHashMap<EntryContentsKey, ICSettingEntry>(); + LinkedHashMap<EntryContentsKey, ICSettingEntry> map = new LinkedHashMap<>(); boolean changed = false; if (added != null) { CDataUtil.fillEntriesMapByContentsKey(map, added); @@ -235,7 +235,7 @@ public class CExternalSettingsDeltaProcessor { } @SuppressWarnings("unchecked") Collection<T> values = (Collection<T>) map.values(); - return changed ? new ArrayList<T>(values) : null; + return changed ? new ArrayList<>(values) : null; } private static boolean isSettingCompatible(ICLanguageSetting setting, CExternalSetting provider) { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsHolder.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsHolder.java index 51a496ca430..4f3c222e704 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsHolder.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsHolder.java @@ -48,7 +48,7 @@ public class CExternalSettingsHolder extends CExternalSettingsContainer { if (CExternalSettingSerializer.ELEMENT_SETTING_INFO.equals(name)) { if (externalSettingList == null) - externalSettingList = new ArrayList<CExternalSetting>(); + externalSettingList = new ArrayList<>(); CExternalSetting setting = CExternalSettingSerializer.load(child); externalSettingList.add(setting); @@ -66,7 +66,7 @@ public class CExternalSettingsHolder extends CExternalSettingsContainer { CExternalSettingsHolder(CExternalSettingsHolder base) { if (base.fSettingsMap != null) - fSettingsMap = new HashMap<ExtSettingMapKey, CExternalSetting>(base.fSettingsMap); + fSettingsMap = new HashMap<>(base.fSettingsMap); } @Override @@ -113,7 +113,7 @@ public class CExternalSettingsHolder extends CExternalSettingsContainer { fSettingsMap.put(key, newSetting); } else { newSetting = new CExternalSetting(setting); - fSettingsMap = new HashMap<ExtSettingMapKey, CExternalSetting>(); + fSettingsMap = new HashMap<>(); fSettingsMap.put(key, newSetting); } fIsModified = true; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsManager.java index f8467b3668b..cbf8541b804 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsManager.java @@ -51,7 +51,7 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP "externalSettings"); //$NON-NLS-1$ private static final String EXTERNAL_SETTING_STORAGE_ID = CCorePlugin.PLUGIN_ID + ".externalSettings"; //$NON-NLS-1$ - private Map<String, FactoryDescriptor> fFactoryMap = new HashMap<String, FactoryDescriptor>(); + private Map<String, FactoryDescriptor> fFactoryMap = new HashMap<>(); private static CExternalSettingsManager fInstance; private CExternalSettingsManager() { @@ -147,7 +147,7 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP fContainer = fFactoryDr.getFactory().createContainer(containerId, project, cfgDes, previousSettings); } catch (CoreException e) { if (failingProvidersMessages == null) - failingProvidersMessages = new HashSet<String>(); + failingProvidersMessages = new HashSet<>(); // only report the error once per session if (!failingProvidersMessages.contains(e.getMessage())) CCorePlugin.log(e.getMessage()); @@ -314,7 +314,7 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP */ private static class ProjDesCfgList { private ICProjectDescription fProjDes; - private List<ICConfigurationDescription> fCfgList = new ArrayList<ICConfigurationDescription>(); + private List<ICConfigurationDescription> fCfgList = new ArrayList<>(); public ProjDesCfgList(ICProjectDescription des, Set<String> idSet) { fProjDes = des; @@ -442,7 +442,7 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP } private List<ICProjectDescription> getModifiedProjDesList(ProjDesCfgList[] lists) { - List<ICProjectDescription> list = new ArrayList<ICProjectDescription>(); + List<ICProjectDescription> list = new ArrayList<>(); for (int i = 0; i < lists.length; i++) { if (lists[i].isWritable()) list.add(lists[i].fProjDes); @@ -461,7 +461,7 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP Set<String> set = null; if (project != null) { if (cfgId != null) { - set = new HashSet<String>(); + set = new HashSet<>(); set.add(cfgId); } ProjDesCfgList l = createCfgList(project, set); @@ -472,7 +472,7 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP } else { // Project is null -- add all CDT projects & configs in the workspace IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); - List<ProjDesCfgList> list = new ArrayList<ProjDesCfgList>(); + List<ProjDesCfgList> list = new ArrayList<>(); for (IProject p : projects) { ProjDesCfgList l = createCfgList(p, set); if (l != null) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettinsDeltaCalculator.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettinsDeltaCalculator.java index c86001b0c3a..ef4681a7ec7 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettinsDeltaCalculator.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettinsDeltaCalculator.java @@ -52,7 +52,7 @@ class CExternalSettinsDeltaCalculator { ExtSettingsDelta(CExternalSetting setting) { fSetting = setting; - fEntryChangeStore = new KindBasedStore<ICSettingEntry[][]>(false); + fEntryChangeStore = new KindBasedStore<>(false); } ExtSettingsDelta(CExternalSetting setting, boolean added) { @@ -90,8 +90,8 @@ class CExternalSettinsDeltaCalculator { ICSettingEntry[][] getEntriesDelta() { int kinds[] = KindBasedStore.getLanguageEntryKinds(); - List<ICSettingEntry> added = new ArrayList<ICSettingEntry>(); - List<ICSettingEntry> removed = new ArrayList<ICSettingEntry>(); + List<ICSettingEntry> added = new ArrayList<>(); + List<ICSettingEntry> removed = new ArrayList<>(); for (int kind : kinds) { ICSettingEntry[][] d = getEntriesDelta(kind); if (d == null) @@ -172,7 +172,7 @@ class CExternalSettinsDeltaCalculator { .fillEntriesMapByContentsKey(new LinkedHashMap<EntryContentsKey, ICSettingEntry>(), entries1); Map<EntryContentsKey, ICSettingEntry> map2 = CDataUtil .fillEntriesMapByContentsKey(new LinkedHashMap<EntryContentsKey, ICSettingEntry>(), entries2); - Map<EntryContentsKey, ICSettingEntry> map1Copy = new LinkedHashMap<EntryContentsKey, ICSettingEntry>(map1); + Map<EntryContentsKey, ICSettingEntry> map1Copy = new LinkedHashMap<>(map1); // Set set1 = new HashSet(Arrays.asList(entries1)); // Set set2 = new HashSet(Arrays.asList(entries2)); // Set set1Copy = new HashSet(set1); @@ -220,7 +220,7 @@ class CExternalSettinsDeltaCalculator { } private static Map<ExtSettingMapKey, ICExternalSetting> toSettingsKeyMap(ICExternalSetting[] settings) { - Map<ExtSettingMapKey, ICExternalSetting> map = new HashMap<ExtSettingMapKey, ICExternalSetting>(); + Map<ExtSettingMapKey, ICExternalSetting> map = new HashMap<>(); for (ICExternalSetting setting : settings) { if (map.put(new ExtSettingMapKey(setting), setting) != null) throw new IllegalArgumentException(); @@ -235,7 +235,7 @@ class CExternalSettinsDeltaCalculator { if (oldSettings == null || oldSettings.length == 0) return createDeltas(newSettings, true); - LinkedList<ExtSettingsDelta> deltaList = new LinkedList<ExtSettingsDelta>(); + LinkedList<ExtSettingsDelta> deltaList = new LinkedList<>(); Map<ExtSettingMapKey, ICExternalSetting> newMap = toSettingsKeyMap(newSettings); Map<ExtSettingMapKey, ICExternalSetting> oldMap = toSettingsKeyMap(oldSettings); @@ -279,7 +279,7 @@ class CExternalSettinsDeltaCalculator { Set<ICSettingEntry> calculateUpdatedEntries(ICSettingEntry current[], ICSettingEntry added[], ICSettingEntry removed[]) { // EntryComparator comparator = new EntryComparator(); - LinkedHashSet<ICSettingEntry> set = new LinkedHashSet<ICSettingEntry>(); + LinkedHashSet<ICSettingEntry> set = new LinkedHashSet<>(); set.addAll(Arrays.asList(current)); set.addAll(Arrays.asList(added)); set.removeAll(Arrays.asList(removed)); @@ -291,8 +291,8 @@ class CExternalSettinsDeltaCalculator { if (deltas == null || deltas.length == 0) return null; - Map<EntryNameKey, ICSettingEntry> addedMap = new LinkedHashMap<EntryNameKey, ICSettingEntry>(); - Map<EntryNameKey, ICSettingEntry> removedMap = new LinkedHashMap<EntryNameKey, ICSettingEntry>(); + Map<EntryNameKey, ICSettingEntry> addedMap = new LinkedHashMap<>(); + Map<EntryNameKey, ICSettingEntry> removedMap = new LinkedHashMap<>(); for (ExtSettingsDelta delta : deltas) { ICSettingEntry[][] change = delta.getEntriesDelta(kind); if (change == null) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CLanguageSetting.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CLanguageSetting.java index 8159e24dc5e..f018807edd8 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CLanguageSetting.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CLanguageSetting.java @@ -73,8 +73,8 @@ public class CLanguageSetting extends CDataProxy implements ICLanguageSetting { CLanguageData data = getCLanguageData(false); ICLanguageSettingEntry entries[] = data.getEntries(kind); if (entries != null) - return new ArrayList<ICLanguageSettingEntry>(Arrays.asList(entries)); - return new ArrayList<ICLanguageSettingEntry>(); + return new ArrayList<>(Arrays.asList(entries)); + return new ArrayList<>(); } @Override diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectConverterDesciptor.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectConverterDesciptor.java index 6dad880f1b4..18acc9ff311 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectConverterDesciptor.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectConverterDesciptor.java @@ -102,7 +102,7 @@ public class CProjectConverterDesciptor { if (supportedIds != null) { IProjectDescription eDes = project.getDescription(); String natures[] = eDes.getNatureIds(); - Set<String> natureSet = new HashSet<String>(Arrays.asList(natures)); + Set<String> natureSet = new HashSet<>(Arrays.asList(natures)); natureSet.removeAll(Arrays.asList(supportedIds)); if (natureSet.size() == natures.length) return false; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescription.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescription.java index 7062f241e1e..e614894f932 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescription.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescription.java @@ -52,7 +52,7 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon private volatile IProject fProject; private final ICSettingsStorage fStorage; private final ICStorageElement fRootStorageElement; - private final HashMap<String, ICConfigurationDescription> fCfgMap = new LinkedHashMap<String, ICConfigurationDescription>(); + private final HashMap<String, ICConfigurationDescription> fCfgMap = new LinkedHashMap<>(); private boolean fIsReadOnly; private boolean fIsModified; private Map<QualifiedName, Object> fPropertiesMap; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionDelta.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionDelta.java index f8935edd5fc..8ae0ed00113 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionDelta.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionDelta.java @@ -20,7 +20,7 @@ import org.eclipse.cdt.core.settings.model.ICDescriptionDelta; import org.eclipse.cdt.core.settings.model.ICSettingObject; public class CProjectDescriptionDelta implements ICDescriptionDelta { - private List<CProjectDescriptionDelta> fChildList = new ArrayList<CProjectDescriptionDelta>(); + private List<CProjectDescriptionDelta> fChildList = new ArrayList<>(); private CProjectDescriptionDelta fParent; private ICSettingObject fSetting; private ICSettingObject fOldSetting; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java index 444cb574113..67a6c5cc218 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java @@ -236,8 +236,8 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager { private volatile Map<String, CConfigurationDataProviderDescriptor> fProviderMap; private volatile CProjectConverterDesciptor fConverters[]; /** Set of Listeners listening for Project Description Deltas */ - private Set<ListenerDescriptor> fListeners = new CopyOnWriteArraySet<ListenerDescriptor>(); - private Map<String, CConfigurationDescriptionCache> fPreferenceMap = new HashMap<String, CConfigurationDescriptionCache>(); + private Set<ListenerDescriptor> fListeners = new CopyOnWriteArraySet<>(); + private Map<String, CConfigurationDescriptionCache> fPreferenceMap = new HashMap<>(); private volatile CConfigBasedDescriptorManager fDescriptorManager; private ResourceChangeHandler fRcChangeHandler; private CProjectDescriptionWorkspacePreferences fPreferences; @@ -284,7 +284,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager { } private void disposeAssociatedListeners(IProject project) { - List<ScannerInfoProviderProxy> proxyListeners = new ArrayList<ScannerInfoProviderProxy>(); + List<ScannerInfoProviderProxy> proxyListeners = new ArrayList<>(); for (ListenerDescriptor ldescriptor : fListeners) { if (ldescriptor.fListener instanceof ScannerInfoProviderProxy) proxyListeners.add((ScannerInfoProviderProxy) ldescriptor.fListener); @@ -681,9 +681,9 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager { private Collection<IProject> projSetFromProjNameSet(Collection<String> projNames) { if (projNames.size() == 0) - return new HashSet<IProject>(0); + return new HashSet<>(0); - Set<IProject> set = new LinkedHashSet<IProject>(); + Set<IProject> set = new LinkedHashSet<>(); IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); for (String sproj : projNames) @@ -710,21 +710,21 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager { return false; // We're still looking at the same configuration - any refs removed? - HashSet<String> removedRefs = new HashSet<String>(); + HashSet<String> removedRefs = new HashSet<>(); if (oldCfg != null && oldCfg.getId().equals(newCfg.getId())) { removedRefs.addAll(oldMap.keySet()); removedRefs.removeAll(newMap.keySet()); } // Get the full set of references from all configuration - LinkedHashSet<String> allRefs = new LinkedHashSet<String>(); + LinkedHashSet<String> allRefs = new LinkedHashSet<>(); for (ICConfigurationDescription cfg : newCDesc.getConfigurations()) allRefs.addAll(cfg.getReferenceInfo().keySet()); // Don't remove a reference if it's referenced by any configuration in the project description removedRefs.removeAll(allRefs); - Collection<IProject> oldProjects = new LinkedHashSet<IProject>(Arrays.asList(des.getReferencedProjects())); + Collection<IProject> oldProjects = new LinkedHashSet<>(Arrays.asList(des.getReferencedProjects())); Collection<IProject> newProjects = projSetFromProjNameSet(allRefs); // If there are no changes, just return @@ -787,11 +787,11 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager { final String[] natureIds = des.getNatureIds(); // Get the set of items to remove ({oldNatures} - {newNatures}) + conflictingNatures - Set<String> toRemove = new HashSet<String>(oldNatures); + Set<String> toRemove = new HashSet<>(oldNatures); toRemove.removeAll(newNatures); // Don't remove items we're re-adding toRemove.addAll(conflictingNatures); // Add conflicting natures for removal // Modify an ordered set of the existing natures with the changes - final LinkedHashSet<String> cur = new LinkedHashSet<String>(Arrays.asList(natureIds)); + final LinkedHashSet<String> cur = new LinkedHashSet<>(Arrays.asList(natureIds)); cur.addAll(newNatures); cur.removeAll(toRemove); @@ -1010,7 +1010,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager { if (cType != null) { String[] exts = cType.getFileSpecs(IContentType.FILE_EXTENSION_SPEC); if (exts != null && exts.length != 0) { - List<ICLanguageSetting> list = new ArrayList<ICLanguageSetting>(); + List<ICLanguageSetting> list = new ArrayList<>(); ICLanguageSetting setting; for (String ext : exts) { setting = findLanguageSettingForExtension(ext, settings/*, src*/); @@ -1055,7 +1055,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager { * @throws CoreException */ Map<String, ICStorageElement> createCfgStorages(ICProjectDescription des) throws CoreException { - LinkedHashMap<String, ICStorageElement> map = new LinkedHashMap<String, ICStorageElement>(); + LinkedHashMap<String, ICStorageElement> map = new LinkedHashMap<>(); ICStorageElement rootElement = des.getStorage(MODULE_ID, false); if (rootElement != null) { ICStorageElement children[] = rootElement.getChildren(); @@ -1204,7 +1204,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager { IExtensionPoint extensionPoint = Platform.getExtensionRegistry() .getExtensionPoint(CConfigurationDataProviderDescriptor.DATA_PROVIDER_EXTPOINT_ID); IExtension exts[] = extensionPoint.getExtensions(); - fProviderMap = new HashMap<String, CConfigurationDataProviderDescriptor>(exts.length); + fProviderMap = new HashMap<>(exts.length); for (IExtension ext : exts) { CConfigurationDataProviderDescriptor des = new CConfigurationDataProviderDescriptor(ext); @@ -1443,8 +1443,8 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager { break; } - Set<CConfigExtensionReference> newSet = new HashSet<CConfigExtensionReference>(Arrays.asList(newRefs)); - Set<CConfigExtensionReference> oldSet = new HashSet<CConfigExtensionReference>(Arrays.asList(oldRefs)); + Set<CConfigExtensionReference> newSet = new HashSet<>(Arrays.asList(newRefs)); + Set<CConfigExtensionReference> oldSet = new HashSet<>(Arrays.asList(oldRefs)); if (newSet.size() != oldSet.size()) { flags |= ICDescriptionDelta.EXT_REF; break; @@ -1671,8 +1671,8 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager { if (delta.getDeltaKind() == ICDescriptionDelta.CHANGED) { ICLanguageSetting newLss[] = newFo.getLanguageSettings(); ICLanguageSetting oldLss[] = oldFo.getLanguageSettings(); - List<ICLanguageSetting> newList = new ArrayList<ICLanguageSetting>(Arrays.asList(newLss)); - List<ICLanguageSetting> oldList = new ArrayList<ICLanguageSetting>(Arrays.asList(oldLss)); + List<ICLanguageSetting> newList = new ArrayList<>(Arrays.asList(newLss)); + List<ICLanguageSetting> oldList = new ArrayList<>(Arrays.asList(oldLss)); List<ICLanguageSetting[]> matched = sortSettings(newList, oldList); for (ICLanguageSetting[] match : matched) { @@ -1721,7 +1721,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager { List<ICLanguageSetting> settings2) { ICLanguageSetting setting1; ICLanguageSetting setting2; - List<ICLanguageSetting[]> result = new ArrayList<ICLanguageSetting[]>(); + List<ICLanguageSetting[]> result = new ArrayList<>(); for (Iterator<ICLanguageSetting> iter1 = settings1.iterator(); iter1.hasNext();) { setting1 = iter1.next(); for (Iterator<ICLanguageSetting> iter2 = settings2.iterator(); iter2.hasNext();) { @@ -1887,8 +1887,8 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager { newEntries = EMPTY_LANGUAGE_SETTINGS_ENTRIES_ARRAY; } - Set<ICLanguageSettingEntry> newEntrySet = new HashSet<ICLanguageSettingEntry>(Arrays.asList(newEntries)); - Set<ICLanguageSettingEntry> oldEntrySet = new HashSet<ICLanguageSettingEntry>(Arrays.asList(oldEntries)); + Set<ICLanguageSettingEntry> newEntrySet = new HashSet<>(Arrays.asList(newEntries)); + Set<ICLanguageSettingEntry> oldEntrySet = new HashSet<>(Arrays.asList(oldEntries)); // Check the removed entries. for (ICLanguageSettingEntry oldEntry : oldEntries) { @@ -1988,7 +1988,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager { indexDelta = createDelta(indexCfg, oldIndexCfg); } if (indexDelta != null) { - List<CElementDelta> list = new ArrayList<CElementDelta>(); + List<CElementDelta> list = new ArrayList<>(); generateCElementDeltasFromCfgDelta(cProject, indexDelta, list); return list.toArray(new ICElementDelta[list.size()]); } @@ -2567,7 +2567,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager { for (CLanguageData lData : lDatas) { String[] exts = CDataUtil.getSourceExtensions(project, lData); - HashSet<String> set = new HashSet<String>(Arrays.asList(exts)); + HashSet<String> set = new HashSet<>(Arrays.asList(exts)); map.put(set, lData); } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionStorageManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionStorageManager.java index 7c4756d9ea5..4a07bbb340c 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionStorageManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionStorageManager.java @@ -93,7 +93,7 @@ public class CProjectDescriptionStorageManager { /** Map of StorageType ID -> List of StorageTypes */ private volatile Map<String, List<CProjectDescriptionStorageTypeProxy>> storageTypeMap; /** Map from IProject -> AbstractCProjectDescriptionStorage which is responsible for (de)serializing the project */ - private ConcurrentHashMap<IProject, AbstractCProjectDescriptionStorage> fDescriptionStorageMap = new ConcurrentHashMap<IProject, AbstractCProjectDescriptionStorage>(); + private ConcurrentHashMap<IProject, AbstractCProjectDescriptionStorage> fDescriptionStorageMap = new ConcurrentHashMap<>(); private volatile static CProjectDescriptionStorageManager instance; @@ -342,7 +342,7 @@ public class CProjectDescriptionStorageManager { private synchronized void initExtensionPoints() { if (storageTypeMap != null) return; - Map<String, List<CProjectDescriptionStorageTypeProxy>> m = new HashMap<String, List<CProjectDescriptionStorageTypeProxy>>(); + Map<String, List<CProjectDescriptionStorageTypeProxy>> m = new HashMap<>(); IExtensionPoint extpoint = Platform.getExtensionRegistry().getExtensionPoint(CCorePlugin.PLUGIN_ID, CPROJ_DESC_STORAGE_EXT_ID); for (IExtension extension : extpoint.getExtensions()) { @@ -413,7 +413,7 @@ public class CProjectDescriptionStorageManager { resource.setResourceAttributes(resAttr); } IResource[] members = ((IContainer) resource).members(); - List<IFile> files = new ArrayList<IFile>(members.length); + List<IFile> files = new ArrayList<>(members.length); for (IResource member : members) { if (member instanceof IFile && member.getResourceAttributes().isReadOnly()) { files.add((IFile) member); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CSettingsRefInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CSettingsRefInfo.java index ac320cc6e73..cfd9258c2ca 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CSettingsRefInfo.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CSettingsRefInfo.java @@ -32,7 +32,7 @@ class CSettingsRefInfo { /** External Settings Holder Map * From references container -> to concrete held settings */ - private HashMap<CContainerRef, CRefSettingsHolder> fESHolderMap = new LinkedHashMap<CContainerRef, CRefSettingsHolder>(); + private HashMap<CContainerRef, CRefSettingsHolder> fESHolderMap = new LinkedHashMap<>(); CSettingsRefInfo() { } @@ -59,7 +59,7 @@ class CSettingsRefInfo { } CContainerRef[] getReferences(String factoryId) { - List<CContainerRef> list = new ArrayList<CContainerRef>(); + List<CContainerRef> list = new ArrayList<>(); for (CContainerRef r : fESHolderMap.keySet()) { if (r.getFactoryId().equals(factoryId)) list.add(r); @@ -104,7 +104,7 @@ class CSettingsRefInfo { } ICSettingEntry[] getAllEntries(int kind) { - Map<EntryNameKey, ICSettingEntry> map = new LinkedHashMap<EntryNameKey, ICSettingEntry>(); + Map<EntryNameKey, ICSettingEntry> map = new LinkedHashMap<>(); for (CRefSettingsHolder h : fESHolderMap.values()) { CExternalSetting[] settings = h.getExternalSettings(); for (int i = 0; i < settings.length; i++) { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgExportSettingContainerFactory.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgExportSettingContainerFactory.java index e5af2854dde..6bf9ebd4cf8 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgExportSettingContainerFactory.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgExportSettingContainerFactory.java @@ -54,7 +54,7 @@ public class CfgExportSettingContainerFactory extends CExternalSettingContainerF private static final char DELIMITER = ';'; /** Cache the external settings exported by project configurations */ - private static final ConcurrentHashMap<String, CExternalSetting[]> cachedSettings = new ConcurrentHashMap<String, CExternalSetting[]>(); + private static final ConcurrentHashMap<String, CExternalSetting[]> cachedSettings = new ConcurrentHashMap<>(); private static CfgExportSettingContainerFactory fInstance; @@ -152,7 +152,7 @@ public class CfgExportSettingContainerFactory extends CExternalSettingContainerF public static Map<String, String> getReferenceMap(ICConfigurationDescription cfg) { CContainerRef[] refs = CExternalSettingsManager.getInstance().getReferences(cfg, FACTORY_ID); - Map<String, String> map = new LinkedHashMap<String, String>(); + Map<String, String> map = new LinkedHashMap<>(); for (int i = 0; i < refs.length; i++) { try { String[] r = parseId(refs[i].getContainerId()); @@ -166,7 +166,7 @@ public class CfgExportSettingContainerFactory extends CExternalSettingContainerF public static void setReferenceMap(ICConfigurationDescription cfg, Map<String, String> map) { Map<String, String> oldRefs = getReferenceMap(cfg); - Map<String, String> newRefs = new LinkedHashMap<String, String>(map); + Map<String, String> newRefs = new LinkedHashMap<>(map); // We need to preserve order. The API we have with the external settings manager allows us to // add and remove individual items. @@ -283,7 +283,7 @@ public class CfgExportSettingContainerFactory extends CExternalSettingContainerF return new String[0]; int deltaKind = delta.getDeltaKind(); - Set<String> cfgIds = new HashSet<String>(); + Set<String> cfgIds = new HashSet<>(); switch (deltaKind) { case ICDescriptionDelta.ADDED: case ICDescriptionDelta.REMOVED: diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgProxyCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgProxyCache.java index 28ec87f9f6a..e51f9d7bfdc 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgProxyCache.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgProxyCache.java @@ -23,7 +23,7 @@ import org.eclipse.cdt.core.settings.model.util.PathSettingsContainer; import org.eclipse.core.runtime.IPath; public class CfgProxyCache implements IProxyCache { - private HashMap<String, CDataProxy> fProxyMap = new HashMap<String, CDataProxy>(); + private HashMap<String, CDataProxy> fProxyMap = new HashMap<>(); private PathSettingsContainer fPathContainer; CfgProxyCache(PathSettingsContainer pathDesContainer) { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ConfigBasedPathEntryStore.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ConfigBasedPathEntryStore.java index 201b0e88e6c..26af7a19ed6 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ConfigBasedPathEntryStore.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ConfigBasedPathEntryStore.java @@ -124,7 +124,7 @@ public class ConfigBasedPathEntryStore implements IPathEntryStore, ICProjectDesc ICConfigurationDescription cfg = getIndexCfg(fProject); List<IPathEntry>[] es = getEntries(fProject, cfg); if (es != null) { - List<IPathEntry> list = new ArrayList<IPathEntry>(es[0].size() + 1); + List<IPathEntry> list = new ArrayList<>(es[0].size() + 1); list.addAll(es[0]); list.add(CoreModel.newContainerEntry(ConfigBasedPathEntryContainer.CONTAINER_PATH)); return list.toArray(new IPathEntry[list.size()]); @@ -139,7 +139,7 @@ public class ConfigBasedPathEntryStore implements IPathEntryStore, ICProjectDesc if (es != null) { List<IPathEntry> sysList = es[1]; List<IPathEntry> usrList = es[0]; - List<IPathEntry> newUsrList = new ArrayList<IPathEntry>(entries.length); + List<IPathEntry> newUsrList = new ArrayList<>(entries.length); for (IPathEntry entry : entries) { if (entry.getEntryKind() != IPathEntry.CDT_CONTAINER) newUsrList.add(entry); @@ -253,10 +253,10 @@ public class ConfigBasedPathEntryStore implements IPathEntryStore, ICProjectDesc private static List<IPathEntry>[] createEntriesList(ICConfigurationDescription cfgDes, PathEntryCollector cr) { @SuppressWarnings("unchecked") ArrayList<IPathEntry>[] es = new ArrayList[2]; - es[0] = new ArrayList<IPathEntry>(); + es[0] = new ArrayList<>(); cr.getEntries(es[0], PathEntryTranslator.INCLUDE_USER, cfgDes); es[0].trimToSize(); - es[1] = new ArrayList<IPathEntry>(); + es[1] = new ArrayList<>(); cr.getEntries(es[1], PathEntryTranslator.INCLUDE_BUILT_INS, cfgDes); es[1].trimToSize(); @@ -288,7 +288,7 @@ public class ConfigBasedPathEntryStore implements IPathEntryStore, ICProjectDesc ICProjectDescription des = CCorePlugin.getDefault().getProjectDescription(project, false); if (des != null) return getContainerEntries(des); - return new ArrayList<IPathEntry>(0); + return new ArrayList<>(0); } private static List<IPathEntry> getContainerEntries(ICProjectDescription des) { @@ -296,7 +296,7 @@ public class ConfigBasedPathEntryStore implements IPathEntryStore, ICProjectDesc List<IPathEntry> es[] = getEntries(des.getProject(), cfg); if (es != null) return es[1]; - return new ArrayList<IPathEntry>(0); + return new ArrayList<>(0); } public static ConfigBasedPathEntryContainer createContainer(IProject project) { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/DescriptionScannerInfoProvider.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/DescriptionScannerInfoProvider.java index 5ef8c27abb9..d944fd91810 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/DescriptionScannerInfoProvider.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/DescriptionScannerInfoProvider.java @@ -190,7 +190,7 @@ public class DescriptionScannerInfoProvider implements IScannerInfoProvider, ICP } private LinkedHashSet<ICLanguageSettingEntry> getEntriesSet(int kind, ICLanguageSetting[] settings) { - LinkedHashSet<ICLanguageSettingEntry> set = new LinkedHashSet<ICLanguageSettingEntry>(); + LinkedHashSet<ICLanguageSettingEntry> set = new LinkedHashSet<>(); ICLanguageSettingEntry[] langEntries; for (ICLanguageSetting setting : settings) { langEntries = setting.getResolvedSettingEntries(kind); @@ -221,7 +221,7 @@ public class DescriptionScannerInfoProvider implements IScannerInfoProvider, ICP } private Map<String, String> getValues(ICMacroEntry macroEntries[]) { - Map<String, String> macrosMap = new HashMap<String, String>(macroEntries.length); + Map<String, String> macrosMap = new HashMap<>(macroEntries.length); String name; String value; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/EntriesNamesContainer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/EntriesNamesContainer.java index f584d72567f..db8ddfa327d 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/EntriesNamesContainer.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/EntriesNamesContainer.java @@ -21,7 +21,7 @@ import org.eclipse.cdt.core.settings.model.util.KindBasedStore; class EntriesNamesContainer { // private String fLanguageSettingsId; - private KindBasedStore<Set<String>> fRemovedEntryNamesStore = new KindBasedStore<Set<String>>(); + private KindBasedStore<Set<String>> fRemovedEntryNamesStore = new KindBasedStore<>(); // EntriesNamesContainer(ICLanguageSetting setting) { // fLanguageSettingsId = setting.getId(); @@ -37,7 +37,7 @@ class EntriesNamesContainer { for (int i = 0; i < infos.length; i++) { Set<String> set = infos[i].getInfo(); if (set != null) - fRemovedEntryNamesStore.put(infos[i].getKind(), new HashSet<String>(set)); + fRemovedEntryNamesStore.put(infos[i].getKind(), new HashSet<>(set)); } } @@ -48,7 +48,7 @@ class EntriesNamesContainer { private Set<String> getRemovedNamesSet(int kind, boolean create) { Set<String> set = fRemovedEntryNamesStore.get(kind); if (set == null && create) { - set = new HashSet<String>(); + set = new HashSet<>(); fRemovedEntryNamesStore.put(kind, set); } return set; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ExtensionContainerFactory.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ExtensionContainerFactory.java index 92a958d04b7..9ee0b4d74a3 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ExtensionContainerFactory.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ExtensionContainerFactory.java @@ -153,7 +153,7 @@ public class ExtensionContainerFactory extends CExternalSettingContainerFactoryW IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_ID); IExtension exts[] = extensionPoint.getExtensions(); - fDescriptorMap = new HashMap<String, CExtensionSettingProviderDescriptor>(); + fDescriptorMap = new HashMap<>(); for (IExtension ext : exts) { CExtensionSettingProviderDescriptor dr = new CExtensionSettingProviderDescriptor(ext); @@ -200,9 +200,9 @@ public class ExtensionContainerFactory extends CExternalSettingContainerFactoryW } public static void setReferencedProviderIds(ICConfigurationDescription cfg, String ids[]) { - Set<String> newIdsSet = new HashSet<String>(Arrays.asList(ids)); - Set<String> oldIdsSet = new HashSet<String>(Arrays.asList(getReferencedProviderIds(cfg))); - Set<String> newIdsSetCopy = new HashSet<String>(newIdsSet); + Set<String> newIdsSet = new HashSet<>(Arrays.asList(ids)); + Set<String> oldIdsSet = new HashSet<>(Arrays.asList(getReferencedProviderIds(cfg))); + Set<String> newIdsSetCopy = new HashSet<>(newIdsSet); newIdsSet.removeAll(oldIdsSet); oldIdsSet.removeAll(newIdsSetCopy); @@ -236,9 +236,9 @@ public class ExtensionContainerFactory extends CExternalSettingContainerFactoryW } public static void updateReferencedProviderIds(ICConfigurationDescription cfg, String ids[]) { - Set<String> newIdsSet = new HashSet<String>(Arrays.asList(ids)); - Set<String> oldIdsSet = new HashSet<String>(Arrays.asList(getReferencedProviderIds(cfg))); - Set<String> newIdsSetCopy = new HashSet<String>(newIdsSet); + Set<String> newIdsSet = new HashSet<>(Arrays.asList(ids)); + Set<String> oldIdsSet = new HashSet<>(Arrays.asList(getReferencedProviderIds(cfg))); + Set<String> newIdsSetCopy = new HashSet<>(newIdsSet); newIdsSetCopy.removeAll(oldIdsSet); newIdsSet.removeAll(newIdsSetCopy); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MapProxyCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MapProxyCache.java index 86dfa7dd6bc..5049f82ef8d 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MapProxyCache.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MapProxyCache.java @@ -25,7 +25,7 @@ public class MapProxyCache implements IProxyCache { private HashMap<String, CDataProxy> getMap(boolean create) { if (fMap == null && create) - fMap = new HashMap<String, CDataProxy>(); + fMap = new HashMap<>(); return fMap; } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MultiConfigDescription.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MultiConfigDescription.java index 11fff5c6904..f5c521e5bf6 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MultiConfigDescription.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MultiConfigDescription.java @@ -211,7 +211,7 @@ public class MultiConfigDescription extends MultiItemsHolder implements ICMultiC */ @Override public ICFileDescription[] getFileDescriptions() { - ArrayList<ICFileDescription> lst = new ArrayList<ICFileDescription>(); + ArrayList<ICFileDescription> lst = new ArrayList<>(); for (int i = 0; i < fCfgs.length; i++) lst.addAll(Arrays.asList(fCfgs[i].getFileDescriptions())); return lst.toArray(new ICFileDescription[lst.size()]); @@ -222,7 +222,7 @@ public class MultiConfigDescription extends MultiItemsHolder implements ICMultiC */ @Override public ICFolderDescription[] getFolderDescriptions() { - ArrayList<ICFolderDescription> lst = new ArrayList<ICFolderDescription>(); + ArrayList<ICFolderDescription> lst = new ArrayList<>(); for (int i = 0; i < fCfgs.length; i++) lst.addAll(Arrays.asList(fCfgs[i].getFolderDescriptions())); return lst.toArray(new ICFolderDescription[lst.size()]); @@ -275,7 +275,7 @@ public class MultiConfigDescription extends MultiItemsHolder implements ICMultiC */ @Override public ICResourceDescription getResourceDescription(IPath path, boolean isForFolder) { - ArrayList<ICResourceDescription> lst = new ArrayList<ICResourceDescription>(); + ArrayList<ICResourceDescription> lst = new ArrayList<>(); for (int i = 0; i < fCfgs.length; i++) { ICResourceDescription rd = fCfgs[i].getResourceDescription(path, false); if (!path.equals(rd.getPath())) { @@ -305,7 +305,7 @@ public class MultiConfigDescription extends MultiItemsHolder implements ICMultiC */ @Override public ICResourceDescription[] getResourceDescriptions() { - ArrayList<ICResourceDescription> lst = new ArrayList<ICResourceDescription>(); + ArrayList<ICResourceDescription> lst = new ArrayList<>(); for (int i = 0; i < fCfgs.length; i++) lst.addAll(Arrays.asList(fCfgs[i].getResourceDescriptions())); return lst.toArray(new ICResourceDescription[lst.size()]); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/PathEntryConfigurationDataProvider.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/PathEntryConfigurationDataProvider.java index d0e334abd7b..b1284eb5eee 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/PathEntryConfigurationDataProvider.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/PathEntryConfigurationDataProvider.java @@ -247,7 +247,7 @@ public class PathEntryConfigurationDataProvider extends CConfigurationDataProvid ICProject cproject = manager.create(project); IPathEntry[] curRawEntries = PathEntryManager.getDefault().getRawPathEntries(cproject); - List<IPathEntry> list = new ArrayList<IPathEntry>(); + List<IPathEntry> list = new ArrayList<>(); list.addAll(Arrays.asList(entries)); for (int i = 0; i < curRawEntries.length; i++) { if (curRawEntries[i].getEntryKind() == IPathEntry.CDT_CONTAINER) { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceChangeHandler.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceChangeHandler.java index 0425b850e6b..abbe02ab4b9 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceChangeHandler.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceChangeHandler.java @@ -73,11 +73,11 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements CProjectDescriptionManager fMngr = CProjectDescriptionManager.getInstance(); /** Map of modified project descriptions to update */ - Map<IProject, ICProjectDescription> fProjDesMap = new HashMap<IProject, ICProjectDescription>(); + Map<IProject, ICProjectDescription> fProjDesMap = new HashMap<>(); /** Set of removed resources */ - Collection<IProject> fRemovedProjects = new HashSet<IProject>(); + Collection<IProject> fRemovedProjects = new HashSet<>(); /** Map of moved & removed resources: 'from' -> 'to'; 'to' may be null for removed resources */ - Map<IResource, IResource> fMovedResources = new HashMap<IResource, IResource>(); + Map<IResource, IResource> fMovedResources = new HashMap<>(); @Override public void handleProjectClose(IProject project) { @@ -116,7 +116,7 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements for (ICSourceEntry entrie : entries) { if (entrie.getFullPath().equals(rcFullPath)) { if (updatedList == null) { - updatedList = new ArrayList<ICSourceEntry>(Arrays.asList(entries)); + updatedList = new ArrayList<>(Arrays.asList(entries)); } updatedList.remove(num); } else { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceDescriptionHolder.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceDescriptionHolder.java index 4d1a47bd4ef..b6014db4140 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceDescriptionHolder.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceDescriptionHolder.java @@ -55,7 +55,7 @@ public class ResourceDescriptionHolder { } public ICResourceDescription[] getResourceDescriptions(final int kind) { - final List<ICResourceDescription> list = new ArrayList<ICResourceDescription>(); + final List<ICResourceDescription> list = new ArrayList<>(); fPathSettingContainer.accept(new IPathSettingsContainerVisitor() { @Override @@ -79,7 +79,7 @@ public class ResourceDescriptionHolder { } public ICResourceDescription[] getResourceDescriptions() { - final List<Object> list = new ArrayList<Object>(); + final List<Object> list = new ArrayList<>(); fPathSettingContainer.accept(new IPathSettingsContainerVisitor() { @Override diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ScannerInfoProviderProxy.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ScannerInfoProviderProxy.java index 26b8ecc2b4d..9c872709dcf 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ScannerInfoProviderProxy.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ScannerInfoProviderProxy.java @@ -71,7 +71,7 @@ public class ScannerInfoProviderProxy extends AbstractCExtensionProxy List<IScannerInfoChangeListener> list = map.get(project); if (list == null) { // Create a new list - list = new ArrayList<IScannerInfoChangeListener>(); + list = new ArrayList<>(); map.put(project, list); } if (!list.contains(listener)) { @@ -85,7 +85,7 @@ public class ScannerInfoProviderProxy extends AbstractCExtensionProxy */ private Map<IProject, List<IScannerInfoChangeListener>> getListeners() { if (listeners == null) { - listeners = new HashMap<IProject, List<IScannerInfoChangeListener>>(); + listeners = new HashMap<>(); } return listeners; } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlProjectDescriptionStorage.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlProjectDescriptionStorage.java index a90b2951fd5..de82650c681 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlProjectDescriptionStorage.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlProjectDescriptionStorage.java @@ -190,7 +190,7 @@ public class XmlProjectDescriptionStorage extends AbstractCProjectDescriptionSto /** A soft reference to the read-only project description * Volatile provides a memory barrier in Java 5+ */ - private volatile Reference<ICProjectDescription> fProjectDescription = new SoftReference<ICProjectDescription>( + private volatile Reference<ICProjectDescription> fProjectDescription = new SoftReference<>( null); /** The last modification stamp of the .cproject project description file */ private volatile long projectModificaitonStamp = IResource.NULL_STAMP; @@ -379,14 +379,14 @@ public class XmlProjectDescriptionStorage extends AbstractCProjectDescriptionSto ICProjectDescription oldDes = fProjectDescription.get(); if (des != null) { if (project.exists() && project.isOpen()) { - fProjectDescription = new SoftReference<ICProjectDescription>(des); + fProjectDescription = new SoftReference<>(des); } else { IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, SettingsModelMessages.getString("CProjectDescriptionManager.16"), null); //$NON-NLS-1$ CCorePlugin.log(new CoreException(status)); } } else { - fProjectDescription = new SoftReference<ICProjectDescription>(null); + fProjectDescription = new SoftReference<>(null); } LanguageSettingsProvidersSerializer.reRegisterListeners(oldDes, fProjectDescription.get()); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlStorage.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlStorage.java index 1bc325ca929..94a11a360ec 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlStorage.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlStorage.java @@ -40,7 +40,7 @@ public class XmlStorage implements ICSettingsStorage { // Lock to prevent concurrent access to XML DOM which isn't thread-safe for read (Bug 319245) final Object fLock; public Element fElement; - private Map<String, InternalXmlStorageElement> fStorageElementMap = new HashMap<String, InternalXmlStorageElement>(); + private Map<String, InternalXmlStorageElement> fStorageElementMap = new HashMap<>(); private volatile boolean fChildrenInited; private boolean fIsReadOnly; private boolean fIsDirty; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlStorageElement.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlStorageElement.java index 02d247533be..45e6cec2b5b 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlStorageElement.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlStorageElement.java @@ -50,7 +50,7 @@ public class XmlStorageElement implements ICStorageElement { final Object fLock; public Element fElement; private ICStorageElement fParent; - protected List<ICStorageElement> fChildList = new ArrayList<ICStorageElement>(); + protected List<ICStorageElement> fChildList = new ArrayList<>(); private volatile boolean fChildrenCreated; private String[] fAttributeFilters; private String[] fChildFilters; @@ -142,7 +142,7 @@ public class XmlStorageElement implements ICStorageElement { public ICStorageElement[] getChildrenByName(String name) { synchronized (fLock) { createChildren(); - ArrayList<ICStorageElement> children = new ArrayList<ICStorageElement>(); + ArrayList<ICStorageElement> children = new ArrayList<>(); for (ICStorageElement child : fChildList) if (name.equals(child.getName())) children.add(child); @@ -397,7 +397,7 @@ public class XmlStorageElement implements ICStorageElement { return false; if (attrs.length != 0) { - Set<String> set = new HashSet<String>(Arrays.asList(attrs)); + Set<String> set = new HashSet<>(Arrays.asList(attrs)); set.removeAll(Arrays.asList(otherAttrs)); if (set.size() != 0) return false; @@ -440,7 +440,7 @@ public class XmlStorageElement implements ICStorageElement { synchronized (fLock) { NamedNodeMap nodeMap = fElement.getAttributes(); int length = nodeMap.getLength(); - List<String> list = new ArrayList<String>(length); + List<String> list = new ArrayList<>(length); for (int i = 0; i < length; i++) { Node node = nodeMap.item(i); String name = node.getNodeName(); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml2/XmlProjectDescriptionStorage2.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml2/XmlProjectDescriptionStorage2.java index 1bfdba73759..4a18b9e7e13 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml2/XmlProjectDescriptionStorage2.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml2/XmlProjectDescriptionStorage2.java @@ -125,7 +125,7 @@ public class XmlProjectDescriptionStorage2 extends XmlProjectDescriptionStorage InternalXmlStorageElement el = super.createStorage(container, fileName, reCreate, createEmptyIfNotFound, readOnly); - Queue<ICStorageElement> nodesToCheck = new LinkedList<ICStorageElement>(); + Queue<ICStorageElement> nodesToCheck = new LinkedList<>(); nodesToCheck.addAll(Arrays.asList(el.getChildren())); while (!nodesToCheck.isEmpty()) { ICStorageElement currEl = nodesToCheck.remove(); @@ -182,7 +182,7 @@ public class XmlProjectDescriptionStorage2 extends XmlProjectDescriptionStorage // Copy the original passed in element, as we're going to re-write the children InternalXmlStorageElement copy = copyElement(element, false); // Map containing external CConfiguration elements to be serialized - Map<String, InternalXmlStorageElement> externalStorageElements = new HashMap<String, InternalXmlStorageElement>(); + Map<String, InternalXmlStorageElement> externalStorageElements = new HashMap<>(); // Iterate through the initial children for (ICStorageElement el : copy.getChildren()) { @@ -190,7 +190,7 @@ public class XmlProjectDescriptionStorage2 extends XmlProjectDescriptionStorage if (!CProjectDescriptionManager.MODULE_ID.equals(el.getAttribute(XmlStorage.MODULE_ID_ATTRIBUTE))) continue; - Queue<ICStorageElement> configStorages = new LinkedList<ICStorageElement>(); + Queue<ICStorageElement> configStorages = new LinkedList<>(); configStorages.addAll(Arrays.asList(el.getChildren())); while (!configStorages.isEmpty()) { InternalXmlStorageElement iEl = (InternalXmlStorageElement) configStorages.remove(); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCache.java index 9ce152cef69..fb369f248de 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCache.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCache.java @@ -143,7 +143,7 @@ public class LRUCache<K, T> implements Cloneable { public LRUCache(int size) { fTimestampCounter = fCurrentSpace = 0; fEntryQueue = fEntryQueueTail = null; - fEntryTable = new Hashtable<K, LRUCacheEntry<K, T>>(size); + fEntryTable = new Hashtable<>(size); fSpaceLimit = size; } @@ -172,7 +172,7 @@ public class LRUCache<K, T> implements Cloneable { public void flush() { fCurrentSpace = 0; LRUCacheEntry<K, T> entry = fEntryQueueTail; // Remember last entry - fEntryTable = new Hashtable<K, LRUCacheEntry<K, T>>(); // Clear it out + fEntryTable = new Hashtable<>(); // Clear it out fEntryQueue = fEntryQueueTail = null; while (entry != null) { // send deletion notifications in LRU order privateNotifyDeletionFromCache(entry); @@ -272,14 +272,14 @@ public class LRUCache<K, T> implements Cloneable { * Returns a new LRUCache instance */ protected LRUCache<K, T> newInstance(int size) { - return new LRUCache<K, T>(size); + return new LRUCache<>(size); } /** * Adds an entry for the given key/value/space. */ protected void privateAdd(K key, T value, int space) { - LRUCacheEntry<K, T> entry = new LRUCacheEntry<K, T>(key, value, space); + LRUCacheEntry<K, T> entry = new LRUCacheEntry<>(key, value, space); this.privateAddEntry(entry, false); } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/OverflowingLRUCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/OverflowingLRUCache.java index e15fd6492b1..343b16eced3 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/OverflowingLRUCache.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/OverflowingLRUCache.java @@ -129,18 +129,18 @@ public abstract class OverflowingLRUCache<K, T> extends LRUCache<K, T> { */ public Enumeration<T> elements() { if (fEntryQueue == null) - return new LRUCacheEnumerator<T>(null); - LRUCacheEnumerator.LRUEnumeratorElement<T> head = new LRUCacheEnumerator.LRUEnumeratorElement<T>( + return new LRUCacheEnumerator<>(null); + LRUCacheEnumerator.LRUEnumeratorElement<T> head = new LRUCacheEnumerator.LRUEnumeratorElement<>( fEntryQueue._fValue); LRUCacheEntry<K, T> currentEntry = fEntryQueue._fNext; LRUCacheEnumerator.LRUEnumeratorElement<T> currentElement = head; while (currentEntry != null) { - currentElement.fNext = new LRUCacheEnumerator.LRUEnumeratorElement<T>(currentEntry._fValue); + currentElement.fNext = new LRUCacheEnumerator.LRUEnumeratorElement<>(currentEntry._fValue); currentElement = currentElement.fNext; currentEntry = currentEntry._fNext; } - return new LRUCacheEnumerator<T>(head); + return new LRUCacheEnumerator<>(head); } public double fillingRatio() { @@ -268,7 +268,7 @@ public abstract class OverflowingLRUCache<K, T> extends LRUCache<K, T> { return "Class: " + fClass + " has " + fCount + " entries."; //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-1$ } } - java.util.HashMap<Class<?>, Temp> h = new java.util.HashMap<Class<?>, Temp>(); + java.util.HashMap<Class<?>, Temp> h = new java.util.HashMap<>(); while (keys.hasMoreElements()) { entry = fEntryTable.get(keys.nextElement()); Class<?> key = entry._fValue.getClass(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/AbstractCLikeLanguage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/AbstractCLikeLanguage.java index aea50a97ef2..38de308e655 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/AbstractCLikeLanguage.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/AbstractCLikeLanguage.java @@ -70,7 +70,7 @@ public abstract class AbstractCLikeLanguage extends AbstractLanguage implements shouldVisitNames = true; } - private List<IASTName> nameList = new ArrayList<IASTName>(); + private List<IASTName> nameList = new ArrayList<>(); @Override public int visit(IASTName name) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/AbstractScannerExtensionConfiguration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/AbstractScannerExtensionConfiguration.java index a69b8f69a32..810288e77af 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/AbstractScannerExtensionConfiguration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/AbstractScannerExtensionConfiguration.java @@ -163,7 +163,7 @@ public abstract class AbstractScannerExtensionConfiguration implements IScannerE */ protected void addMacro(String signature, String value) { if (fAddMacroList == null) { - fAddMacroList = new ArrayList<IMacro>(); + fAddMacroList = new ArrayList<>(); } fAddMacroList.add(new MacroDefinition(signature.toCharArray(), value.toCharArray())); fAddMacros = null; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/CLanguageKeywords.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/CLanguageKeywords.java index aa6be5e53de..0fc68f3baef 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/CLanguageKeywords.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/CLanguageKeywords.java @@ -55,7 +55,7 @@ public class CLanguageKeywords implements ICLanguageKeywords { @Override public String[] getKeywords() { if (keywords == null) { - Set<String> keywordSet = new HashSet<String>(KeywordSets.getKeywords(KeywordSetKey.KEYWORDS, language)); + Set<String> keywordSet = new HashSet<>(KeywordSets.getKeywords(KeywordSetKey.KEYWORDS, language)); CharArrayIntMap additionalKeywords = config.getAdditionalKeywords(); if (additionalKeywords != null) { for (Iterator<char[]> iterator = additionalKeywords.toList().iterator(); iterator.hasNext();) { @@ -80,7 +80,7 @@ public class CLanguageKeywords implements ICLanguageKeywords { @Override public String[] getPreprocessorKeywords() { if (preprocessorKeywords == null) { - Set<String> keywords = new HashSet<String>(KeywordSets.getKeywords(KeywordSetKey.PP_DIRECTIVE, language)); + Set<String> keywords = new HashSet<>(KeywordSets.getKeywords(KeywordSetKey.PP_DIRECTIVE, language)); CharArrayIntMap additionalKeywords = config.getAdditionalPreprocessorKeywords(); if (additionalKeywords != null) { for (Iterator<char[]> iterator = additionalKeywords.toList().iterator(); iterator.hasNext();) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/export/ExternalExportProjectProvider.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/export/ExternalExportProjectProvider.java index e6c17afcd31..daffd9eb830 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/export/ExternalExportProjectProvider.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/export/ExternalExportProjectProvider.java @@ -90,13 +90,13 @@ public class ExternalExportProjectProvider extends AbstractExportProjectProvider } // -include - List<String> includeFiles = new ArrayList<String>(); + List<String> includeFiles = new ArrayList<>(); if (isPresent(OPT_INCLUDE)) { includeFiles.addAll(getParameters(OPT_INCLUDE)); } // -exclude - List<String> excludeFiles = new ArrayList<String>(); + List<String> excludeFiles = new ArrayList<>(); if (isPresent(OPT_EXCLUDE)) { excludeFiles.addAll(getParameters(OPT_EXCLUDE)); } @@ -157,7 +157,7 @@ public class ExternalExportProjectProvider extends AbstractExportProjectProvider content.createLink(new Path(location.getAbsolutePath()), IResource.NONE, null); // Setup path entries - List<IPathEntry> entries = new ArrayList<IPathEntry>( + List<IPathEntry> entries = new ArrayList<>( Arrays.asList(CoreModel.getRawPathEntries(cproject))); // pre-include files @@ -192,7 +192,7 @@ public class ExternalExportProjectProvider extends AbstractExportProjectProvider * @return a list of additional entries to add to the project */ protected List<IPathEntry> getAdditionalRawEntries() { - List<IPathEntry> entries = new ArrayList<IPathEntry>(); + List<IPathEntry> entries = new ArrayList<>(); entries.add(CoreModel.newIncludeEntry(content.getProjectRelativePath(), null, content.getLocation(), true)); return entries; } @@ -218,7 +218,7 @@ public class ExternalExportProjectProvider extends AbstractExportProjectProvider */ @Override public Map<String, String> getExportProperties() { - Map<String, String> properties = new HashMap<String, String>(); + Map<String, String> properties = new HashMap<>(); Date now = Calendar.getInstance().getTime(); properties.put(ORG_ECLIPSE_CDT_CORE_INDEX_EXPORT_DATESTAMP, DateFormat.getDateInstance().format(now) + " " + DateFormat.getTimeInstance().format(now)); //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ArrayUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ArrayUtil.java index 6fbc94ec148..f1262a972f3 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ArrayUtil.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ArrayUtil.java @@ -707,7 +707,7 @@ public abstract class ArrayUtil { public static <T> T[] removeDuplicates(T[] array) { int k = 0; if (array.length >= 16) { - HashSet<T> set = new HashSet<T>(array.length); + HashSet<T> set = new HashSet<>(array.length); for (int i = 0; i < array.length; i++) { T obj = array[i]; if (obj != null && set.add(obj)) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayMap.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayMap.java index 3d089c53ba3..e0cc6898a2e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayMap.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayMap.java @@ -141,7 +141,7 @@ public final class CharArrayMap<V> { * Constructs an empty CharArrayMap with default initial capacity. */ public CharArrayMap() { - map = new HashMap<Key, V>(); + map = new HashMap<>(); } /** @@ -152,7 +152,7 @@ public final class CharArrayMap<V> { */ public static <V> CharArrayMap<V> createOrderedMap() { // TreeMap does not have a constructor that takes an initial capacity - return new CharArrayMap<V>(new TreeMap<Key, V>()); + return new CharArrayMap<>(new TreeMap<Key, V>()); } private CharArrayMap(Map<Key, V> map) { @@ -165,7 +165,7 @@ public final class CharArrayMap<V> { * @throws IllegalArgumentException if the initial capacity is negative */ public CharArrayMap(int initialCapacity) { - map = new HashMap<Key, V>(initialCapacity); + map = new HashMap<>(initialCapacity); } /** @@ -267,7 +267,7 @@ public final class CharArrayMap<V> { */ public Collection<char[]> keys() { Set<Key> keys = map.keySet(); - ArrayList<char[]> r = new ArrayList<char[]>(keys.size()); + ArrayList<char[]> r = new ArrayList<>(keys.size()); for (Key key : keys) { r.add(CharArrayUtils.extract(key.buffer, key.start, key.length)); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharTable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharTable.java index dba19db4a42..b50721b4277 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharTable.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharTable.java @@ -119,7 +119,7 @@ public class CharTable extends HashTable { } public List<char[]> toList() { - List<char[]> list = new ArrayList<char[]>(size()); + List<char[]> list = new ArrayList<>(size()); int size = size(); for (int i = 0; i < size; i++) { list.add(keyAt(i)); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CollectionUtils.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CollectionUtils.java index 982dcf01008..850435cb8ad 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CollectionUtils.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CollectionUtils.java @@ -152,7 +152,7 @@ public final class CollectionUtils { public static <T, U> List<U> listMapGet(Map<T, List<U>> m, T t) { List<U> result = m.get(t); if (result == null) { - result = new ArrayList<U>(); + result = new ArrayList<>(); m.put(t, result); } return result; @@ -175,7 +175,7 @@ public final class CollectionUtils { ++n; } } else if (result == null) { - result = new ArrayList<T>(collection.size() - 1); + result = new ArrayList<>(collection.size() - 1); for (T u : collection) { if (--n < 0) break; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectTable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectTable.java index 84e917d1e41..331aa7ba873 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectTable.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectTable.java @@ -47,7 +47,7 @@ public abstract class ObjectTable<T> extends HashTable implements Iterable<T> { public List<T> toList() { int size = size(); - List<T> list = new ArrayList<T>(size); + List<T> list = new ArrayList<>(size); for (int i = 0; i < size; i++) { list.add(keyAt(i)); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TagManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TagManager.java index 83602c9d2f1..a7042ac4e0b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TagManager.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TagManager.java @@ -47,7 +47,7 @@ public class TagManager { } private static Map<String, TaggerDescriptor> loadExtensions() { - Map<String, TaggerDescriptor> taggers = new HashMap<String, TaggerDescriptor>(); + Map<String, TaggerDescriptor> taggers = new HashMap<>(); // Load the extensions IConfigurationElement[] elements = Platform.getExtensionRegistry() @@ -75,7 +75,7 @@ public class TagManager { /** Provides an opportunity for all enabled taggers to process the given values. */ public Iterable<ITag> process(ITagWriter tagWriter, IBinding binding, IASTName ast) { - List<ITag> tags = new LinkedList<ITag>(); + List<ITag> tags = new LinkedList<>(); for (TaggerDescriptor desc : taggers.values()) { IBindingTagger tagger = desc.getBindingTaggerFor(binding, ast); if (tagger != null) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTNodeSelector.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTNodeSelector.java index e7d9ec8565d..27b07a17890 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTNodeSelector.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTNodeSelector.java @@ -84,7 +84,7 @@ public class ASTNodeSelector implements IASTNodeSelector { } } } - final ASTNodeSpecification<T> nodeSpec = new ASTNodeSpecification<T>(relation, requiredClass, offsetInFile, + final ASTNodeSpecification<T> nodeSpec = new ASTNodeSpecification<>(relation, requiredClass, offsetInFile, lengthInFile); nodeSpec.setRangeInSequence(sequenceNumber, sequenceLength, false); nodeSpec.setSearchInExpansion(searchInExpansion); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTProblem.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTProblem.java index 6e1db9ca820..92c0d3149d1 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTProblem.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTProblem.java @@ -32,7 +32,7 @@ import com.ibm.icu.text.MessageFormat; public class ASTProblem extends ASTNode implements IASTProblem { protected static final Map<Integer, String> errorMessages; static { - errorMessages = new HashMap<Integer, String>(); + errorMessages = new HashMap<>(); errorMessages.put(Integer.valueOf(PREPROCESSOR_POUND_ERROR), ParserMessages.getString("ScannerProblemFactory.error.preproc.error")); //$NON-NLS-1$ errorMessages.put(Integer.valueOf(PREPROCESSOR_POUND_WARNING), diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java index b80211fb166..7b9d8ba7562 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java @@ -2449,12 +2449,12 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser { final int lt = LTcatchEOF(1); if (allowAttrib && (lt == IGCCToken.t__attribute__)) { if (result == null) { - result = new ArrayList<IASTAttributeSpecifier>(); + result = new ArrayList<>(); } result.add(__attribute__()); } else if (allowDeclspec && (lt == IGCCToken.t__declspec)) { if (result == null) { - result = new ArrayList<IASTAttributeSpecifier>(); + result = new ArrayList<>(); } result.add(__declspec()); } else { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/CStringValue.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/CStringValue.java index a20e86ec9f1..6aa59fb0cf2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/CStringValue.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/CStringValue.java @@ -27,7 +27,7 @@ import org.eclipse.core.runtime.CoreException; public final class CStringValue implements IValue { private static final Map<Character, Character> escapeSequences; static { - Map<Character, Character> map = new HashMap<Character, Character>(); + Map<Character, Character> map = new HashMap<>(); map.put('\'', '\''); map.put('"', '"'); map.put('?', '?'); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ChildCollector.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ChildCollector.java index 74264b0fa33..40fd93139b8 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ChildCollector.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ChildCollector.java @@ -44,7 +44,7 @@ class ChildCollector extends ASTGenericVisitor { if (fNodes == null) { if (child == fNode) return PROCESS_CONTINUE; - fNodes = new ArrayList<IASTNode>(); + fNodes = new ArrayList<>(); } fNodes.add(child); return PROCESS_SKIP; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/GCCBuiltinSymbolProvider.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/GCCBuiltinSymbolProvider.java index a6529b19558..9cdbc3a49fb 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/GCCBuiltinSymbolProvider.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/GCCBuiltinSymbolProvider.java @@ -66,7 +66,7 @@ public class GCCBuiltinSymbolProvider implements IBuiltinBindingsProvider { public static final ASTNodeProperty BUILTIN_GCC_SYMBOL = new ASTNodeProperty( "GCCBuiltinSymbolProvider.BUILTIN_GCC_SYMBOL - built-in GCC symbol"); //$NON-NLS-1$ - private static final Map<String, char[]> CHAR_ARRAYS = new HashMap<String, char[]>(); + private static final Map<String, char[]> CHAR_ARRAYS = new HashMap<>(); private IBinding[] fBindings; private IScope fScope; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/SizeofCalculator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/SizeofCalculator.java index e9bc40364e3..2b29f562aa1 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/SizeofCalculator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/SizeofCalculator.java @@ -110,7 +110,7 @@ public class SizeofCalculator { public SizeofCalculator(IASTTranslationUnit ast) { this.ast = ast; int maxAlignment = 32; - Map<String, String> sizeofMacros = new HashMap<String, String>(); + Map<String, String> sizeofMacros = new HashMap<>(); for (IASTPreprocessorMacroDefinition macro : ast.getBuiltinMacroDefinitions()) { String name = macro.getName().toString(); if ("__BIGGEST_ALIGNMENT__".equals(name)) { //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CScope.java index 7b7ead2be1a..3f8a13aa10a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CScope.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CScope.java @@ -205,7 +205,7 @@ public class CScope implements ICScope, IASTInternalScope { @SuppressWarnings("unchecked") CharArrayObjectMap<Object> map = (CharArrayObjectMap<Object>) mapsToNameOrBinding[type]; if (map == CharArrayObjectMap.EMPTY_MAP) - mapsToNameOrBinding[type] = map = new CharArrayObjectMap<Object>(1); + mapsToNameOrBinding[type] = map = new CharArrayObjectMap<>(1); Object o = map.get(nchars); if (o instanceof IASTName) { @@ -643,7 +643,7 @@ public class CScope implements ICScope, IASTInternalScope { @SuppressWarnings("unchecked") CharArrayObjectMap<Object> map = (CharArrayObjectMap<Object>) mapsToNameOrBinding[type]; if (map == CharArrayObjectMap.EMPTY_MAP) - mapsToNameOrBinding[type] = map = new CharArrayObjectMap<Object>(2); + mapsToNameOrBinding[type] = map = new CharArrayObjectMap<>(2); map.put(binding.getNameCharArray(), binding); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CStructMapper.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CStructMapper.java index 69bf58513b9..7e182fd188c 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CStructMapper.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CStructMapper.java @@ -60,7 +60,7 @@ public class CStructMapper { public ICompositeType mapToAST(ICompositeType type) { if (fStructs == null) { - fStructs = new CharArrayMap<IASTName>(); + fStructs = new CharArrayMap<>(); fTranslationUnit.accept(new Visitor()); } IASTName name = fStructs.get(type.getNameCharArray()); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTAmbiguousTemplateArgument.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTAmbiguousTemplateArgument.java index b8b6fd82250..29590cb6bcc 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTAmbiguousTemplateArgument.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTAmbiguousTemplateArgument.java @@ -44,7 +44,7 @@ public class CPPASTAmbiguousTemplateArgument extends ASTAmbiguousNode implements * or {@link ICPPASTPackExpansionExpression}. */ public CPPASTAmbiguousTemplateArgument(IASTNode... nodes) { - fNodes = new ArrayList<IASTNode>(2); + fNodes = new ArrayList<>(2); for (IASTNode node : nodes) { if (node instanceof IASTTypeId || node instanceof IASTExpression) { fNodes.add(node); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java index b8971514149..8b894b79128 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java @@ -398,7 +398,7 @@ public class CPPASTQualifiedName extends CPPASTNameBase implements ICPPASTQualif private List<IBinding> filterClassScopeBindings(ICPPClassType classType, IBinding[] bindings, final boolean isDeclaration) { - List<IBinding> filtered = new ArrayList<IBinding>(); + List<IBinding> filtered = new ArrayList<>(); final boolean allowNonstatic = canBeFieldAccess(classType) || isAddressOf() || inUsingDecl(); final IBinding templateDefinition = (classType instanceof ICPPTemplateInstance) ? ((ICPPTemplateInstance) classType).getTemplateDefinition() diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java index 8b12c6387af..1022c0ec963 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java @@ -143,7 +143,7 @@ public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPI } static private class NamespaceMemberCollector extends ASTVisitor { - public ObjectSet<IBinding> members = new ObjectSet<IBinding>(8); + public ObjectSet<IBinding> members = new ObjectSet<>(8); public NamespaceMemberCollector() { shouldVisitNamespaces = true; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScopeMapper.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScopeMapper.java index 947cb7c687b..e20ccb8291a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScopeMapper.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScopeMapper.java @@ -304,7 +304,7 @@ public class CPPScopeMapper { final String name = getReverseQualifiedName(container); List<UsingDirectiveWrapper> list = fPerName.get(name); if (list == null) { - list = new LinkedList<UsingDirectiveWrapper>(); + list = new LinkedList<>(); fPerName.put(name, list); } list.add(new UsingDirectiveWrapper(offset, ud)); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java index a2a87d03683..d4e6b667c63 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java @@ -1537,7 +1537,7 @@ public class CPPSemantics { if (listOfNominated == null) { listOfNominated = new ArrayList<>(1); if (data.usingDirectives.isEmpty()) { - data.usingDirectives = new HashMap<ICPPNamespaceScope, List<ICPPNamespaceScope>>(); + data.usingDirectives = new HashMap<>(); } data.usingDirectives.put((ICPPNamespaceScope) appearsIn, listOfNominated); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUtil.java index 3c18ebdc69d..67ed6a80cf2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUtil.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUtil.java @@ -130,7 +130,7 @@ public class EvalUtil { fixed = fixed.computeForFunctionCall(record, context); } } - return new Pair<ICPPEvaluation, ICPPEvaluation>(updateable, fixed); + return new Pair<>(updateable, fixed); } public static class Pair<T1, T2> { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTModificationStore.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTModificationStore.java index d8753d270e5..43c9ad8b83e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTModificationStore.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTModificationStore.java @@ -24,7 +24,7 @@ public class ASTModificationStore { private HashMap<ASTModification, ASTModificationMap> fNestedModMaps; public ASTModificationStore() { - fNestedModMaps = new HashMap<ASTModification, ASTModificationMap>(); + fNestedModMaps = new HashMap<>(); } /** diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/DeclarationGeneratorImpl.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/DeclarationGeneratorImpl.java index b6325f26519..4dd516b0cf3 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/DeclarationGeneratorImpl.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/DeclarationGeneratorImpl.java @@ -141,7 +141,7 @@ public class DeclarationGeneratorImpl extends DeclarationGenerator { try { // Addition of pointer operators has to be in reverse order, so it's deferred until // the end. - Map<IASTDeclarator, LinkedList<IASTPointerOperator>> pointerOperatorMap = new HashMap<IASTDeclarator, LinkedList<IASTPointerOperator>>(); + Map<IASTDeclarator, LinkedList<IASTPointerOperator>> pointerOperatorMap = new HashMap<>(); // If the type is an array of something, create a declaration of a pointer to something // instead (to allow assignment, etc). diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ContainerNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ContainerNode.java index 2e6010d0053..578c1816b1a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ContainerNode.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ContainerNode.java @@ -31,7 +31,7 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode; * @author Emanuel Graf IFS */ public class ContainerNode extends ASTNode { - private final ArrayList<IASTNode> nodes = new ArrayList<IASTNode>(); + private final ArrayList<IASTNode> nodes = new ArrayList<>(); public ContainerNode(IASTNode... nodes) { Collections.addAll(this.nodes, nodes); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/MacroExpansionHandler.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/MacroExpansionHandler.java index 1b6fdeabf6b..c63e660c8c5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/MacroExpansionHandler.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/MacroExpansionHandler.java @@ -47,7 +47,7 @@ public class MacroExpansionHandler { private final Scribe scribe; private int lastMacroExpOffset; private IASTTranslationUnit ast; - private Map<String, List<IIndexName>> macroExpansion = new TreeMap<String, List<IIndexName>>(); + private Map<String, List<IIndexName>> macroExpansion = new TreeMap<>(); public MacroExpansionHandler(Scribe scribe) { this.scribe = scribe; @@ -189,10 +189,10 @@ public class MacroExpansionHandler { ast = unit; IIndex index = ast.getIndex(); if (index != null) { - macroExpansion = new TreeMap<String, List<IIndexName>>(); + macroExpansion = new TreeMap<>(); IASTPreprocessorMacroDefinition[] md = ast.getMacroDefinitions(); - TreeSet<String> paths = new TreeSet<String>(); + TreeSet<String> paths = new TreeSet<>(); for (IASTPreprocessorIncludeStatement is : ast.getIncludeDirectives()) { if (!is.isSystemInclude()) { paths.add(is.getContainingFilename()); @@ -212,7 +212,7 @@ public class MacroExpansionHandler { List<IIndexName> fileList = macroExpansion.get(filename); if (paths.contains(filename)) { if (fileList == null) { - fileList = new ArrayList<IIndexName>(); + fileList = new ArrayList<>(); macroExpansion.put(filename, fileList); } fileList.add(iIndexName); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ASTModificationHelper.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ASTModificationHelper.java index cf6bcc39ed1..15b2491370d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ASTModificationHelper.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ASTModificationHelper.java @@ -40,7 +40,7 @@ public class ASTModificationHelper { public <T extends IASTNode> T[] createModifiedChildArray(IASTNode parent, T[] unmodifiedChildren, Class<T> clazz, NodeCommentMap commentMap) { - ArrayList<T> modifiedChildren = new ArrayList<T>(Arrays.asList(unmodifiedChildren)); + ArrayList<T> modifiedChildren = new ArrayList<>(Arrays.asList(unmodifiedChildren)); for (ASTModification parentModification : modificationsForNode(parent)) { switch (parentModification.getKind()) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/NodeCommentMap.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/NodeCommentMap.java index f8f0d14d342..8753023c21a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/NodeCommentMap.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/NodeCommentMap.java @@ -34,10 +34,10 @@ import org.eclipse.cdt.internal.core.dom.rewrite.util.ASTNodes; * @author Guido Zgraggen IFS */ public class NodeCommentMap { - protected final Map<IASTNode, List<IASTComment>> leadingMap = new HashMap<IASTNode, List<IASTComment>>(); - protected final Map<IASTNode, List<IASTComment>> trailingMap = new HashMap<IASTNode, List<IASTComment>>(); - protected final Map<IASTNode, List<IASTComment>> freestandingMap = new HashMap<IASTNode, List<IASTComment>>(); - protected final List<IASTTranslationUnit> coveredUnits = new ArrayList<IASTTranslationUnit>(); + protected final Map<IASTNode, List<IASTComment>> leadingMap = new HashMap<>(); + protected final Map<IASTNode, List<IASTComment>> trailingMap = new HashMap<>(); + protected final Map<IASTNode, List<IASTComment>> freestandingMap = new HashMap<>(); + protected final List<IASTTranslationUnit> coveredUnits = new ArrayList<>(); /** * Add a comment to the map with the trailing comments. @@ -47,7 +47,7 @@ public class NodeCommentMap { public void addTrailingCommentToNode(IASTNode node, IASTComment comment) { List<IASTComment> comments = trailingMap.get(node); if (comments == null) { - comments = new ArrayList<IASTComment>(); + comments = new ArrayList<>(); } comments.add(comment); trailingMap.put(node, comments); @@ -62,7 +62,7 @@ public class NodeCommentMap { */ public List<IASTComment> getTrailingCommentsForNode(IASTNode node) { List<IASTComment> list = trailingMap.get(node); - return list != null ? list : new ArrayList<IASTComment>(); + return list != null ? list : new ArrayList<>(); } /** @@ -73,7 +73,7 @@ public class NodeCommentMap { public void addLeadingCommentToNode(IASTNode node, IASTComment comment) { List<IASTComment> comments = leadingMap.get(node); if (comments == null) { - comments = new ArrayList<IASTComment>(); + comments = new ArrayList<>(); } comments.add(comment); leadingMap.put(node, comments); @@ -88,7 +88,7 @@ public class NodeCommentMap { */ public List<IASTComment> getLeadingCommentsForNode(IASTNode node) { List<IASTComment> list = leadingMap.get(node); - return list != null ? list : new ArrayList<IASTComment>(); + return list != null ? list : new ArrayList<>(); } /** @@ -99,7 +99,7 @@ public class NodeCommentMap { public void addFreestandingCommentToNode(IASTNode node, IASTComment comment) { List<IASTComment> comments = freestandingMap.get(node); if (comments == null) { - comments = new ArrayList<IASTComment>(); + comments = new ArrayList<>(); } comments.add(comment); freestandingMap.put(node, comments); @@ -114,7 +114,7 @@ public class NodeCommentMap { */ public List<IASTComment> getFreestandingCommentsForNode(IASTNode node) { List<IASTComment> list = freestandingMap.get(node); - return list != null ? list : new ArrayList<IASTComment>(); + return list != null ? list : new ArrayList<>(); } /** @@ -149,7 +149,7 @@ public class NodeCommentMap { * @return List */ public List<IASTComment> getAllCommentsForNode(IASTNode node) { - List<IASTComment> comment = new ArrayList<IASTComment>(); + List<IASTComment> comment = new ArrayList<>(); comment.addAll(getFreestandingCommentsForNode(node)); comment.addAll(getLeadingCommentsForNode(node)); comment.addAll(getTrailingCommentsForNode(node)); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/NodeCommenter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/NodeCommenter.java index 378f98c5cc5..65f9aac1c05 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/NodeCommenter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/NodeCommenter.java @@ -73,7 +73,7 @@ public class NodeCommenter { this.visitor = visitor; this.commentHandler = commHandler; this.commentMap = commentMap; - this.children = new ArrayList<IASTNode>(); + this.children = new ArrayList<>(); } protected void writeNodeList(IASTNode[] nodes) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java index 530bf307be4..a95f8b3e640 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java @@ -322,7 +322,7 @@ public class CIndex implements IIndex { Collection<IIndexFile> in = Collections.singletonList(file); Set<FileContentKey> handled = new HashSet<>(); while (true) { - Collection<IIndexFile> nextLevel = depth != 0 ? new ArrayDeque<IIndexFile>() : null; + Collection<IIndexFile> nextLevel = depth != 0 ? new ArrayDeque<>() : null; for (IIndexFile indexFile : in) { IIndexFragmentFile file1 = (IIndexFragmentFile) indexFile; for (IIndexFragment fragment : fFragments) { @@ -362,7 +362,7 @@ public class CIndex implements IIndex { Collection<IIndexFile> in = Collections.singletonList(file); Set<Object> handled = new HashSet<>(); while (true) { - Collection<IIndexFile> nextLevel = depth != 0 ? new ArrayDeque<IIndexFile>() : null; + Collection<IIndexFile> nextLevel = depth != 0 ? new ArrayDeque<>() : null; for (IIndexFile indexFile : in) { IIndexFragmentFile file1 = (IIndexFragmentFile) indexFile; IIndexInclude[] includes = file1.getIncludes(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexBasedFileContentProvider.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexBasedFileContentProvider.java index bc7d040d14f..374d75bdc53 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexBasedFileContentProvider.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexBasedFileContentProvider.java @@ -63,7 +63,7 @@ public final class IndexBasedFileContentProvider extends InternalFileContentProv private final AbstractIndexerTask fRelatedIndexerTask; private long fFileSizeLimit = 0; private IIndexFile[] fContextToHeaderGap; - private final Map<IIndexFileLocation, IFileNomination> fPragmaOnce = new HashMap<IIndexFileLocation, IFileNomination>(); + private final Map<IIndexFileLocation, IFileNomination> fPragmaOnce = new HashMap<>(); private Set<String> fHeadersToIndexAllVersions = Collections.emptySet(); private boolean fIndexAllHeaderVersions; @@ -133,11 +133,11 @@ public final class IndexBasedFileContentProvider extends InternalFileContentProv IIndexFile file = selectIndexFile(macroDictionary, ifl); if (file != null) { try { - List<IIndexFile> files = new ArrayList<IIndexFile>(); - List<IIndexMacro> macros = new ArrayList<IIndexMacro>(); - List<ICPPUsingDirective> directives = new ArrayList<ICPPUsingDirective>(); - Map<IIndexFileLocation, IFileNomination> newPragmaOnce = new HashMap<IIndexFileLocation, IFileNomination>(); - LinkedHashSet<IIndexFile> preLoaded = new LinkedHashSet<IIndexFile>(); + List<IIndexFile> files = new ArrayList<>(); + List<IIndexMacro> macros = new ArrayList<>(); + List<ICPPUsingDirective> directives = new ArrayList<>(); + Map<IIndexFileLocation, IFileNomination> newPragmaOnce = new HashMap<>(); + LinkedHashSet<IIndexFile> preLoaded = new LinkedHashSet<>(); collectFileContent(file, null, newPragmaOnce, preLoaded, files, macros, directives, null); // Report pragma once inclusions, only if no exception was thrown. fPragmaOnce.putAll(newPragmaOnce); @@ -164,7 +164,7 @@ public final class IndexBasedFileContentProvider extends InternalFileContentProv } public List<String> toPathList(Collection<IIndexFileLocation> newPragmaOnce) { - List<String> newPragmaOncePaths = new ArrayList<String>(newPragmaOnce.size()); + List<String> newPragmaOncePaths = new ArrayList<>(newPragmaOnce.size()); for (IIndexFileLocation l : newPragmaOnce) { newPragmaOncePaths.add(fPathResolver.getASTPath(l)); } @@ -207,7 +207,7 @@ public final class IndexBasedFileContentProvider extends InternalFileContentProv if (fPragmaOnce.containsKey(ifl)) return false; } else { - preventRecursion = new HashSet<IIndexFile>(); + preventRecursion = new HashSet<>(); } if (!preventRecursion.add(file)) return false; @@ -267,11 +267,11 @@ public final class IndexBasedFileContentProvider extends InternalFileContentProv if (contextFile == null || targetFile == null || contextFile == targetFile) return null; - Map<IIndexFileLocation, IFileNomination> newPragmaOnce = new HashMap<IIndexFileLocation, IFileNomination>(); - List<IIndexFile> filesIncluded = new ArrayList<IIndexFile>(); - ArrayList<IIndexMacro> macros = new ArrayList<IIndexMacro>(); - ArrayList<ICPPUsingDirective> directives = new ArrayList<ICPPUsingDirective>(); - LinkedHashSet<IIndexFile> preLoaded = new LinkedHashSet<IIndexFile>(); + Map<IIndexFileLocation, IFileNomination> newPragmaOnce = new HashMap<>(); + List<IIndexFile> filesIncluded = new ArrayList<>(); + ArrayList<IIndexMacro> macros = new ArrayList<>(); + ArrayList<ICPPUsingDirective> directives = new ArrayList<>(); + LinkedHashSet<IIndexFile> preLoaded = new LinkedHashSet<>(); if (!collectFileContent(contextFile, targetFile, newPragmaOnce, preLoaded, filesIncluded, macros, directives, new HashSet<IIndexFile>())) { return null; @@ -287,7 +287,7 @@ public final class IndexBasedFileContentProvider extends InternalFileContentProv } private List<FileVersion> toList(LinkedHashSet<IIndexFile> preLoaded) throws CoreException { - List<FileVersion> result = new ArrayList<InternalFileContent.FileVersion>(preLoaded.size()); + List<FileVersion> result = new ArrayList<>(preLoaded.size()); for (IIndexFile file : preLoaded) { String path = fPathResolver.getASTPath(file.getLocation()); result.add(new FileVersion(path, file.getSignificantMacros())); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFactory.java index b8bd5f7b64c..46e70ee569f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFactory.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFactory.java @@ -77,7 +77,7 @@ public class IndexFactory { Collection<ICProject> indexProjects = getProjects(projects, addDependencies, addDependent, new HashSet<IProject>()); - HashMap<String, IIndexFragment> fragments = new LinkedHashMap<String, IIndexFragment>(); + HashMap<String, IIndexFragment> fragments = new LinkedHashMap<>(); for (ICProject cproject : indexProjects) { IIndexFragment pdom = fPDOMManager.getPDOM(cproject); if (pdom != null) { @@ -106,7 +106,7 @@ public class IndexFactory { private Collection<ICProject> getProjects(ICProject[] projects, boolean addDependencies, boolean addDependent, Set<IProject> handled) { - List<ICProject> result = new ArrayList<ICProject>(); + List<ICProject> result = new ArrayList<>(); for (ICProject cproject : projects) { checkAddProject(cproject, handled, result); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/AbstractCompositeFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/AbstractCompositeFactory.java index 7be14caaa5b..c16920c8197 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/AbstractCompositeFactory.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/AbstractCompositeFactory.java @@ -93,7 +93,7 @@ public abstract class AbstractCompositeFactory implements ICompositesFactory { * @return an array of unique bindings */ protected IIndexFragmentBinding[] mergeBindingArrays(IIndexFragmentBinding[][] fragmentBindings) { - TreeSet<IIndexFragmentBinding> ts = new TreeSet<IIndexFragmentBinding>(fragmentComparator); + TreeSet<IIndexFragmentBinding> ts = new TreeSet<>(fragmentComparator); for (IIndexFragmentBinding[] array : fragmentBindings) { if (array != null) { for (IIndexFragmentBinding element : array) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassSpecialization.java index 9c1c38b4314..37f0da7e435 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassSpecialization.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassSpecialization.java @@ -48,7 +48,7 @@ public class CompositeCPPClassSpecialization extends CompositeCPPClassType imple private final ThreadLocal<Set<IBinding>> fInProgress = new ThreadLocal<Set<IBinding>>() { @Override protected Set<IBinding> initialValue() { - return new HashSet<IBinding>(); + return new HashSet<>(); } }; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeInstanceCache.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeInstanceCache.java index 244d0934821..3dd1afca195 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeInstanceCache.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeInstanceCache.java @@ -47,7 +47,7 @@ public class CompositeInstanceCache { private ICPPDeferredClassInstance fDeferredInstance; public CompositeInstanceCache() { - fMap = new HashMap<String, ICPPTemplateInstance>(); + fMap = new HashMap<>(); } synchronized public final void addInstance(ICPPTemplateArgument[] arguments, ICPPTemplateInstance instance) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/IndexProviderManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/IndexProviderManager.java index 40a227bb81d..20c66dac259 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/IndexProviderManager.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/IndexProviderManager.java @@ -101,14 +101,14 @@ public final class IndexProviderManager implements IElementChangedListener { */ public void reset(VersionRange pdomVersionRange) { this.fragmentProviders = new IIndexFragmentProvider[0]; - this.provisionMap = new HashMap<ProvisionMapKey, Boolean>(); + this.provisionMap = new HashMap<>(); this.pdomVersionRange = pdomVersionRange; - this.compatibleFragmentUnavailable = new HashSet<String>(); + this.compatibleFragmentUnavailable = new HashSet<>(); } public void startup() { - List<IIndexFragmentProvider> providers = new ArrayList<IIndexFragmentProvider>(); - List<IConfigurationElement[]> usageSpecifications = new ArrayList<IConfigurationElement[]>(); + List<IIndexFragmentProvider> providers = new ArrayList<>(); + List<IConfigurationElement[]> usageSpecifications = new ArrayList<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint indexProviders = registry.getExtensionPoint(CCorePlugin.INDEX_UNIQ_ID); for (IExtension extension : indexProviders.getExtensions()) { @@ -189,7 +189,7 @@ public final class IndexProviderManager implements IElementChangedListener { */ public IIndexFragment[] getProvidedIndexFragments(ICConfigurationDescription config, int usage) throws CoreException { - Map<String, IIndexFragment> id2fragment = new HashMap<String, IIndexFragment>(); + Map<String, IIndexFragment> id2fragment = new HashMap<>(); IProject project = config.getProjectDescription().getProject(); for (int i = 0; i < fragmentProviders.length; i++) { @@ -215,7 +215,7 @@ public final class IndexProviderManager implements IElementChangedListener { } // Make log entries for any fragments which have no compatible equivalents - List<IIndexFragment> preresult = new ArrayList<IIndexFragment>(); + List<IIndexFragment> preresult = new ArrayList<>(); for (Map.Entry<String, IIndexFragment> entry : id2fragment.entrySet()) { if (entry.getValue() == null) { String key = entry.getKey(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/PDOMCache.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/PDOMCache.java index e10ec6a9128..ad7a40789ca 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/PDOMCache.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/PDOMCache.java @@ -35,7 +35,7 @@ class PDOMCache { private static Object singletonMutex = new Object(); private PDOMCache() { - this.path2pdom = new HashMap<File, PDOM>(); + this.path2pdom = new HashMap<>(); } /** diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/ReadOnlyPDOMProviderBridge.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/ReadOnlyPDOMProviderBridge.java index f1f1a7657d0..0f7404f9242 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/ReadOnlyPDOMProviderBridge.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/ReadOnlyPDOMProviderBridge.java @@ -36,7 +36,7 @@ public class ReadOnlyPDOMProviderBridge implements IIndexFragmentProvider { @Override public IIndexFragment[] getIndexFragments(ICConfigurationDescription config) throws CoreException { - List<PDOM> result = new ArrayList<PDOM>(); + List<PDOM> result = new ArrayList<>(); IPDOMDescriptor[] descriptions = provider.getDescriptors(config); if (descriptions != null) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/FileEncodingRegistry.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/FileEncodingRegistry.java index 8934321f936..24e905984df 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/FileEncodingRegistry.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/FileEncodingRegistry.java @@ -34,7 +34,7 @@ public class FileEncodingRegistry implements Serializable { public FileEncodingRegistry(String defaultEncoding) { this.defaultEncoding = defaultEncoding; - fFilePathToEncodingMap = new TreeMap<String, String>(); + fFilePathToEncodingMap = new TreeMap<>(); } public void setDefaultEncoding(String newDefaultEncoding) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexer.java index a8a4d2a8183..9e958f3e5b4 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexer.java @@ -435,7 +435,7 @@ public abstract class StandaloneIndexer { * @return */ private List<String> getFilesAdded(List<String> tus) { - List<String> added = new ArrayList<String>(); + List<String> added = new ArrayList<>(); FilenameFilter filter = getExclusionFilter(); if (filter == null) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerInputAdapter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerInputAdapter.java index 4a244ba0eb9..064a34a9924 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerInputAdapter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerInputAdapter.java @@ -39,7 +39,7 @@ import org.eclipse.core.runtime.Path; * @since 5.0 */ public class StandaloneIndexerInputAdapter extends IndexerInputAdapter { - private final HashMap<String, IIndexFileLocation> fIflCache = new HashMap<String, IIndexFileLocation>(); + private final HashMap<String, IIndexFileLocation> fIflCache = new HashMap<>(); private final FileExistsCache fExistsCache; private final StandaloneIndexer fIndexer; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/EmptyIterator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/EmptyIterator.java index 40c40ea7ef3..cf4d1624448 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/EmptyIterator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/EmptyIterator.java @@ -17,7 +17,7 @@ import java.util.Iterator; import java.util.NoSuchElementException; public final class EmptyIterator<T> implements Iterator<T> { - public static final EmptyIterator<?> EMPTY_ITERATOR = new EmptyIterator<Object>(); + public static final EmptyIterator<?> EMPTY_ITERATOR = new EmptyIterator<>(); @SuppressWarnings("unchecked") public static <T> EmptyIterator<T> empty() { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java index 19997ccd301..4716f38abe5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java @@ -708,7 +708,7 @@ class ASTInclusionNode implements IASTInclusionNode { @Override public IASTInclusionNode[] getNestedInclusions() { if (fInclusions == null) { - ArrayList<IASTInclusionNode> result = new ArrayList<IASTInclusionNode>(); + ArrayList<IASTInclusionNode> result = new ArrayList<>(); fLocationCtx.getInclusions(result); fInclusions = result.toArray(new IASTInclusionNode[result.size()]); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LazyCharArray.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LazyCharArray.java index e4c98e7dc70..7aa2f983a08 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LazyCharArray.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LazyCharArray.java @@ -38,12 +38,12 @@ public abstract class LazyCharArray extends AbstractCharArray { fCharEndOffset = charOffset + chars.length; fSourceOffset = sourceOffset; fSourceEndOffset = sourceEndOffset; - fCharsReference = new SoftReference<char[]>(chars); + fCharsReference = new SoftReference<>(chars); } } private int fLength = -1; - private List<Chunk> fChunks = new ArrayList<Chunk>(); + private List<Chunk> fChunks = new ArrayList<>(); private StreamHasher fHasher; private long fHash64; // Make a reference to the currently used char[], such that it is not collected. @@ -182,7 +182,7 @@ public abstract class LazyCharArray extends AbstractCharArray { if (data == null) { data = new char[chunk.fCharEndOffset - chunk.fCharOffset]; rereadChunkData(chunk, data); - chunk.fCharsReference = new SoftReference<char[]>(data); + chunk.fCharsReference = new SoftReference<>(data); } return fCurrentChars = data; } @@ -198,7 +198,7 @@ public abstract class LazyCharArray extends AbstractCharArray { */ public void testClearData() { for (Chunk chunk : fChunks) { - chunk.fCharsReference = new SoftReference<char[]>(null); + chunk.fCharsReference = new SoftReference<>(null); } if (fCurrentChars != null) fCurrentChars = null; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpander.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpander.java index 3fad817a9bc..a292c8bd945 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpander.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpander.java @@ -130,8 +130,8 @@ public class MacroExpander { private final CharArrayMap<PreprocessorMacro> fDictionary; private final LocationMap fLocationMap; private final LexerOptions fLexOptions; - private ArrayList<IASTName> fImplicitMacroExpansions = new ArrayList<IASTName>(); - private ArrayList<ImageLocationInfo> fImageLocationInfos = new ArrayList<ImageLocationInfo>(); + private ArrayList<IASTName> fImplicitMacroExpansions = new ArrayList<>(); + private ArrayList<ImageLocationInfo> fImageLocationInfos = new ArrayList<>(); private boolean fCompletionMode; private int fStartOffset; private int fEndOffset; @@ -173,7 +173,7 @@ public class MacroExpander { fEndOffset = identifier.getEndOffset(); fCompletionMode = completionMode; - IdentityHashMap<PreprocessorMacro, PreprocessorMacro> forbidden = new IdentityHashMap<PreprocessorMacro, PreprocessorMacro>(); + IdentityHashMap<PreprocessorMacro, PreprocessorMacro> forbidden = new IdentityHashMap<>(); // setup input sequence TokenSource input = new TokenSource(lexer); @@ -232,7 +232,7 @@ public class MacroExpander { fStartOffset = identifier.getOffset(); fEndOffset = identifier.getEndOffset(); fCompletionMode = false; - IdentityHashMap<PreprocessorMacro, PreprocessorMacro> forbidden = new IdentityHashMap<PreprocessorMacro, PreprocessorMacro>(); + IdentityHashMap<PreprocessorMacro, PreprocessorMacro> forbidden = new IdentityHashMap<>(); // setup input sequence TokenSource input = new TokenSource(lexer); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpansionTracker.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpansionTracker.java index 44de7cc5ac0..0f55e98f958 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpansionTracker.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpansionTracker.java @@ -26,7 +26,7 @@ import org.eclipse.text.edits.ReplaceEdit; public class MacroExpansionTracker { public class MacroInfo { private TokenList fMacroCall = new TokenList(); - private ArrayList<TokenList> fArguments = new ArrayList<TokenList>(); + private ArrayList<TokenList> fArguments = new ArrayList<>(); public MacroInfo(Token identifier) { fMacroCall.append(identifier); @@ -46,7 +46,7 @@ public class MacroExpansionTracker { private char[] fInput; private String fReplacementText = ""; //$NON-NLS-1$ - private LinkedList<MacroInfo> fMacroStack = new LinkedList<MacroInfo>(); + private LinkedList<MacroInfo> fMacroStack = new LinkedList<>(); private IToken fReplaceFrom; private IToken fReplaceTo; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MultiMacroExpansionExplorer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MultiMacroExpansionExplorer.java index 92ff75e22a7..6005cfd3712 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MultiMacroExpansionExplorer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MultiMacroExpansionExplorer.java @@ -119,7 +119,7 @@ public class MultiMacroExpansionExplorer extends MacroExpansionExplorer { for (IASTPreprocessorMacroExpansion expansion : expansions) { IASTName ref = expansion.getMacroReference(); if (ref != null) { - ArrayList<IASTName> refs = new ArrayList<IASTName>(); + ArrayList<IASTName> refs = new ArrayList<>(); refs.add(ref); refs.addAll(Arrays.asList(expansion.getNestedMacroReferences())); IASTFileLocation refLoc = expansion.getFileLocation(); @@ -166,7 +166,7 @@ public class MultiMacroExpansionExplorer extends MacroExpansionExplorer { } private Map<IMacroBinding, IASTFileLocation> getMacroLocations(final ILocationResolver resolver) { - final Map<IMacroBinding, IASTFileLocation> result = new HashMap<IMacroBinding, IASTFileLocation>(); + final Map<IMacroBinding, IASTFileLocation> result = new HashMap<>(); addLocations(resolver.getBuiltinMacroDefinitions(), result); addLocations(resolver.getMacroDefinitions(), result); return result; @@ -203,7 +203,7 @@ public class MultiMacroExpansionExplorer extends MacroExpansionExplorer { * Combines the replace edits of the leading delegates. */ private List<ReplaceEdit> combineReplaceEdits(int count) { - ArrayList<ReplaceEdit> edits = new ArrayList<ReplaceEdit>(); + ArrayList<ReplaceEdit> edits = new ArrayList<>(); for (int i = 0; i < count; i++) { IMacroExpansionStep step = fDelegates[i].getFullExpansion(); shiftAndAddEdits(fBoundaries[2 * i], step.getReplacements(), edits); @@ -264,7 +264,7 @@ public class MultiMacroExpansionExplorer extends MacroExpansionExplorer { before.append(dresult.getCodeBeforeStep()); before.append(fSource, end, fSource.length - end); - List<ReplaceEdit> replacements = new ArrayList<ReplaceEdit>(); + List<ReplaceEdit> replacements = new ArrayList<>(); shiftAndAddEdits(shift, dresult.getReplacements(), replacements); fCachedStep = new MacroExpansionStep(before.toString(), dresult.getExpandedMacro(), dresult.getLocationOfExpandedMacroDefinition(), diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java index e3b822970e4..9afbae833b8 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java @@ -126,7 +126,7 @@ final class ScannerContext { */ public final Conditional newBranch(BranchKind branchKind, boolean withinExpansion) { if (fConditionals == null) { - fConditionals = new ArrayList<Conditional>(); + fConditionals = new ArrayList<>(); } Conditional result; @@ -325,7 +325,7 @@ final class ScannerContext { public void trackSignificantMacros() { fInternalModifications = new CharArraySet(5); - fSignificantMacros = new CharArrayObjectMap<char[]>(5); + fSignificantMacros = new CharArrayObjectMap<>(5); } public void setPragmaOnce(boolean val) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/SingleMacroExpansionExplorer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/SingleMacroExpansionExplorer.java index e0d7b0b1f2b..2ab2723bcb4 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/SingleMacroExpansionExplorer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/SingleMacroExpansionExplorer.java @@ -53,7 +53,7 @@ public class SingleMacroExpansionExplorer extends MacroExpansionExplorer { } private CharArrayMap<PreprocessorMacro> createDictionary(IASTName[] refs) { - CharArrayMap<PreprocessorMacro> map = new CharArrayMap<PreprocessorMacro>(refs.length); + CharArrayMap<PreprocessorMacro> map = new CharArrayMap<>(refs.length); for (IASTName name : refs) { addMacroDefinition(map, name); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/token/KeywordSets.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/token/KeywordSets.java index b7e117a2b35..f2edfaf1f96 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/token/KeywordSets.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/token/KeywordSets.java @@ -65,23 +65,23 @@ public class KeywordSets { return null; } - private static final Set<String> EMPTY_TABLE = new HashSet<String>(0); + private static final Set<String> EMPTY_TABLE = new HashSet<>(0); private static final Set<String> NAMESPACE_ONLY_SET; static { - NAMESPACE_ONLY_SET = new HashSet<String>(1); + NAMESPACE_ONLY_SET = new HashSet<>(1); NAMESPACE_ONLY_SET.add(Keywords.NAMESPACE); } private static final Set<String> MACRO_ONLY; static { - MACRO_ONLY = new HashSet<String>(1); + MACRO_ONLY = new HashSet<>(1); MACRO_ONLY.add("defined()"); //$NON-NLS-1$ } private static final Set<String> DECL_SPECIFIER_SEQUENCE_C; static { - DECL_SPECIFIER_SEQUENCE_C = new TreeSet<String>(); + DECL_SPECIFIER_SEQUENCE_C = new TreeSet<>(); DECL_SPECIFIER_SEQUENCE_C.add(Keywords.INLINE); DECL_SPECIFIER_SEQUENCE_C.add(Keywords.AUTO); DECL_SPECIFIER_SEQUENCE_C.add(Keywords.REGISTER); @@ -110,7 +110,7 @@ public class KeywordSets { private static final Set<String> DECL_SPECIFIER_SEQUENCE_CPP; static { - DECL_SPECIFIER_SEQUENCE_CPP = new TreeSet<String>(); + DECL_SPECIFIER_SEQUENCE_CPP = new TreeSet<>(); // add all of C then remove the ones we don't need DECL_SPECIFIER_SEQUENCE_CPP.addAll(DECL_SPECIFIER_SEQUENCE_C); DECL_SPECIFIER_SEQUENCE_CPP.remove(Keywords._COMPLEX); @@ -132,14 +132,14 @@ public class KeywordSets { private static final Map<ParserLanguage, Set<String>> DECL_SPECIFIER_SEQUENCE_TABLE; static { - DECL_SPECIFIER_SEQUENCE_TABLE = new HashMap<ParserLanguage, Set<String>>(); + DECL_SPECIFIER_SEQUENCE_TABLE = new HashMap<>(); DECL_SPECIFIER_SEQUENCE_TABLE.put(ParserLanguage.CPP, DECL_SPECIFIER_SEQUENCE_CPP); DECL_SPECIFIER_SEQUENCE_TABLE.put(ParserLanguage.C, DECL_SPECIFIER_SEQUENCE_C); } private static final Set<String> DECLARATION_CPP; static { - DECLARATION_CPP = new TreeSet<String>(); + DECLARATION_CPP = new TreeSet<>(); DECLARATION_CPP.addAll(DECL_SPECIFIER_SEQUENCE_CPP); DECLARATION_CPP.add(Keywords.ASM); DECLARATION_CPP.add(Keywords.TEMPLATE); @@ -151,21 +151,21 @@ public class KeywordSets { private static final Set<String> DECLARATION_C; static { - DECLARATION_C = new TreeSet<String>(); + DECLARATION_C = new TreeSet<>(); DECLARATION_C.addAll(DECL_SPECIFIER_SEQUENCE_C); DECLARATION_C.add(Keywords.ASM); } private static final Map<ParserLanguage, Set<String>> DECLARATION_TABLE; static { - DECLARATION_TABLE = new HashMap<ParserLanguage, Set<String>>(2); + DECLARATION_TABLE = new HashMap<>(2); DECLARATION_TABLE.put(ParserLanguage.CPP, DECLARATION_CPP); DECLARATION_TABLE.put(ParserLanguage.C, DECLARATION_C); } private static final Set<String> EXPRESSION_C; static { - EXPRESSION_C = new TreeSet<String>(); + EXPRESSION_C = new TreeSet<>(); EXPRESSION_C.add(Keywords.CHAR); EXPRESSION_C.add(Keywords.SHORT); EXPRESSION_C.add(Keywords.INT); @@ -179,7 +179,7 @@ public class KeywordSets { private static final Set<String> EXPRESSION_CPP; static { - EXPRESSION_CPP = new TreeSet<String>(EXPRESSION_C); + EXPRESSION_CPP = new TreeSet<>(EXPRESSION_C); EXPRESSION_CPP.add(Keywords.BOOL); EXPRESSION_CPP.add(Keywords.CHAR16_T); EXPRESSION_CPP.add(Keywords.CHAR32_T); @@ -202,14 +202,14 @@ public class KeywordSets { private static final Map<ParserLanguage, Set<String>> EXPRESSION_TABLE; static { - EXPRESSION_TABLE = new HashMap<ParserLanguage, Set<String>>(2); + EXPRESSION_TABLE = new HashMap<>(2); EXPRESSION_TABLE.put(ParserLanguage.CPP, EXPRESSION_CPP); EXPRESSION_TABLE.put(ParserLanguage.C, EXPRESSION_C); } private static final Set<String> STATEMENT_C; static { - STATEMENT_C = new TreeSet<String>(); + STATEMENT_C = new TreeSet<>(); STATEMENT_C.addAll(DECLARATION_C); STATEMENT_C.addAll(EXPRESSION_C); STATEMENT_C.add(Keywords.FOR); @@ -228,7 +228,7 @@ public class KeywordSets { private static final Set<String> STATEMENT_CPP; static { - STATEMENT_CPP = new TreeSet<String>(DECLARATION_CPP); + STATEMENT_CPP = new TreeSet<>(DECLARATION_CPP); STATEMENT_CPP.addAll(EXPRESSION_CPP); STATEMENT_CPP.add(Keywords.TRY); STATEMENT_CPP.add(Keywords.FOR); @@ -248,14 +248,14 @@ public class KeywordSets { private static final Map<ParserLanguage, Set<String>> STATEMENT_TABLE; static { - STATEMENT_TABLE = new HashMap<ParserLanguage, Set<String>>(); + STATEMENT_TABLE = new HashMap<>(); STATEMENT_TABLE.put(ParserLanguage.CPP, STATEMENT_CPP); STATEMENT_TABLE.put(ParserLanguage.C, STATEMENT_C); } private static final Set<String> BASE_SPECIFIER_CPP; static { - BASE_SPECIFIER_CPP = new TreeSet<String>(); + BASE_SPECIFIER_CPP = new TreeSet<>(); BASE_SPECIFIER_CPP.add(Keywords.PUBLIC); BASE_SPECIFIER_CPP.add(Keywords.PROTECTED); BASE_SPECIFIER_CPP.add(Keywords.PRIVATE); @@ -264,7 +264,7 @@ public class KeywordSets { private static final Set<String> CLASS_MEMBER; static { - CLASS_MEMBER = new TreeSet<String>(DECL_SPECIFIER_SEQUENCE_CPP); + CLASS_MEMBER = new TreeSet<>(DECL_SPECIFIER_SEQUENCE_CPP); CLASS_MEMBER.add(Keywords.PUBLIC); CLASS_MEMBER.add(Keywords.PROTECTED); CLASS_MEMBER.add(Keywords.PRIVATE); @@ -272,7 +272,7 @@ public class KeywordSets { private static final Set<String> POST_USING_CPP; static { - POST_USING_CPP = new TreeSet<String>(); + POST_USING_CPP = new TreeSet<>(); POST_USING_CPP.add(Keywords.NAMESPACE); POST_USING_CPP.add(Keywords.TYPENAME); } @@ -281,7 +281,7 @@ public class KeywordSets { private static final Set<String> FUNCTION_MODIFIER_CPP; static { - FUNCTION_MODIFIER_CPP = new TreeSet<String>(FUNCTION_MODIFIER_C); + FUNCTION_MODIFIER_CPP = new TreeSet<>(FUNCTION_MODIFIER_C); FUNCTION_MODIFIER_CPP.add(Keywords.THROW); FUNCTION_MODIFIER_CPP.add(Keywords.TRY); @@ -290,14 +290,14 @@ public class KeywordSets { private static final Map<ParserLanguage, Set<String>> FUNCTION_MODIFIER_TABLE; static { - FUNCTION_MODIFIER_TABLE = new HashMap<ParserLanguage, Set<String>>(2); + FUNCTION_MODIFIER_TABLE = new HashMap<>(2); FUNCTION_MODIFIER_TABLE.put(ParserLanguage.CPP, FUNCTION_MODIFIER_CPP); FUNCTION_MODIFIER_TABLE.put(ParserLanguage.C, FUNCTION_MODIFIER_C); } private static final Set<String> PP_DIRECTIVES_C; static { - PP_DIRECTIVES_C = new TreeSet<String>(); + PP_DIRECTIVES_C = new TreeSet<>(); PP_DIRECTIVES_C.add(Directives.POUND_BLANK); PP_DIRECTIVES_C.add(Directives.POUND_DEFINE); PP_DIRECTIVES_C.add(Directives.POUND_UNDEF); @@ -317,7 +317,7 @@ public class KeywordSets { private static final Set<String> PP_DIRECTIVES_CPP; static { - PP_DIRECTIVES_CPP = new TreeSet<String>(); + PP_DIRECTIVES_CPP = new TreeSet<>(); PP_DIRECTIVES_CPP.add(Directives.POUND_BLANK); PP_DIRECTIVES_CPP.add(Directives.POUND_DEFINE); PP_DIRECTIVES_CPP.add(Directives.POUND_UNDEF); @@ -337,7 +337,7 @@ public class KeywordSets { private static final Set<String> ALL_C; static { - ALL_C = new TreeSet<String>(PP_DIRECTIVES_CPP); + ALL_C = new TreeSet<>(PP_DIRECTIVES_CPP); ALL_C.add(Keywords.AUTO); ALL_C.add(Keywords.BREAK); ALL_C.add(Keywords.CASE); @@ -382,7 +382,7 @@ public class KeywordSets { private static final Set<String> ALL_CPP; static { - ALL_CPP = new TreeSet<String>(PP_DIRECTIVES_CPP); + ALL_CPP = new TreeSet<>(PP_DIRECTIVES_CPP); ALL_CPP.add(Keywords.ALIGNAS); ALL_CPP.add(Keywords.ALIGNOF); ALL_CPP.add(Keywords.AND); @@ -471,14 +471,14 @@ public class KeywordSets { private static final Map<ParserLanguage, Set<String>> ALL_TABLE; static { - ALL_TABLE = new HashMap<ParserLanguage, Set<String>>(2); + ALL_TABLE = new HashMap<>(2); ALL_TABLE.put(ParserLanguage.C, ALL_C); ALL_TABLE.put(ParserLanguage.CPP, ALL_CPP); } private static final Set<String> KEYWORDS_CPP; static { - KEYWORDS_CPP = new TreeSet<String>(); + KEYWORDS_CPP = new TreeSet<>(); KEYWORDS_CPP.add(Keywords.ALIGNAS); KEYWORDS_CPP.add(Keywords.ALIGNOF); KEYWORDS_CPP.add(Keywords.AND); @@ -568,7 +568,7 @@ public class KeywordSets { private static Set<String> KEYWORDS_C; static { - KEYWORDS_C = new TreeSet<String>(); + KEYWORDS_C = new TreeSet<>(); KEYWORDS_C.add(Keywords.ASM); KEYWORDS_C.add(Keywords.AUTO); KEYWORDS_C.add(Keywords.BREAK); @@ -610,14 +610,14 @@ public class KeywordSets { private static final Map<ParserLanguage, Set<String>> KEYWORDS_TABLE; static { - KEYWORDS_TABLE = new HashMap<ParserLanguage, Set<String>>(2); + KEYWORDS_TABLE = new HashMap<>(2); KEYWORDS_TABLE.put(ParserLanguage.C, KEYWORDS_C); KEYWORDS_TABLE.put(ParserLanguage.CPP, KEYWORDS_CPP); } private static final Set<String> TYPES_C; static { - TYPES_C = new TreeSet<String>(); + TYPES_C = new TreeSet<>(); TYPES_C.add(Keywords.CHAR); TYPES_C.add(Keywords.DOUBLE); TYPES_C.add(Keywords.FLOAT); @@ -634,7 +634,7 @@ public class KeywordSets { private static final Set<String> TYPES_CPP; static { - TYPES_CPP = new TreeSet<String>(); + TYPES_CPP = new TreeSet<>(); TYPES_CPP.add(Keywords.BOOL); TYPES_CPP.add(Keywords.CHAR); TYPES_CPP.add(Keywords.CHAR16_T); @@ -652,14 +652,14 @@ public class KeywordSets { private static Map<ParserLanguage, Set<String>> TYPES_TABLE; static { - TYPES_TABLE = new HashMap<ParserLanguage, Set<String>>(2); + TYPES_TABLE = new HashMap<>(2); TYPES_TABLE.put(ParserLanguage.C, TYPES_C); TYPES_TABLE.put(ParserLanguage.CPP, TYPES_CPP); } private static Map<ParserLanguage, Set<String>> PP_DIRECTIVES_TABLE; static { - PP_DIRECTIVES_TABLE = new HashMap<ParserLanguage, Set<String>>(2); + PP_DIRECTIVES_TABLE = new HashMap<>(2); PP_DIRECTIVES_TABLE.put(ParserLanguage.C, PP_DIRECTIVES_C); PP_DIRECTIVES_TABLE.put(ParserLanguage.CPP, PP_DIRECTIVES_CPP); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/Profiler.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/Profiler.java index c31175cd270..5bedde683a2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/Profiler.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/Profiler.java @@ -82,11 +82,11 @@ public class Profiler { private Map<String, int[]> counters; private Profiler() { - timers = new HashMap<String, Timer>(); - counters = new HashMap<String, int[]>(); + timers = new HashMap<>(); + counters = new HashMap<>(); } - private static ThreadLocal<Profiler> threadProfiler = new ThreadLocal<Profiler>(); + private static ThreadLocal<Profiler> threadProfiler = new ThreadLocal<>(); /** * @@ -136,7 +136,7 @@ public class Profiler { public static void printStats() { Profiler profiler = threadProfiler.get(); if (profiler != null) { - List<Map.Entry<String, Timer>> list = new ArrayList<Map.Entry<String, Timer>>(profiler.timers.entrySet()); + List<Map.Entry<String, Timer>> list = new ArrayList<>(profiler.timers.entrySet()); Comparator<Map.Entry<String, Timer>> c = new Comparator<Map.Entry<String, Timer>>() { @Override public int compare(Entry<String, Timer> o1, Entry<String, Timer> o2) { @@ -152,7 +152,7 @@ public class Profiler { } if (!profiler.counters.isEmpty()) { - List<Map.Entry<String, int[]>> keyList = new ArrayList<Map.Entry<String, int[]>>( + List<Map.Entry<String, int[]>> keyList = new ArrayList<>( profiler.counters.entrySet()); Comparator<Map.Entry<String, int[]>> c2 = new Comparator<Map.Entry<String, int[]>>() { @Override diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/Checksums.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/Checksums.java index 21a22f57be1..70143155075 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/Checksums.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/Checksums.java @@ -105,7 +105,7 @@ public class Checksums { */ public static Map<String, Object> createChecksumMap(IFile[] tus, MessageDigest md, IProgressMonitor pm) throws OperationCanceledException { - Map<String, Object> result = new HashMap<String, Object>(); + Map<String, Object> result = new HashMap<>(); putAlgorithm(result, md); pm.beginTask(Messages.Checksums_taskComputeChecksums, tus.length); for (IFile file : tus) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexUpdatePolicy.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexUpdatePolicy.java index dad14340d4f..4c0d54c62de 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexUpdatePolicy.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexUpdatePolicy.java @@ -32,9 +32,9 @@ public class IndexUpdatePolicy { private final ICProject fCProject; private int fKind; - private HashSet<ITranslationUnit> fForce = new HashSet<ITranslationUnit>(); - private HashSet<ITranslationUnit> fTimestamp = new HashSet<ITranslationUnit>(); - private HashSet<ITranslationUnit> fRemoved = new HashSet<ITranslationUnit>(); + private HashSet<ITranslationUnit> fForce = new HashSet<>(); + private HashSet<ITranslationUnit> fTimestamp = new HashSet<>(); + private HashSet<ITranslationUnit> fRemoved = new HashSet<>(); private IPDOMIndexer fIndexer; private boolean fReindexRequested; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/LanguageSettingsChangeListener.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/LanguageSettingsChangeListener.java index ed9dfd528e8..04ea3d69079 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/LanguageSettingsChangeListener.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/LanguageSettingsChangeListener.java @@ -71,7 +71,7 @@ public class LanguageSettingsChangeListener implements ILanguageSettingsChangeLi private void reindex(String cfgId, ILanguageSettingsChangeEvent event) { CModelManager manager = CModelManager.getDefault(); ICProject cProject = manager.getCModel().getCProject(event.getProjectName()); - Set<ICElement> tuSelection = new HashSet<ICElement>(); + Set<ICElement> tuSelection = new HashSet<>(); Set<IResource> resources = event.getAffectedResources(cfgId); if (resources != null && !resources.isEmpty()) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java index af60d35e886..3cdb615386e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java @@ -1581,7 +1581,7 @@ public class PDOM extends PlatformObject implements IPDOM { public void putCachedVariableResult(Long key, IValue result) { synchronized (fVariableResultCache) { - fVariableResultCache.put(key, new WeakReference<IValue>(result)); + fVariableResultCache.put(key, new WeakReference<>(result)); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMASTProcessorManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMASTProcessorManager.java index 1f5c4fb55c6..4877dd3340f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMASTProcessorManager.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMASTProcessorManager.java @@ -29,7 +29,7 @@ public class PDOMASTProcessorManager { private static final String EXTENSION_POINT = "PDOMASTProcessor"; //$NON-NLS-1$ - private static final List<PDOMASTProcessorDesc> processors = new ArrayList<PDOMASTProcessorDesc>(); + private static final List<PDOMASTProcessorDesc> processors = new ArrayList<>(); static { // Load the extensions IConfigurationElement[] elements = Platform.getExtensionRegistry() @@ -52,7 +52,7 @@ public class PDOMASTProcessorManager { IPDOMASTProcessor processor = desc.getProcessorFor(ast); if (processor != null) { if (list == null) - list = new ArrayList<IPDOMASTProcessor>(); + list = new ArrayList<>(); list.add(processor); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMProxy.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMProxy.java index 5db504904f9..b678934cb27 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMProxy.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMProxy.java @@ -49,12 +49,12 @@ import org.eclipse.core.runtime.IProgressMonitor; public class PDOMProxy implements IPDOM { private PDOM fDelegate; private int fReadLockCount; - private Set<IListener> fListeners = new HashSet<IListener>(); + private Set<IListener> fListeners = new HashSet<>(); private Map<Thread, DebugLockInfo> fLockDebugging; public PDOMProxy() { if (PDOM.sDEBUG_LOCKS) { - fLockDebugging = new HashMap<Thread, DebugLockInfo>(); + fLockDebugging = new HashMap<>(); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/TeamPDOMExportOperation.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/TeamPDOMExportOperation.java index 8a600e4c5e1..6b1a4c9686b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/TeamPDOMExportOperation.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/TeamPDOMExportOperation.java @@ -176,7 +176,7 @@ public class TeamPDOMExportOperation implements IWorkspaceRunnable { private void createChecksums(ICProject cproject, PDOM pdom, File target, IProgressMonitor monitor) throws CoreException { - HashSet<String> fullPaths = new HashSet<String>(); + HashSet<String> fullPaths = new HashSet<>(); try { pdom.acquireReadLock(); } catch (InterruptedException e) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WaitForRefreshJobs.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WaitForRefreshJobs.java index 8cacdff1a32..d9dbbc435ec 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WaitForRefreshJobs.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WaitForRefreshJobs.java @@ -29,7 +29,7 @@ import org.eclipse.core.runtime.jobs.Job; * Postpones indexer setup until there are no running refresh jobs. */ public class WaitForRefreshJobs extends IndexerSetupParticipant { - private Set<ICProject> fProjects = new HashSet<ICProject>(); + private Set<ICProject> fProjects = new HashSet<>(); private Set<Job> fRefreshJobs = Collections.synchronizedSet(new HashSet<Job>()); private IJobChangeListener fJobListener = new IJobChangeListener() { @@ -85,7 +85,7 @@ public class WaitForRefreshJobs extends IndexerSetupParticipant { if (isRefreshing()) return; projects = fProjects; - fProjects = new HashSet<ICProject>(); + fProjects = new HashSet<>(); } for (ICProject project : projects) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java index 6d95d6822ee..fd38a885dd9 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java @@ -215,7 +215,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment { * @throws CoreException */ public void rewriteLocations(final IIndexLocationConverter newConverter) throws CoreException { - final List<PDOMFile> pdomfiles = new ArrayList<PDOMFile>(); + final List<PDOMFile> pdomfiles = new ArrayList<>(); getFileIndex().accept(new IBTreeVisitor() { @Override public int compare(long record) throws CoreException { @@ -231,7 +231,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment { }); clearFileIndex(); - final List<PDOMFile> notConverted = new ArrayList<PDOMFile>(); + final List<PDOMFile> notConverted = new ArrayList<>(); for (PDOMFile file : pdomfiles) { String internalFormat = newConverter.toInternalFormat(file.getLocation()); if (internalFormat != null) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java index d154b94a61f..14672682e25 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java @@ -242,7 +242,7 @@ public class DBProperties { } public static Set<String> getKeySet(final Database db, final BTree index) throws CoreException { - final Set<String> result = new HashSet<String>(); + final Set<String> result = new HashSet<>(); index.accept(new IBTreeVisitor() { @Override public int compare(long record) throws CoreException { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/PDOMStringSet.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/PDOMStringSet.java index fe50f7cc582..df7caae07e3 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/PDOMStringSet.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/PDOMStringSet.java @@ -99,7 +99,7 @@ public class PDOMStringSet { NodeType.Item.put(db, new_node, record); if (lazyCache == null) - lazyCache = new HashMap<String, Long>(); + lazyCache = new HashMap<>(); lazyCache.put(str, record); // If the Database has already been partially searched, then the loaded pointer will be after the @@ -131,7 +131,7 @@ public class PDOMStringSet { // otherwise prepare the cache for the data that is about to be loaded if (lazyCache == null) - lazyCache = new HashMap<String, Long>(); + lazyCache = new HashMap<>(); // if nothing has been loaded, then start loading with the head node, otherwise continue // loading from whatever is after the last loaded node diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerCollector.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerCollector.java index 75f57112fab..0e79ad238b3 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerCollector.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerCollector.java @@ -38,7 +38,7 @@ public final class MacroContainerCollector implements IBTreeVisitor { private IProgressMonitor monitor = null; private int monitorCheckCounter = 0; - private List<PDOMMacroContainer> macros = new ArrayList<PDOMMacroContainer>(); + private List<PDOMMacroContainer> macros = new ArrayList<>(); /** * Collects all nodes with given name, passing the filter. If prefixLookup is set to diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerPatternCollector.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerPatternCollector.java index 3f3bd84f67d..e3a6abfd7e5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerPatternCollector.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerPatternCollector.java @@ -29,7 +29,7 @@ import org.eclipse.core.runtime.OperationCanceledException; public final class MacroContainerPatternCollector implements IBTreeVisitor { private final PDOMLinkage fLinkage; - private final List<PDOMMacroContainer> macros = new ArrayList<PDOMMacroContainer>(); + private final List<PDOMMacroContainer> macros = new ArrayList<>(); private final Pattern fPattern; private final IProgressMonitor fMonitor; private int fMonitorCheckCounter = 0; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java index 0c7ea7d0aaf..fa841dd5ace 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java @@ -476,7 +476,7 @@ public class PDOMFile implements IIndexFragmentFile { assert getFirstName() == null; assert getFirstMacroReference() == null; final PDOMLinkage linkage = getLinkage(); - HashMap<IASTName, PDOMName> nameCache = new HashMap<IASTName, PDOMName>(); + HashMap<IASTName, PDOMName> nameCache = new HashMap<>(); PDOMName lastName = null; PDOMMacroReferenceName lastMacroName = null; for (IASTName[] name : names) { @@ -592,7 +592,7 @@ public class PDOMFile implements IIndexFragmentFile { setFirstMacro(null); // Delete all the names in this file - ArrayList<PDOMName> names = new ArrayList<PDOMName>(); + ArrayList<PDOMName> names = new ArrayList<>(); PDOMName name = getFirstName(); while (name != null) { names.add(name); @@ -606,7 +606,7 @@ public class PDOMFile implements IIndexFragmentFile { setFirstName(null); // Delete all macro references - ArrayList<PDOMMacroReferenceName> mrefs = new ArrayList<PDOMMacroReferenceName>(); + ArrayList<PDOMMacroReferenceName> mrefs = new ArrayList<>(); PDOMMacroReferenceName mref = getFirstMacroReference(); while (mref != null) { mrefs.add(mref); @@ -684,7 +684,7 @@ public class PDOMFile implements IIndexFragmentFile { @Override public IIndexInclude[] getIncludes() throws CoreException { - List<PDOMInclude> result = new ArrayList<PDOMInclude>(); + List<PDOMInclude> result = new ArrayList<>(); PDOMInclude include = getFirstInclude(); while (include != null) { result.add(include); @@ -706,7 +706,7 @@ public class PDOMFile implements IIndexFragmentFile { @Override public IIndexMacro[] getMacros() throws CoreException { - List<PDOMMacro> result = new ArrayList<PDOMMacro>(); + List<PDOMMacro> result = new ArrayList<>(); PDOMMacro macro = getFirstMacro(); while (macro != null) { result.add(macro); @@ -722,7 +722,7 @@ public class PDOMFile implements IIndexFragmentFile { @Override public IIndexName[] findNames(int offset, int length) throws CoreException { - ArrayList<IIndexName> result = new ArrayList<IIndexName>(); + ArrayList<IIndexName> result = new ArrayList<>(); for (PDOMName name = getFirstName(); name != null; name = name.getNextInFile()) { int nameOffset = name.getNodeOffset(); if (nameOffset >= offset) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java index ea02592d4c8..170f025f470 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java @@ -440,7 +440,7 @@ public abstract class PDOMLinkage extends PDOMNamedNode implements IIndexLinkage .getCachedResult(key); CharArrayMap<PDOMBinding[]> map = cached == null ? null : cached.get(); if (map == null) { - map = new CharArrayMap<PDOMBinding[]>(); + map = new CharArrayMap<>(); pdom.putCachedResult(key, new SoftReference<CharArrayMap<?>>(map)); } return map; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCEnumeration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCEnumeration.java index da1f2588880..df26b63665a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCEnumeration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCEnumeration.java @@ -104,13 +104,13 @@ class PDOMCEnumeration extends PDOMBinding implements IEnumeration, IIndexType, if (result == null && create) { // there is no cache, build it: result = loadEnumerators(); - pdom.putCachedResult(key, new SoftReference<List<PDOMCEnumerator>>(result)); + pdom.putCachedResult(key, new SoftReference<>(result)); } return result; } private List<PDOMCEnumerator> loadEnumerators() { - final ArrayList<PDOMCEnumerator> result = new ArrayList<PDOMCEnumerator>(); + final ArrayList<PDOMCEnumerator> result = new ArrayList<>(); try { PDOMNodeLinkedList list = new PDOMNodeLinkedList(getLinkage(), record + OFFSET_ENUMERATOR_LIST); list.accept(new IPDOMVisitor() { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java index b1a7f443859..1cb22a003c7 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java @@ -219,7 +219,7 @@ public class PDOMCPPClassTemplate extends PDOMCPPClassType @Override public ICPPClassTemplatePartialSpecialization[] getPartialSpecializations() { try { - ArrayList<PDOMCPPClassTemplatePartialSpecialization> partials = new ArrayList<PDOMCPPClassTemplatePartialSpecialization>(); + ArrayList<PDOMCPPClassTemplatePartialSpecialization> partials = new ArrayList<>(); for (PDOMCPPClassTemplatePartialSpecialization partial = getFirstPartial(); partial != null; partial = partial .getNextPartial()) { partials.add(partial); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumScope.java index 4c8a6eea309..3dca8c8e21c 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumScope.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumScope.java @@ -88,7 +88,7 @@ class PDOMCPPEnumScope implements ICPPEnumScope, IIndexScope { try { CharArrayObjectMap<IPDOMCPPEnumerator> map = getBindingMap(fBinding); if (lookup.isPrefixLookup()) { - final List<IBinding> result = new ArrayList<IBinding>(); + final List<IBinding> result = new ArrayList<>(); final char[] nc = lookup.getLookupKey(); IContentAssistMatcher matcher = ContentAssistMatcherFactory.getInstance().createMatcher(nc); for (char[] key : map.keys()) { @@ -187,7 +187,7 @@ class PDOMCPPEnumScope implements ICPPEnumScope, IIndexScope { // loses the order. List<IPDOMCPPEnumerator> enumerators = new ArrayList<>(); enumType.loadEnumerators(enumerators); - List<IEnumerator> result = new ArrayList<IEnumerator>(); + List<IEnumerator> result = new ArrayList<>(); for (IEnumerator value : enumerators) { if (IndexFilter.ALL_DECLARED.acceptBinding(value)) { result.add(value); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java index d3d099b6034..4752e5e0ab5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java @@ -196,7 +196,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants { private final static int RECORD_SIZE = FIRST_NAMESPACE_CHILD_OFFSET + Database.PTR_SIZE; // Only used when writing to database, which is single-threaded - private final LinkedList<Runnable> postProcesses = new LinkedList<Runnable>(); + private final LinkedList<Runnable> postProcesses = new LinkedList<>(); public PDOMCPPLinkage(PDOM pdom, long record) { super(pdom, record); @@ -1533,7 +1533,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants { if (rec == 0) { return ICPPUsingDirective.EMPTY_ARRAY; } - LinkedList<ICPPUsingDirective> uds = new LinkedList<ICPPUsingDirective>(); + LinkedList<ICPPUsingDirective> uds = new LinkedList<>(); do { PDOMCPPUsingDirective ud = new PDOMCPPUsingDirective(this, rec); uds.addFirst(ud); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDeclarationSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDeclarationSpecialization.java index 9baaef0f319..0460b2c70d3 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDeclarationSpecialization.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDeclarationSpecialization.java @@ -43,7 +43,7 @@ class PDOMCPPUsingDeclarationSpecialization extends PDOMCPPSpecialization implem PDOMBinding specialized) throws CoreException { super(linkage, parent, (ICPPSpecialization) using, specialized); - Set<PDOMBinding> targets = new LinkedHashSet<PDOMBinding>(); + Set<PDOMBinding> targets = new LinkedHashSet<>(); PDOMNodeLinkedList list = new PDOMNodeLinkedList(getLinkage(), record + TARGET_BINDINGS); for (IBinding delegate : using.getDelegates()) { PDOMBinding target = getLinkage().adaptBinding(delegate); @@ -71,7 +71,7 @@ class PDOMCPPUsingDeclarationSpecialization extends PDOMCPPSpecialization implem public IBinding[] getDelegates() { if (delegates == null) { PDOMNodeLinkedList list = new PDOMNodeLinkedList(getLinkage(), record + TARGET_BINDINGS); - final List<IBinding> result = new ArrayList<IBinding>(); + final List<IBinding> result = new ArrayList<>(); try { list.accept(new IPDOMVisitor() { @Override diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/CLIUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/CLIUtil.java index fd11cfcfeed..fb4e8167288 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/CLIUtil.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/CLIUtil.java @@ -54,7 +54,7 @@ public class CLIUtil { * Returns a map of String option to List of String parameters. */ public static Map<String, List<String>> parseToMap(String[] args) { - Map<String, List<String>> result = new HashMap<String, List<String>>(); + Map<String, List<String>> result = new HashMap<>(); String current = null; for (String arg : args) { if (arg.startsWith("-")) { //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOMApplication.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOMApplication.java index a9942840597..91b1f2ab80d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOMApplication.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOMApplication.java @@ -182,7 +182,7 @@ public class GeneratePDOMApplication implements IApplication { */ private static synchronized IExportProjectProvider getExportProjectProvider(String fqn) { if (projectInitializers == null) { - projectInitializers = new HashMap<String, IExportProjectProvider>(); + projectInitializers = new HashMap<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint indexExtensions = registry.getExtensionPoint(CCorePlugin.INDEX_UNIQ_ID); IExtension[] extensions = indexExtensions.getExtensions(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/DeltaAnalyzer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/DeltaAnalyzer.java index 2af7bbe956d..76999c465d9 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/DeltaAnalyzer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/DeltaAnalyzer.java @@ -30,9 +30,9 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.NullProgressMonitor; public class DeltaAnalyzer { - private final List<ITranslationUnit> fForce = new ArrayList<ITranslationUnit>(); - private final List<ITranslationUnit> fChanged = new ArrayList<ITranslationUnit>(); - private final List<ITranslationUnit> fRemoved = new ArrayList<ITranslationUnit>(); + private final List<ITranslationUnit> fForce = new ArrayList<>(); + private final List<ITranslationUnit> fChanged = new ArrayList<>(); + private final List<ITranslationUnit> fRemoved = new ArrayList<>(); // For testing purposes, only. public static boolean sSuppressPotentialTUs = false; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerASTVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerASTVisitor.java index d825be11530..a6f73f930c8 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerASTVisitor.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerASTVisitor.java @@ -91,8 +91,8 @@ abstract public class IndexerASTVisitor extends ASTVisitor { private IASTName fDefinitionName; private IASTNode fDefinitionNode; - private ArrayList<Definition> fStack = new ArrayList<Definition>(); - private ArrayList<IASTProblem> fProblems = new ArrayList<IASTProblem>(); + private ArrayList<Definition> fStack = new ArrayList<>(); + private ArrayList<IASTProblem> fProblems = new ArrayList<>(); public IndexerASTVisitor(boolean visitImplicitNames) { shouldVisitNames = true; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMUpdateTask.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMUpdateTask.java index 96104d923bc..f96164e0f7b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMUpdateTask.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMUpdateTask.java @@ -99,7 +99,7 @@ public class PDOMUpdateTask implements IPDOMIndexerTask { private void createDelegate(ICProject project, IProgressMonitor monitor) throws CoreException, InterruptedException { - HashSet<ITranslationUnit> set = new HashSet<ITranslationUnit>(); + HashSet<ITranslationUnit> set = new HashSet<>(); if ((fUpdateOptions & (IIndexManager.UPDATE_ALL | IIndexManager.UPDATE_CHECK_TIMESTAMPS)) != 0) { TranslationUnitCollector collector = new TranslationUnitCollector(set, set, monitor); boolean haveProject = false; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerIncludeResolutionHeuristics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerIncludeResolutionHeuristics.java index cdcfb6c8689..685e482daea 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerIncludeResolutionHeuristics.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerIncludeResolutionHeuristics.java @@ -109,12 +109,12 @@ public class ProjectIndexerIncludeResolutionHeuristics implements IIncludeFileRe } private IProject[] getOpenReferencedProjects(IProject prj) { - Set<IProject> result = new HashSet<IProject>(); + Set<IProject> result = new HashSet<>(); if (prj.isOpen()) { result.add(prj); - List<IProject> projectsToSearch = new ArrayList<IProject>(); + List<IProject> projectsToSearch = new ArrayList<>(); projectsToSearch.add(prj); for (int i = 0; i < projectsToSearch.size(); i++) { IProject project = projectsToSearch.get(i); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerInputAdapter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerInputAdapter.java index 0e4c1f06e06..3e199f69eea 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerInputAdapter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerInputAdapter.java @@ -69,7 +69,7 @@ public class ProjectIndexerInputAdapter extends IndexerInputAdapter { fCProject = cproject; fProjectPrefix = cproject.getProject().getFullPath().toString() + IPath.SEPARATOR; if (useCache) { - fIflCache = new HashMap<String, IIndexFileLocation>(); + fIflCache = new HashMap<>(); fExistsCache = new FileExistsCache(isCaseInsensitiveFileSystem()); } else { fIflCache = null; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/tag/PDOMTagIndex.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/tag/PDOMTagIndex.java index 05f9f9a3267..458cbc26520 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/tag/PDOMTagIndex.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/tag/PDOMTagIndex.java @@ -156,7 +156,7 @@ public class PDOMTagIndex { } final Long bindingRecord = Long.valueOf(binding_record); - return new BTreeIterable<ITag>(btree, new BTreeIterable.Descriptor<ITag>() { + return new BTreeIterable<>(btree, new BTreeIterable.Descriptor<ITag>() { @Override public ITag create(long record) { return new PDOMTag(db, record); @@ -179,7 +179,7 @@ public class PDOMTagIndex { // record. In each case we decide whether to delete or update the tag. Tags of the same size can be // updated in place, otherwise the tag needs to be deleted and recreated. - final Map<String, ITag> newTags = new HashMap<String, ITag>(); + final Map<String, ITag> newTags = new HashMap<>(); for (ITag tag : tags) { ITag dupTag = newTags.put(tag.getTaggerId(), tag); if (dupTag != null) diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java index 6c3d73e9d5c..88c19f5b954 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java @@ -104,7 +104,7 @@ public class CProjectNature implements IProjectNature { public static void removeNature(IProject project, String natureId, IProgressMonitor monitor) throws CoreException { IProjectDescription description = project.getDescription(); String[] prevNatures = description.getNatureIds(); - List<String> newNatures = new ArrayList<String>(Arrays.asList(prevNatures)); + List<String> newNatures = new ArrayList<>(Arrays.asList(prevNatures)); newNatures.remove(natureId); description.setNatureIds(newNatures.toArray(new String[newNatures.size()])); project.setDescription(description, monitor); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java index 3cdc4ce91ae..1ef74605d05 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java @@ -170,8 +170,8 @@ public class ErrorParserManager extends OutputStream implements IConsoleParser, String[] parsersIDs) { fProject = project; fMarkerGenerator = markerGenerator; - fDirectoryStack = new Vector<URI>(); - fErrors = new ArrayList<ProblemMarkerInfo>(); + fDirectoryStack = new Vector<>(); + fErrors = new ArrayList<>(); enableErrorParsers(parsersIDs); if (baseDirectoryURI != null) { @@ -187,7 +187,7 @@ public class ErrorParserManager extends OutputStream implements IConsoleParser, if (parserIDs == null) { parserIDs = ErrorParserExtensionManager.getDefaultErrorParserIds(); } - fErrorParsers = new LinkedHashMap<String, IErrorParser[]>(parserIDs.length); + fErrorParsers = new LinkedHashMap<>(parserIDs.length); for (String parsersID : parserIDs) { IErrorParser errorParser = getErrorParserCopy(parsersID); if (errorParser != null) { diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ProblemMarkerInfo.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ProblemMarkerInfo.java index f77671bca69..25f39c36ffb 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ProblemMarkerInfo.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ProblemMarkerInfo.java @@ -95,7 +95,7 @@ public class ProblemMarkerInfo { this.variableName = variableName; this.externalPath = null; this.type = null; - this.attributes = new HashMap<String, String>(); + this.attributes = new HashMap<>(); this.startChar = startChar; this.endChar = endChar; } diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java index 3b5d4f9a808..5dcb30c83b9 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java @@ -738,7 +738,7 @@ public abstract class CBuildConfiguration extends PlatformObject implements ICBu } IMacroEntry[] macros = CoreModel.getMacroEntries(resPath); - Map<String, String> symbolMap = new HashMap<String, String>(); + Map<String, String> symbolMap = new HashMap<>(); for (int i = 0; i < macros.length; ++i) { symbolMap.put(macros[i].getMacroName(), macros[i].getMacroValue()); } diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/errorparsers/RegexErrorParser.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/errorparsers/RegexErrorParser.java index 477e9f22149..10a6386ca38 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/errorparsers/RegexErrorParser.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/errorparsers/RegexErrorParser.java @@ -37,7 +37,7 @@ import org.eclipse.cdt.core.IErrorParserNamed; public class RegexErrorParser implements IErrorParserNamed { private String fId; private String fName; - private final List<RegexErrorPattern> fPatterns = new ArrayList<RegexErrorPattern>(); + private final List<RegexErrorPattern> fPatterns = new ArrayList<>(); /** * Default constructor will initialize the error parser with the name of the class diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/CodeFormatterApplication.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/CodeFormatterApplication.java index 96b1ec4b5aa..e42880cca75 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/CodeFormatterApplication.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/CodeFormatterApplication.java @@ -149,7 +149,7 @@ public class CodeFormatterApplication implements IApplication { private File[] processCommandLine(String[] argsArray) { - ArrayList<String> args = new ArrayList<String>(); + ArrayList<String> args = new ArrayList<>(); for (int i = 0, max = argsArray.length; i < max; i++) { args.add(argsArray[i]); } @@ -161,7 +161,7 @@ public class CodeFormatterApplication implements IApplication { int mode = DEFAULT_MODE; - ArrayList<File> filesToFormat = new ArrayList<File>(); + ArrayList<File> filesToFormat = new ArrayList<>(); loop: while (index < argCount) { String currentArg = argsArray[index++]; diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/DefaultCodeFormatterOptions.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/DefaultCodeFormatterOptions.java index 5cbcf5f1427..6aac8f17204 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/DefaultCodeFormatterOptions.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/DefaultCodeFormatterOptions.java @@ -281,7 +281,7 @@ public class DefaultCodeFormatterOptions { } public Map<String, String> getMap() { - Map<String, String> options = new HashMap<String, String>(); + Map<String, String> options = new HashMap<>(); // options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION, getAlignment(this.alignment_for_arguments_in_allocation_expression)); options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION, getAlignment(this.alignment_for_arguments_in_method_invocation)); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/IndentManipulation.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/IndentManipulation.java index 38d13264d09..4a6c3d17e29 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/IndentManipulation.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/IndentManipulation.java @@ -330,7 +330,7 @@ public final class IndentManipulation { throw new IllegalArgumentException(); } - ArrayList<ReplaceEdit> result = new ArrayList<ReplaceEdit>(); + ArrayList<ReplaceEdit> result = new ArrayList<>(); try { ILineTracker tracker = new DefaultLineTracker(); tracker.set(source); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/RefreshExclusion.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/RefreshExclusion.java index c9f166b65e7..c862461de0d 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/RefreshExclusion.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/RefreshExclusion.java @@ -56,7 +56,7 @@ public abstract class RefreshExclusion implements Cloneable { RefreshExclusion parentExclusion, IResource parentResource, RefreshScopeManager manager) throws CoreException { - List<RefreshExclusion> exclusions = new LinkedList<RefreshExclusion>(); + List<RefreshExclusion> exclusions = new LinkedList<>(); // the parent element might contain any number of exclusions... iterate through the list ICStorageElement[] children = parentElement.getChildren(); @@ -138,9 +138,9 @@ public abstract class RefreshExclusion implements Cloneable { } protected String fContributorId = ""; //$NON-NLS-1$ - protected List<ExclusionInstance> fExclusionInstanceList = new LinkedList<ExclusionInstance>(); + protected List<ExclusionInstance> fExclusionInstanceList = new LinkedList<>(); protected ExclusionType fExclusionType = ExclusionType.RESOURCE; - protected List<RefreshExclusion> fNestedExclusions = new LinkedList<RefreshExclusion>(); + protected List<RefreshExclusion> fNestedExclusions = new LinkedList<>(); protected RefreshExclusion fParentExclusion; diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/RefreshScopeManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/RefreshScopeManager.java index ce6d3e2c245..481f6ec19df 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/RefreshScopeManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/RefreshScopeManager.java @@ -105,7 +105,7 @@ public class RefreshScopeManager { private int fVersion = 2; private RefreshScopeManager() { - fClassnameToExclusionFactoryMap = new HashMap<String, RefreshExclusionFactory>(); + fClassnameToExclusionFactoryMap = new HashMap<>(); loadExtensions(); try { loadSettings(); @@ -184,7 +184,7 @@ public class RefreshScopeManager { List<RefreshExclusion> exclusions = resourceMap.get(resource); if (exclusions == null) { - exclusions = new LinkedList<RefreshExclusion>(); + exclusions = new LinkedList<>(); resourceMap.put(resource, exclusions); } @@ -201,7 +201,7 @@ public class RefreshScopeManager { if (!resourceMap.containsKey(resource)) { // create a new one: - LinkedList<RefreshExclusion> exclusions = new LinkedList<RefreshExclusion>(); + LinkedList<RefreshExclusion> exclusions = new LinkedList<>(); resourceMap.put(resource, exclusions); } } @@ -283,7 +283,7 @@ public class RefreshScopeManager { HashMap<IResource, List<RefreshExclusion>> resourceMap = configMap.get(configName); if (resourceMap == null) { - resourceMap = new HashMap<IResource, List<RefreshExclusion>>(); + resourceMap = new HashMap<>(); if (!fIsLoading) resourceMap.put(project, new LinkedList<RefreshExclusion>()); configMap.put(configName, resourceMap); @@ -311,7 +311,7 @@ public class RefreshScopeManager { private HashMap<IProject, HashMap<String, HashMap<IResource, List<RefreshExclusion>>>> getProjectToConfigurationToResourcesMap() { if (fProjToConfToResToExcluMap == null) { - fProjToConfToResToExcluMap = new HashMap<IProject, HashMap<String, HashMap<IResource, List<RefreshExclusion>>>>(); + fProjToConfToResToExcluMap = new HashMap<>(); } return fProjToConfToResToExcluMap; @@ -397,11 +397,11 @@ public class RefreshScopeManager { ICProjectDescription projectDescription = descriptionManager.getProjectDescription(project, false); if (projectDescription == null && resourceMap.keySet().isEmpty()) { //return project itself as the default to refresh - ArrayList<IResource> resources = new ArrayList<IResource>(); + ArrayList<IResource> resources = new ArrayList<>(); resources.add(project); return resources; } - return new ArrayList<IResource>(resourceMap.keySet()); + return new ArrayList<>(resourceMap.keySet()); } public int getVersion() { @@ -517,7 +517,7 @@ public class RefreshScopeManager { private void initializeConfigMap(IProject project) { - HashMap<String, HashMap<IResource, List<RefreshExclusion>>> configMap = new HashMap<String, HashMap<IResource, List<RefreshExclusion>>>(); + HashMap<String, HashMap<IResource, List<RefreshExclusion>>> configMap = new HashMap<>(); // for each build configuration CProjectDescriptionManager descriptionManager = CProjectDescriptionManager.getInstance(); @@ -527,7 +527,7 @@ public class RefreshScopeManager { ICConfigurationDescription cfgDescs[] = projectDescription.getConfigurations(); for (ICConfigurationDescription cfgDesc : cfgDescs) { String configName = cfgDesc.getName(); - HashMap<IResource, List<RefreshExclusion>> resourceMap = new HashMap<IResource, List<RefreshExclusion>>(); + HashMap<IResource, List<RefreshExclusion>> resourceMap = new HashMap<>(); if (!fIsLoading || fIsNewProject) //config settings could be loading and detects a new project and if so, add the default refresh setting resourceMap.put(project, new LinkedList<RefreshExclusion>()); configMap.put(configName, resourceMap); @@ -712,7 +712,7 @@ public class RefreshScopeManager { HashMap<IResource, List<RefreshExclusion>> resourceMap = getResourcesToExclusionsMap(project, configName); List<RefreshExclusion> exclusions = resourceMap.get(resource); if (exclusions == null) { - exclusions = new LinkedList<RefreshExclusion>(); + exclusions = new LinkedList<>(); resourceMap.put(resource, exclusions); } @@ -725,7 +725,7 @@ public class RefreshScopeManager { public synchronized void setExclusions(IProject project, String configName, IResource resource, List<RefreshExclusion> newExclusions) { HashMap<IResource, List<RefreshExclusion>> resourceMap = getResourcesToExclusionsMap(project, configName); - List<RefreshExclusion> exclusions = new LinkedList<RefreshExclusion>(newExclusions); + List<RefreshExclusion> exclusions = new LinkedList<>(newExclusions); resourceMap.put(resource, exclusions); } @@ -739,7 +739,7 @@ public class RefreshScopeManager { List<RefreshExclusion> exclusions = resourceMap.get(resource); if (exclusions == null) { - exclusions = new LinkedList<RefreshExclusion>(); + exclusions = new LinkedList<>(); resourceMap.put(resource, exclusions); } @@ -759,7 +759,7 @@ public class RefreshScopeManager { while (resource_iterator.hasNext()) { IResource source_resource = resource_iterator.next(); List<RefreshExclusion> source_exclusions = source_resourceMap.get(source_resource); - List<RefreshExclusion> target_exclusions = new LinkedList<RefreshExclusion>(); + List<RefreshExclusion> target_exclusions = new LinkedList<>(); for (RefreshExclusion exclusion : source_exclusions) { target_exclusions.add(exclusion); } diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ScannerProvider.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ScannerProvider.java index 230eefce895..1780b3bbd0a 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ScannerProvider.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ScannerProvider.java @@ -70,7 +70,7 @@ public class ScannerProvider extends AbstractCExtension implements IScannerInfoP */ private static Map<IProject, List<IScannerInfoChangeListener>> getListeners() { if (listeners == null) { - listeners = new HashMap<IProject, List<IScannerInfoChangeListener>>(); + listeners = new HashMap<>(); } return listeners; } @@ -131,7 +131,7 @@ public class ScannerProvider extends AbstractCExtension implements IScannerInfoP // get the macros IMacroEntry[] macros = CoreModel.getMacroEntries(resPath); - Map<String, String> symbolMap = new HashMap<String, String>(); + Map<String, String> symbolMap = new HashMap<>(); for (int i = 0; i < macros.length; ++i) { symbolMap.put(macros[i].getMacroName(), macros[i].getMacroValue()); } @@ -166,7 +166,7 @@ public class ScannerProvider extends AbstractCExtension implements IScannerInfoP List<IScannerInfoChangeListener> list = map.get(project); if (list == null) { // Create a new list - list = new ArrayList<IScannerInfoChangeListener>(); + list = new ArrayList<>(); map.put(project, list); } if (!list.contains(listener)) { diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/BuildRunnerHelper.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/BuildRunnerHelper.java index e39e9f28345..2ccbdb5c9f4 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/BuildRunnerHelper.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/BuildRunnerHelper.java @@ -148,7 +148,7 @@ public class BuildRunnerHelper implements Closeable { // stdout/stderr get to the console through ErrorParserManager errorParserManager.setOutputStream(consoleOut); - List<IConsoleParser> parsers = new ArrayList<IConsoleParser>(); + List<IConsoleParser> parsers = new ArrayList<>(); // Using ErrorParserManager as console parser helps to avoid intermixing buffered streams // as ConsoleOutputSniffer waits for EOL to send a line to console parsers // separately for each stream. @@ -217,7 +217,7 @@ public class BuildRunnerHelper implements Closeable { IMarker[] markers = workspace.getRoot().findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE); String projectName = project.getName(); - List<IMarker> markersList = new ArrayList<IMarker>(); + List<IMarker> markersList = new ArrayList<>(); for (IMarker marker : markers) { if (projectName.equals(marker.getAttribute(IMarker.SOURCE_ID))) { markersList.add(marker); @@ -560,7 +560,7 @@ public class BuildRunnerHelper implements Closeable { */ public static String[] envMapToEnvp(Map<String, String> envMap) { // Convert into envp strings - List<String> strings = new ArrayList<String>(envMap.size()); + List<String> strings = new ArrayList<>(envMap.size()); for (Entry<String, String> entry : envMap.entrySet()) { strings.add(entry.getKey() + '=' + entry.getValue()); } @@ -579,7 +579,7 @@ public class BuildRunnerHelper implements Closeable { IEnvironmentVariableManager mngr = CCorePlugin.getDefault().getBuildEnvironmentManager(); IEnvironmentVariable[] vars = mngr.getVariables(cfgDescription, true); // Convert into envp strings - List<String> strings = new ArrayList<String>(vars.length); + List<String> strings = new ArrayList<>(vars.length); for (IEnvironmentVariable var : vars) { strings.add(var.getName() + '=' + var.getValue()); } diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptor.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptor.java index 6ea6dd48ec5..26ff058b1fc 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptor.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptor.java @@ -91,7 +91,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor { /** Map: storageModule ID -> ICStorageElement <br/> * CDescriptor's map of so far uncommited storage elements. */ - private final Map<String, SynchronizedStorageElement> fStorageDataElMap = new HashMap<String, SynchronizedStorageElement>(); + private final Map<String, SynchronizedStorageElement> fStorageDataElMap = new HashMap<>(); private volatile boolean fIsDirty; /** Current CDescriptor Event which tracks changes between operationStart & operationStop */ private CDescriptorEvent fOpEvent; @@ -379,7 +379,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor { public ICExtensionReference[] get(String extensionPoint) { try { fLock.acquire(); - LinkedHashSet<ICExtensionReference> extRefs = new LinkedHashSet<ICExtensionReference>(); + LinkedHashSet<ICExtensionReference> extRefs = new LinkedHashSet<>(); // Add the ICConfigExtensionReferences for the current configuration description for (ICConfigExtensionReference cfgRes : fCfgDes.get(extensionPoint)) diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptorManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptorManager.java index dc6311be7f8..b1384ea1909 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptorManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptorManager.java @@ -86,13 +86,13 @@ final public class CConfigBasedDescriptorManager implements ICDescriptorManager private static volatile Map<String, COwnerConfiguration> fOwnerConfigMap; private volatile static ICProjectDescriptionListener fDescriptionListener; - private Collection<ICDescriptorListener> fListeners = new CopyOnWriteArraySet<ICDescriptorListener>(); + private Collection<ICDescriptorListener> fListeners = new CopyOnWriteArraySet<>(); /** Map: IProjet -> CConfigBasedDescriptor weak reference <br /> * Multiple threads operating concurrently will get the same shared * ICDescriptor, however we don't keep a reference to this for longer * than is necessary.*/ - final ConcurrentHashMap<IProject, Reference<CConfigBasedDescriptor>> fProjectDescriptorMap = new ConcurrentHashMap<IProject, Reference<CConfigBasedDescriptor>>(); + final ConcurrentHashMap<IProject, Reference<CConfigBasedDescriptor>> fProjectDescriptorMap = new ConcurrentHashMap<>(); private CConfigBasedDescriptorManager() { } @@ -363,21 +363,21 @@ final public class CConfigBasedDescriptorManager implements ICDescriptorManager dr = loadDescriptor(des); // Use the ConcurrentHashMap to ensure that only one descriptor is live at a time (for a given project...) - ref = fProjectDescriptorMap.putIfAbsent(project, new SoftReference<CConfigBasedDescriptor>(dr)); + ref = fProjectDescriptorMap.putIfAbsent(project, new SoftReference<>(dr)); if (ref != null) { // Someone was here before us... CConfigBasedDescriptor dr1 = ref.get(); if (dr1 != null) return dr1; synchronized (this) { - ref = fProjectDescriptorMap.putIfAbsent(project, new SoftReference<CConfigBasedDescriptor>(dr)); + ref = fProjectDescriptorMap.putIfAbsent(project, new SoftReference<>(dr)); if (ref != null) { // Someone was here before us... dr1 = ref.get(); if (dr1 != null) return dr1; } - fProjectDescriptorMap.put(project, new SoftReference<CConfigBasedDescriptor>(dr)); + fProjectDescriptorMap.put(project, new SoftReference<>(dr)); } } } finally { @@ -449,7 +449,7 @@ final public class CConfigBasedDescriptorManager implements ICDescriptorManager private static void initializeOwnerConfiguration() { IExtensionPoint extpoint = Platform.getExtensionRegistry().getExtensionPoint(CCorePlugin.PLUGIN_ID, "CProject"); //$NON-NLS-1$ IExtension extension[] = extpoint.getExtensions(); - fOwnerConfigMap = new HashMap<String, COwnerConfiguration>(extension.length); + fOwnerConfigMap = new HashMap<>(extension.length); for (int i = 0; i < extension.length; i++) { IConfigurationElement element[] = extension[i].getConfigurationElements(); for (int j = 0; j < element.length; j++) { diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionInfo.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionInfo.java index 73d925ebb57..f78c5a52d9a 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionInfo.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionInfo.java @@ -17,7 +17,7 @@ import java.util.HashMap; public class CExtensionInfo { - protected HashMap<String, String> attribMap = new HashMap<String, String>(4); + protected HashMap<String, String> attribMap = new HashMap<>(4); public CExtensionInfo() { diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CdtVarPathEntryVariableManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CdtVarPathEntryVariableManager.java index 912e7f1ad72..d356b74b9f2 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CdtVarPathEntryVariableManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CdtVarPathEntryVariableManager.java @@ -96,7 +96,7 @@ public class CdtVarPathEntryVariableManager implements IPathEntryVariableManager @Override public ICdtVariable[] getVariables(IVariableContextInfo context) { ICdtVariable vars[] = fUserVarSupplier.getMacros(ICoreVariableContextInfo.CONTEXT_WORKSPACE, null); - List<ICdtVariable> list = new ArrayList<ICdtVariable>(); + List<ICdtVariable> list = new ArrayList<>(); for (ICdtVariable var : vars) { if (getVariablePath(var) != null) list.add(var); @@ -157,7 +157,7 @@ public class CdtVarPathEntryVariableManager implements IPathEntryVariableManager @Override public String[] getVariableNames() { ICdtVariable[] vars = fUserVarSupplier.getMacros(ICoreVariableContextInfo.CONTEXT_WORKSPACE, null); - ArrayList<String> list = new ArrayList<String>(); + ArrayList<String> list = new ArrayList<>(); for (int i = 0; i > vars.length; i++) { if (getVariablePath(vars[i]) != null) list.add(vars[i].getName()); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerManager.java index 850bfa69c6b..c5816cf25c4 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerManager.java @@ -55,7 +55,7 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf private HashMap<Object, PositionTrackerChain> fPositionTrackerMap; private PositionTrackerManager() { - fPositionTrackerMap = new HashMap<Object, PositionTrackerChain>(); + fPositionTrackerMap = new HashMap<>(); } public synchronized void install() { @@ -176,7 +176,7 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf fMemoryCounter += chain.getMemorySize(); } if (fMemoryCounter > MAX_MEMORY_AFTER_CLEANUP) { - SortedMap<Long, List<PositionTrackerChain>> map = new TreeMap<Long, List<PositionTrackerChain>>(); + SortedMap<Long, List<PositionTrackerChain>> map = new TreeMap<>(); for (Iterator<PositionTrackerChain> iter = fPositionTrackerMap.values().iterator(); iter.hasNext();) { PositionTrackerChain chain = iter.next(); addChain(map, chain); @@ -202,7 +202,7 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf Long lor = Long.valueOf(or); List<PositionTrackerChain> list = map.get(lor); if (list == null) { - list = new LinkedList<PositionTrackerChain>(); + list = new LinkedList<>(); map.put(lor, list); } list.add(chain); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/ProblemMarkerFilterManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/ProblemMarkerFilterManager.java index 17dd81075d8..c5a2ee0c3fc 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/ProblemMarkerFilterManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/ProblemMarkerFilterManager.java @@ -47,13 +47,13 @@ public class ProblemMarkerFilterManager { /** * List of all executable extension registered in Extension Registry */ - private final List<ProblemMarkerFilterDesc> filters = new ArrayList<ProblemMarkerFilterDesc>(); + private final List<ProblemMarkerFilterDesc> filters = new ArrayList<>(); /** * Cache of active filters for known projects. * This cache allow to skip evaluation of enablementExpression for every marker. */ - private final Map<IProject, List<ProblemMarkerFilterDesc>> filtersCache = new WeakHashMap<IProject, List<ProblemMarkerFilterDesc>>(); + private final Map<IProject, List<ProblemMarkerFilterDesc>> filtersCache = new WeakHashMap<>(); /** * Last Problem Marker that was accepted. @@ -131,7 +131,7 @@ public class ProblemMarkerFilterManager { synchronized (filtersCache) { List<ProblemMarkerFilterDesc> result = filtersCache.get(project); if (result == null) { - result = new ArrayList<ProblemMarkerFilterDesc>(); + result = new ArrayList<>(); for (ProblemMarkerFilterDesc filterDesc : filters) { if (filterDesc.matches(project)) { result.add(filterDesc); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/EclipseVariablesVariableSupplier.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/EclipseVariablesVariableSupplier.java index 326f4e4e7f7..69cf8061ac8 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/EclipseVariablesVariableSupplier.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/EclipseVariablesVariableSupplier.java @@ -176,7 +176,7 @@ public class EclipseVariablesVariableSupplier implements ICdtVariableSupplier { IStringVariableManager mngr = VariablesPlugin.getDefault().getStringVariableManager(); IDynamicVariable vars[] = mngr.getDynamicVariables(); - Map<String, IStringVariable> map = new HashMap<String, IStringVariable>(); + Map<String, IStringVariable> map = new HashMap<>(); for (IDynamicVariable var : vars) { final String name = var.getName(); if (!isDeadlockProneVariable(name)) { diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/StorableCdtVariable.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/StorableCdtVariable.java index ae0675c93c8..8b3b146d7a0 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/StorableCdtVariable.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/StorableCdtVariable.java @@ -67,7 +67,7 @@ public class StorableCdtVariable extends CdtVariable { fStringValue = element.getAttribute(VALUE); else { ICStorageElement nodeList[] = element.getChildren(); - List<String> values = new ArrayList<String>(); + List<String> values = new ArrayList<>(); for (int i = 0; i < nodeList.length; ++i) { ICStorageElement node = nodeList[i]; if (node.getName().equals(VALUE_ELEMENT_NAME)) { diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/StorableCdtVariables.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/StorableCdtVariables.java index 704304bd6e8..dc7bae3a189 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/StorableCdtVariables.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/StorableCdtVariables.java @@ -43,7 +43,7 @@ public class StorableCdtVariables implements IStorableCdtVariables { private HashMap<String, ICdtVariable> getMap() { if (fMacros == null) - fMacros = new HashMap<String, ICdtVariable>(); + fMacros = new HashMap<>(); return fMacros; } @@ -58,7 +58,7 @@ public class StorableCdtVariables implements IStorableCdtVariables { } public StorableCdtVariables(ICdtVariable vars[], boolean readOnly) { - fMacros = new HashMap<String, ICdtVariable>(vars.length); + fMacros = new HashMap<>(vars.length); for (ICdtVariable var : vars) { addMacro(var); } @@ -183,8 +183,8 @@ public class StorableCdtVariables implements IStorableCdtVariables { deleteAll(); else { if (getMap().size() != 0) { - Set<String> existing = new HashSet<String>(); - Set<String> macroNames = new HashSet<String>(); + Set<String> existing = new HashSet<>(); + Set<String> macroNames = new HashSet<>(); for (ICdtVariable m : getMap().values()) { existing.add(m.getName()); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/UserDefinedVariableSupplier.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/UserDefinedVariableSupplier.java index 134f66d3728..2fa67fba038 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/UserDefinedVariableSupplier.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/UserDefinedVariableSupplier.java @@ -391,8 +391,8 @@ public class UserDefinedVariableSupplier extends CoreMacroSupplierBase { } else if (newVars == null || newVars.length == 0) { removedVars = oldVars.clone(); } else { - HashSet<VarKey> newSet = new HashSet<VarKey>(newVars.length); - HashSet<VarKey> oldSet = new HashSet<VarKey>(oldVars.length); + HashSet<VarKey> newSet = new HashSet<>(newVars.length); + HashSet<VarKey> oldSet = new HashSet<>(oldVars.length); for (ICdtVariable newVar : newVars) { newSet.add(new VarKey(newVar, true)); @@ -417,7 +417,7 @@ public class UserDefinedVariableSupplier extends CoreMacroSupplierBase { newSetCopy.removeAll(newSet); - HashSet<VarKey> modifiedSet = new HashSet<VarKey>(newSetCopy.size()); + HashSet<VarKey> modifiedSet = new HashSet<>(newSetCopy.size()); for (Object element : newSetCopy) { VarKey key = (VarKey) element; modifiedSet.add(new VarKey(key.getVariable(), false)); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/ContributedEnvironment.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/ContributedEnvironment.java index ae454d819c7..1055fda7f6d 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/ContributedEnvironment.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/ContributedEnvironment.java @@ -80,7 +80,7 @@ public class ContributedEnvironment implements IContributedEnvironment { EnvVarCollector cr = EnvironmentVariableManager.getVariables(getContextInfo(des), true); if (cr != null) { EnvVarDescriptor collected[] = cr.toArray(true); - List<IEnvironmentVariable> vars = new ArrayList<IEnvironmentVariable>(collected.length); + List<IEnvironmentVariable> vars = new ArrayList<>(collected.length); IEnvironmentVariable var; IEnvironmentContextInfo info = new DefaultEnvironmentContextInfo(des);//getContextInfo(des); for (int i = 0; i < collected.length; i++) { diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/EnvVarCollector.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/EnvVarCollector.java index 17c30dd99cd..2f894f82837 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/EnvVarCollector.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/EnvVarCollector.java @@ -63,7 +63,7 @@ public class EnvVarCollector { if (fMap == null) { noCheck = true; - fMap = new HashMap<String, EnvVarDescriptor>(); + fMap = new HashMap<>(); } EnvVarDescriptor des = null; @@ -89,7 +89,7 @@ public class EnvVarCollector { if (fMap == null) return new EnvVarDescriptor[0]; Collection<EnvVarDescriptor> values = fMap.values(); - List<EnvVarDescriptor> list = new ArrayList<EnvVarDescriptor>(); + List<EnvVarDescriptor> list = new ArrayList<>(); Iterator<EnvVarDescriptor> iter = values.iterator(); while (iter.hasNext()) { EnvVarDescriptor des = iter.next(); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/EnvironmentVariableManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/EnvironmentVariableManager.java index 740108feb26..11712ff7e5e 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/EnvironmentVariableManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/EnvironmentVariableManager.java @@ -247,7 +247,7 @@ public class EnvironmentVariableManager implements IEnvironmentVariableManager { if (!includeParentLevels) { ICoreEnvironmentVariableSupplier suppliers[] = infos[0].getSuppliers(); - set = new HashSet<String>(); + set = new HashSet<>(); for (int i = 0; i < suppliers.length; i++) { IEnvironmentVariable vars[] = suppliers[i].getVariables(infos[0].getContext()); if (vars != null) { @@ -278,7 +278,7 @@ public class EnvironmentVariableManager implements IEnvironmentVariableManager { IEnvironmentVariable vars[] = null; if (set != null) { - List<IEnvironmentVariable> varList = new ArrayList<IEnvironmentVariable>(); + List<IEnvironmentVariable> varList = new ArrayList<>(); Iterator<String> iter = set.iterator(); while (iter.hasNext()) { @@ -343,7 +343,7 @@ public class EnvironmentVariableManager implements IEnvironmentVariableManager { if (contextInfo == null) return null; - List<IEnvironmentContextInfo> list = new ArrayList<IEnvironmentContextInfo>(); + List<IEnvironmentContextInfo> list = new ArrayList<>(); list.add(contextInfo); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/UserDefinedEnvironmentSupplier.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/UserDefinedEnvironmentSupplier.java index 7015873724a..e9889bd349a 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/UserDefinedEnvironmentSupplier.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/UserDefinedEnvironmentSupplier.java @@ -256,7 +256,7 @@ public class UserDefinedEnvironmentSupplier extends StorableEnvironmentLoader private IEnvironmentVariable[] combineVariables(IEnvironmentVariable[] oldVariables, IEnvironmentVariable[] newVariables) { - Map<String, IEnvironmentVariable> vars = new HashMap<String, IEnvironmentVariable>( + Map<String, IEnvironmentVariable> vars = new HashMap<>( oldVariables.length + newVariables.length); for (IEnvironmentVariable variable : oldVariables) vars.put(variable.getName(), variable); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/resources/ResourceExclusion.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/resources/ResourceExclusion.java index b50fcfd75da..506df940338 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/resources/ResourceExclusion.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/resources/ResourceExclusion.java @@ -38,7 +38,7 @@ public class ResourceExclusion extends RefreshExclusion { @Override public synchronized boolean testExclusion(IResource resource) { // Populate the resources to be excluded by this exclusion. - List<IResource> excludedResources = new LinkedList<IResource>(); + List<IResource> excludedResources = new LinkedList<>(); List<ExclusionInstance> exclusionInstances = getExclusionInstances(); for (ExclusionInstance instance : exclusionInstances) { diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/resources/ResourceLookupTree.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/resources/ResourceLookupTree.java index b62661b4691..615ccd2d544 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/resources/ResourceLookupTree.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/resources/ResourceLookupTree.java @@ -131,7 +131,7 @@ class ResourceLookupTree implements IResourceChangeListener, IResourceDeltaVisit public ResourceLookupTree() { fRootNode = new Node(null, CharArrayUtils.EMPTY, false, false) { }; - fFileExtensions = new HashMap<String, Extensions>(); + fFileExtensions = new HashMap<>(); fUnrefJob = new Job("Timer") { //$NON-NLS-1$ @Override protected IStatus run(IProgressMonitor monitor) { @@ -331,7 +331,7 @@ class ResourceLookupTree implements IResourceChangeListener, IResourceDeltaVisit public void simulateNodeMapCollection() { synchronized (fLock) { fNodeMap = null; - fNodeMapRef = new SoftReference<Map<Integer, Object>>(null); + fNodeMapRef = new SoftReference<>(null); } } @@ -348,8 +348,8 @@ class ResourceLookupTree implements IResourceChangeListener, IResourceDeltaVisit if (fNodeMap == null) { fFileExtensions.clear(); - fNodeMap = new HashMap<Integer, Object>(); - fNodeMapRef = new SoftReference<Map<Integer, Object>>(fNodeMap); + fNodeMap = new HashMap<>(); + fNodeMapRef = new SoftReference<>(fNodeMap); } } fUnrefJob.cancel(); @@ -380,14 +380,14 @@ class ResourceLookupTree implements IResourceChangeListener, IResourceDeltaVisit private void initFileExtensions() { if (fDefaultExtensions == null) { - HashSet<String> cdtContentTypes = new HashSet<String>(); + HashSet<String> cdtContentTypes = new HashSet<>(); String[] registeredContentTypes = CoreModel.getRegistedContentTypeIds(); cdtContentTypes.addAll(Arrays.asList(registeredContentTypes)); final IContentTypeManager ctm = Platform.getContentTypeManager(); final IContentType[] ctts = ctm.getAllContentTypes(); - Set<String> cdtExtensions = new HashSet<String>(); + Set<String> cdtExtensions = new HashSet<>(); for (IContentType ctt : ctts) { IContentType basedOn = ctt; while (basedOn != null) { @@ -400,7 +400,7 @@ class ResourceLookupTree implements IResourceChangeListener, IResourceDeltaVisit } fDefaultExtensions = new Extensions(cdtExtensions, false); - Set<String> nonCDTExtensions = new HashSet<String>(); + Set<String> nonCDTExtensions = new HashSet<>(); outer: for (IContentType ctt : ctts) { IContentType basedOn = ctt; while (basedOn != null) { @@ -736,7 +736,7 @@ class ResourceLookupTree implements IResourceChangeListener, IResourceDeltaVisit while (suffix.startsWith("../")) { //$NON-NLS-1$ suffix = suffix.substring(3); } - Set<String> prjset = new HashSet<String>(); + Set<String> prjset = new HashSet<>(); for (IProject prj : projects) { prjset.add(prj.getName()); } @@ -865,7 +865,7 @@ class ResourceLookupTree implements IResourceChangeListener, IResourceDeltaVisit @SuppressWarnings("nls") public void dump() { - List<String> lines = new ArrayList<String>(); + List<String> lines = new ArrayList<>(); synchronized (fLock) { for (Object object : fNodeMap.values()) { Node[] nodes = convert(object); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/ErrorParserExtensionManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/ErrorParserExtensionManager.java index a36f1c77b41..1b008ba1757 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/ErrorParserExtensionManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/ErrorParserExtensionManager.java @@ -88,9 +88,9 @@ public class ErrorParserExtensionManager { private static final String ATTR_VALUE_INFO = "Info"; //$NON-NLS-1$ private static final String ATTR_VALUE_IGNORE = "Ignore"; //$NON-NLS-1$ - private static final LinkedHashMap<String, IErrorParserNamed> fExtensionErrorParsers = new LinkedHashMap<String, IErrorParserNamed>(); - private static final LinkedHashMap<String, IErrorParserNamed> fAvailableErrorParsers = new LinkedHashMap<String, IErrorParserNamed>(); - private static final Map<String, Set<String>> fErrorParserContexts = new HashMap<String, Set<String>>(); + private static final LinkedHashMap<String, IErrorParserNamed> fExtensionErrorParsers = new LinkedHashMap<>(); + private static final LinkedHashMap<String, IErrorParserNamed> fAvailableErrorParsers = new LinkedHashMap<>(); + private static final Map<String, Set<String>> fErrorParserContexts = new HashMap<>(); private static LinkedHashMap<String, IErrorParserNamed> fUserDefinedErrorParsers = null; private static List<String> fDefaultErrorParserIds = null; @@ -144,11 +144,11 @@ public class ErrorParserExtensionManager { } if (doc != null) { - Set<IErrorParserNamed> sortedErrorParsers = new TreeSet<IErrorParserNamed>(new ErrorParserComparator()); + Set<IErrorParserNamed> sortedErrorParsers = new TreeSet<>(new ErrorParserComparator()); loadErrorParserExtensions(doc, sortedErrorParsers); if (sortedErrorParsers.size() > 0) { - fUserDefinedErrorParsers = new LinkedHashMap<String, IErrorParserNamed>(); + fUserDefinedErrorParsers = new LinkedHashMap<>(); for (IErrorParserNamed errorParser : sortedErrorParsers) { fUserDefinedErrorParsers.put(errorParser.getId(), errorParser); } @@ -216,7 +216,7 @@ public class ErrorParserExtensionManager { * @noreference This method is not intended to be referenced by clients. */ synchronized public static void loadErrorParserExtensions() { - Set<IErrorParserNamed> sortedErrorParsers = new TreeSet<IErrorParserNamed>(new ErrorParserComparator()); + Set<IErrorParserNamed> sortedErrorParsers = new TreeSet<>(new ErrorParserComparator()); loadErrorParserExtensions(Platform.getExtensionRegistry(), sortedErrorParsers); fExtensionErrorParsers.clear(); @@ -266,7 +266,7 @@ public class ErrorParserExtensionManager { private static void recalculateAvailableErrorParsers() { fAvailableErrorParsers.clear(); // put default parsers on top of the list - List<String> ids = new ArrayList<String>(); + List<String> ids = new ArrayList<>(); if (fDefaultErrorParserIds != null) { for (String id : fDefaultErrorParserIds) { IErrorParserNamed errorParser = null; @@ -283,7 +283,7 @@ public class ErrorParserExtensionManager { } } // then the rest in the order defined by comparator - Set<IErrorParserNamed> sortedErrorParsers = new TreeSet<IErrorParserNamed>(new ErrorParserComparator()); + Set<IErrorParserNamed> sortedErrorParsers = new TreeSet<>(new ErrorParserComparator()); if (fUserDefinedErrorParsers != null) { for (String id : fUserDefinedErrorParsers.keySet()) { @@ -600,7 +600,7 @@ public class ErrorParserExtensionManager { } boolean newContextCreated = false; if (contexts == null) { - contexts = new HashSet<String>(); + contexts = new HashSet<>(); newContextCreated = true; } for (IConfigurationElement contextElement : contextElements) { @@ -653,9 +653,9 @@ public class ErrorParserExtensionManager { if (errorParsers == null) { fUserDefinedErrorParsers = null; } else { - Set<IErrorParserNamed> sortedErrorParsers = new TreeSet<IErrorParserNamed>(new ErrorParserComparator()); + Set<IErrorParserNamed> sortedErrorParsers = new TreeSet<>(new ErrorParserComparator()); sortedErrorParsers.addAll(Arrays.asList(errorParsers)); - fUserDefinedErrorParsers = new LinkedHashMap<String, IErrorParserNamed>(); + fUserDefinedErrorParsers = new LinkedHashMap<>(); // set customized list for (IErrorParserNamed errorParser : sortedErrorParsers) { fUserDefinedErrorParsers.put(errorParser.getId(), errorParser); @@ -711,7 +711,7 @@ public class ErrorParserExtensionManager { if (ids == null) { fDefaultErrorParserIds = null; } else { - fDefaultErrorParserIds = new ArrayList<String>(Arrays.asList(ids)); + fDefaultErrorParserIds = new ArrayList<>(Arrays.asList(ids)); } recalculateAvailableErrorParsers(); } @@ -753,7 +753,7 @@ public class ErrorParserExtensionManager { * defined ones from workspace, that can be used in the given context. */ public static String[] getErrorParserAvailableIdsInContext(String context) { - List<String> ids = new ArrayList<String>(); + List<String> ids = new ArrayList<>(); for (String id : fAvailableErrorParsers.keySet()) { if (getErrorParserContexts(id).contains(context)) { ids.add(id); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CCodeFormatter.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CCodeFormatter.java index 0e73d5c5782..b4495b61413 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CCodeFormatter.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CCodeFormatter.java @@ -120,7 +120,7 @@ public class CCodeFormatter extends CodeFormatter { public void setOptions(Map<String, ?> options) { if (options != null) { this.options = options; - Map<String, String> formatterPrefs = new HashMap<String, String>(options.size()); + Map<String, String> formatterPrefs = new HashMap<>(options.size()); for (String key : options.keySet()) { Object value = options.get(key); if (value instanceof String) { diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java index 7a5d2a8693c..22ae42e2b46 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java @@ -612,7 +612,7 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor, * possible, by a {@link TokenRange}. */ private List<Object> getMacroArguments(int expectedNumberOfArguments) { - List<TokenRange> argumentRanges = new ArrayList<TokenRange>(expectedNumberOfArguments); + List<TokenRange> argumentRanges = new ArrayList<>(expectedNumberOfArguments); TokenRange currentArgument = null; localScanner.resetTo(getCurrentPosition(), scribe.scannerEndPosition); localScanner.getNextToken(); // Skip the opening parenthesis. @@ -649,7 +649,7 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor, } } - List<Object> arguments = new ArrayList<Object>(argumentRanges.size()); + List<Object> arguments = new ArrayList<>(argumentRanges.size()); IASTNodeSelector nodeSelector = ast.getNodeSelector(null); for (TokenRange argument : argumentRanges) { IASTNode node = nodeSelector.findNodeInExpansion(argument.getOffset(), argument.getLength()); @@ -2895,7 +2895,7 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor, } private int formatOverloadedLeftShiftChain(IASTBinaryExpression binaryExpression) { - List<IASTExpression> elements = new ArrayList<IASTExpression>(); + List<IASTExpression> elements = new ArrayList<>(); IASTExpression node; do { elements.add(binaryExpression.getOperand2()); @@ -4480,10 +4480,10 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor, if (fileName == null) { return Collections.emptyList(); } - List<Position> positions = new ArrayList<Position>(); + List<Position> positions = new ArrayList<>(); int inactiveCodeStart = -1; boolean inInactiveCode = false; - Stack<Boolean> inactiveCodeStack = new Stack<Boolean>(); + Stack<Boolean> inactiveCodeStack = new Stack<>(); IASTPreprocessorStatement[] preprocStmts = translationUnit.getAllPreprocessorStatements(); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/ScannerContext.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/ScannerContext.java index f43811a6c0a..20760933e73 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/ScannerContext.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/ScannerContext.java @@ -22,7 +22,7 @@ import java.util.Stack; public class ScannerContext { private Reader fReader; private int fOffset; - private Stack<Integer> fUndo = new Stack<Integer>(); + private Stack<Integer> fUndo = new Stack<>(); public ScannerContext() { } diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/SimpleScanner.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/SimpleScanner.java index 4d27a43d890..f04a4cdb5ff 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/SimpleScanner.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/SimpleScanner.java @@ -28,7 +28,7 @@ import java.util.HashMap; */ public class SimpleScanner { private static final int EOFCHAR = -1; - protected static HashMap<String, Integer> fgKeywords = new HashMap<String, Integer>(); + protected static HashMap<String, Integer> fgKeywords = new HashMap<>(); protected Token fCurrentToken; protected ScannerContext fContext; diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/SharedDefaults.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/SharedDefaults.java index c46e6f6d7ef..aed2d2650cd 100644 --- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/SharedDefaults.java +++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/SharedDefaults.java @@ -93,9 +93,9 @@ public class SharedDefaults extends HashMap<String, String> { */ public SharedDefaults() { - sharedDefaultsMap = new HashMap<String, String>(); - persistDataMap = new HashMap<String, String>(); - tableDataMap = new HashMap<String, String>(); + sharedDefaultsMap = new HashMap<>(); + persistDataMap = new HashMap<>(); + tableDataMap = new HashMap<>(); // The conditional controls here is provided to have consistent // data storage in the file during System crash or diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateCore.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateCore.java index 4139f19dacf..ba26faba483 100644 --- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateCore.java +++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateCore.java @@ -83,7 +83,7 @@ public class TemplateCore { throw new TemplateInitializationException( "Unable to load project template. Location URL is null for " + templateInfo.getTemplateId()); //$NON-NLS-1$ templateDescriptor = new TemplateDescriptor(descriptorURL, templateInfo.getPluginId()); - valueStore = new ValueStore<String>(this); + valueStore = new ValueStore<>(this); valueStore.putAll(templateDescriptor.getTemplateDefaults(templateDescriptor.getRootElement())); valueStore.putAll(TemplateEngine.getSharedDefaults()); valueStore.put("projectType", templateInfo.getProjectType()); //$NON-NLS-1$ @@ -99,7 +99,7 @@ public class TemplateCore { * @return Set */ public Set<String> getAllMissingMacrosInProcesses() { - Set<String> set = new TreeSet<String>(allMacrosInProcesses); + Set<String> set = new TreeSet<>(allMacrosInProcesses); for (Iterator<String> iter = set.iterator(); iter.hasNext();) { if (valueStore.get(iter.next()) != null) { iter.remove(); diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateDescriptor.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateDescriptor.java index 70dfc803fc0..f8a709f1dc1 100644 --- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateDescriptor.java +++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateDescriptor.java @@ -63,7 +63,7 @@ public class TemplateDescriptor { throw new TemplateInitializationException(msg, se); } this.rootElement = document.getDocumentElement(); - this.persistVector = new ArrayList<String>(); + this.persistVector = new ArrayList<>(); this.pluginId = pluginId; } @@ -74,7 +74,7 @@ public class TemplateDescriptor { * @return default values with keys */ public Map<String, String> getTemplateDefaults(Element element) { - Map<String, String> templateDefaults = new HashMap<String, String>(); + Map<String, String> templateDefaults = new HashMap<>(); Element propertyGroupElement; List<Element> children = TemplateEngine.getChildrenOfElement(element); for (int i = 0, l = children.size(); i < l; i++) { @@ -119,7 +119,7 @@ public class TemplateDescriptor { */ public List<Element> getPropertyGroupList() { List<Element> resultList = null; - List<Element> list = new ArrayList<Element>(); + List<Element> list = new ArrayList<>(); resultList = list; if (rootElement != null) { List<Element> tempList = TemplateEngine.getChildrenOfElement(rootElement); diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateEngine.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateEngine.java index b27d11fb3e5..90b3c7de34c 100644 --- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateEngine.java +++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateEngine.java @@ -55,9 +55,9 @@ public class TemplateEngine { /** * This is a Map <WizardID, TemplateInfo>. */ - private Map<String, List<TemplateInfo>> templateInfoMap = new LinkedHashMap<String, List<TemplateInfo>>(); + private Map<String, List<TemplateInfo>> templateInfoMap = new LinkedHashMap<>(); - Map<String, TemplateCategory> categoryMap = new HashMap<String, TemplateCategory>(); + Map<String, TemplateCategory> categoryMap = new HashMap<>(); /** * TemplateEngine constructor, create and initialise SharedDefaults. @@ -71,7 +71,7 @@ public class TemplateEngine { */ public TemplateCore[] getTemplates() { TemplateInfo[] templateInfoArray = getTemplateInfos(); - List<TemplateCore> tcores = new ArrayList<TemplateCore>(); + List<TemplateCore> tcores = new ArrayList<>(); for (int i = 0; i < templateInfoArray.length; i++) { TemplateInfo info = templateInfoArray[i]; try { @@ -123,7 +123,7 @@ public class TemplateEngine { */ public TemplateCore[] getTemplates(String projectType, String toolChain, String usageFilter) { TemplateInfo[] templateInfoArray = getTemplateInfos(projectType, toolChain, usageFilter); - List<TemplateCore> templatesList = new ArrayList<TemplateCore>(); + List<TemplateCore> templatesList = new ArrayList<>(); for (int i = 0; i < templateInfoArray.length; i++) { TemplateInfo info = templateInfoArray[i]; try { @@ -173,7 +173,7 @@ public class TemplateEngine { * @param template */ public void updateSharedDefaults(TemplateCore template) { - Map<String, String> tobePersisted = new HashMap<String, String>(); + Map<String, String> tobePersisted = new HashMap<>(); Map<String, String> valueStore = template.getValueStore(); for (String key : template.getPersistTrueIDs()) { tobePersisted.put(key, valueStore.get(key)); @@ -235,12 +235,12 @@ public class TemplateEngine { } IConfigurationElement[] toolChainConfigs = config.getChildren(TemplateEngineHelper.TOOL_CHAIN); - Set<String> toolChainIdSet = new LinkedHashSet<String>(); + Set<String> toolChainIdSet = new LinkedHashSet<>(); for (IConfigurationElement toolChainConfig : toolChainConfigs) toolChainIdSet.add(toolChainConfig.getAttribute(TemplateEngineHelper.ID)); IConfigurationElement[] parentCategoryConfigs = config.getChildren("parentCategory"); //$NON-NLS-1$ - List<String> parentCategoryIds = new ArrayList<String>(); + List<String> parentCategoryIds = new ArrayList<>(); for (IConfigurationElement parentCategoryConfig : parentCategoryConfigs) parentCategoryIds.add(parentCategoryConfig.getAttribute("id")); //$NON-NLS-1$ @@ -257,7 +257,7 @@ public class TemplateEngine { String label = config.getAttribute("label"); //$NON-NLS-1$ IConfigurationElement[] parentCategoryConfigs = config.getChildren("parentCategory"); //$NON-NLS-1$ - List<String> parentCategoryIds = new ArrayList<String>(); + List<String> parentCategoryIds = new ArrayList<>(); for (IConfigurationElement parentCategoryConfig : parentCategoryConfigs) parentCategoryIds.add(parentCategoryConfig.getAttribute("id")); //$NON-NLS-1$ @@ -283,7 +283,7 @@ public class TemplateEngine { templateId = config.getAttribute(TemplateEngineHelper.ID); IConfigurationElement[] toolChainConfigs = config.getChildren(TemplateEngineHelper.TOOL_CHAIN); - Set<String> toolChainIdSet = new LinkedHashSet<String>(); + Set<String> toolChainIdSet = new LinkedHashSet<>(); for (int k = 0; k < toolChainConfigs.length; k++) { toolChainIdSet.add(toolChainConfigs[k].getAttribute(TemplateEngineHelper.ID)); } @@ -312,7 +312,7 @@ public class TemplateEngine { */ public TemplateInfo[] getTemplateInfos(String projectType, String toolChain, String usageFilter) { List<TemplateInfo> templateInfoList = templateInfoMap.get(projectType.trim()); - List<TemplateInfo> matchedTemplateInfoList = new ArrayList<TemplateInfo>(); + List<TemplateInfo> matchedTemplateInfoList = new ArrayList<>(); if (templateInfoList != null) { for (TemplateInfo templateInfo : templateInfoList) { @@ -355,7 +355,7 @@ public class TemplateEngine { * @return all TemplateInfo objects known to the TemplateEngine */ public TemplateInfo[] getTemplateInfos() { - List<TemplateInfo> infoList = new ArrayList<TemplateInfo>(); + List<TemplateInfo> infoList = new ArrayList<>(); for (List<TemplateInfo> infos : templateInfoMap.values()) { infoList.addAll(infos); } @@ -388,7 +388,7 @@ public class TemplateEngine { * @since 4.0 */ public static List<Element> getChildrenOfElement(Element element) { - List<Element> list = new ArrayList<Element>(); + List<Element> list = new ArrayList<>(); NodeList children = element.getChildNodes(); for (int i = 0, l = children.getLength(); i < l; i++) { Node child = children.item(i); @@ -409,7 +409,7 @@ public class TemplateEngine { * @since 4.0 */ public static List<Element> getChildrenOfElementByTag(Element element, String tag) { - List<Element> list = new ArrayList<Element>(); + List<Element> list = new ArrayList<>(); NodeList children = element.getChildNodes(); for (int i = 0, l = children.getLength(); i < l; i++) { Node child = children.item(i); diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ConditionalProcessGroup.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ConditionalProcessGroup.java index 3d8dc100ec1..6a529f307df 100644 --- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ConditionalProcessGroup.java +++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ConditionalProcessGroup.java @@ -110,7 +110,7 @@ public class ConditionalProcessGroup { private void collectMacros(String value) { if (value != null) { if (macros == null) { - macros = new HashSet<String>(); + macros = new HashSet<>(); } macros.addAll(ProcessHelper.getReplaceKeys(value)); } @@ -134,7 +134,7 @@ public class ConditionalProcessGroup { */ private void createProcessObjects(TemplateCore templateCore, List<Element> processElements) { this.template = templateCore; - this.processes = new ArrayList<Process>(processElements.size()); + this.processes = new ArrayList<>(processElements.size()); for (int j = 0, l = processElements.size(); j < l; j++) { Element processElem = processElements.get(j); if (processElem.getNodeName().equals(TemplateDescriptor.PROCESS)) { @@ -215,12 +215,12 @@ public class ConditionalProcessGroup { throw new ProcessFailureException(getUnexpandableMacroMessage()); } if (!isConditionValueTrue()) { - List<IStatus> statuses = new ArrayList<IStatus>(1); + List<IStatus> statuses = new ArrayList<>(1); statuses.add(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, IStatus.INFO, Messages.getString("ConditionalProcessGroup.notExecuting") + id, null)); //$NON-NLS-1$ return statuses; } - List<IStatus> statuses = new ArrayList<IStatus>(processes.size()); + List<IStatus> statuses = new ArrayList<>(processes.size()); for (Process process : processes) { try { statuses.add(process.process(monitor)); @@ -261,14 +261,14 @@ public class ConditionalProcessGroup { public Set<String> getAllMacros() { Set<String> set = null; if (macros != null) { - set = new HashSet<String>(); + set = new HashSet<>(); set.addAll(macros); } for (Process process : processes) { Set<String> subSet = process.getMacros(); if (subSet != null) { if (set == null) { - set = new HashSet<String>(); + set = new HashSet<>(); } set.addAll(subSet); } diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/Process.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/Process.java index f5764a957ec..b1b30eb832b 100644 --- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/Process.java +++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/Process.java @@ -64,7 +64,7 @@ public class Process { private void buildArgs(TemplateCore templateCore, Element element) { List<Element> children = TemplateEngine.getChildrenOfElement(element); ProcessParameter[] params = processRunner.getProcessParameters(); - List<ProcessArgument> list = new ArrayList<ProcessArgument>(params.length); + List<ProcessArgument> list = new ArrayList<>(params.length); int childIndex = 0; for (int i = 0; i < params.length; i++) { ProcessParameter param = params[i]; @@ -192,7 +192,7 @@ public class Process { Set<String> subSet = arg.getMacros(); if (subSet != null) { if (set == null) { - set = new HashSet<String>(); + set = new HashSet<>(); } set.addAll(subSet); } diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ProcessArgument.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ProcessArgument.java index d2118b2afee..c0a0234e7a7 100644 --- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ProcessArgument.java +++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ProcessArgument.java @@ -81,7 +81,7 @@ public class ProcessArgument { complexValue[i] = new ProcessArgument(template, children.get(i)); Set<String> subMacros = complexValue[i].getMacros(); if (macros == null) { - macros = new HashSet<String>(); + macros = new HashSet<>(); } if (subMacros != null) { macros.addAll(subMacros); @@ -100,7 +100,7 @@ public class ProcessArgument { Set<String> subMacros = complexValueArray[i][j].getMacros(); if (subMacros != null) { if (macros == null) { - macros = new HashSet<String>(); + macros = new HashSet<>(); } macros.addAll(subMacros); } @@ -117,7 +117,7 @@ public class ProcessArgument { this.template = template; name = param.getName(); type = param.getType(); - macros = new HashSet<String>(); + macros = new HashSet<>(); macros.add(name); simpleValue = ProcessHelper.getReplaceMarker(name); this.externalParam = param; @@ -132,7 +132,7 @@ public class ProcessArgument { return; } if (macros == null) { - macros = new HashSet<String>(); + macros = new HashSet<>(); } macros.addAll(ProcessHelper.getReplaceKeys(value)); } diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ProcessHelper.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ProcessHelper.java index 4ccfda25d54..6478849ad7a 100644 --- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ProcessHelper.java +++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ProcessHelper.java @@ -93,7 +93,7 @@ public class ProcessHelper { * @since 5.5 */ public static Set<String> getReplaceKeys(String str, String startPattern, String endPattern) { - Set<String> replaceStrings = new HashSet<String>(); + Set<String> replaceStrings = new HashSet<>(); int start = 0; int end = 0; while ((start = str.indexOf(startPattern, start)) >= 0) { diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ProcessRunnerFactory.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ProcessRunnerFactory.java index fcbe7982b20..d9f51a3b5c1 100644 --- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ProcessRunnerFactory.java +++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ProcessRunnerFactory.java @@ -50,7 +50,7 @@ public class ProcessRunnerFactory { * */ private synchronized void initializeProcessRunners() { - processRunnerMap = new HashMap<String, ProcessRunner>(); + processRunnerMap = new HashMap<>(); IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_PROCESSES); IExtension[] extensions = point.getExtensions(); for (int i = 0; i < extensions.length; i++) { @@ -67,7 +67,7 @@ public class ProcessRunnerFactory { IConfigurationElement[] elementChildren = element.getChildren(); for (int k = 0; k < elementChildren.length; k++) { if (params == null) { - params = new ArrayList<ProcessParameter>(); + params = new ArrayList<>(); } params.add(new ProcessParameter(elementChildren[k])); } diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/TemplateProcessHandler.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/TemplateProcessHandler.java index b5a769e1e98..3a3efac7c90 100644 --- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/TemplateProcessHandler.java +++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/TemplateProcessHandler.java @@ -44,7 +44,7 @@ public class TemplateProcessHandler { private void initialize() { TemplateDescriptor desc = template.getTemplateDescriptor(); Element root = desc.getRootElement(); - conditionalProcessGroupList = new ArrayList<ConditionalProcessGroup>(); + conditionalProcessGroupList = new ArrayList<>(); List<Element> nodeList = TemplateEngine.getChildrenOfElementByTag(root, TemplateDescriptor.IF); for (int j = 0, l = nodeList.size(); j < l; j++) { conditionalProcessGroupList.add(new ConditionalProcessGroup(template, nodeList.get(j), j + 1)); @@ -62,7 +62,7 @@ public class TemplateProcessHandler { * @throws ProcessFailureException */ public IStatus[] processAll(IProgressMonitor monitor) throws ProcessFailureException { - List<IStatus> allStatuses = new ArrayList<IStatus>(); + List<IStatus> allStatuses = new ArrayList<>(); for (ConditionalProcessGroup cpg : conditionalProcessGroupList) { try { allStatuses.addAll(cpg.process(monitor)); @@ -77,7 +77,7 @@ public class TemplateProcessHandler { * @return the union of all macros used in this template's process groups */ public Set<String> getAllMacros() { - Set<String> set = new HashSet<String>(); + Set<String> set = new HashSet<>(); for (ConditionalProcessGroup cpg : conditionalProcessGroupList) { Set<String> subSet = cpg.getAllMacros(); if (subSet != null) { diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/processes/CreateSourceFolder.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/processes/CreateSourceFolder.java index 57ec5da5cb8..cab9c1ee0c2 100644 --- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/processes/CreateSourceFolder.java +++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/processes/CreateSourceFolder.java @@ -104,7 +104,7 @@ public class CreateSourceFolder extends ProcessRunner { for (int i = 0; i < configs.length; i++) { ICConfigurationDescription config = configs[i]; ICSourceEntry[] entries = config.getSourceEntries(); - Set<ICSourceEntry> set = new HashSet<ICSourceEntry>(); + Set<ICSourceEntry> set = new HashSet<>(); for (int j = 0; j < entries.length; j++) { if (new Path(entries[j].getValue()).segmentCount() == 1) continue; @@ -127,7 +127,7 @@ public class CreateSourceFolder extends ProcessRunner { private void createFolder(String targetPath, IProgressMonitor monitor, IPath projPath, ICProject cProject) throws CModelException { IPathEntry[] entries = cProject.getRawPathEntries(); - List<IPathEntry> newEntries = new ArrayList<IPathEntry>(entries.length + 1); + List<IPathEntry> newEntries = new ArrayList<>(entries.length + 1); int projectEntryIndex = -1; IPath path = projPath.append(targetPath); diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/processes/SetEnvironmentVariable.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/processes/SetEnvironmentVariable.java index 33399892279..6054a2d8124 100644 --- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/processes/SetEnvironmentVariable.java +++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/processes/SetEnvironmentVariable.java @@ -63,7 +63,7 @@ public class SetEnvironmentVariable extends ProcessRunner { throws ProcessFailureException { IProject project = null; - Map<String, String> envVars = new LinkedHashMap<String, String>(); + Map<String, String> envVars = new LinkedHashMap<>(); for (ProcessArgument arg : args) { String argName = arg.getName(); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/SafeStringInterner.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/SafeStringInterner.java index 453525cbf28..d98a72e7868 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/SafeStringInterner.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/SafeStringInterner.java @@ -66,7 +66,7 @@ public class SafeStringInterner { return map; } - HashMap<String, T> tempMap = new HashMap<String, T>(map); + HashMap<String, T> tempMap = new HashMap<>(map); map.clear(); for (String string : tempMap.keySet()) { T value = tempMap.get(string); @@ -94,7 +94,7 @@ public class SafeStringInterner { return map; } - LinkedHashMap<String, T> tempMap = new LinkedHashMap<String, T>(map); + LinkedHashMap<String, T> tempMap = new LinkedHashMap<>(map); map.clear(); for (String string : tempMap.keySet()) { T value = tempMap.get(string); @@ -122,7 +122,7 @@ public class SafeStringInterner { return map; } - HashMap<String, T> tempMap = new HashMap<String, T>(map); + HashMap<String, T> tempMap = new HashMap<>(map); map.clear(); for (String string : tempMap.keySet()) { T value = tempMap.get(string); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/UNCPathConverterImpl.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/UNCPathConverterImpl.java index 1ddb28ee8ea..70565e3d9ae 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/UNCPathConverterImpl.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/UNCPathConverterImpl.java @@ -47,7 +47,7 @@ public class UNCPathConverterImpl extends UNCPathConverter { private void loadUNCPathConverters() { if (fUNCPathConverters == null) { - ArrayList<UNCPathConverter> list = new ArrayList<UNCPathConverter>(); + ArrayList<UNCPathConverter> list = new ArrayList<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint extensionPoint = registry.getExtensionPoint(EXTENSION_POINT); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/WeakHashSet.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/WeakHashSet.java index 6eec8501191..a7a7400fafe 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/WeakHashSet.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/WeakHashSet.java @@ -59,7 +59,7 @@ public class WeakHashSet<T> { HashableWeakReference<T>[] values; public int elementSize; // number of elements in the table int threshold; - ReferenceQueue<T> referenceQueue = new ReferenceQueue<T>(); + ReferenceQueue<T> referenceQueue = new ReferenceQueue<>(); public WeakHashSet() { this(5); @@ -93,7 +93,7 @@ public class WeakHashSet<T> { index = 0; } } - this.values[index] = new HashableWeakReference<T>(obj, this.referenceQueue); + this.values[index] = new HashableWeakReference<>(obj, this.referenceQueue); // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) @@ -178,7 +178,7 @@ public class WeakHashSet<T> { } private void rehash() { - WeakHashSet<T> newHashSet = new WeakHashSet<T>(this.elementSize * 2); // double the number of expected elements + WeakHashSet<T> newHashSet = new WeakHashSet<>(this.elementSize * 2); // double the number of expected elements newHashSet.referenceQueue = this.referenceQueue; HashableWeakReference<T> currentValue; for (int i = 0, length = this.values.length; i < length; i++) diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/AR.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/AR.java index fdf6d2be73b..b7ddf28feb8 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/AR.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/AR.java @@ -246,7 +246,7 @@ public class AR { if (headers != null) return; - Vector<ARHeader> v = new Vector<ARHeader>(); + Vector<ARHeader> v = new Vector<>(); try { // // Check for EOF condition @@ -304,7 +304,7 @@ public class AR { } public String[] extractFiles(String outdir, String[] names) throws IOException { - Vector<String> names_used = new Vector<String>(); + Vector<String> names_used = new Vector<>(); String object_name; int count; diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CommandLineUtil.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CommandLineUtil.java index 4082b8046d5..7d481c5fb48 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CommandLineUtil.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CommandLineUtil.java @@ -72,7 +72,7 @@ public class CommandLineUtil { } char[] array = line.trim().toCharArray(); - ArrayList<String> aList = new ArrayList<String>(); + ArrayList<String> aList = new ArrayList<>(); StringBuilder buffer = new StringBuilder(); int state = INITIAL; for (int i = 0; i < array.length; i++) { @@ -187,7 +187,7 @@ public class CommandLineUtil { } char[] array = line.trim().toCharArray(); - ArrayList<String> aList = new ArrayList<String>(); + ArrayList<String> aList = new ArrayList<>(); StringBuilder buffer = new StringBuilder(); int state = INITIAL; for (int i = 0; i < array.length; i++) { diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/EFSExtensionManager.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/EFSExtensionManager.java index 09e930d99ac..5ca419099e7 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/EFSExtensionManager.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/EFSExtensionManager.java @@ -57,7 +57,7 @@ public class EFSExtensionManager { private static String EXTENSION_ID = "EFSExtensionProvider"; //$NON-NLS-1$ private EFSExtensionManager() { - fSchemeToExtensionProviderMap = new HashMap<String, EFSExtensionProvider>(); + fSchemeToExtensionProviderMap = new HashMap<>(); loadExtensions(); } diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/NM.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/NM.java index fa3c1405559..0dc2b6bd7c1 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/NM.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/NM.java @@ -150,10 +150,10 @@ public class NM { args[params.length + 1] = file; } - undef_symbols = new ArrayList<String>(); - text_symbols = new ArrayList<AddressNamePair>(); - data_symbols = new ArrayList<AddressNamePair>(); - bss_symbols = new ArrayList<AddressNamePair>(); + undef_symbols = new ArrayList<>(); + text_symbols = new ArrayList<>(); + data_symbols = new ArrayList<>(); + bss_symbols = new ArrayList<>(); Process process = ProcessFactory.getFactory().exec(args); parseOutput(process.getInputStream()); process.destroy(); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/Objdump.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/Objdump.java index 8736a9d2c30..16339e22706 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/Objdump.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/Objdump.java @@ -35,7 +35,7 @@ public class Objdump { params = new String[0]; } else { // FIXME: This is wrong we have to check for quoted strings. - List<String> list = new ArrayList<String>(); + List<String> list = new ArrayList<>(); StringTokenizer st = new StringTokenizer(param); while (st.hasMoreTokens()) { list.add(st.nextToken()); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/CdtVariableResolver.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/CdtVariableResolver.java index f1b8e1f91fb..6c720512b5d 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/CdtVariableResolver.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/CdtVariableResolver.java @@ -194,7 +194,7 @@ public class CdtVariableResolver { throw e; } else { - List<String> list = new ArrayList<String>(); + List<String> list = new ArrayList<>(); for (String value : values) { String resolved[]; try { diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/SupplierBasedCdtVariableManager.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/SupplierBasedCdtVariableManager.java index 9e48251952a..248896c578e 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/SupplierBasedCdtVariableManager.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/SupplierBasedCdtVariableManager.java @@ -46,7 +46,7 @@ public class SupplierBasedCdtVariableManager { if (contextInfo == null) return new ICdtVariable[0]; - Map<String, ICdtVariable> map = new HashMap<String, ICdtVariable>(); + Map<String, ICdtVariable> map = new HashMap<>(); IVariableContextInfo infos[] = includeParentContexts ? getAllVariableContextInfos(contextInfo) : new IVariableContextInfo[] { contextInfo }; @@ -77,7 +77,7 @@ public class SupplierBasedCdtVariableManager { if (contextInfo == null) return null; - List<IVariableContextInfo> list = new ArrayList<IVariableContextInfo>(); + List<IVariableContextInfo> list = new ArrayList<>(); list.add(contextInfo); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/SupplierBasedCdtVariableSubstitutor.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/SupplierBasedCdtVariableSubstitutor.java index c112ad76a1d..c0aa1d2a457 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/SupplierBasedCdtVariableSubstitutor.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/SupplierBasedCdtVariableSubstitutor.java @@ -201,9 +201,9 @@ public class SupplierBasedCdtVariableSubstitutor implements IVariableSubstitutor } - private Map<String, ResolvedMacro> fResolvedMacros = new HashMap<String, ResolvedMacro>(); - private HashSet<String> fMacrosUnderResolution = new HashSet<String>(); - private Stack<MacroDescriptor> fMacroDescriptors = new Stack<MacroDescriptor>(); + private Map<String, ResolvedMacro> fResolvedMacros = new HashMap<>(); + private HashSet<String> fMacrosUnderResolution = new HashSet<>(); + private Stack<MacroDescriptor> fMacroDescriptors = new Stack<>(); public SupplierBasedCdtVariableSubstitutor(IVariableContextInfo contextInfo, String inexistentMacroValue, String listDelimiter) { @@ -344,7 +344,7 @@ public class SupplierBasedCdtVariableSubstitutor implements IVariableSubstitutor if (resolvedValues.length == 1) result = resolvedValues[0]; else { - List<String> list = new ArrayList<String>(); + List<String> list = new ArrayList<>(); for (String[] resolvedValue : resolvedValues) list.addAll(Arrays.asList(resolvedValue)); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/CodeViewReader.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/CodeViewReader.java index ec6d7ae9850..6ccb3b53db6 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/CodeViewReader.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/CodeViewReader.java @@ -35,7 +35,7 @@ public class CodeViewReader implements ISymbolReader { cvData = dataOffset; isLe = littleEndian; - fileList = new ArrayList<String>(); + fileList = new ArrayList<>(); } @Override diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Coff.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Coff.java index cb30c418500..b418fb34fd4 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Coff.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Coff.java @@ -696,7 +696,7 @@ public class Coff { } public static String[] getStringTable(byte[] bytes) { - List<String> aList = new ArrayList<String>(); + List<String> aList = new ArrayList<>(); int offset = 0; for (int i = 0; i < bytes.length; i++) { if (bytes[i] == 0) { diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PEArchive.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PEArchive.java index d4a00b6d05e..226ee4d8cd5 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PEArchive.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PEArchive.java @@ -240,7 +240,7 @@ public class PEArchive { if (headers != null) return; - Vector<ARHeader> v = new Vector<ARHeader>(); + Vector<ARHeader> v = new Vector<>(); try { // // Check for EOF condition @@ -298,7 +298,7 @@ public class PEArchive { } public String[] extractFiles(String outdir, String[] names) throws IOException { - Vector<String> names_used = new Vector<String>(); + Vector<String> names_used = new Vector<>(); String object_name; int count; diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/CygwinPEBinaryObject.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/CygwinPEBinaryObject.java index bfafa3e2d20..c9d1cb968a9 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/CygwinPEBinaryObject.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/CygwinPEBinaryObject.java @@ -182,7 +182,7 @@ public class CygwinPEBinaryObject extends PEBinaryObject { symbolLoadingCPPFilt = getCPPFilt(); symbolLoadingCygPath = getCygPath(); - ArrayList<Symbol> list = new ArrayList<Symbol>(); + ArrayList<Symbol> list = new ArrayList<>(); super.loadSymbols(pe, list); // Add any global symbols diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/PEBinaryArchive.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/PEBinaryArchive.java index 59f695257fb..d5034aa9dfa 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/PEBinaryArchive.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/PEBinaryArchive.java @@ -33,7 +33,7 @@ public class PEBinaryArchive extends BinaryFile implements IBinaryArchive { public PEBinaryArchive(PEParser parser, IPath path) throws IOException { super(parser, path, IBinaryFile.ARCHIVE); new AR(path.toOSString()).dispose(); // check file type - children = new ArrayList<IBinaryObject>(5); + children = new ArrayList<>(5); } /** diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/PEBinaryObject.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/PEBinaryObject.java index 4e90c1afee2..5c20e3d089f 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/PEBinaryObject.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/PEBinaryObject.java @@ -167,7 +167,7 @@ public class PEBinaryObject extends BinaryObjectAdapter { } protected void loadSymbols(PE pe) throws IOException { - ArrayList<Symbol> list = new ArrayList<Symbol>(); + ArrayList<Symbol> list = new ArrayList<>(); loadSymbols(pe, list); symbols = list.toArray(NO_SYMBOLS); Arrays.sort(symbols); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java index 480bb36f336..4ec78e0367c 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java @@ -98,7 +98,7 @@ public class Dwarf { code = c; tag = t; hasChildren = h; - attributes = new ArrayList<Attribute>(); + attributes = new ArrayList<>(); } } @@ -173,9 +173,9 @@ public class Dwarf { int identifierCase; } - Map<String, ByteBuffer> dwarfSections = new HashMap<String, ByteBuffer>(); - Map<String, ByteBuffer> dwarfAltSections = new HashMap<String, ByteBuffer>(); - Map<Integer, Map<Long, AbbreviationEntry>> abbreviationMaps = new HashMap<Integer, Map<Long, AbbreviationEntry>>(); + Map<String, ByteBuffer> dwarfSections = new HashMap<>(); + Map<String, ByteBuffer> dwarfAltSections = new HashMap<>(); + Map<Integer, Map<Long, AbbreviationEntry>> abbreviationMaps = new HashMap<>(); boolean isLE; @@ -511,7 +511,7 @@ public class Dwarf { Integer key = Integer.valueOf(header.abbreviationOffset); Map<Long, AbbreviationEntry> abbrevs = abbreviationMaps.get(key); if (abbrevs == null) { - abbrevs = new HashMap<Long, AbbreviationEntry>(); + abbrevs = new HashMap<>(); abbreviationMaps.put(key, abbrevs); ByteBuffer data = dwarfSections.get(DWARF_DEBUG_ABBREV); if (data != null) { @@ -555,7 +555,7 @@ public class Dwarf { AbbreviationEntry entry = abbrevs.get(Long.valueOf(code)); if (entry != null) { int len = entry.attributes.size(); - List<AttributeValue> list = new ArrayList<AttributeValue>(len); + List<AttributeValue> list = new ArrayList<>(len); try { for (int i = 0; i < len; i++) { Attribute attr = entry.attributes.get(i); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/DwarfReader.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/DwarfReader.java index c7cd0cad0ec..624b27e59aa 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/DwarfReader.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/DwarfReader.java @@ -55,13 +55,13 @@ public class DwarfReader extends Dwarf implements ISymbolReader, ICompileOptions final static String[] DWARF_ALT_SectionsToParse = { DWARF_DEBUG_STR, DWARF_DEBUG_MACRO }; - private final Collection<String> m_fileCollection = new HashSet<String>(); - private final Map<Long, String> m_stmtFileMap = new HashMap<Long, String>(); - private final Map<String, ArrayList<String>> m_compileOptionsMap = new HashMap<String, ArrayList<String>>(); + private final Collection<String> m_fileCollection = new HashSet<>(); + private final Map<Long, String> m_stmtFileMap = new HashMap<>(); + private final Map<String, ArrayList<String>> m_compileOptionsMap = new HashMap<>(); private String[] m_fileNames = null; private boolean m_parsed = false; private boolean m_macros_parsed = false; - private final ArrayList<Integer> m_parsedLineTableOffsets = new ArrayList<Integer>(); + private final ArrayList<Integer> m_parsedLineTableOffsets = new ArrayList<>(); private long m_parsedLineTableSize = 0; public DwarfReader(String file) throws IOException { @@ -334,7 +334,7 @@ public class DwarfReader extends Dwarf implements ISymbolReader, ICompileOptions // Read in directories. // - ArrayList<String> dirList = new ArrayList<String>(); + ArrayList<String> dirList = new ArrayList<>(); // Put the compilation directory of the CU as the first dir dirList.add(cuCompDir); @@ -481,7 +481,7 @@ public class DwarfReader extends Dwarf implements ISymbolReader, ICompileOptions // Read in directories. // - ArrayList<String> dirList = new ArrayList<String>(); + ArrayList<String> dirList = new ArrayList<>(); String str, fileName; @@ -745,14 +745,14 @@ public class DwarfReader extends Dwarf implements ISymbolReader, ICompileOptions ByteBuffer str = dwarfSections.get(DWARF_DEBUG_STR); ByteBuffer altdata = dwarfAltSections.get(DWARF_DEBUG_MACRO); ByteBuffer altstr = dwarfAltSections.get(DWARF_DEBUG_STR); - Set<String> fixupList = new HashSet<String>(); - Set<String> fixupAltList = new HashSet<String>(); + Set<String> fixupList = new HashSet<>(); + Set<String> fixupAltList = new HashSet<>(); boolean DEBUG = false; if (data == null) return; - HashMap<Long, ArrayList<String>> t_macros = new HashMap<Long, ArrayList<String>>(); - HashMap<Long, ArrayList<String>> t_alt_macros = new HashMap<Long, ArrayList<String>>(); + HashMap<Long, ArrayList<String>> t_macros = new HashMap<>(); + HashMap<Long, ArrayList<String>> t_alt_macros = new HashMap<>(); // Parse the macro section, looking for command-line macros meant for compiling files (i.e. // not internal macro definitions in headers or C/C++ files. Keep track of any forward @@ -836,7 +836,7 @@ public class DwarfReader extends Dwarf implements ISymbolReader, ICompileOptions // have non-standard entry types defined which we need to know when // we come across macro entries later if ((flags & 0x4) != 0) { - opcodeInfos = new HashMap<Integer, OpcodeInfo>(); + opcodeInfos = new HashMap<>(); int num_opcodes = data.get(); for (int i = 0; i < num_opcodes; ++i) { OpcodeInfo info = new OpcodeInfo(offset_size_8); @@ -852,7 +852,7 @@ public class DwarfReader extends Dwarf implements ISymbolReader, ICompileOptions } } - ArrayList<String> macros = new ArrayList<String>(); + ArrayList<String> macros = new ArrayList<>(); boolean done = false; @@ -871,7 +871,7 @@ public class DwarfReader extends Dwarf implements ISymbolReader, ICompileOptions m_compileOptionsMap.put(fileName, macros); if (DEBUG) System.out.println("following macros found for file " + macros.toString()); //$NON-NLS-1$ - macros = new ArrayList<String>(); + macros = new ArrayList<>(); } if (fileName != null) if (DEBUG) diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/Stabs.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/Stabs.java index c58c5ad96a5..c99897e1bb8 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/Stabs.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/Stabs.java @@ -61,7 +61,7 @@ public class Stabs { int bracket; String currentFile; - Map<TypeNumber, DebugType> mapTypes = new HashMap<TypeNumber, DebugType>(); + Map<TypeNumber, DebugType> mapTypes = new HashMap<>(); DebugType voidType = new DebugBaseType("void", 0, false); //$NON-NLS-1$ public Stabs(String file) throws IOException { @@ -972,7 +972,7 @@ public class Stabs { * @return */ DebugType parseStabEnumType(String name, Reader reader) throws IOException { - List<DebugEnumField> list = new ArrayList<DebugEnumField>(); + List<DebugEnumField> list = new ArrayList<>(); String fieldName = null; StringBuilder sb = new StringBuilder(); int c; diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/StabsReader.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/StabsReader.java index d964387d22e..20f50982176 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/StabsReader.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/StabsReader.java @@ -43,7 +43,7 @@ public class StabsReader implements ISymbolReader { stabstrData = stabstr; isLe = littleEndian; is64 = is64bit; - fileList = new ArrayList<String>(); + fileList = new ArrayList<>(); } @Override diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/tools/DebugSymsRequestor.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/tools/DebugSymsRequestor.java index 1a6ea2ad35e..0a58348f5c6 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/tools/DebugSymsRequestor.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/tools/DebugSymsRequestor.java @@ -32,7 +32,7 @@ public class DebugSymsRequestor implements IDebugEntryRequestor { DebugSym currentCU; DebugSym currentFunction; - List<DebugSym> list = new ArrayList<DebugSym>(); + List<DebugSym> list = new ArrayList<>(); /** * diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/AR.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/AR.java index a5980e618ae..bb37c2db604 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/AR.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/AR.java @@ -246,7 +246,7 @@ public class AR { if (headers != null) return; - Vector<ARHeader> v = new Vector<ARHeader>(); + Vector<ARHeader> v = new Vector<>(); try { // // Check for EOF condition @@ -304,7 +304,7 @@ public class AR { } public String[] extractFiles(String outdir, String[] names) throws IOException { - Vector<String> names_used = new Vector<String>(); + Vector<String> names_used = new Vector<>(); String object_name; int count; diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/Elf.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/Elf.java index e66e6fbf6e5..ebd04b45671 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/Elf.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/Elf.java @@ -646,7 +646,7 @@ public class Elf { return new Dynamic[0]; } section.makeSureNotCompressed(); - ArrayList<Dynamic> dynList = new ArrayList<Dynamic>(); + ArrayList<Dynamic> dynList = new ArrayList<>(); efile.seek(section.sh_offset); int off = 0; // We must assume the section is a table ignoring the sh_entsize as it @@ -1007,7 +1007,7 @@ public class Elf { public Section[] getSections(int type) throws IOException { if (sections == null) getSections(); - ArrayList<Section> slist = new ArrayList<Section>(); + ArrayList<Section> slist = new ArrayList<>(); for (int i = 0; i < sections.length; i++) { if (sections[i].sh_type == type) slist.add(sections[i]); @@ -1084,7 +1084,7 @@ public class Elf { numSyms = (int) section.sh_size / (int) section.sh_entsize; } section.makeSureNotCompressed(); - ArrayList<Symbol> symList = new ArrayList<Symbol>(numSyms); + ArrayList<Symbol> symList = new ArrayList<>(numSyms); long offset = section.sh_offset; for (int c = 0; c < numSyms; offset += section.sh_entsize, c++) { efile.seek(offset); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/ElfHelper.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/ElfHelper.java index 30d1b19f87b..b5063ff16df 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/ElfHelper.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/ElfHelper.java @@ -130,7 +130,7 @@ public class ElfHelper { } public Elf.Symbol[] getExternalFunctions() throws IOException { - Vector<Symbol> v = new Vector<Symbol>(); + Vector<Symbol> v = new Vector<>(); loadSymbols(); loadSections(); @@ -153,7 +153,7 @@ public class ElfHelper { } public Elf.Symbol[] getExternalObjects() throws IOException { - Vector<Symbol> v = new Vector<Symbol>(); + Vector<Symbol> v = new Vector<>(); loadSymbols(); loadSections(); @@ -176,7 +176,7 @@ public class ElfHelper { } public Elf.Symbol[] getUndefined() throws IOException { - Vector<Symbol> v = new Vector<Symbol>(); + Vector<Symbol> v = new Vector<>(); loadSymbols(); @@ -190,7 +190,7 @@ public class ElfHelper { } public Elf.Symbol[] getLocalFunctions() throws IOException { - Vector<Symbol> v = new Vector<Symbol>(); + Vector<Symbol> v = new Vector<>(); loadSymbols(); loadSections(); @@ -213,7 +213,7 @@ public class ElfHelper { } public Elf.Symbol[] getLocalObjects() throws IOException { - Vector<Symbol> v = new Vector<Symbol>(); + Vector<Symbol> v = new Vector<>(); loadSymbols(); loadSections(); @@ -236,7 +236,7 @@ public class ElfHelper { } public Elf.Symbol[] getCommonObjects() throws IOException { - Vector<Symbol> v = new Vector<Symbol>(); + Vector<Symbol> v = new Vector<>(); loadSymbols(); loadSections(); @@ -255,7 +255,7 @@ public class ElfHelper { } public Elf.Dynamic[] getNeeded() throws IOException { - Vector<Dynamic> v = new Vector<Dynamic>(); + Vector<Dynamic> v = new Vector<>(); loadDynamics(); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfBinaryArchive.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfBinaryArchive.java index d6187558eac..413e7eb386a 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfBinaryArchive.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfBinaryArchive.java @@ -35,7 +35,7 @@ public class ElfBinaryArchive extends BinaryFile implements IBinaryArchive { public ElfBinaryArchive(IBinaryParser parser, IPath p) throws IOException { super(parser, p, IBinaryFile.ARCHIVE); new AR(p.toOSString()).dispose(); // check file type - children = new ArrayList<IBinaryObject>(5); + children = new ArrayList<>(5); } /** diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfBinaryObject.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfBinaryObject.java index 1bbc905b2cf..9f180c39e58 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfBinaryObject.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfBinaryObject.java @@ -170,7 +170,7 @@ public class ElfBinaryObject extends BinaryObjectAdapter { } protected void loadSymbols(ElfHelper helper) throws IOException { - ArrayList<Symbol> list = new ArrayList<Symbol>(); + ArrayList<Symbol> list = new ArrayList<>(); // addSymbols(helper.getExternalFunctions(), ISymbol.FUNCTION, list); addSymbols(helper.getLocalFunctions(), ISymbol.FUNCTION, list); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/envvar/EnvironmentCollector.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/envvar/EnvironmentCollector.java index 7733fb6b2d3..2a29a4a88f1 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/envvar/EnvironmentCollector.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/envvar/EnvironmentCollector.java @@ -19,7 +19,7 @@ import java.util.Map; import org.eclipse.cdt.core.envvar.IEnvironmentVariable; public class EnvironmentCollector { - private Map<String, IEnvironmentVariable> fEnfironmentMap = new HashMap<String, IEnvironmentVariable>(); + private Map<String, IEnvironmentVariable> fEnfironmentMap = new HashMap<>(); public IEnvironmentVariable addVariable(IEnvironmentVariable var) { if (var == null) diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/envvar/PrefsStorableEnvironment.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/envvar/PrefsStorableEnvironment.java index 7b07d0db9f5..7d0ad31d961 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/envvar/PrefsStorableEnvironment.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/envvar/PrefsStorableEnvironment.java @@ -71,7 +71,7 @@ public class PrefsStorableEnvironment extends StorableEnvironment { /** Cache of Environment as loaded from the {@link ISerializeInfo} * contains no non-persisted changes */ - private Map<String, IEnvironmentVariable> fCachedSerialEnv = new HashMap<String, IEnvironmentVariable>(); + private Map<String, IEnvironmentVariable> fCachedSerialEnv = new HashMap<>(); // State to track whether API users have changed these boolean values private boolean fAppendChanged = false; @@ -94,7 +94,7 @@ public class PrefsStorableEnvironment extends StorableEnvironment { Reference<PrefsStorableEnvironment> parentRef; public PrefListener(PrefsStorableEnvironment parent, ISerializeInfo info) { - this.parentRef = new WeakReference<PrefsStorableEnvironment>(parent); + this.parentRef = new WeakReference<>(parent); register(info); } @@ -203,7 +203,7 @@ public class PrefsStorableEnvironment extends StorableEnvironment { */ private Set<String> getDeletedSet() { if (fDeletedVariables == null) - fDeletedVariables = new HashSet<String>(); + fDeletedVariables = new HashSet<>(); return fDeletedVariables; } @@ -414,7 +414,7 @@ public class PrefsStorableEnvironment extends StorableEnvironment { if (!isDirty()) return; - HashMap<String, IEnvironmentVariable> oldEnv = new HashMap<String, IEnvironmentVariable>(fCachedSerialEnv); + HashMap<String, IEnvironmentVariable> oldEnv = new HashMap<>(fCachedSerialEnv); Preferences element = fSerialEnv.getNode().node(fSerialEnv.getPrefName()); element.putBoolean(ATTRIBUTE_APPEND, fAppend); @@ -490,7 +490,7 @@ public class PrefsStorableEnvironment extends StorableEnvironment { Map<String, IEnvironmentVariable> getAllVariablesMap() { checkBackingSerializeInfo(); // Get all the environment from the backing store first - Map<String, IEnvironmentVariable> vars = new HashMap<String, IEnvironmentVariable>(); + Map<String, IEnvironmentVariable> vars = new HashMap<>(); if (fCachedSerialEnv != null) vars.putAll(fCachedSerialEnv); if (fDeletedVariables != null) diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/envvar/StorableEnvironment.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/envvar/StorableEnvironment.java index ec1b9cdb606..ba45db85862 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/envvar/StorableEnvironment.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/envvar/StorableEnvironment.java @@ -48,7 +48,7 @@ public class StorableEnvironment { */ Map<String, IEnvironmentVariable> getMap() { if (fVariables == null) - fVariables = new HashMap<String, IEnvironmentVariable>(); + fVariables = new HashMap<>(); return fVariables; } @@ -294,7 +294,7 @@ public class StorableEnvironment { * @return cloned map of all variables set on this storable environment runtime variables + backing store vars */ Map<String, IEnvironmentVariable> getAllVariablesMap() { - Map<String, IEnvironmentVariable> vars = new HashMap<String, IEnvironmentVariable>(); + Map<String, IEnvironmentVariable> vars = new HashMap<>(); vars.putAll(getMap()); return vars; } diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/AR.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/AR.java index a84720bfc4d..cc7ebb714f8 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/AR.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/AR.java @@ -242,7 +242,7 @@ public class AR { if (headers != null) return; - Vector<ARHeader> v = new Vector<ARHeader>(); + Vector<ARHeader> v = new Vector<>(); try { // // Check for EOF condition @@ -291,7 +291,7 @@ public class AR { } public String[] extractFiles(String outdir, String[] names) throws IOException { - Vector<String> names_used = new Vector<String>(); + Vector<String> names_used = new Vector<>(); String object_name; int count; diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachO.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachO.java index 655e4330002..4bd96f5bd2c 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachO.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachO.java @@ -48,7 +48,7 @@ public class MachO { private Symbol[] local_symbols; /* local symbols from DySymtabCommand */ private boolean dynsym = false; /* set if DynSymtabCommand is present */ Line[] lines; /* line table */ - private ArrayList<Section> sections = new ArrayList<Section>(); /* sections from SegmentCommand */ + private ArrayList<Section> sections = new ArrayList<>(); /* sections from SegmentCommand */ SymtabCommand symtab; /* SymtabCommand that contains the symbol table */ protected static final String EMPTY_STRING = ""; //$NON-NLS-1$ @@ -1144,7 +1144,7 @@ public class MachO { case LoadCommand.LC_SYMTAB: symtab = (SymtabCommand) loadcommand; efile.seek(symtab.symoff); - ArrayList<Symbol> symList = new ArrayList<Symbol>(symtab.nsyms); + ArrayList<Symbol> symList = new ArrayList<>(symtab.nsyms); for (int s = 0; s < symtab.nsyms; s++) { Symbol symbol = new Symbol(); symbol.n_strx = efile.readIntE(); @@ -1166,7 +1166,7 @@ public class MachO { } } if (dysymtab != null) { - ArrayList<Symbol> symList = new ArrayList<Symbol>(dysymtab.nlocalsym); + ArrayList<Symbol> symList = new ArrayList<>(dysymtab.nlocalsym); for (int s = dysymtab.ilocalsym; s < dysymtab.nlocalsym; s++) { symList.add(symbols[s]); } @@ -1190,7 +1190,7 @@ public class MachO { } /* now create line table, sorted on address */ - Map<Line, Line> lineList = new HashMap<Line, Line>(nlines); + Map<Line, Line> lineList = new HashMap<>(nlines); for (Symbol sym : symbols) { if (sym.n_type == Symbol.N_SLINE || sym.n_type == Symbol.N_FUN) { Line lentry = new Line(); @@ -1236,9 +1236,9 @@ public class MachO { private ArrayList<Section> getSections(SegmentCommand seg) throws IOException { if (seg.nsects == 0) { - return new ArrayList<Section>(); + return new ArrayList<>(); } - ArrayList<Section> sections = new ArrayList<Section>(); + ArrayList<Section> sections = new ArrayList<>(); for (int i = 0; i < seg.nsects; i++) { Section section = new Section(); byte[] sectname = new byte[16]; @@ -1597,7 +1597,7 @@ public class MachO { } public DyLib[] getDyLibs(int type) { - ArrayList<DyLib> v = new ArrayList<DyLib>(); + ArrayList<DyLib> v = new ArrayList<>(); for (LoadCommand loadcommand : loadcommands) { if (loadcommand.cmd == type) { DyLibCommand dl = (DyLibCommand) loadcommand; diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachO64.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachO64.java index 1ab56e9a822..b319a0c1ecc 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachO64.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachO64.java @@ -46,7 +46,7 @@ public class MachO64 { private Symbol[] local_symbols; /* local symbols from DySymtabCommand */ private boolean dynsym = false; /* set if DynSymtabCommand is present */ Line[] lines; /* line table */ - private ArrayList<Section> sections = new ArrayList<Section>(); /* sections from SegmentCommand */ + private ArrayList<Section> sections = new ArrayList<>(); /* sections from SegmentCommand */ SymtabCommand symtab; /* SymtabCommand that contains the symbol table */ protected static final String EMPTY_STRING = ""; //$NON-NLS-1$ @@ -1219,7 +1219,7 @@ public class MachO64 { case LoadCommand.LC_SYMTAB: symtab = (SymtabCommand) loadcommand; efile.seek(symtab.symoff); - ArrayList<Symbol> symList = new ArrayList<Symbol>(symtab.nsyms); + ArrayList<Symbol> symList = new ArrayList<>(symtab.nsyms); for (int s = 0; s < symtab.nsyms; s++) { Symbol symbol = new Symbol(); symbol.is64 = b64; @@ -1246,7 +1246,7 @@ public class MachO64 { } } if (dysymtab != null) { - ArrayList<Symbol> symList = new ArrayList<Symbol>(dysymtab.nlocalsym); + ArrayList<Symbol> symList = new ArrayList<>(dysymtab.nlocalsym); for (int s = dysymtab.ilocalsym; s < dysymtab.nlocalsym; s++) { symList.add(symbols[s]); } @@ -1270,7 +1270,7 @@ public class MachO64 { } /* now create line table, sorted on address */ - Map<Line, Line> lineList = new HashMap<Line, Line>(nlines); + Map<Line, Line> lineList = new HashMap<>(nlines); for (Symbol sym : symbols) { if (sym.n_type == Symbol.N_SLINE || sym.n_type == Symbol.N_FUN) { Line lentry = new Line(); @@ -1315,9 +1315,9 @@ public class MachO64 { private ArrayList<Section> getSections(SegmentCommand seg) throws IOException { if (seg.nsects == 0) { - return new ArrayList<Section>(); + return new ArrayList<>(); } - ArrayList<Section> sections = new ArrayList<Section>(); + ArrayList<Section> sections = new ArrayList<>(); for (int i = 0; i < seg.nsects; i++) { Section section = new Section(); byte[] sectname = new byte[16]; @@ -1729,7 +1729,7 @@ public class MachO64 { } public DyLib[] getDyLibs(int type) { - ArrayList<DyLib> v = new ArrayList<DyLib>(); + ArrayList<DyLib> v = new ArrayList<>(); for (LoadCommand loadcommand : loadcommands) { if (loadcommand.cmd == type) { DyLibCommand dl = (DyLibCommand) loadcommand; diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachOHelper.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachOHelper.java index 265c4598e0c..620d4c651cc 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachOHelper.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachOHelper.java @@ -118,7 +118,7 @@ public class MachOHelper { } public MachO.Symbol[] getExternalFunctions() throws IOException { - Vector<Symbol> v = new Vector<Symbol>(); + Vector<Symbol> v = new Vector<>(); loadBinary(); @@ -136,7 +136,7 @@ public class MachOHelper { } public MachO.Symbol[] getExternalObjects() throws IOException { - Vector<Symbol> v = new Vector<Symbol>(); + Vector<Symbol> v = new Vector<>(); loadBinary(); @@ -154,7 +154,7 @@ public class MachOHelper { } public MachO.Symbol[] getUndefined() throws IOException { - Vector<Symbol> v = new Vector<Symbol>(); + Vector<Symbol> v = new Vector<>(); loadBinary(); @@ -171,7 +171,7 @@ public class MachOHelper { * TODO: I'm not sure if this are correct. Need to check */ public MachO.Symbol[] getLocalFunctions() throws IOException { - Vector<Symbol> v = new Vector<Symbol>(); + Vector<Symbol> v = new Vector<>(); loadBinary(); @@ -192,7 +192,7 @@ public class MachOHelper { * TODO: I'm not sure if this are correct. Need to check */ public MachO.Symbol[] getLocalObjects() throws IOException { - Vector<Symbol> v = new Vector<Symbol>(); + Vector<Symbol> v = new Vector<>(); loadBinary(); @@ -210,7 +210,7 @@ public class MachOHelper { } public MachO.Symbol[] getCommonObjects() throws IOException { - Vector<Symbol> v = new Vector<Symbol>(); + Vector<Symbol> v = new Vector<>(); loadBinary(); @@ -226,7 +226,7 @@ public class MachOHelper { } public String[] getNeeded() throws IOException { - Vector<String> v = new Vector<String>(); + Vector<String> v = new Vector<>(); loadBinary(); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachOHelper64.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachOHelper64.java index dc8cafcf429..de322172485 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachOHelper64.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachOHelper64.java @@ -119,7 +119,7 @@ public class MachOHelper64 { } public MachO64.Symbol[] getExternalFunctions() throws IOException { - Vector<Symbol> v = new Vector<Symbol>(); + Vector<Symbol> v = new Vector<>(); loadBinary(); @@ -137,7 +137,7 @@ public class MachOHelper64 { } public MachO64.Symbol[] getExternalObjects() throws IOException { - Vector<Symbol> v = new Vector<Symbol>(); + Vector<Symbol> v = new Vector<>(); loadBinary(); @@ -155,7 +155,7 @@ public class MachOHelper64 { } public MachO64.Symbol[] getUndefined() throws IOException { - Vector<Symbol> v = new Vector<Symbol>(); + Vector<Symbol> v = new Vector<>(); loadBinary(); @@ -172,7 +172,7 @@ public class MachOHelper64 { * TODO: I'm not sure if this are correct. Need to check */ public MachO64.Symbol[] getLocalFunctions() throws IOException { - Vector<Symbol> v = new Vector<Symbol>(); + Vector<Symbol> v = new Vector<>(); loadBinary(); for (Symbol sym : dynsyms) { @@ -192,7 +192,7 @@ public class MachOHelper64 { * TODO: I'm not sure if this are correct. Need to check */ public MachO64.Symbol[] getLocalObjects() throws IOException { - Vector<Symbol> v = new Vector<Symbol>(); + Vector<Symbol> v = new Vector<>(); loadBinary(); @@ -210,7 +210,7 @@ public class MachOHelper64 { } public MachO64.Symbol[] getCommonObjects() throws IOException { - Vector<Symbol> v = new Vector<Symbol>(); + Vector<Symbol> v = new Vector<>(); loadBinary(); @@ -226,7 +226,7 @@ public class MachOHelper64 { } public String[] getNeeded() throws IOException { - Vector<String> v = new Vector<String>(); + Vector<String> v = new Vector<>(); loadBinary(); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/parser/MachOBinaryArchive.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/parser/MachOBinaryArchive.java index c4795bad3a6..da20d640931 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/parser/MachOBinaryArchive.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/parser/MachOBinaryArchive.java @@ -36,7 +36,7 @@ public class MachOBinaryArchive extends BinaryFile implements IBinaryArchive { public MachOBinaryArchive(IBinaryParser parser, IPath p) throws IOException { super(parser, p, IBinaryFile.ARCHIVE); new AR(p.toOSString()).dispose(); // check file type - children = new ArrayList<IBinaryObject>(5); + children = new ArrayList<>(5); } /** diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/parser/MachOBinaryArchive64.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/parser/MachOBinaryArchive64.java index 06b72cf0bfa..8de3bf3cec9 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/parser/MachOBinaryArchive64.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/parser/MachOBinaryArchive64.java @@ -34,7 +34,7 @@ public class MachOBinaryArchive64 extends BinaryFile implements IBinaryArchive { public MachOBinaryArchive64(IBinaryParser parser, IPath p) throws IOException { super(parser, p, IBinaryFile.ARCHIVE); new AR(p.toOSString()).dispose(); // check file type - children = new ArrayList<IBinaryObject>(5); + children = new ArrayList<>(5); } /** diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/parser/MachOBinaryObject.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/parser/MachOBinaryObject.java index 2b235133272..37495287cf8 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/parser/MachOBinaryObject.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/parser/MachOBinaryObject.java @@ -252,7 +252,7 @@ public class MachOBinaryObject extends BinaryObjectAdapter { protected ISymbol[] loadSymbols(MachOHelper helper) throws IOException { CPPFilt cppfilt = null; try { - ArrayList<Symbol> list = new ArrayList<Symbol>(); + ArrayList<Symbol> list = new ArrayList<>(); // Hack should be remove when Elf is clean helper.getMachO().setCppFilter(false); cppfilt = getCPPFilt(); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/parser/MachOBinaryObject64.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/parser/MachOBinaryObject64.java index 4d1eb0b35d9..e59087fae4c 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/parser/MachOBinaryObject64.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/parser/MachOBinaryObject64.java @@ -262,7 +262,7 @@ public class MachOBinaryObject64 extends BinaryObjectAdapter { protected ISymbol[] loadSymbols(MachOHelper64 helper) throws IOException { CPPFilt cppfilt = null; try { - ArrayList<Symbol> list = new ArrayList<Symbol>(); + ArrayList<Symbol> list = new ArrayList<>(); // Hack should be remove when Elf is clean helper.getMachO().setCppFilter(false); cppfilt = getCPPFilt(); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/AR.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/AR.java index d80276b810a..4499a1c88fa 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/AR.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/AR.java @@ -241,7 +241,7 @@ public class AR { if (memberHeaders != null) return; - Vector<ARHeader> v = new Vector<ARHeader>(); + Vector<ARHeader> v = new Vector<>(); try { // // Check for EOF condition @@ -273,7 +273,7 @@ public class AR { } private String[] extractFiles(String outdir, String[] names) throws IOException { - Vector<String> names_used = new Vector<String>(); + Vector<String> names_used = new Vector<>(); String object_name; int count; diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/SOM.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/SOM.java index e4adf1f6f37..8d51309c245 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/SOM.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/SOM.java @@ -474,7 +474,7 @@ public class SOM { getRandomAccessFile(); rfile.seek(offset); int numSymbols = getFileHeader().symbol_total; - ArrayList<Symbol> symList = new ArrayList<Symbol>(numSymbols); + ArrayList<Symbol> symList = new ArrayList<>(numSymbols); for (int i = 0; i < numSymbols; ++i) { Symbol v = new Symbol(rfile); symList.add(v); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/parser/SOMBinaryArchive.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/parser/SOMBinaryArchive.java index feffd849c54..53cee864579 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/parser/SOMBinaryArchive.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/parser/SOMBinaryArchive.java @@ -40,7 +40,7 @@ public class SOMBinaryArchive extends BinaryFile implements IBinaryArchive { public SOMBinaryArchive(IBinaryParser parser, IPath path) throws IOException { super(parser, path, IBinaryFile.ARCHIVE); new AR(path.toOSString()).dispose(); // check file type - children = new ArrayList<IBinaryObject>(5); + children = new ArrayList<>(5); } /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/parser/SOMBinaryObject.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/parser/SOMBinaryObject.java index d37e43b01d7..ec31c2b1a5a 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/parser/SOMBinaryObject.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/parser/SOMBinaryObject.java @@ -186,7 +186,7 @@ public class SOMBinaryObject extends BinaryObjectAdapter { } protected void loadSymbols(SOM som) throws IOException { - ArrayList<Symbol> list = new ArrayList<Symbol>(); + ArrayList<Symbol> list = new ArrayList<>(); SOM.Symbol[] peSyms = som.getSymbols(); byte[] table = som.getStringTable(); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/AR.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/AR.java index 59cc84deee7..aea7534e873 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/AR.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/AR.java @@ -268,7 +268,7 @@ public class AR { if (memberHeaders != null) return; - Vector<MemberHeader> v = new Vector<MemberHeader>(); + Vector<MemberHeader> v = new Vector<>(); try { // // Check for EOF condition @@ -301,7 +301,7 @@ public class AR { } public String[] extractFiles(String outdir, String[] names) throws IOException { - Vector<String> names_used = new Vector<String>(); + Vector<String> names_used = new Vector<>(); String object_name; int count; diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/XCoff32.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/XCoff32.java index c7c31e9a0e8..47f00173dcc 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/XCoff32.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/XCoff32.java @@ -644,7 +644,7 @@ public class XCoff32 { getRandomAccessFile(); rfile.seek(offset); int numSymbols = getFileHeader().f_nsyms; - ArrayList<Symbol> symList = new ArrayList<Symbol>(numSymbols); + ArrayList<Symbol> symList = new ArrayList<>(numSymbols); for (int i = 0; i < numSymbols; ++i) { Symbol v = new Symbol(rfile); symList.add(v); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/parser/XCOFFBinaryArchive.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/parser/XCOFFBinaryArchive.java index 5ca9894f817..38790d0050f 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/parser/XCOFFBinaryArchive.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/parser/XCOFFBinaryArchive.java @@ -40,7 +40,7 @@ public class XCOFFBinaryArchive extends BinaryFile implements IBinaryArchive { public XCOFFBinaryArchive(IBinaryParser parser, IPath path) throws IOException { super(parser, path, IBinaryFile.ARCHIVE); new AR(path.toOSString()).dispose(); // check file type - children = new ArrayList<IBinaryObject>(5); + children = new ArrayList<>(5); } /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/parser/XCOFFBinaryObject.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/parser/XCOFFBinaryObject.java index 0849a7f1b17..81e9893d7b2 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/parser/XCOFFBinaryObject.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/parser/XCOFFBinaryObject.java @@ -177,7 +177,7 @@ public class XCOFFBinaryObject extends BinaryObjectAdapter { } protected void loadSymbols(XCoff32 xcoff) throws IOException { - ArrayList<XCoffSymbol> list = new ArrayList<XCoffSymbol>(); + ArrayList<XCoffSymbol> list = new ArrayList<>(); XCoff32.Symbol[] peSyms = xcoff.getSymbols(); byte[] table = xcoff.getStringTable(); diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/Main.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/Main.java index c349cf8736c..cb6818d2419 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/Main.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/Main.java @@ -404,7 +404,7 @@ public class Main { * @exception Exception thrown if a problem occurs during launching */ public static void main(String argString) throws Exception { - Vector<Object> list = new Vector<Object>(5); + Vector<Object> list = new Vector<>(5); for (StringTokenizer tokens = new StringTokenizer(argString, " "); tokens.hasMoreElements();) //$NON-NLS-1$ list.addElement(tokens.nextElement()); main(list.toArray(new String[list.size()])); diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/ResourceTestHelper.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/ResourceTestHelper.java index 16781c35505..c456faa47b2 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/ResourceTestHelper.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/ResourceTestHelper.java @@ -129,7 +129,7 @@ public class ResourceTestHelper { } public static IFile[] findFiles(String prefix, String suffix, int i, int n) { - List<IFile> files = new ArrayList<IFile>(n); + List<IFile> files = new ArrayList<>(n); for (int j = i; j < i + n; j++) { String path = prefix + j + suffix; files.add(findFile(path)); @@ -187,7 +187,7 @@ public class ResourceTestHelper { } private static List<Integer> identifierPositions(StringBuffer buffer, String identifier) { - List<Integer> positions = new ArrayList<Integer>(); + List<Integer> positions = new ArrayList<>(); int i = -1; while (true) { i = buffer.indexOf(identifier, i + 1); diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/util/StringAsserts.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/util/StringAsserts.java index e3668d9f026..15eecccfcb5 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/util/StringAsserts.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/util/StringAsserts.java @@ -109,8 +109,8 @@ abstract public class StringAsserts { } public static void assertEqualStringsIgnoreOrder(String[] actuals, String[] expecteds) { - ArrayList<String> list1 = new ArrayList<String>(Arrays.asList(actuals)); - ArrayList<String> list2 = new ArrayList<String>(Arrays.asList(expecteds)); + ArrayList<String> list1 = new ArrayList<>(Arrays.asList(actuals)); + ArrayList<String> list2 = new ArrayList<>(Arrays.asList(expecteds)); for (int i = list1.size() - 1; i >= 0; i--) { if (list2.remove(list1.get(i))) { @@ -152,8 +152,8 @@ abstract public class StringAsserts { } public static void assertExpectedExistInProposals(String[] actuals, String[] expecteds) { - ArrayList<String> list1 = new ArrayList<String>(Arrays.asList(actuals)); - ArrayList<String> list2 = new ArrayList<String>(Arrays.asList(expecteds)); + ArrayList<String> list1 = new ArrayList<>(Arrays.asList(actuals)); + ArrayList<String> list2 = new ArrayList<>(Arrays.asList(expecteds)); for (int i = list1.size() - 1; i >= 0; i--) { if (list2.remove(list1.get(i))) { diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/DOMASTNodeLeaf.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/DOMASTNodeLeaf.java index a95d2ab179c..eadac4a534f 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/DOMASTNodeLeaf.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/DOMASTNodeLeaf.java @@ -90,7 +90,7 @@ public class DOMASTNodeLeaf implements IAdaptable { // used for applying filters to the tree, since it is lazily populated // all parents of the desired tree object to display need to have a flag as well private int filterFlag = 0; - private static Set<String> ignoreInterfaces = new HashSet<String>(); + private static Set<String> ignoreInterfaces = new HashSet<>(); public static final int FLAG_PROBLEM = 1 << 0; public static final int FLAG_PREPROCESSOR = 1 << 1; public static final int FLAG_INCLUDE_STATEMENTS = 1 << 2; @@ -131,7 +131,7 @@ public class DOMASTNodeLeaf implements IAdaptable { if (node == null) return BLANK_STRING; StringBuilder buffer = new StringBuilder(); - List<Class<?>> search = new LinkedList<Class<?>>(); + List<Class<?>> search = new LinkedList<>(); boolean done = false; boolean needComma = false; diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameDialog.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameDialog.java index 431d37f4fb5..ed53bd7a8ea 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameDialog.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameDialog.java @@ -76,7 +76,7 @@ class FindIASTNameDialog extends Dialog { @Override public void shellActivated(ShellEvent e) { String oldText = fFindField.getText(); // XXX workaround for 10766 - List<String> oldList = new ArrayList<String>(); + List<String> oldList = new ArrayList<>(); oldList.addAll(fFindHistory); readConfiguration(); @@ -248,7 +248,7 @@ class FindIASTNameDialog extends Dialog { updateTarget(target, false); fDialogPositionInit = null; - fFindHistory = new ArrayList<String>(HISTORY_SIZE - 1); + fFindHistory = new ArrayList<>(HISTORY_SIZE - 1); fWrapInit = false; fCaseInit = false; diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameTarget.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameTarget.java index 4bf95d24c96..cff7352c1ba 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameTarget.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameTarget.java @@ -48,7 +48,7 @@ public class FindIASTNameTarget implements IFindReplaceTarget, IFindReplaceTarge { shouldVisitNames = true; } - public List<IASTName> nameList = new ArrayList<IASTName>(); + public List<IASTName> nameList = new ArrayList<>(); String findString = null; boolean caseSensitive = true; diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/templateengine/TemplateEngineTestsHelper.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/templateengine/TemplateEngineTestsHelper.java index 60d31e69e96..6a3c93f1f52 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/templateengine/TemplateEngineTestsHelper.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/templateengine/TemplateEngineTestsHelper.java @@ -64,7 +64,7 @@ public class TemplateEngineTestsHelper { public static TemplateCore[] getTestTemplates() { TemplateCore[] templates = TemplateEngine.getDefault().getTemplates(); - List<TemplateCore> testTemplates = new ArrayList<TemplateCore>(); + List<TemplateCore> testTemplates = new ArrayList<>(); for (int i = 0; i < templates.length; i++) { if (templates[i].getTemplateType().equals("TestTemplate")) { testTemplates.add(templates[i]); diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/templateengine/TestTemplateEngineBugs.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/templateengine/TestTemplateEngineBugs.java index 7a7ee994b2d..ff1c3b19fe0 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/templateengine/TestTemplateEngineBugs.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/templateengine/TestTemplateEngineBugs.java @@ -34,7 +34,7 @@ public class TestTemplateEngineBugs extends BaseTestCase { } private Set<String> set(String... s) { - HashSet<String> result = new HashSet<String>(); + HashSet<String> result = new HashSet<>(); result.addAll(Arrays.asList(s)); return result; } diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/BaseUITestCase.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/BaseUITestCase.java index a33b833762a..8de614ba976 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/BaseUITestCase.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/BaseUITestCase.java @@ -234,7 +234,7 @@ public class BaseUITestCase extends BaseTestCase { } private Control[] findControls(Control w, Class<?> clazz) { - ArrayList<Control> result = new ArrayList<Control>(); + ArrayList<Control> result = new ArrayList<>(); findControls(w, clazz, result); return result.toArray(new Control[result.size()]); } diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/extension/CHOpenListener.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/extension/CHOpenListener.java index c70d5240fd2..173bd41196c 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/extension/CHOpenListener.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/extension/CHOpenListener.java @@ -74,7 +74,7 @@ public class CHOpenListener implements IOpenListener { } IEditorPart editor = page.openEditor(input, editorId); IMarker fMarker = file.createMarker(IMarker.TEXT); - HashMap<String, Object> map = new HashMap<String, Object>(); + HashMap<String, Object> map = new HashMap<>(); map.put(IMarker.LINE_NUMBER, 3); fMarker.setAttributes(map); IDE.gotoMarker(editor, fMarker); diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/chelp/CHelpProviderTester.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/chelp/CHelpProviderTester.java index 0c3f125b721..799bb863d46 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/chelp/CHelpProviderTester.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/chelp/CHelpProviderTester.java @@ -295,7 +295,7 @@ public class CHelpProviderTester { } public IFunctionSummary[] generateMatchingFunctions(ICHelpBook[] helpBooks, String prefix, String providerID) { - ArrayList<IFunctionSummary> lst = new ArrayList<IFunctionSummary>(); + ArrayList<IFunctionSummary> lst = new ArrayList<>(); for (ICHelpBook helpBook : helpBooks) { if (helpBook instanceof CHelpBook) { lst.addAll(((CHelpBook) helpBook).getMatchingFunctions(prefix)); diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/misc/LanguageVerifierTests.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/misc/LanguageVerifierTests.java index 3a3a929ff52..af6ca6bd603 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/misc/LanguageVerifierTests.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/misc/LanguageVerifierTests.java @@ -39,7 +39,7 @@ public class LanguageVerifierTests extends TestCase { config.addWorkspaceMapping("foo", "bar"); config.addWorkspaceMapping("foo2", "bar2"); - Map<String, ILanguage> availableLanguages = new HashMap<String, ILanguage>(); + Map<String, ILanguage> availableLanguages = new HashMap<>(); availableLanguages.put("foo", null); availableLanguages.put("foo3", null); diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/quickfix/AssistQuickFixTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/quickfix/AssistQuickFixTest.java index ab6032e1dc0..86a65d792c6 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/quickfix/AssistQuickFixTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/quickfix/AssistQuickFixTest.java @@ -149,7 +149,7 @@ public class AssistQuickFixTest extends BaseUITestCase { private static final List<ICCompletionProposal> collectCorrections(CorrectionContext context, Class<?>[] filteredTypes) throws CoreException { - List<ICCompletionProposal> proposals = new ArrayList<ICCompletionProposal>(); + List<ICCompletionProposal> proposals = new ArrayList<>(); IStatus status = CCorrectionProcessor.collectCorrections(context, new IProblemLocation[0], proposals); assertStatusOk(status); @@ -183,7 +183,7 @@ public class AssistQuickFixTest extends BaseUITestCase { private static final ArrayList<ICCompletionProposal> collectAssists(CorrectionContext context, Class<?>[] filteredTypes) throws CoreException { - ArrayList<ICCompletionProposal> proposals = new ArrayList<ICCompletionProposal>(); + ArrayList<ICCompletionProposal> proposals = new ArrayList<>(); IStatus status = CCorrectionProcessor.collectAssists(context, new IProblemLocation[0], proposals); assertStatusOk(status); diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AbstractAutoEditTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AbstractAutoEditTest.java index 8068418c1c4..9b2bdd678fc 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AbstractAutoEditTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AbstractAutoEditTest.java @@ -45,7 +45,7 @@ public class AbstractAutoEditTest extends BaseTestCase { */ protected static class AutoEditTester { private IAutoEditStrategy tabsToSpacesConverter; - private Map<String, IAutoEditStrategy> fStrategyMap = new HashMap<String, IAutoEditStrategy>(); + private Map<String, IAutoEditStrategy> fStrategyMap = new HashMap<>(); IDocument fDoc; private String fPartitioning; private int fCaretOffset; diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CAutoIndentTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CAutoIndentTest.java index c0356e8cbe2..294e7ea268d 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CAutoIndentTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CAutoIndentTest.java @@ -347,7 +347,7 @@ public class CAutoIndentTest extends AbstractAutoEditTest { public void testBracketIndentForConstructorDefinition_Bug183814() throws BadLocationException { DefaultCodeFormatterOptions whitesmiths = DefaultCodeFormatterOptions.getWhitesmithsSettings(); - CCorePlugin.setOptions(new HashMap<String, String>(whitesmiths.getMap())); + CCorePlugin.setOptions(new HashMap<>(whitesmiths.getMap())); AutoEditTester tester = createAutoEditTester(); tester.type("Foo::Foo()\n{"); @@ -356,7 +356,7 @@ public class CAutoIndentTest extends AbstractAutoEditTest { public void testSmartPasteWhitesmiths_Bug180531() throws Exception { DefaultCodeFormatterOptions whitesmiths = DefaultCodeFormatterOptions.getWhitesmithsSettings(); - CCorePlugin.setOptions(new HashMap<String, String>(whitesmiths.getMap())); + CCorePlugin.setOptions(new HashMap<>(whitesmiths.getMap())); AutoEditTester tester = createAutoEditTester(); tester.type("A::~A()\n{"); @@ -380,7 +380,7 @@ public class CAutoIndentTest extends AbstractAutoEditTest { DefaultCodeFormatterOptions defaultOptions = DefaultCodeFormatterOptions.getDefaultSettings(); defaultOptions.indent_body_declarations_compare_to_namespace_header = true; - CCorePlugin.setOptions(new HashMap<String, String>(defaultOptions.getMap())); + CCorePlugin.setOptions(new HashMap<>(defaultOptions.getMap())); tester = createAutoEditTester(); tester.type("namespace ns {\n"); @@ -431,13 +431,13 @@ public class CAutoIndentTest extends AbstractAutoEditTest { } public void testTabsAsSpaces_SmartIndentDisabled_Bug242707() throws Exception { - HashMap<String, String> options = new HashMap<String, String>(); + HashMap<String, String> options = new HashMap<>(); options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE); options.put(DefaultCodeFormatterConstants.FORMATTER_INDENTATION_SIZE, "3"); options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "3"); DefaultCodeFormatterOptions defaultOptions = DefaultCodeFormatterOptions.getDefaultSettings(); defaultOptions.set(options); - CCorePlugin.setOptions(new HashMap<String, String>(defaultOptions.getMap())); + CCorePlugin.setOptions(new HashMap<>(defaultOptions.getMap())); IPreferenceStore store = PreferenceConstants.getPreferenceStore(); store.setValue(PreferenceConstants.EDITOR_SMART_TAB, false); @@ -542,7 +542,7 @@ public class CAutoIndentTest extends AbstractAutoEditTest { public void testSkipToStatementStartWhitesmiths_Bug311018() throws Exception { DefaultCodeFormatterOptions whitesmiths = DefaultCodeFormatterOptions.getWhitesmithsSettings(); - CCorePlugin.setOptions(new HashMap<String, String>(whitesmiths.getMap())); + CCorePlugin.setOptions(new HashMap<>(whitesmiths.getMap())); AutoEditTester tester = createAutoEditTester(); tester.type("if (i > 0)\n"); //$NON-NLS-1$ tester.type("{\n"); //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CPartitionScanner.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CPartitionScanner.java index 1aab6b1b4b4..6d95f66db72 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CPartitionScanner.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CPartitionScanner.java @@ -102,7 +102,7 @@ public class CPartitionScanner extends RuleBasedPartitionScanner implements ICPa IToken single_comment = new Token(C_SINGLE_LINE_COMMENT); IToken string = new Token(C_STRING); IToken character = new Token(C_CHARACTER); - List<IPredicateRule> rules = new ArrayList<IPredicateRule>(); + List<IPredicateRule> rules = new ArrayList<>(); // Minimize the number of rules, since we have duplicate rules // in the CCodeScanner... diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java index ad6014f0ba8..4c2a10cc35a 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java @@ -51,7 +51,7 @@ public class CodeFormatterTest extends BaseUITestCase { protected void setUp() throws Exception { super.setUp(); fDefaultOptions = DefaultCodeFormatterOptions.getDefaultSettings().getMap(); - fOptions = new HashMap<String, Object>(fDefaultOptions); + fOptions = new HashMap<>(fDefaultOptions); } @Override diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTestBase.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTestBase.java index 8cec47298e2..2e738b1a860 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTestBase.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTestBase.java @@ -252,7 +252,7 @@ abstract public class FoldingTestBase extends BaseUITestCase { } protected PositionAndCollapsed[] getFoldingPositions() { - List<PositionAndCollapsed> positionAndCollapseds = new ArrayList<PositionAndCollapsed>(); + List<PositionAndCollapsed> positionAndCollapseds = new ArrayList<>(); ProjectionAnnotationModel model = fEditor .getAdapter(ProjectionAnnotationModel.class); assertNotNull(model); diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/SemanticHighlightingTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/SemanticHighlightingTest.java index a34bbb6ea4f..7537a80bb10 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/SemanticHighlightingTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/SemanticHighlightingTest.java @@ -205,7 +205,7 @@ public class SemanticHighlightingTest extends TestCase { List<String>[] expected = new List[lines]; for (int i = 0; i < lines; ++i) { - expected[i] = new ArrayList<String>(); + expected[i] = new ArrayList<>(); } for (IASTComment comment : fAST.getComments()) { String contents = new String(comment.getComment()); @@ -219,7 +219,7 @@ public class SemanticHighlightingTest extends TestCase { List<String>[] actual = new List[lines]; for (int i = 0; i < lines; ++i) { - actual[i] = new ArrayList<String>(); + actual[i] = new ArrayList<>(); } for (Position p : getSemanticHighlightingPositions()) { assertTrue(p instanceof HighlightedPosition); diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TemplateFormatterTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TemplateFormatterTest.java index c26ff63cba7..e53386dba7c 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TemplateFormatterTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TemplateFormatterTest.java @@ -73,7 +73,7 @@ public class TemplateFormatterTest extends BaseUITestCase { } private void setOption(String key, String value) { - HashMap<String, String> options = new HashMap<String, String>(1); + HashMap<String, String> options = new HashMap<>(1); options.put(key, value); CCorePlugin.setOptions(options); } diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java index 14b25dbe037..483f7f1c1b6 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java @@ -920,7 +920,7 @@ public class CompletionTests extends CompletionTestBase { } private static void createIncludeFiles(File dir, String[] files) throws IOException { - Set<String> includeDirs = new HashSet<String>(); + Set<String> includeDirs = new HashSet<>(); for (String file2 : files) { File file = new File(dir, file2); final File parentFile = file.getParentFile(); diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/DocCommentHighlightingTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/DocCommentHighlightingTest.java index 40bd5f3db07..440c2fa4f4c 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/DocCommentHighlightingTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/DocCommentHighlightingTest.java @@ -136,7 +136,7 @@ public class DocCommentHighlightingTest extends BaseUITestCase { } protected List<Position> findRangesColored(RGB rgb) { - List<Position> result = new ArrayList<Position>(); + List<Position> result = new ArrayList<>(); IEditorPart p = get(); ISourceViewer vw = ((CEditor) p).getViewer(); Accessor a = new Accessor(vw, TextViewer.class); @@ -166,7 +166,7 @@ public class DocCommentHighlightingTest extends BaseUITestCase { } private List<Position> mkPositions(int[][] raw) { - List<Position> result = new ArrayList<Position>(); + List<Position> result = new ArrayList<>(); for (int i = 0; i < raw.length; i++) { Assert.assertEquals(2, raw[i].length); result.add(new Position(raw[i][0], raw[i][1])); diff --git a/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java b/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java index ecbb2f8d12c..56bf1aa88e7 100644 --- a/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java +++ b/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java @@ -63,7 +63,7 @@ public class TypeSelectionDialog extends TwoPaneElementSelector { private StringMatcher fNameMatcher; private StringMatcher[] fSegmentMatchers; private boolean fMatchGlobalNamespace; - private Collection<Integer> fVisibleTypes = new HashSet<Integer>(); + private Collection<Integer> fVisibleTypes = new HashSet<>(); private boolean fShowLowLevelTypes; @Override @@ -218,7 +218,7 @@ public class TypeSelectionDialog extends TwoPaneElementSelector { // the filter matcher contains state information, must not be static private final TypeFilterMatcher fFilterMatcher = new TypeFilterMatcher(); - private Set<Integer> fKnownTypes = new HashSet<Integer>(ALL_TYPES.length); + private Set<Integer> fKnownTypes = new HashSet<>(ALL_TYPES.length); private Text fTextWidget; private boolean fSelectFilterText = false; private FilteredList fNewFilteredList; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/codemanipulation/StubUtility.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/codemanipulation/StubUtility.java index c9be45ef9aa..7e87a4f9350 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/codemanipulation/StubUtility.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/codemanipulation/StubUtility.java @@ -439,7 +439,7 @@ public class StubUtility { IDocument doc = new Document(buffer.getString()); int nLines = doc.getNumberOfLines(); MultiTextEdit edit = new MultiTextEdit(); - HashSet<Integer> removedLines = new HashSet<Integer>(); + HashSet<Integer> removedLines = new HashSet<>(); for (int i = 0; i < variables.length; i++) { TemplateVariable position = findVariable(buffer, variables[i]); if (position == null) { @@ -762,7 +762,7 @@ public class StubUtility { } templateDatas = projectStore.getTemplateData(); } - List<Template> result = new ArrayList<Template>(); + List<Template> result = new ArrayList<>(); for (int j = 0; j < contentTypes.length; j++) { for (int i = 0; i < templateDatas.length; i++) { Template template = templateDatas[i].getTemplate(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/fix/LinkedProposalModel.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/fix/LinkedProposalModel.java index f435b0d82a6..087be3a3a59 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/fix/LinkedProposalModel.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/fix/LinkedProposalModel.java @@ -31,7 +31,7 @@ public class LinkedProposalModel { } if (fPositionGroups == null) { - fPositionGroups = new HashMap<String, LinkedProposalPositionGroup>(); + fPositionGroups = new HashMap<>(); } fPositionGroups.put(positionGroup.getGroupId(), positionGroup); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/fix/LinkedProposalPositionGroup.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/fix/LinkedProposalPositionGroup.java index ce56e364793..cb16dd6a767 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/fix/LinkedProposalPositionGroup.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/fix/LinkedProposalPositionGroup.java @@ -113,8 +113,8 @@ public class LinkedProposalPositionGroup { public LinkedProposalPositionGroup(String groupID) { fGroupId = groupID; - fPositions = new ArrayList<PositionInformation>(); - fProposals = new ArrayList<Proposal>(); + fPositions = new ArrayList<>(); + fProposals = new ArrayList<>(); } public void addPosition(PositionInformation position) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/BranchFlowInfo.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/BranchFlowInfo.java index 8af3398e546..00186f662e2 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/BranchFlowInfo.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/BranchFlowInfo.java @@ -22,7 +22,7 @@ class BranchFlowInfo extends FlowInfo { public BranchFlowInfo(IASTName label, FlowContext context) { super(NO_RETURN); - fBranches = new HashSet<String>(2); + fBranches = new HashSet<>(2); fBranches.add(makeString(label)); } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/FlowAnalyzer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/FlowAnalyzer.java index 9b8e209df83..ec01bb42528 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/FlowAnalyzer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/FlowAnalyzer.java @@ -100,8 +100,8 @@ abstract class FlowAnalyzer extends ASTGenericVisitor { static protected class SwitchData { private boolean fHasDefaultCase; - private final List<IRegion> fRanges = new ArrayList<IRegion>(4); - private final List<FlowInfo> fInfos = new ArrayList<FlowInfo>(4); + private final List<IRegion> fRanges = new ArrayList<>(4); + private final List<FlowInfo> fInfos = new ArrayList<>(4); public void setHasDefaultCase() { fHasDefaultCase = true; @@ -129,7 +129,7 @@ abstract class FlowAnalyzer extends ASTGenericVisitor { } } - private final HashMap<IASTNode, FlowInfo> fData = new HashMap<IASTNode, FlowInfo>(100); + private final HashMap<IASTNode, FlowInfo> fData = new HashMap<>(100); FlowContext fFlowContext; public FlowAnalyzer(FlowContext context) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/FlowContext.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/FlowContext.java index cbba70d5c72..850ccefcd05 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/FlowContext.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/FlowContext.java @@ -44,7 +44,7 @@ public class FlowContext extends LocalVariableIndex { public FlowContext(IASTFunctionDefinition functionDefinition) { super(functionDefinition); - fExceptionStack = new ArrayList<ICPPASTCatchHandler[]>(3); + fExceptionStack = new ArrayList<>(3); } public void setConsiderAccessMode(boolean b) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/FlowInfo.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/FlowInfo.java index 3d0b7da93c8..be6e06a8e75 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/FlowInfo.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/FlowInfo.java @@ -232,7 +232,7 @@ public abstract class FlowInfo { public Set<IVariable> get(FlowContext context, int mode) { if (fAccessModes == null) return Collections.emptySet(); - Set<IVariable> result = new HashSet<IVariable>(fAccessModes.length); + Set<IVariable> result = new HashSet<>(fAccessModes.length); for (int i = 0; i < fAccessModes.length; i++) { int accessMode = fAccessModes[i]; if ((accessMode & mode) != 0) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/LocalVariableIndex.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/LocalVariableIndex.java index 1083d36f9f1..a32070d330d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/LocalVariableIndex.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/refactoring/code/flow/LocalVariableIndex.java @@ -30,7 +30,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName; * one. */ public class LocalVariableIndex { - private final Map<IVariable, Integer> variableMap = new HashMap<IVariable, Integer>(); + private final Map<IVariable, Integer> variableMap = new HashMap<>(); public LocalVariableIndex(IASTFunctionDefinition functionDefinition) { functionDefinition.accept(new ASTVisitor() { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CFormatter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CFormatter.java index 4e4804c601b..fe65c123fb2 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CFormatter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CFormatter.java @@ -354,10 +354,10 @@ public class CFormatter { private List<TypedPosition> createRangeMarkers(TemplateVariable[] variables, IDocument document) throws MalformedTreeException, BadLocationException { - Map<ReplaceEdit, String> markerToOriginal = new HashMap<ReplaceEdit, String>(); + Map<ReplaceEdit, String> markerToOriginal = new HashMap<>(); MultiTextEdit root = new MultiTextEdit(0, document.getLength()); - List<TextEdit> edits = new ArrayList<TextEdit>(); + List<TextEdit> edits = new ArrayList<>(); boolean hasModifications = false; for (int i = 0; i != variables.length; i++) { final TemplateVariable variable = variables[i]; @@ -388,7 +388,7 @@ public class CFormatter { root.apply(document, TextEdit.UPDATE_REGIONS); } - List<TypedPosition> positions = new ArrayList<TypedPosition>(); + List<TypedPosition> positions = new ArrayList<>(); for (Iterator<TextEdit> it = edits.iterator(); it.hasNext();) { TextEdit edit = it.next(); try { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/FileTemplateContextType.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/FileTemplateContextType.java index c177f4afce0..a6de6963391 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/FileTemplateContextType.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/FileTemplateContextType.java @@ -196,7 +196,7 @@ public class FileTemplateContextType extends TemplateContextType { @Override protected void validateVariables(TemplateVariable[] variables) throws TemplateException { - ArrayList<String> required = new ArrayList<String>(5); + ArrayList<String> required = new ArrayList<>(5); for (int i = 0; i < variables.length; i++) { String type = variables[i].getType(); if (getResolver(type) == null) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/util/Resources.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/util/Resources.java index c88b797fad9..583368e9d39 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/util/Resources.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/util/Resources.java @@ -101,7 +101,7 @@ public class Resources { * @see org.eclipse.core.resources.IWorkspace#validateEdit(org.eclipse.core.resources.IFile[], java.lang.Object) */ public static IStatus makeCommittable(IResource[] resources, Object context) { - List<IResource> readOnlyFiles = new ArrayList<IResource>(); + List<IResource> readOnlyFiles = new ArrayList<>(); for (int i = 0; i < resources.length; i++) { IResource resource = resources[i]; if (resource.getType() == IResource.FILE) { @@ -133,7 +133,7 @@ public class Resources { } private static Map<IFile, Long> createModificationStampMap(List<IResource> files) { - Map<IFile, Long> map = new HashMap<IFile, Long>(); + Map<IFile, Long> map = new HashMap<>(); for (Iterator<IResource> iter = files.iterator(); iter.hasNext();) { IFile file = (IFile) iter.next(); map.put(file, Long.valueOf(file.getModificationStamp())); @@ -177,7 +177,7 @@ public class Resources { } public static String[] getLocationOSStrings(IResource[] resources) { - List<String> result = new ArrayList<String>(resources.length); + List<String> result = new ArrayList<>(resources.length); for (int i = 0; i < resources.length; i++) { IPath location = resources[i].getLocation(); if (location != null) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java index bc866c132b9..cc92fdd0203 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java @@ -425,7 +425,7 @@ public class BaseCElementContentProvider implements ITreeContentProvider { if (!cproject.getProject().isOpen()) return NO_CHILDREN; - List<ICElement> list = new ArrayList<ICElement>(); + List<ICElement> list = new ArrayList<>(); ICElement[] children = cproject.getChildren(); for (ICElement child : children) { if (child instanceof ISourceRoot && child.getResource().getType() == IResource.PROJECT) { @@ -454,7 +454,7 @@ public class BaseCElementContentProvider implements ITreeContentProvider { Object[] children = unit.getChildren(); if (fIncludesGrouping) { boolean hasInclude = false; - ArrayList<Object> list = new ArrayList<Object>(children.length); + ArrayList<Object> list = new ArrayList<>(children.length); for (int i = 0; i < children.length; i++) { if (!(children[i] instanceof IInclude)) { list.add(children[i]); @@ -467,10 +467,10 @@ public class BaseCElementContentProvider implements ITreeContentProvider { } children = list.toArray(); } - Map<String, NamespacesGrouping> nsmap = new HashMap<String, NamespacesGrouping>(); + Map<String, NamespacesGrouping> nsmap = new HashMap<>(); if (fNamespacesGrouping) { // check if there is another namespace with the same name for the same parent - List<Object> list = new ArrayList<Object>(children.length); + List<Object> list = new ArrayList<>(children.length); for (int i = 0; i < children.length; ++i) { if (children[i] instanceof INamespace) { INamespace n1 = (INamespace) children[i]; @@ -492,8 +492,8 @@ public class BaseCElementContentProvider implements ITreeContentProvider { } if (fMemberGrouping) { // check if there is another member with the same namespace for the same parent - List<Object> list = new ArrayList<Object>(children.length); - Map<String, MembersGrouping> map = new HashMap<String, MembersGrouping>(); + List<Object> list = new ArrayList<>(children.length); + Map<String, MembersGrouping> map = new HashMap<>(); for (int i = 0; i < children.length; ++i) { if (children[i] instanceof IMember) { final ICElement member = (ICElement) children[i]; @@ -515,7 +515,7 @@ public class BaseCElementContentProvider implements ITreeContentProvider { children = list.toArray(); } if (fMacroGrouping) { - ArrayList<Object> list = new ArrayList<Object>(children.length); + ArrayList<Object> list = new ArrayList<>(children.length); boolean hasMacros = false; for (int i = 0; i < children.length; i++) { if (!(children[i] instanceof IMacro)) @@ -542,8 +542,8 @@ public class BaseCElementContentProvider implements ITreeContentProvider { Object[] children = element.getChildren(); if (fMemberGrouping) { // check if there is another member with the same namespace for the same parent - List<Object> list = new ArrayList<Object>(children.length); - Map<String, MembersGrouping> map = new HashMap<String, MembersGrouping>(); + List<Object> list = new ArrayList<>(children.length); + Map<String, MembersGrouping> map = new HashMap<>(); for (int i = 0; i < children.length; ++i) { if (children[i] instanceof IMember) { final ICElement member = (ICElement) children[i]; @@ -602,9 +602,9 @@ public class BaseCElementContentProvider implements ITreeContentProvider { private List<ICElement> getMissingElements(ICContainer container, ICElement[] elements) { // nested source roots may be filtered out below the project root, // we need to find them to add them back in - List<ICElement> missingElements = new ArrayList<ICElement>(); + List<ICElement> missingElements = new ArrayList<>(); try { - List<IResource> missingContainers = new ArrayList<IResource>(); + List<IResource> missingContainers = new ArrayList<>(); IResource[] allChildren = container.getResource().members(); for (IResource child : allChildren) { if (!(child instanceof IContainer)) @@ -666,7 +666,7 @@ public class BaseCElementContentProvider implements ITreeContentProvider { } catch (CModelException e) { roots = new ISourceRoot[0]; } - List<Object> nonCResources = new ArrayList<Object>(objects.length); + List<Object> nonCResources = new ArrayList<>(objects.length); for (Object object : objects) { Object o = object; // A folder can also be a source root in the following case @@ -745,7 +745,7 @@ public class BaseCElementContentProvider implements ITreeContentProvider { protected IBinary[] getBinaries(IBinaryContainer container) throws CModelException { ICElement[] celements = container.getChildren(); - ArrayList<IBinary> list = new ArrayList<IBinary>(celements.length); + ArrayList<IBinary> list = new ArrayList<>(celements.length); for (ICElement celement : celements) { if (celement instanceof IBinary) { IBinary bin = (IBinary) celement; @@ -764,7 +764,7 @@ public class BaseCElementContentProvider implements ITreeContentProvider { protected IArchive[] getArchives(IArchiveContainer container) throws CModelException { ICElement[] celements = container.getChildren(); - ArrayList<IArchive> list = new ArrayList<IArchive>(celements.length); + ArrayList<IArchive> list = new ArrayList<>(celements.length); for (ICElement celement : celements) { if (celement instanceof IArchive) { IArchive ar = (IArchive) celement; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java index b2e759068e0..b62561b2f9b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java @@ -45,7 +45,7 @@ public class CPluginImages { public static final IPath ICONS_PATH = new Path("$nl$/icons"); //$NON-NLS-1$ /** Converter from CPluginImages key to CDTSharedImages key */ - private static Map<String, String> fPathMap = new HashMap<String, String>(); + private static Map<String, String> fPathMap = new HashMap<>(); private static final String NAME_PREFIX = CUIPlugin.PLUGIN_ID + '.'; private static final int NAME_PREFIX_LENGTH = NAME_PREFIX.length(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/LineBackgroundPainter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/LineBackgroundPainter.java index a07e16e491c..f2d6520f5e7 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/LineBackgroundPainter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/LineBackgroundPainter.java @@ -62,11 +62,11 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener { /** The viewer's widget */ private StyledText fTextWidget; /** Text positions (cursor line position is always at index 0 */ - private List<Position> fPositions = new ArrayList<Position>(); + private List<Position> fPositions = new ArrayList<>(); /** Cached text positions */ - private List<Position> fLastPositions = new ArrayList<Position>(); + private List<Position> fLastPositions = new ArrayList<>(); /** Temporary changed positions */ - private List<Position> fChangedPositions = new ArrayList<Position>(); + private List<Position> fChangedPositions = new ArrayList<>(); /** Cursor line position */ private Position fCursorLine = new TypedPosition(0, 0, CURSOR_LINE_TYPE); /** Saved cursor line position */ @@ -76,7 +76,7 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener { /** Whether cursor line highlighting is active */ private boolean fCursorLineActive; /** Map of position type to color */ - private Map<String, Color> fColorMap = new HashMap<String, Color>(); + private Map<String, Color> fColorMap = new HashMap<>(); /** * Creates a new painter for the given text viewer. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/MembersGrouping.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/MembersGrouping.java index d67b8f22a48..d5128d78db0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/MembersGrouping.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/MembersGrouping.java @@ -47,7 +47,7 @@ public class MembersGrouping extends CElementGrouping { @Override public Object[] getChildren(Object object) { - List<ICElement> nsMembers = new ArrayList<ICElement>(); + List<ICElement> nsMembers = new ArrayList<>(); if (fParent instanceof IParent) { try { nsMembers.addAll(getNamespaceChildren(((IParent) fParent).getChildren())); @@ -71,7 +71,7 @@ public class MembersGrouping extends CElementGrouping { * @return */ private Collection<? extends ICElement> getNamespaceChildren(ICElement[] icElements) { - List<ICElement> members = new ArrayList<ICElement>(icElements.length); + List<ICElement> members = new ArrayList<>(icElements.length); for (ICElement icElement : icElements) { if (icElement instanceof IMember) { String name = icElement.getElementName(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AbstractUpdateIndexAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AbstractUpdateIndexAction.java index 96165fb0f5c..5ed01bf26ec 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AbstractUpdateIndexAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AbstractUpdateIndexAction.java @@ -76,7 +76,7 @@ public abstract class AbstractUpdateIndexAction implements IObjectActionDelegate } protected ICElement[] getSelectedCElements() { - ArrayList<ICElement> tuSelection = new ArrayList<ICElement>(); + ArrayList<ICElement> tuSelection = new ArrayList<>(); if (fSelection instanceof IStructuredSelection) { IStructuredSelection resources = SelectionConverter.convertSelectionToResources(fSelection); for (Iterator<?> i = resources.iterator(); i.hasNext();) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AddBlockCommentAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AddBlockCommentAction.java index be397742b37..b5a446fda55 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AddBlockCommentAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AddBlockCommentAction.java @@ -57,7 +57,7 @@ public class AddBlockCommentAction extends BlockCommentAction { if (!(docExtension instanceof IDocument)) return; - List<Edit> edits = new LinkedList<Edit>(); + List<Edit> edits = new LinkedList<>(); ITypedRegion firstPartition = docExtension.getPartition(ICPartitions.C_PARTITIONING, selection.getOffset(), false); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/CreateParserLogAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/CreateParserLogAction.java index 1dd57c36422..7f2cd706952 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/CreateParserLogAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/CreateParserLogAction.java @@ -99,9 +99,9 @@ public class CreateParserLogAction implements IObjectActionDelegate { private static final String INDENT = " "; private static final class MyVisitor extends ASTVisitor { - List<IASTProblem> fProblems = new ArrayList<IASTProblem>(); - List<IProblemBinding> fProblemBindings = new ArrayList<IProblemBinding>(); - List<Exception> fExceptions = new ArrayList<Exception>(); + List<IASTProblem> fProblems = new ArrayList<>(); + List<IProblemBinding> fProblemBindings = new ArrayList<>(); + List<Exception> fExceptions = new ArrayList<>(); MyVisitor() { shouldVisitProblems = true; @@ -154,7 +154,7 @@ public class CreateParserLogAction implements IObjectActionDelegate { return; } - List<IWorkingCopy> workingCopies = new ArrayList<IWorkingCopy>(); + List<IWorkingCopy> workingCopies = new ArrayList<>(); final IWorkbenchPage activePage = fSite.getWorkbenchWindow().getActivePage(); for (IEditorReference eref : activePage.getEditorReferences()) { IEditorPart editor = eref.getEditor(false); @@ -312,7 +312,7 @@ public class CreateParserLogAction implements IObjectActionDelegate { output(out, "Preincluded files (option -include):", scfg.getIncludeFiles()); output(out, "Preincluded macro files (option -imacros):", scfg.getMacroFiles()); - HashSet<String> reported = new HashSet<String>(); + HashSet<String> reported = new HashSet<>(); output(out, "Macro definitions (option -D):", scfg.getDefinedSymbols(), reported); output(out, "Macro definitions (from language + headers in index):", ast.getBuiltinMacroDefinitions(), reported); @@ -374,7 +374,7 @@ public class CreateParserLogAction implements IObjectActionDelegate { IASTPreprocessorIncludeStatement[] includeDirectives, int linkageID) throws CoreException { fWroteUnresolvedTitle = false; ASTFilePathResolver resolver = new ProjectIndexerInputAdapter(prj); - HashSet<IIndexFile> handled = new HashSet<IIndexFile>(); + HashSet<IIndexFile> handled = new HashSet<>(); for (IASTPreprocessorIncludeStatement include : includeDirectives) { if (include.isResolved()) { IIndexFileLocation ifl = resolver.resolveASTPath(include.getPath()); @@ -429,7 +429,7 @@ public class CreateParserLogAction implements IObjectActionDelegate { if (!definedSymbols.isEmpty()) { out.println(label); - SortedMap<String, String> sorted = new TreeMap<String, String>(COMP_INSENSITIVE); + SortedMap<String, String> sorted = new TreeMap<>(COMP_INSENSITIVE); sorted.putAll(definedSymbols); for (Entry<String, String> entry : sorted.entrySet()) { final String macro = entry.getKey() + '=' + entry.getValue(); @@ -445,7 +445,7 @@ public class CreateParserLogAction implements IObjectActionDelegate { HashSet<String> reported) { if (defs.length > 0) { out.println(label); - SortedSet<String> macros = new TreeSet<String>(COMP_INSENSITIVE); + SortedSet<String> macros = new TreeSet<>(COMP_INSENSITIVE); for (IASTPreprocessorMacroDefinition def : defs) { macros.add(def.toString()); } @@ -518,7 +518,7 @@ public class CreateParserLogAction implements IObjectActionDelegate { } private ArrayList<ITranslationUnit> getSelectedTranslationUnits() { - ArrayList<ITranslationUnit> tuSelection = new ArrayList<ITranslationUnit>(); + ArrayList<ITranslationUnit> tuSelection = new ArrayList<>(); if (fSelection instanceof IStructuredSelection) { IStructuredSelection cElements = SelectionConverter.convertSelectionToCElements(fSelection); Iterator<?> i = cElements.iterator(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/DeleteResConfigsHandler.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/DeleteResConfigsHandler.java index 0cff564ebfe..dcd186889a3 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/DeleteResConfigsHandler.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/DeleteResConfigsHandler.java @@ -117,7 +117,7 @@ public class DeleteResConfigsHandler extends AbstractHandler { ICResourceDescription rd = cfgd.getResourceDescription(path, true); if (rd != null) { if (objects == null) - objects = new ArrayList<IResource>(); + objects = new ArrayList<>(); objects.add(res); break; // stop configurations scanning } @@ -211,7 +211,7 @@ public class DeleteResConfigsHandler extends AbstractHandler { if (outData != null) return outData.toArray(); - outData = new ArrayList<ResCfgData>(); + outData = new ArrayList<>(); List<?> ls = (List<?>) inputElement; Iterator<?> it = ls.iterator(); IProject proj = null; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ExcludeFromBuildHandler.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ExcludeFromBuildHandler.java index 19923aa1a4d..05d1c51ba41 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ExcludeFromBuildHandler.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ExcludeFromBuildHandler.java @@ -115,10 +115,10 @@ public class ExcludeFromBuildHandler extends AbstractHandler { continue; if (objects == null) - objects = new ArrayList<IResource>(); + objects = new ArrayList<>(); objects.add(res); if (cfgNames == null) { - cfgNames = new ArrayList<String>(cfgds.length); + cfgNames = new ArrayList<>(cfgds.length); for (int j = 0; j < cfgds.length; j++) { if (!canExclude(res, cfgds[j])) { cfgNames = null; @@ -221,7 +221,7 @@ public class ExcludeFromBuildHandler extends AbstractHandler { status[i] = true; } } - ArrayList<String> lst = new ArrayList<String>(); + ArrayList<String> lst = new ArrayList<>(); for (int i = 0; i < status.length; i++) if (status[i]) lst.add(cfgNames.get(i)); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/OpenActionUtil.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/OpenActionUtil.java index 9ec5d1fe7bd..03b553a6a7d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/OpenActionUtil.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/OpenActionUtil.java @@ -67,7 +67,7 @@ public class OpenActionUtil { */ public static List<ISourceReference> filterResolveResults(ICElement[] codeResolveResults) { int nResults = codeResolveResults.length; - List<ISourceReference> refs = new ArrayList<ISourceReference>(nResults); + List<ISourceReference> refs = new ArrayList<>(nResults); for (int i = 0; i < nResults; i++) { if (codeResolveResults[i] instanceof ISourceReference) refs.add((ISourceReference) codeResolveResults[i]); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/RemoveBlockCommentAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/RemoveBlockCommentAction.java index e6809dce6b5..8660627f0d9 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/RemoveBlockCommentAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/RemoveBlockCommentAction.java @@ -54,7 +54,7 @@ public class RemoveBlockCommentAction extends BlockCommentAction { if (!(docExtension instanceof IDocument)) return; - List<Edit> edits = new LinkedList<Edit>(); + List<Edit> edits = new LinkedList<>(); int partitionStart = -1; int partitionEnd = selection.getOffset(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/SelectionConverter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/SelectionConverter.java index a9265f0cf00..62d6a2919b0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/SelectionConverter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/SelectionConverter.java @@ -83,7 +83,7 @@ public class SelectionConverter { * @return The converted selection */ public static IStructuredSelection convertSelectionToCElements(ISelection s, boolean keepNonCElements) { - List<Object> converted = new ArrayList<Object>(); + List<Object> converted = new ArrayList<>(); if (s instanceof IStructuredSelection) { Object[] elements = ((IStructuredSelection) s).toArray(); for (int i = 0; i < elements.length; i++) { @@ -104,7 +104,7 @@ public class SelectionConverter { } public static IStructuredSelection convertSelectionToResources(ISelection s) { - List<Object> converted = new ArrayList<Object>(); + List<Object> converted = new ArrayList<>(); if (s instanceof StructuredSelection) { Object[] elements = ((StructuredSelection) s).toArray(); for (int i = 0; i < elements.length; i++) { @@ -156,7 +156,7 @@ public class SelectionConverter { */ public static IStructuredSelection allResources(IStructuredSelection selection, int resourceMask) { Iterator<?> adaptables = selection.iterator(); - List<IResource> result = new ArrayList<IResource>(); + List<IResource> result = new ArrayList<>(); while (adaptables.hasNext()) { Object next = adaptables.next(); if (next instanceof IAdaptable) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleManager.java index 6c9dd71ea5b..b015e44bae0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleManager.java @@ -70,7 +70,7 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang private ListenerList<IBuildConsoleListener> listeners = new ListenerList<>(); /** UI console object in which per-project consoles are shown */ private BuildConsole fConsole; - private Map<IProject, BuildConsolePartitioner> fConsoleMap = new HashMap<IProject, BuildConsolePartitioner>(); + private Map<IProject, BuildConsolePartitioner> fConsoleMap = new HashMap<>(); private Color infoColor; private Color outputColor; private Color errorColor; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CElementSet.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CElementSet.java index 321abffe14e..51f33ba61c5 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CElementSet.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CElementSet.java @@ -23,7 +23,7 @@ import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.internal.ui.viewsupport.WorkingSetFilterUI; public class CElementSet { - private Set<ICElement> fSet = new LinkedHashSet<ICElement>(); + private Set<ICElement> fSet = new LinkedHashSet<>(); private int fHashCode; CElementSet(ICElement[] elements) { @@ -76,7 +76,7 @@ public class CElementSet { } public ICElement[] getElements(WorkingSetFilterUI filter) { - ArrayList<ICElement> result = new ArrayList<ICElement>(fSet.size()); + ArrayList<ICElement> result = new ArrayList<>(fSet.size()); for (Iterator<ICElement> iter = fSet.iterator(); iter.hasNext();) { ICElement element = iter.next(); if (filter == null || filter.isPartOfWorkingSet(element)) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHContentProvider.java index cf3548aa8b2..42ebe62c902 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHContentProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHContentProvider.java @@ -211,7 +211,7 @@ public class CHContentProvider extends AsyncTreeContentProvider { } CHNode[] createNodes(CHNode node, CalledByResult result) throws CoreException { - ArrayList<CHNode> nodes = new ArrayList<CHNode>(); + ArrayList<CHNode> nodes = new ArrayList<>(); ICElement[] elements = result.getElements(); for (ICElement element : elements) { if (element != null) { @@ -248,7 +248,7 @@ public class CHContentProvider extends AsyncTreeContentProvider { CHNode[] createNodes(CHNode node, CallsToResult callsTo) throws CoreException { ITranslationUnit tu = CModelUtil.getTranslationUnit(node.getRepresentedDeclaration()); - ArrayList<CHNode> result = new ArrayList<CHNode>(); + ArrayList<CHNode> result = new ArrayList<>(); CElementSet[] elementSets = callsTo.getElementSets(); for (CElementSet elementSet : elementSets) { CElementSet set = elementSet; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHEProviderSettings.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHEProviderSettings.java index d664e2204ac..03779676190 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHEProviderSettings.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHEProviderSettings.java @@ -42,8 +42,8 @@ public class CHEProviderSettings { static IStyledLabelProvider[] chLabelProviders = null; private static void loadExtensions() { - List<ICHEContentProvider> chCProviders = new ArrayList<ICHEContentProvider>(); - List<IStyledLabelProvider> chLProviders = new ArrayList<IStyledLabelProvider>(); + List<ICHEContentProvider> chCProviders = new ArrayList<>(); + List<IStyledLabelProvider> chLProviders = new ArrayList<>(); IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_ID); if (extensionPoint != null) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHHistoryListAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHHistoryListAction.java index ed093e0ce40..298d3af4b6b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHHistoryListAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHHistoryListAction.java @@ -71,7 +71,7 @@ public class CHHistoryListAction extends Action { ILabelProvider labelProvider = new CUILabelProvider(CHHistoryAction.LABEL_OPTIONS, CElementImageProvider.OVERLAY_ICONS); - fHistoryList = new ListDialogField<ICElement>(adapter, buttonLabels, labelProvider); + fHistoryList = new ListDialogField<>(adapter, buttonLabels, labelProvider); fHistoryList.setLabelText(CHMessages.CHHistoryListAction_HistoryList_label); fHistoryList.setElements(Arrays.asList(historyEntries)); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHLabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHLabelProvider.java index ca548c5aa6b..38e14f60a1f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHLabelProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHLabelProvider.java @@ -45,7 +45,7 @@ public class CHLabelProvider extends AppearanceAwareLabelProvider { private CUILabelProvider fCLabelProvider = new CUILabelProvider(LABEL_OPTIONS_SIMPLE, CElementImageProvider.OVERLAY_ICONS); private CHContentProvider fContentProvider; - private HashMap<String, Image> fCachedImages = new HashMap<String, Image>(); + private HashMap<String, Image> fCachedImages = new HashMap<>(); private Color fColorInactive; private IStyledLabelProvider[] fProviders; private CHViewPart fView; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHNode.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHNode.java index aea54b5691e..5ac3a2d9543 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHNode.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHNode.java @@ -145,7 +145,7 @@ public class CHNode implements IAdaptable { fReferences = Collections.singletonList(info); return; case 1: - fReferences = new ArrayList<CHReferenceInfo>(fReferences); + fReferences = new ArrayList<>(fReferences); break; } fReferences.add(info); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHProviderManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHProviderManager.java index 501e3cff9f9..d4b4d53dcaf 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHProviderManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHProviderManager.java @@ -43,7 +43,7 @@ public class CHProviderManager { public List<ICallHierarchyProvider> getCallHierarchyProviders() { if (callHierarchyProviders == null) { - callHierarchyProviders = new ArrayList<ICallHierarchyProvider>(); + callHierarchyProviders = new ArrayList<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint indexProviderPoint = registry.getExtensionPoint(CALL_HIERARCHY_PROVIDERS); for (IExtension extension : indexProviderPoint.getExtensions()) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHQueries.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHQueries.java index 1289e87087b..d8079b4822c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHQueries.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHQueries.java @@ -178,7 +178,7 @@ public class CHQueries { static ICElement[] findOverriders(IIndex index, ICPPMethod binding) throws CoreException { IBinding[] virtualOverriders = ClassTypeHelper.findOverriders(index, binding); if (virtualOverriders.length > 0) { - ArrayList<ICElementHandle> list = new ArrayList<ICElementHandle>(); + ArrayList<ICElementHandle> list = new ArrayList<>(); list.addAll(Arrays.asList(IndexUI.findRepresentative(index, binding))); for (IBinding overrider : virtualOverriders) { list.addAll(Arrays.asList(IndexUI.findRepresentative(index, overrider))); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java index 3cae498e4e4..0f624c11ddf 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java @@ -68,11 +68,11 @@ public class CallHierarchyUI { /** * List of the Call Hierarchy views in LRU order, where the most recently used view is at index 0. */ - private static List<CHViewPart> fLRUCallHierarchyViews = new ArrayList<CHViewPart>(); + private static List<CHViewPart> fLRUCallHierarchyViews = new ArrayList<>(); private static int fViewCount; private static final int MAX_HISTORY_SIZE = 10; - private static List<ICElement> fHistoryEntries = new ArrayList<ICElement>(MAX_HISTORY_SIZE); + private static List<ICElement> fHistoryEntries = new ArrayList<>(MAX_HISTORY_SIZE); public static void setIsJUnitTest(boolean val) { sIsJUnitTest = val; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/ReferenceVisitor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/ReferenceVisitor.java index 26c618cd508..8e84b3a4327 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/ReferenceVisitor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/ReferenceVisitor.java @@ -25,7 +25,7 @@ import org.eclipse.cdt.core.dom.ast.IASTName; * @since 4.0 */ class ReferenceVisitor extends ASTVisitor { - private ArrayList<IASTName> fReferences = new ArrayList<IASTName>(); + private ArrayList<IASTName> fReferences = new ArrayList<>(); private int fOffset; private int fEndOffset; private String fFileName; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CStructureCreatorVisitor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CStructureCreatorVisitor.java index df7c9abadb9..18da53cc7b9 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CStructureCreatorVisitor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CStructureCreatorVisitor.java @@ -63,7 +63,7 @@ class CStructureCreatorVisitor extends ASTVisitor { private static final String TRANSLATION_UNIT_NAME = CUIMessages.CStructureCreatorVisitor_translationUnitName; private static final String ANONYMOUS_NAME = CoreModelMessages.getString("CElementLabels.anonymous"); //$NON-NLS-1$ - private Stack<DocumentRangeNode> fStack = new Stack<DocumentRangeNode>(); + private Stack<DocumentRangeNode> fStack = new Stack<>(); private IDocument fDocument; private String fTranslationUnitFileName; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/BuildGroup.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/BuildGroup.java index 53aa87cc984..fdc505dba0d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/BuildGroup.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/BuildGroup.java @@ -74,7 +74,7 @@ public class BuildGroup extends CViewActionGroup { @Override public void run() { // Ensure we correctly save files in all referenced projects before build - Set<IProject> prjs = new HashSet<IProject>(); + Set<IProject> prjs = new HashSet<>(); for (IResource resource : getSelectedResources()) { IProject project = resource.getProject(); if (project != null) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java index 2ecd51348a0..dd61e9432d2 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java @@ -947,7 +947,7 @@ public class CView extends ViewPart IMemento childMem = memento.getChild(TAG_EXPANDED); if (childMem != null) { - ArrayList<ICElement> elements = new ArrayList<ICElement>(); + ArrayList<ICElement> elements = new ArrayList<>(); IMemento[] elementMem = childMem.getChildren(TAG_ELEMENT); for (IMemento element2 : elementMem) { String p = element2.getString(TAG_PATH); @@ -963,7 +963,7 @@ public class CView extends ViewPart } childMem = memento.getChild(TAG_SELECTION); if (childMem != null) { - ArrayList<ICElement> list = new ArrayList<ICElement>(); + ArrayList<ICElement> list = new ArrayList<>(); IMemento[] elementMem = childMem.getChildren(TAG_ELEMENT); for (IMemento element2 : elementMem) { String p = element2.getString(TAG_PATH); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewContentProvider.java index 99c26431f88..0e58a5bf1c8 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewContentProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewContentProvider.java @@ -170,7 +170,7 @@ public class CViewContentProvider extends CElementContentProvider { protected IBinary[] getExecutables(IBinaryContainer container) throws CModelException { ICElement[] celements = container.getChildren(); - ArrayList<IBinary> list = new ArrayList<IBinary>(celements.length); + ArrayList<IBinary> list = new ArrayList<>(celements.length); for (int i = 0; i < celements.length; i++) { if (celements[i] instanceof IBinary) { IBinary bin = (IBinary) celements[i]; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewMoveAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewMoveAction.java index 720708489e9..4f4154544e6 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewMoveAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewMoveAction.java @@ -68,7 +68,7 @@ public class CViewMoveAction extends MoveResourceAction { List<?> destinations = getDestinations(); if (destinations != null && destinations.isEmpty() == false) { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - List<IResource> resources = new ArrayList<IResource>(); + List<IResource> resources = new ArrayList<>(); Iterator<?> iterator = destinations.iterator(); while (iterator.hasNext()) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/LibraryRefContainer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/LibraryRefContainer.java index 9cfe9b92ae8..2a79068500a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/LibraryRefContainer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/LibraryRefContainer.java @@ -61,7 +61,7 @@ public class LibraryRefContainer extends CElementGrouping { public Object[] getChildren(Object o) { try { ILibraryReference[] references = fCProject.getLibraryReferences(); - ArrayList<ILibraryReference> list = new ArrayList<ILibraryReference>(references.length); + ArrayList<ILibraryReference> list = new ArrayList<>(references.length); for (ILibraryReference reference : references) { IPath path = reference.getPath(); IFile file = reference.getCModel().getWorkspace().getRoot().getFileForLocation(path); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/SelectionTransferDropAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/SelectionTransferDropAdapter.java index 680df5dc04d..589a4129675 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/SelectionTransferDropAdapter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/SelectionTransferDropAdapter.java @@ -338,7 +338,7 @@ public class SelectionTransferDropAdapter extends CDTViewerDropAdapter implement } public static ICElement[] getCElements(List<?> elements) { - List<ICElement> resources = new ArrayList<ICElement>(elements.size()); + List<ICElement> resources = new ArrayList<>(elements.size()); for (Iterator<?> iter = elements.iterator(); iter.hasNext();) { Object element = iter.next(); if (element instanceof ITranslationUnit) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/SelectionList.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/SelectionList.java index f6054525872..98e28bb61bd 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/SelectionList.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/SelectionList.java @@ -136,7 +136,7 @@ public class SelectionList extends Composite { if (fList == null || fList.isDisposed() || fList.getSelectionCount() == 0) return Collections.emptyList(); int[] listSelection = fList.getSelectionIndices(); - List<Object> selected = new ArrayList<Object>(listSelection.length); + List<Object> selected = new ArrayList<>(listSelection.length); for (int i = 0; i < listSelection.length; i++) { selected.add(fElements[fFilteredElements[listSelection[i]]]); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/TextFieldNavigationHandler.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/TextFieldNavigationHandler.java index 263f5e017e7..7d864c159af 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/TextFieldNavigationHandler.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/TextFieldNavigationHandler.java @@ -363,7 +363,7 @@ public class TextFieldNavigationHandler { if (fSubmissions != null) return fSubmissions; - fSubmissions = new ArrayList<Submission>(); + fSubmissions = new ArrayList<>(); ICommandService commandService = PlatformUI.getWorkbench().getAdapter(ICommandService.class); IBindingService bindingService = PlatformUI.getWorkbench().getAdapter(IBindingService.class); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/AbstractPathOptionBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/AbstractPathOptionBlock.java index cf1af894ad4..49e30dd3aa2 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/AbstractPathOptionBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/AbstractPathOptionBlock.java @@ -80,7 +80,7 @@ abstract public class AbstractPathOptionBlock extends TabFolderOptionBlock imple List<CPElement> elements = getCPaths(); IPathEntry[] entries = getCProject().getRawPathEntries(); - List<IPathEntry> cpath = new ArrayList<IPathEntry>(elements.size() + entries.length); + List<IPathEntry> cpath = new ArrayList<>(elements.size() + entries.length); int[] applyTypes = getAppliedFilteredTypes(); // create and set the paths @@ -138,7 +138,7 @@ abstract public class AbstractPathOptionBlock extends TabFolderOptionBlock imple if (cpathEntries != null) { newCPath = getFilteredElements(cpathEntries, getFilteredTypes()); } else { - newCPath = new ArrayList<CPElement>(); + newCPath = new ArrayList<>(); } initialize(element, newCPath); } @@ -150,7 +150,7 @@ abstract public class AbstractPathOptionBlock extends TabFolderOptionBlock imple abstract protected void initialize(ICElement element, List<CPElement> cPaths); protected ArrayList<CPElement> getFilteredElements(IPathEntry[] cPathEntries, int[] types) { - ArrayList<CPElement> newCPath = new ArrayList<CPElement>(); + ArrayList<CPElement> newCPath = new ArrayList<>(); for (IPathEntry curr : cPathEntries) { if (contains(types, curr.getEntryKind())) { newCPath.add(CPElement.createFromExisting(curr, getCElement())); @@ -305,7 +305,7 @@ abstract public class AbstractPathOptionBlock extends TabFolderOptionBlock imple IPathEntry[] entries = getCProject().getRawPathEntries(); - List<IPathEntry> cpath = new ArrayList<IPathEntry>(cPathEntries.size() + entries.length); + List<IPathEntry> cpath = new ArrayList<>(cPathEntries.size() + entries.length); int[] applyTypes = getAppliedFilteredTypes(); // create and set the paths diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPElement.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPElement.java index 7dd7f2106d4..f3752a3685c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPElement.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPElement.java @@ -59,7 +59,7 @@ public class CPElement { private final IPath fPath; private final ICProject fCProject; private final IResource fResource; - private final ArrayList<Object> fChildren = new ArrayList<Object>(1); + private final ArrayList<Object> fChildren = new ArrayList<>(1); private boolean fIsExported; @@ -490,7 +490,7 @@ public class CPElement { // return new Object[] { findAttributeElement(SOURCEATTACHMENT) }; case IPathEntry.CDT_CONTAINER: { - List<Object> list = new ArrayList<Object>(); + List<Object> list = new ArrayList<>(); for (int i = 0; i < fChildren.size(); i++) { Object curr = fChildren.get(i); if (curr instanceof CPElementGroup) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPElementGroup.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPElementGroup.java index 1ceca40f13e..4481900de58 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPElementGroup.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPElementGroup.java @@ -35,13 +35,13 @@ public class CPElementGroup { public CPElementGroup(IResource resource) { this.kind = -1; this.resource = resource; - this.childrenListMap = new LinkedHashMap<Integer, List<CPElement>>(2); + this.childrenListMap = new LinkedHashMap<>(2); } public CPElementGroup(CPElement parent, int kind) { this.parent = parent; this.kind = kind; - this.childrenList = new ArrayList<CPElement>(); + this.childrenList = new ArrayList<>(); } public IResource getResource() { @@ -126,9 +126,9 @@ public class CPElementGroup { if (elements.length > 0) { if (childrenListMap != null) { childrenListMap.put(Integer.valueOf(elements[0].getEntryKind()), - new ArrayList<CPElement>(Arrays.asList(elements))); + new ArrayList<>(Arrays.asList(elements))); } else { - childrenList = new ArrayList<CPElement>(Arrays.asList(elements)); + childrenList = new ArrayList<>(Arrays.asList(elements)); } } } @@ -162,7 +162,7 @@ public class CPElementGroup { } Collection<List<CPElement>> lists = childrenListMap.values(); Iterator<List<CPElement>> iter = lists.iterator(); - List<CPElement> children = new ArrayList<CPElement>(); + List<CPElement> children = new ArrayList<>(); while (iter.hasNext()) { children.addAll(iter.next()); } @@ -196,7 +196,7 @@ public class CPElementGroup { } else { children = childrenListMap.get(Integer.valueOf(kind)); if (children == null && create) { - children = new ArrayList<CPElement>(); + children = new ArrayList<>(); childrenListMap.put(Integer.valueOf(kind), children); } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPElementSorter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPElementSorter.java index dd37747eb48..fedda3aa109 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPElementSorter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPElementSorter.java @@ -72,9 +72,9 @@ public class CPElementSorter extends ViewerSorter { @Override public void sort(Viewer viewer, Object[] elements) { // include paths and symbol definitions must not be sorted - List<Object> sort = new ArrayList<Object>(elements.length); - List<CPElement> includes = new ArrayList<CPElement>(elements.length); - List<CPElement> syms = new ArrayList<CPElement>(elements.length); + List<Object> sort = new ArrayList<>(elements.length); + List<CPElement> includes = new ArrayList<>(elements.length); + List<CPElement> syms = new ArrayList<>(elements.length); for (Object element : elements) { if (element instanceof CPElement) { CPElement cpelement = (CPElement) element; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathBasePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathBasePage.java index e770f2a0a62..8df8255e11f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathBasePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathBasePage.java @@ -38,7 +38,7 @@ public abstract class CPathBasePage extends AbstractCOptionPage { protected void fixNestingConflicts(List<CPElement> newEntries, List<CPElement> existingList, Set<CPElement> modifiedSourceEntries) { - ArrayList<CPElement> existing = new ArrayList<CPElement>(existingList); + ArrayList<CPElement> existing = new ArrayList<>(existingList); for (int i = 0; i < newEntries.size(); i++) { CPElement curr = newEntries.get(i); addExclusionPatterns(curr, existing, modifiedSourceEntries); @@ -76,7 +76,7 @@ public abstract class CPathBasePage extends AbstractCOptionPage { public abstract boolean isEntryKind(int kind); protected List<CPElement> filterList(List<CPElement> cpelements) { - ArrayList<CPElement> filtered = new ArrayList<CPElement>(); + ArrayList<CPElement> filtered = new ArrayList<>(); for (int i = 0; i < cpelements.size(); i++) { CPElement cpe = cpelements.get(i); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerDefaultPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerDefaultPage.java index 64e8036c30b..eb498e0b5d1 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerDefaultPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerDefaultPage.java @@ -47,7 +47,7 @@ public class CPathContainerDefaultPage extends NewElementWizardPage implements I setDescription(CPathEntryMessages.CPathContainerDefaultPage_description); setImageDescriptor(CPluginImages.DESC_WIZBAN_ADD_LIBRARY); - fUsedPaths = new ArrayList<IPath>(); + fUsedPaths = new ArrayList<>(); fEntryField = new StringDialogField(); fEntryField.setLabelText(CPathEntryMessages.CPathContainerDefaultPage_path_label); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerDescriptor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerDescriptor.java index a7a7c3f2fff..7c1c0f0f817 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerDescriptor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerDescriptor.java @@ -364,7 +364,7 @@ public class CPathContainerDescriptor implements IContainerDescriptor { } public static IContainerDescriptor[] getDescriptors() { - ArrayList<IContainerDescriptor> containers = new ArrayList<IContainerDescriptor>(); + ArrayList<IContainerDescriptor> containers = new ArrayList<>(); IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(CUIPlugin.PLUGIN_ID, ATT_EXTENSION); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerEntryPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerEntryPage.java index 91bc6479c51..ed3aed0b9df 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerEntryPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerEntryPage.java @@ -69,7 +69,7 @@ public class CPathContainerEntryPage extends CPathBasePage { ContainersAdapter adapter = new ContainersAdapter(); - fContainersList = new TreeListDialogField<CPElement>(adapter, buttonLabels, new CPElementLabelProvider()); + fContainersList = new TreeListDialogField<>(adapter, buttonLabels, new CPElementLabelProvider()); fContainersList.setDialogFieldListener(adapter); fContainersList.setLabelText(CPathEntryMessages.ContainerEntryPage_libraries_label); @@ -89,7 +89,7 @@ public class CPathContainerEntryPage extends CPathBasePage { private void updateLibrariesList() { List<CPElement> cpelements = fCPathList.getElements(); - List<CPElement> libelements = new ArrayList<CPElement>(cpelements.size()); + List<CPElement> libelements = new ArrayList<>(cpelements.size()); int nElements = cpelements.size(); for (int i = 0; i < nElements; i++) { @@ -220,7 +220,7 @@ public class CPathContainerEntryPage extends CPathBasePage { int nElementsChosen = containers.length; // remove duplicates List<CPElement> cplist = fContainersList.getElements(); - List<CPElement> elementsToAdd = new ArrayList<CPElement>(nElementsChosen); + List<CPElement> elementsToAdd = new ArrayList<>(nElementsChosen); for (int i = 0; i < nElementsChosen; i++) { CPElement curr = containers[i]; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerWizard.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerWizard.java index 302e78025a9..e526212b5cf 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerWizard.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerWizard.java @@ -123,7 +123,7 @@ public class CPathContainerWizard extends Wizard { } else if (fEntryToEdit == null) { // new entry: show selection page as // first page IContainerDescriptor[] containers = CPathContainerDescriptor.getDescriptors(); - List<IContainerDescriptor> allContainers = new ArrayList<IContainerDescriptor>(Arrays.asList(containers)); + List<IContainerDescriptor> allContainers = new ArrayList<>(Arrays.asList(containers)); if (fFilterType != null) { allContainers.add(0, new ProjectContainerDescriptor(fFilterType)); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathFilterPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathFilterPage.java index 4f8235eea16..24032a4aa4f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathFilterPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathFilterPage.java @@ -123,7 +123,7 @@ public class CPathFilterPage extends WizardPage { } private void createExlusions(boolean showExported) { - fExclusions = new ArrayList<Object>(); + fExclusions = new ArrayList<>(); if (filter != null) { viewer.removeFilter(filter); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPage.java index cf17136734d..4cd08701591 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPage.java @@ -277,7 +277,7 @@ public class CPathIncludeSymbolEntryPage extends CPathIncludeSymbolEntryBasePage private List<CPElementGroup> createGroups(ICElement element, List<?> cPaths) { // create resource groups - List<CPElementGroup> resourceGroups = new ArrayList<CPElementGroup>(5); + List<CPElementGroup> resourceGroups = new ArrayList<>(5); fTopGroup = new CPElementGroup(element.getResource()); resourceGroups.add(fTopGroup); // add containers first so that they appear at top of list @@ -1116,7 +1116,7 @@ public class CPathIncludeSymbolEntryPage extends CPathIncludeSymbolEntryBasePage @Override public List<CPElement> getCPaths() { - List<CPElement> cPaths = new ArrayList<CPElement>(); + List<CPElement> cPaths = new ArrayList<>(); List<CPElementGroup> groups = fIncludeSymPathsList.getElements(); for (int i = 0; i < groups.size(); i++) { CPElementGroup group = groups.get(i); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPerFilePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPerFilePage.java index 9deedc2c957..adf63ce042d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPerFilePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPerFilePage.java @@ -326,7 +326,7 @@ public class CPathIncludeSymbolEntryPerFilePage extends CPathIncludeSymbolEntryB private List<CPElementGroup> createGroups(ICElement element, List<CPElement> cPaths) { // create resource groups - List<CPElementGroup> resourceGroups = new ArrayList<CPElementGroup>(5); + List<CPElementGroup> resourceGroups = new ArrayList<>(5); fTopGroup = new CPElementGroup(element.getResource()); resourceGroups.add(fTopGroup); // add containers first so that they appear at top of list @@ -1171,7 +1171,7 @@ public class CPathIncludeSymbolEntryPerFilePage extends CPathIncludeSymbolEntryB @Override public List<CPElement> getCPaths() { - List<CPElement> cPaths = new ArrayList<CPElement>(); + List<CPElement> cPaths = new ArrayList<>(); List<CPElementGroup> groups = fIncludeSymPathsList.getElements(); for (int i = 0; i < groups.size(); i++) { CPElementGroup group = groups.get(i); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathLibraryEntryPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathLibraryEntryPage.java index d2b834ff545..ebbe97dcee9 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathLibraryEntryPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathLibraryEntryPage.java @@ -94,7 +94,7 @@ public class CPathLibraryEntryPage extends CPathBasePage { CPathEntryMessages.LibrariesEntryPage_libraries_remove_button, null, CPathEntryMessages.LibrariesEntryPage_libraries_export_button }; - fLibrariesList = new TreeListDialogField<CPElement>(adapter, buttonLabels, new CPElementLabelProvider()); + fLibrariesList = new TreeListDialogField<>(adapter, buttonLabels, new CPElementLabelProvider()); fLibrariesList.setDialogFieldListener(adapter); fLibrariesList.setLabelText(CPathEntryMessages.LibrariesEntryPage_libraries_label); @@ -262,7 +262,7 @@ public class CPathLibraryEntryPage extends CPathBasePage { int nElementsChosen = libentries.length; // remove duplicates List<CPElement> cplist = fLibrariesList.getElements(); - List<CPElement> elementsToAdd = new ArrayList<CPElement>(nElementsChosen); + List<CPElement> elementsToAdd = new ArrayList<>(nElementsChosen); for (int i = 0; i < nElementsChosen; i++) { CPElement curr = libentries[i]; @@ -426,7 +426,7 @@ public class CPathLibraryEntryPage extends CPathBasePage { } private IFile[] getUsedLibFiles(CPElement existing) { - List<IResource> res = new ArrayList<IResource>(); + List<IResource> res = new ArrayList<>(); List<CPElement> cplist = fLibrariesList.getElements(); for (int i = 0; i < cplist.size(); i++) { CPElement elem = cplist.get(i); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathOutputEntryPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathOutputEntryPage.java index fc8e9172890..cc6cf459232 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathOutputEntryPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathOutputEntryPage.java @@ -94,7 +94,7 @@ public class CPathOutputEntryPage extends CPathBasePage { CPathEntryMessages.OutputPathEntryPage_folders_edit_button, CPathEntryMessages.OutputPathEntryPage_folders_remove_button }; - fOutputList = new TreeListDialogField<CPElement>(adapter, buttonLabels, new CPElementLabelProvider()); + fOutputList = new TreeListDialogField<>(adapter, buttonLabels, new CPElementLabelProvider()); fOutputList.setDialogFieldListener(adapter); fOutputList.setLabelText(CPathEntryMessages.OutputPathEntryPage_folders_label); @@ -245,7 +245,7 @@ public class CPathOutputEntryPage extends CPathBasePage { protected void outputPageCustomButtonPressed(DialogField field, int index) { if (field == fOutputList) { if (index == IDX_ADD) { - List<CPElement> elementsToAdd = new ArrayList<CPElement>(10); + List<CPElement> elementsToAdd = new ArrayList<>(10); IProject project = fCurrCProject.getProject(); if (project.exists()) { if (hasFolders(project)) { @@ -268,7 +268,7 @@ public class CPathOutputEntryPage extends CPathBasePage { } } if (!elementsToAdd.isEmpty()) { - HashSet<CPElement> modifiedElements = new HashSet<CPElement>(); + HashSet<CPElement> modifiedElements = new HashSet<>(); askForAddingExclusionPatternsDialog(elementsToAdd, modifiedElements); fOutputList.addElements(elementsToAdd); @@ -472,7 +472,7 @@ public class CPathOutputEntryPage extends CPathBasePage { List<IContainer> existingContainers = getExistingContainers(null); IProject[] allProjects = fWorkspaceRoot.getProjects(); - ArrayList<IProject> rejectedElements = new ArrayList<IProject>(allProjects.length); + ArrayList<IProject> rejectedElements = new ArrayList<>(allProjects.length); IProject currProject = fCurrCProject.getProject(); for (int i = 0; i < allProjects.length; i++) { if (!allProjects[i].equals(currProject)) { @@ -515,7 +515,7 @@ public class CPathOutputEntryPage extends CPathBasePage { } private List<IContainer> getExistingContainers(CPElement existing) { - List<IContainer> res = new ArrayList<IContainer>(); + List<IContainer> res = new ArrayList<>(); List<CPElement> cplist = fOutputList.getElements(); for (int i = 0; i < cplist.size(); i++) { CPElement elem = cplist.get(i); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathProjectsEntryPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathProjectsEntryPage.java index bf74026947d..f9e7d78664c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathProjectsEntryPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathProjectsEntryPage.java @@ -60,7 +60,7 @@ public class CPathProjectsEntryPage extends CPathBasePage { String[] buttonLabels = new String[] { CPathEntryMessages.ProjectsEntryPage_projects_checkall_button, CPathEntryMessages.ProjectsEntryWorkbookPage_projects_uncheckall_button }; - fProjectsList = new CheckedListDialogField<CPElement>(null, buttonLabels, new CPElementLabelProvider()); + fProjectsList = new CheckedListDialogField<>(null, buttonLabels, new CPElementLabelProvider()); fProjectsList.setDialogFieldListener(listener); fProjectsList.setLabelText(CPathEntryMessages.ProjectsEntryPage_projects_label); fProjectsList.setCheckAllButtonIndex(0); @@ -136,13 +136,13 @@ public class CPathProjectsEntryPage extends CPathBasePage { void updateProjectsList(ICProject currCProject) { ICModel cmodel = currCProject.getCModel(); - List<CPElement> projects = new ArrayList<CPElement>(); - final List<CPElement> checkedProjects = new ArrayList<CPElement>(); + List<CPElement> projects = new ArrayList<>(); + final List<CPElement> checkedProjects = new ArrayList<>(); try { ICProject[] cprojects = cmodel.getCProjects(); // a vector remembering all projects that dont have to be added anymore - List<IResource> existingProjects = new ArrayList<IResource>(cprojects.length); + List<IResource> existingProjects = new ArrayList<>(cprojects.length); existingProjects.add(currCProject.getProject()); // add the projects-cpentries that are already on the C Path diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathSourceEntryPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathSourceEntryPage.java index f7ee0ff0b08..8ded3d9d596 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathSourceEntryPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathSourceEntryPage.java @@ -93,7 +93,7 @@ public class CPathSourceEntryPage extends CPathBasePage { CPathEntryMessages.SourcePathEntryPath_folders_edit_button, CPathEntryMessages.SourcePathEntryPage_folders_remove_button }; - fFoldersList = new TreeListDialogField<CPElement>(adapter, buttonLabels, new CPElementLabelProvider()); + fFoldersList = new TreeListDialogField<>(adapter, buttonLabels, new CPElementLabelProvider()); fFoldersList.setDialogFieldListener(adapter); fFoldersList.setLabelText(CPathEntryMessages.SourcePathEntryPage_folders_label); @@ -229,7 +229,7 @@ public class CPathSourceEntryPage extends CPathBasePage { protected void sourcePageCustomButtonPressed(DialogField field, int index) { if (field == fFoldersList) { if (index == IDX_ADD) { - List<CPElement> elementsToAdd = new ArrayList<CPElement>(10); + List<CPElement> elementsToAdd = new ArrayList<>(10); IProject project = fCurrCProject.getProject(); if (project.exists()) { CPElement[] srcentries = openSourceContainerDialog(null); @@ -245,7 +245,7 @@ public class CPathSourceEntryPage extends CPathBasePage { } } if (!elementsToAdd.isEmpty()) { - HashSet<CPElement> modifiedElements = new HashSet<CPElement>(); + HashSet<CPElement> modifiedElements = new HashSet<>(); askForAddingExclusionPatternsDialog(elementsToAdd, modifiedElements); fFoldersList.addElements(elementsToAdd); @@ -449,7 +449,7 @@ public class CPathSourceEntryPage extends CPathBasePage { List<IContainer> existingContainers = getExistingContainers(null); IProject[] allProjects = fWorkspaceRoot.getProjects(); - ArrayList<IProject> rejectedElements = new ArrayList<IProject>(allProjects.length); + ArrayList<IProject> rejectedElements = new ArrayList<>(allProjects.length); IProject currProject = fCurrCProject.getProject(); for (int i = 0; i < allProjects.length; i++) { if (!allProjects[i].equals(currProject)) { @@ -492,7 +492,7 @@ public class CPathSourceEntryPage extends CPathBasePage { } private List<IContainer> getExistingContainers(CPElement existing) { - List<IContainer> res = new ArrayList<IContainer>(); + List<IContainer> res = new ArrayList<>(); List<CPElement> cplist = fFoldersList.getElements(); for (int i = 0; i < cplist.size(); i++) { CPElement elem = cplist.get(i); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathTabBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathTabBlock.java index f4530a0c713..7aedb1da5c9 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathTabBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathTabBlock.java @@ -74,7 +74,7 @@ public class CPathTabBlock extends AbstractPathOptionBlock { }; BuildPathAdapter adapter = new BuildPathAdapter(); - fCPathList = new ListDialogField<CPElement>(null, buttonLabels, null); + fCPathList = new ListDialogField<>(null, buttonLabels, null); fCPathList.setDialogFieldListener(adapter); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/ExclusionPatternDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/ExclusionPatternDialog.java index bc0c4bc7c14..4167f850764 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/ExclusionPatternDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/ExclusionPatternDialog.java @@ -96,7 +96,7 @@ public class ExclusionPatternDialog extends StatusDialog { ExclusionPatternAdapter adapter = new ExclusionPatternAdapter(); - fExclusionPatternList = new ListDialogField<String>(adapter, buttonLabels, new ExclusionPatternLabelProvider()); + fExclusionPatternList = new ListDialogField<>(adapter, buttonLabels, new ExclusionPatternLabelProvider()); fExclusionPatternList.setDialogFieldListener(adapter); fExclusionPatternList.setLabelText(label); fExclusionPatternList.setRemoveButtonIndex(IDX_REMOVE); @@ -111,7 +111,7 @@ public class ExclusionPatternDialog extends StatusDialog { IPath[] pattern = (IPath[]) entryToEdit.getAttribute(CPElement.EXCLUSION); - ArrayList<String> elements = new ArrayList<String>(pattern.length); + ArrayList<String> elements = new ArrayList<>(pattern.length); for (IPath element : pattern) { elements.add(element.toString()); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/MultipleFolderSelectionDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/MultipleFolderSelectionDialog.java index 6ce6ce1c3ac..e0f626094f0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/MultipleFolderSelectionDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/MultipleFolderSelectionDialog.java @@ -85,7 +85,7 @@ public class MultipleFolderSelectionDialog extends SelectionStatusDialog impleme } public void setExisting(Object[] existing) { - fExisting = new HashSet<Object>(); + fExisting = new HashSet<>(); for (int i = 0; i < existing.length; i++) { fExisting.add(existing[i]); } @@ -109,7 +109,7 @@ public class MultipleFolderSelectionDialog extends SelectionStatusDialog impleme */ public void addFilter(ViewerFilter filter) { if (fFilters == null) - fFilters = new ArrayList<ViewerFilter>(4); + fFilters = new ArrayList<>(4); fFilters.add(filter); } @@ -134,7 +134,7 @@ public class MultipleFolderSelectionDialog extends SelectionStatusDialog impleme checked = null; } } else { - ArrayList<Object> res = new ArrayList<Object>(); + ArrayList<Object> res = new ArrayList<>(); for (int i = 0; i < checked.length; i++) { Object elem = checked[i]; if (!fExisting.contains(elem)) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/ProjectContainerPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/ProjectContainerPage.java index 30e670affd6..a9090dcb4e7 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/ProjectContainerPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/ProjectContainerPage.java @@ -136,7 +136,7 @@ public class ProjectContainerPage extends WizardPage implements IPathEntryContai } private void initializeView() { - List<ICProject> list = new ArrayList<ICProject>(); + List<ICProject> list = new ArrayList<>(); List<IPathEntry> current; try { current = Arrays.asList(fCProject.getRawPathEntries()); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/SourceAttachmentBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/SourceAttachmentBlock.java index f5ca91dca82..761d3e32b2b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/SourceAttachmentBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/SourceAttachmentBlock.java @@ -448,7 +448,7 @@ public class SourceAttachmentBlock { IProgressMonitor monitor) throws CModelException { IPathEntry[] oldClasspath = cproject.getRawPathEntries(); int nEntries = oldClasspath.length; - ArrayList<IPathEntry> newEntries = new ArrayList<IPathEntry>(nEntries + 1); + ArrayList<IPathEntry> newEntries = new ArrayList<>(nEntries + 1); int entryKind = newEntry.getEntryKind(); IPath jarPath = newEntry.getPath(); boolean found = false; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dnd/DelegatingDragAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dnd/DelegatingDragAdapter.java index 5f386b4879e..437e373dfce 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dnd/DelegatingDragAdapter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dnd/DelegatingDragAdapter.java @@ -52,8 +52,8 @@ public class DelegatingDragAdapter implements DragSourceListener { boolean saveDoit = event.doit; Object saveData = event.data; boolean doIt = false; - List<Transfer> transfers = new ArrayList<Transfer>(fPossibleListeners.length); - fActiveListeners = new ArrayList<TransferDragSourceListener>(fPossibleListeners.length); + List<Transfer> transfers = new ArrayList<>(fPossibleListeners.length); + fActiveListeners = new ArrayList<>(fPossibleListeners.length); for (TransferDragSourceListener listener : fPossibleListeners) { event.doit = saveDoit; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dnd/FileTransferDragAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dnd/FileTransferDragAdapter.java index 595a0568e06..91fcdb40480 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dnd/FileTransferDragAdapter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dnd/FileTransferDragAdapter.java @@ -89,7 +89,7 @@ public class FileTransferDragAdapter implements TransferDragSourceListener { public RefreshOperation(List<IResource> resources) { super(); - roots = new HashSet<IResource>(resources.size()); + roots = new HashSet<>(resources.size()); for (IResource resource : resources) { IResource parent = resource.getParent(); @@ -127,7 +127,7 @@ public class FileTransferDragAdapter implements TransferDragSourceListener { if (selection instanceof IStructuredSelection) { IStructuredSelection structured = (IStructuredSelection) selection; - result = new ArrayList<IResource>(structured.size()); + result = new ArrayList<>(structured.size()); for (Iterator<?> iterator = structured.iterator(); iterator.hasNext();) { Object object = iterator.next(); @@ -150,7 +150,7 @@ public class FileTransferDragAdapter implements TransferDragSourceListener { private static String[] getResourceLocations(List<IResource> resources) { if (!resources.isEmpty()) { int count = resources.size(); - List<String> locations = new ArrayList<String>(count); + List<String> locations = new ArrayList<>(count); for (IResource resource : resources) { IPath location = resource.getLocation(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dnd/ResourceTransferDragAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dnd/ResourceTransferDragAdapter.java index eb2e572aa2f..d31ecbfaf00 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dnd/ResourceTransferDragAdapter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dnd/ResourceTransferDragAdapter.java @@ -107,7 +107,7 @@ public class ResourceTransferDragAdapter implements TransferDragSourceListener { if (selection instanceof IStructuredSelection) { IStructuredSelection structured = (IStructuredSelection) selection; - resources = new ArrayList<IResource>(structured.size()); + resources = new ArrayList<>(structured.size()); for (Iterator<?> iterator = structured.iterator(); iterator.hasNext();) { Object element = iterator.next(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dnd/ResourceTransferDropAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dnd/ResourceTransferDropAdapter.java index 9f06282b975..0c9b2e93bb4 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dnd/ResourceTransferDropAdapter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dnd/ResourceTransferDropAdapter.java @@ -133,7 +133,7 @@ public class ResourceTransferDropAdapter extends CDTViewerDropAdapter implements * @return the resource selection from the LocalSelectionTransfer */ private IResource[] getSelectedResources() { - ArrayList<IResource> selectedResources = new ArrayList<IResource>(); + ArrayList<IResource> selectedResources = new ArrayList<>(); ISelection selection = LocalSelectionTransfer.getTransfer().getSelection(); if (selection instanceof IStructuredSelection) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinerProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinerProvider.java index f1047ded1e7..eb35a768097 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinerProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinerProvider.java @@ -220,7 +220,7 @@ public class CContentOutlinerProvider extends BaseCElementContentProvider { * @return Updated selection. */ protected ISelection updateSelection(ISelection sel) { - final ArrayList<ICElement> newSelection = new ArrayList<ICElement>(); + final ArrayList<ICElement> newSelection = new ArrayList<>(); if (sel instanceof IStructuredSelection) { final Iterator<?> iter = ((IStructuredSelection) sel).iterator(); while (iter.hasNext()) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CDocumentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CDocumentProvider.java index f1de61a02cc..00fbed3a19f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CDocumentProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CDocumentProvider.java @@ -664,7 +664,7 @@ public class CDocumentProvider extends TextFileDocumentProvider { private ListenerList<IAnnotationModelListener> fListenerList; public GlobalAnnotationModelListener() { - fListenerList = new ListenerList<IAnnotationModelListener>(ListenerList.IDENTITY); + fListenerList = new ListenerList<>(ListenerList.IDENTITY); } @Override @@ -942,7 +942,7 @@ public class CDocumentProvider extends TextFileDocumentProvider { TextEdit rootEdit = null; ICProject cProject = tu.getCProject(); - Map<String, Object> options = new HashMap<String, Object>(cProject.getOptions(true)); + Map<String, Object> options = new HashMap<>(cProject.getOptions(true)); options.put(DefaultCodeFormatterConstants.FORMATTER_TRANSLATION_UNIT, tu); CodeFormatter formatter = ToolFactory.createCodeFormatter(options); String code = document.get(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java index 67fc913798a..f0b7ce3b2c2 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java @@ -395,9 +395,9 @@ public class CEditor extends TextEditor ICElement inputCElement = getInputCElement(); ICProject cProject = inputCElement != null ? inputCElement.getCProject() : null; if (cProject == null) { - preferences = new HashMap<String, Object>(CCorePlugin.getOptions()); + preferences = new HashMap<>(CCorePlugin.getOptions()); } else { - preferences = new HashMap<String, Object>(cProject.getOptions(true)); + preferences = new HashMap<>(cProject.getOptions(true)); } if (inputCElement instanceof ITranslationUnit) { @@ -1344,7 +1344,7 @@ public class CEditor extends TextEditor * AST reconciling listeners. * @since 4.0 */ - private final ListenerList<ICReconcilingListener> fReconcilingListeners = new ListenerList<ICReconcilingListener>( + private final ListenerList<ICReconcilingListener> fReconcilingListeners = new ListenerList<>( ListenerList.IDENTITY); /** @@ -1405,7 +1405,7 @@ public class CEditor extends TextEditor setOutlinerContextMenuId("#CEditorOutlinerContext"); //$NON-NLS-1$ fCEditorErrorTickUpdater = new CEditorErrorTickUpdater(this); - fPostSaveListeners = new ListenerList<IPostSaveListener>(); + fPostSaveListeners = new ListenerList<>(); } @Override diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CElementIncludeResolver.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CElementIncludeResolver.java index 000315c2529..abebbdd70bb 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CElementIncludeResolver.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CElementIncludeResolver.java @@ -45,7 +45,7 @@ import org.eclipse.core.runtime.Platform; public class CElementIncludeResolver { public static List<IPath> resolveInclude(IInclude include) throws CoreException { IResource res = include.getUnderlyingResource(); - ArrayList<IPath> filesFound = new ArrayList<IPath>(4); + ArrayList<IPath> filesFound = new ArrayList<>(4); String fullFileName = include.getFullFileName(); if (fullFileName != null) { IPath fullPath = new Path(fullFileName); @@ -114,7 +114,7 @@ public class CElementIncludeResolver { return; } } - HashSet<IPath> foundSet = new HashSet<IPath>(); + HashSet<IPath> foundSet = new HashSet<>(); for (String includePath : includePaths) { IPath path = PathUtil.getCanonicalPathWindows(new Path(includePath).append(includeFile)); File file = path.toFile(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CSourceViewer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CSourceViewer.java index 5ede0b64d32..adc2798de70 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CSourceViewer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CSourceViewer.java @@ -423,7 +423,7 @@ public class CSourceViewer extends ProjectionViewer implements IPropertyChangeLi List<ITextPresentationListener> textPresentationListeners = fTextPresentationListeners; if (textPresentationListeners == null) - fTextPresentationListeners = textPresentationListeners = new ArrayList<ITextPresentationListener>(); + fTextPresentationListeners = textPresentationListeners = new ArrayList<>(); textPresentationListeners.remove(listener); textPresentationListeners.add(0, listener); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/DocumentAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/DocumentAdapter.java index 254fa95aeea..8b400022fba 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/DocumentAdapter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/DocumentAdapter.java @@ -216,7 +216,7 @@ public class DocumentAdapter implements IBuffer, IDocumentListener, IAdaptable { private Set<String> fLegalLineDelimiters; - private List<IBufferChangedListener> fBufferListeners = new ArrayList<IBufferChangedListener>(3); + private List<IBufferChangedListener> fBufferListeners = new ArrayList<>(3); private IStatus fStatus; final private IPath fLocation; @@ -528,7 +528,7 @@ public class DocumentAdapter implements IBuffer, IDocumentListener, IAdaptable { if (fLegalLineDelimiters == null) { // collect all line delimiters in the document - HashSet<String> existingDelimiters = new HashSet<String>(); + HashSet<String> existingDelimiters = new HashSet<>(); for (int i = fDocument.getNumberOfLines() - 1; i >= 0; i--) { try { @@ -588,7 +588,7 @@ public class DocumentAdapter implements IBuffer, IDocumentListener, IAdaptable { private void fireBufferChanged(BufferChangedEvent event) { if (fBufferListeners != null && fBufferListeners.size() > 0) { - Iterator<IBufferChangedListener> e = new ArrayList<IBufferChangedListener>(fBufferListeners).iterator(); + Iterator<IBufferChangedListener> e = new ArrayList<>(fBufferListeners).iterator(); while (e.hasNext()) e.next().bufferChanged(event); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/EclipsePreferencesAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/EclipsePreferencesAdapter.java index ee2d0c9ead5..e5a265580dd 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/EclipsePreferencesAdapter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/EclipsePreferencesAdapter.java @@ -57,7 +57,7 @@ class EclipsePreferencesAdapter implements IPreferenceStore { } /** Listeners on on this adapter */ - private ListenerList<IPropertyChangeListener> fListeners = new ListenerList<IPropertyChangeListener>( + private ListenerList<IPropertyChangeListener> fListeners = new ListenerList<>( ListenerList.IDENTITY); /** Listener on the node */ diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/InactiveCodeHighlighting.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/InactiveCodeHighlighting.java index a2daeb77e47..1a7aea46a58 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/InactiveCodeHighlighting.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/InactiveCodeHighlighting.java @@ -229,10 +229,10 @@ public class InactiveCodeHighlighting implements ICReconcilingListener, ITextInp if (fileName == null) { return Collections.emptyList(); } - List<Position> positions = new ArrayList<Position>(); + List<Position> positions = new ArrayList<>(); int inactiveCodeStart = -1; boolean inInactiveCode = false; - Stack<Boolean> inactiveCodeStack = new Stack<Boolean>(); + Stack<Boolean> inactiveCodeStack = new Stack<>(); IASTPreprocessorStatement[] preprocStmts = translationUnit.getAllPreprocessorStatements(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/InteractiveHeaderChooser.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/InteractiveHeaderChooser.java index a3badc46ee4..18e32bf4423 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/InteractiveHeaderChooser.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/InteractiveHeaderChooser.java @@ -39,7 +39,7 @@ public class InteractiveHeaderChooser implements IHeaderChooser { public InteractiveHeaderChooser(String title, Shell shell) { this.title = title; this.shell = shell; - userChoiceCache = new HashMap<Collection<IPath>, IPath>(); + userChoiceCache = new HashMap<>(); } @Override @@ -49,7 +49,7 @@ public class InteractiveHeaderChooser implements IHeaderChooser { if (headers.size() == 1) return headers.iterator().next(); - Set<IPath> cacheKey = new HashSet<IPath>(headers); + Set<IPath> cacheKey = new HashSet<>(headers); // Check the decision cache. If the cache doesn't help, ask the user. // Query the cache. if (userChoiceCache.containsKey(cacheKey)) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OverrideIndicatorManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OverrideIndicatorManager.java index 7b989a51c9c..bd10ca4b757 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OverrideIndicatorManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OverrideIndicatorManager.java @@ -113,7 +113,7 @@ public class OverrideIndicatorManager implements ICReconcilingListener { return; final IIndex index = ast.getIndex(); - final Map<Annotation, Position> annotationMap = new HashMap<Annotation, Position>(50); + final Map<Annotation, Position> annotationMap = new HashMap<>(50); class MethodFinder extends ASTVisitor { { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SelectionHistory.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SelectionHistory.java index 9f15c4f8747..2e850a468ee 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SelectionHistory.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SelectionHistory.java @@ -31,7 +31,7 @@ public class SelectionHistory { public SelectionHistory(CEditor editor) { Assert.isNotNull(editor); fEditor = editor; - fHistory = new Stack<ISourceRange>(); + fHistory = new Stack<>(); fSelectionListener = new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent event) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SelectionToDeclarationJob.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SelectionToDeclarationJob.java index 710188148a5..25adab75cf7 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SelectionToDeclarationJob.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SelectionToDeclarationJob.java @@ -196,7 +196,7 @@ public class SelectionToDeclarationJob extends Job implements ASTRunnable { targets = ArrayUtil.trim(ArrayUtil.addAll(targets, implicitTargets)); - final ArrayList<IFunctionDeclaration> functionElements = new ArrayList<IFunctionDeclaration>(); + final ArrayList<IFunctionDeclaration> functionElements = new ArrayList<>(); filterToFunctions(fTranslationUnit.getCProject(), fIndex, targets, functionElements); // save the resolved function declarations @@ -256,7 +256,7 @@ public class SelectionToDeclarationJob extends Job implements ASTRunnable { private IName[] findDefinitions(IIndex index, IASTTranslationUnit ast, NameKind kind, IBinding binding) throws CoreException { - List<IASTName> declNames = new ArrayList<IASTName>(); + List<IASTName> declNames = new ArrayList<>(); declNames.addAll(Arrays.asList(ast.getDefinitionsInAST(binding))); for (Iterator<IASTName> i = declNames.iterator(); i.hasNext();) { IASTName name = i.next(); @@ -296,7 +296,7 @@ public class SelectionToDeclarationJob extends Job implements ASTRunnable { astNames[i] = null; } else if (ASTQueries.findAncestorWithType(name, ICPPASTUsingDeclaration.class) != null) { if (usingDeclarations == null) - usingDeclarations = new ArrayList<IASTName>(1); + usingDeclarations = new ArrayList<>(1); usingDeclarations.add(name); astNames[i] = null; } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingManager.java index e932f37e45d..c722a9f5248 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingManager.java @@ -418,7 +418,7 @@ public class SemanticHighlightingManager implements IPropertyChangeListener { private static class PreviewerExternalSDKHighlighting extends SemanticHighlightingWithOwnPreference { static private final Set<String> fHarcodedSDKFunctions; static { - fHarcodedSDKFunctions = new HashSet<String>(); + fHarcodedSDKFunctions = new HashSet<>(); fHarcodedSDKFunctions.add("fprintf"); //$NON-NLS-1$ // add others as necessary } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingPresenter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingPresenter.java index 5d8297a87e2..d81f5646e77 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingPresenter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingPresenter.java @@ -233,7 +233,7 @@ public class SemanticHighlightingPresenter implements ITextPresentationListener, private CPresentationReconciler fPresentationReconciler; /** UI's current highlighted positions - can contain <code>null</code> elements */ - private List<HighlightedPosition> fPositions = new ArrayList<HighlightedPosition>(); + private List<HighlightedPosition> fPositions = new ArrayList<>(); /** UI position lock */ private Object fPositionLock = new Object(); @@ -398,7 +398,7 @@ public class SemanticHighlightingPresenter implements ITextPresentationListener, * removed on the fly. The second of two is the list of added positions. The result * is stored in newPositions. */ - List<HighlightedPosition> newPositions = new ArrayList<HighlightedPosition>(newSize); + List<HighlightedPosition> newPositions = new ArrayList<>(newSize); HighlightedPosition position = null; HighlightedPosition addedPosition = null; for (int i = 0, j = 0, n = oldPositions.size(), m = addedPositions.length; i < n || position != null @@ -550,7 +550,7 @@ public class SemanticHighlightingPresenter implements ITextPresentationListener, int i = computeIndexAtOffset(fPositions, region.getOffset()); int n = computeIndexAtOffset(fPositions, region.getOffset() + region.getLength()); if (n - i > 2) { - List<StyleRange> ranges = new ArrayList<StyleRange>(n - i); + List<StyleRange> ranges = new ArrayList<>(n - i); for (; i < n; i++) { HighlightedPosition position = fPositions.get(i); if (!position.isDeleted()) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingReconciler.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingReconciler.java index db55fded183..b3c093de5c2 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingReconciler.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingReconciler.java @@ -345,9 +345,9 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener { private HighlightingStyle[] fHighlightings; /** Background job's added highlighted positions */ - protected List<HighlightedPosition> fAddedPositions = new ArrayList<HighlightedPosition>(); + protected List<HighlightedPosition> fAddedPositions = new ArrayList<>(); /** Background job's removed highlighted positions */ - protected List<HighlightedPosition> fRemovedPositions = new ArrayList<HighlightedPosition>(); + protected List<HighlightedPosition> fRemovedPositions = new ArrayList<>(); /** Number of removed positions */ protected int fNOfRemovedPositions; @@ -452,7 +452,7 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener { CPPSemantics.popLookupPoint(); } List<HighlightedPosition> oldPositions = fRemovedPositions; - List<HighlightedPosition> newPositions = new ArrayList<HighlightedPosition>(fNOfRemovedPositions); + List<HighlightedPosition> newPositions = new ArrayList<>(fNOfRemovedPositions); for (int i = 0, n = oldPositions.size(); i < n; i++) { HighlightedPosition current = oldPositions.get(i); if (current != null) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightings.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightings.java index 36f30dc50dc..1c401db70fb 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightings.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightings.java @@ -2086,7 +2086,7 @@ public class SemanticHighlightings { private static SemanticHighlighting[] loadSemanticHighlightings() { - Map<Key, SemanticHighlighting> highlightings = new TreeMap<SemanticHighlightings.Key, SemanticHighlighting>(); + Map<Key, SemanticHighlighting> highlightings = new TreeMap<>(); // load the built-in highlightings loadBuiltInSemanticHighlightings(highlightings); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SourceHeaderPartnerFinder.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SourceHeaderPartnerFinder.java index 9b5a7c7fd69..392278b8f39 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SourceHeaderPartnerFinder.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SourceHeaderPartnerFinder.java @@ -124,7 +124,7 @@ public final class SourceHeaderPartnerFinder { } public PartnerFileVisitor() { - fMap = new HashMap<IPath, Counter>(); + fMap = new HashMap<>(); } @Override diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/ToggleCommentAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/ToggleCommentAction.java index b3f9a8ef0e9..342903f8f57 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/ToggleCommentAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/ToggleCommentAction.java @@ -341,7 +341,7 @@ public final class ToggleCommentAction extends TextEditorAction { fPrefixesMap = null; String[] types = configuration.getConfiguredContentTypes(sourceViewer); - Map<String, String[]> prefixesMap = new HashMap<String, String[]>(types.length); + Map<String, String[]> prefixesMap = new HashMap<>(types.length); for (String type : types) { String[] prefixes = configuration.getDefaultPrefixes(sourceViewer, type); if (prefixes != null && prefixes.length > 0) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmCodeScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmCodeScanner.java index aea4b0541d2..eb87948b976 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmCodeScanner.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmCodeScanner.java @@ -51,7 +51,7 @@ public final class AsmCodeScanner extends AbstractCScanner { protected List<IRule> createRules() { IToken token; - List<IRule> rules = new ArrayList<IRule>(); + List<IRule> rules = new ArrayList<>(); // Add rule(s) for single line comments token = getToken(ICColorConstants.C_SINGLE_LINE_COMMENT); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmPreprocessorScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmPreprocessorScanner.java index cfe6a007d15..32fcce6b15c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmPreprocessorScanner.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmPreprocessorScanner.java @@ -60,7 +60,7 @@ public class AsmPreprocessorScanner extends AbstractCScanner { * Creates rules used in this RulesBasedScanner */ protected List<IRule> createRules() { - List<IRule> rules = new ArrayList<IRule>(); + List<IRule> rules = new ArrayList<>(); IToken defaultToken = getToken(ICColorConstants.PP_DEFAULT); IToken token; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/filters/CustomFiltersDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/filters/CustomFiltersDialog.java index bf6d5fabc3a..9739122f81f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/filters/CustomFiltersDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/filters/CustomFiltersDialog.java @@ -90,7 +90,7 @@ public class CustomFiltersDialog extends SelectionDialog { fEnabledFilterIds = enabledFilterIds; fBuiltInFilters = FilterDescriptor.getFilterDescriptors(fViewId); - fFilterDescriptorChangeHistory = new Stack<FilterDescriptor>(); + fFilterDescriptorChangeHistory = new Stack<>(); setShellStyle(getShellStyle() | SWT.RESIZE); } @@ -280,7 +280,7 @@ public class CustomFiltersDialog extends SelectionDialog { @Override protected void okPressed() { if (fBuiltInFilters != null) { - ArrayList<FilterDescriptor> result = new ArrayList<FilterDescriptor>(); + ArrayList<FilterDescriptor> result = new ArrayList<>(); for (int i = 0; i < fBuiltInFilters.length; ++i) { if (fCheckBoxList.getChecked(fBuiltInFilters[i])) result.add(fBuiltInFilters[i]); @@ -333,7 +333,7 @@ public class CustomFiltersDialog extends SelectionDialog { */ public String[] getEnabledFilterIds() { Object[] result = getResult(); - Set<String> enabledIds = new HashSet<String>(result.length); + Set<String> enabledIds = new HashSet<>(result.length); for (Object element : result) enabledIds.add(((FilterDescriptor) element).getId()); return enabledIds.toArray(new String[enabledIds.size()]); @@ -356,7 +356,7 @@ public class CustomFiltersDialog extends SelectionDialog { private FilterDescriptor[] getEnabledFilterDescriptors() { FilterDescriptor[] filterDescs = fBuiltInFilters; - List<FilterDescriptor> result = new ArrayList<FilterDescriptor>(filterDescs.length); + List<FilterDescriptor> result = new ArrayList<>(filterDescs.length); List<String> enabledFilterIds = Arrays.asList(fEnabledFilterIds); for (FilterDescriptor filterDesc : filterDescs) { String id = filterDesc.getId(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/filters/FilterDescriptor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/filters/FilterDescriptor.java index 999f1c14754..c6f4493300a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/filters/FilterDescriptor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/filters/FilterDescriptor.java @@ -86,7 +86,7 @@ public class FilterDescriptor implements Comparable<FilterDescriptor> { */ public static FilterDescriptor[] getFilterDescriptors(String targetId) { FilterDescriptor[] filterDescs = FilterDescriptor.getFilterDescriptors(); - List<FilterDescriptor> result = new ArrayList<FilterDescriptor>(filterDescs.length); + List<FilterDescriptor> result = new ArrayList<>(filterDescs.length); for (int i = 0; i < filterDescs.length; i++) { String tid = filterDescs[i].getTargetId(); if (tid == null || tid.equals(targetId)) @@ -247,8 +247,8 @@ public class FilterDescriptor implements Comparable<FilterDescriptor> { * Creates the filter descriptors. */ private static FilterDescriptor[] createFilterDescriptors(IConfigurationElement[] elements) { - List<FilterDescriptor> result = new ArrayList<FilterDescriptor>(5); - Set<String> descIds = new HashSet<String>(5); + List<FilterDescriptor> result = new ArrayList<>(5); + Set<String> descIds = new HashSet<>(5); for (int i = 0; i < elements.length; i++) { final IConfigurationElement element = elements[i]; if (FILTER_TAG.equals(element.getName())) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CFunctionSummary.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CFunctionSummary.java index 8ba53f9bde4..da25eb8c325 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CFunctionSummary.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CFunctionSummary.java @@ -44,7 +44,7 @@ public class CFunctionSummary implements IFunctionSummary { String args = null; String type = null; NodeList list = e.getChildNodes(); - ArrayList<IRequiredInclude> incList = new ArrayList<IRequiredInclude>(); + ArrayList<IRequiredInclude> incList = new ArrayList<>(); for (int j = 0; j < list.getLength(); j++) { Node node = list.item(j); if (node.getNodeType() != Node.ELEMENT_NODE) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpBook.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpBook.java index 3f3434d4c95..9361f0bc3b8 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpBook.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpBook.java @@ -42,7 +42,7 @@ public class CHelpBook implements ICHelpBook { private TreeMap<String, CHelpEntry> entries; public CHelpBook(Element e) { - entries = new TreeMap<String, CHelpEntry>(); + entries = new TreeMap<>(); if (e.hasAttribute(ATTR_TITLE)) title = e.getAttribute(ATTR_TITLE).trim(); @@ -126,7 +126,7 @@ public class CHelpBook implements ICHelpBook { } if (col.size() > 0) { - ArrayList<IFunctionSummary> out = new ArrayList<IFunctionSummary>(col.size()); + ArrayList<IFunctionSummary> out = new ArrayList<>(col.size()); for (CHelpEntry he : col) for (IFunctionSummary fs : he.getFunctionSummary()) out.add(fs); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpEntry.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpEntry.java index c15ccbdeead..d7c6d07e8a1 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpEntry.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpEntry.java @@ -33,8 +33,8 @@ public class CHelpEntry { public CHelpEntry(Element e) { keyword = e.getAttribute(ATTR_KEYWD).trim(); - ArrayList<CFunctionSummary> obs1 = new ArrayList<CFunctionSummary>(); - ArrayList<CHelpTopic> obs2 = new ArrayList<CHelpTopic>(); + ArrayList<CFunctionSummary> obs1 = new ArrayList<>(); + ArrayList<CHelpTopic> obs2 = new ArrayList<>(); NodeList list = e.getChildNodes(); for (int i = 0; i < list.getLength(); i++) { Node node = list.item(i); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpProvider.java index 1170bc2d1d0..6181ae206d4 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpProvider.java @@ -78,7 +78,7 @@ public class CHelpProvider implements ICHelpProvider { public ICHelpResourceDescriptor[] getHelpResources(ICHelpInvocationContext context, ICHelpBook[] helpBooks, String name) { - ArrayList<ICHelpResourceDescriptor> lst = new ArrayList<ICHelpResourceDescriptor>(); + ArrayList<ICHelpResourceDescriptor> lst = new ArrayList<>(); for (ICHelpBook h : helpBooks) { if (h instanceof CHelpBook) { ICHelpResourceDescriptor hrd = ((CHelpBook) h).getHelpResources(context, name); @@ -94,7 +94,7 @@ public class CHelpProvider implements ICHelpProvider { @Override public IFunctionSummary[] getMatchingFunctions(ICHelpInvocationContext context, ICHelpBook[] helpBooks, String prefix) { - ArrayList<IFunctionSummary> lst = new ArrayList<IFunctionSummary>(); + ArrayList<IFunctionSummary> lst = new ArrayList<>(); for (int i = 0; i < helpBooks.length; i++) { if (helpBooks[i] instanceof CHelpBook) { List<IFunctionSummary> fs = ((CHelpBook) helpBooks[i]).getMatchingFunctions(context, prefix); @@ -132,7 +132,7 @@ public class CHelpProvider implements ICHelpProvider { if (extensionPoint != null) { IExtension[] extensions = extensionPoint.getExtensions(); if (extensions != null) { - ArrayList<ICHelpBook> chbl = new ArrayList<ICHelpBook>(); + ArrayList<ICHelpBook> chbl = new ArrayList<>(); for (IExtension ex : extensions) { String pluginId = ex.getNamespaceIdentifier(); for (IConfigurationElement el : ex.getConfigurationElements()) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBContentProvider.java index a31f3a15df0..06641474ad8 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBContentProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBContentProvider.java @@ -107,7 +107,7 @@ public class IBContentProvider extends AsyncTreeContentProvider { directiveFile = node.getRepresentedFile(); } if (includes.length > 0) { - Set<IBNode> result = new LinkedHashSet<IBNode>(includes.length); + Set<IBNode> result = new LinkedHashSet<>(includes.length); for (IIndexInclude include : includes) { try { if (fComputeIncludedBy) { @@ -156,8 +156,8 @@ public class IBContentProvider extends AsyncTreeContentProvider { return index.findIncludedBy(files[0]); } if (files.length > 0) { - ArrayList<IIndexInclude> list = new ArrayList<IIndexInclude>(); - HashSet<IIndexFileLocation> handled = new HashSet<IIndexFileLocation>(); + ArrayList<IIndexInclude> list = new ArrayList<>(); + HashSet<IIndexFileLocation> handled = new HashSet<>(); for (IIndexFile file : files) { final IIndexInclude[] includes = index.findIncludedBy(file); for (IIndexInclude indexInclude : includes) { @@ -183,8 +183,8 @@ public class IBContentProvider extends AsyncTreeContentProvider { return index.findIncludes(files[0]); } if (files.length > 0) { - ArrayList<IIndexInclude> list = new ArrayList<IIndexInclude>(); - HashSet<IIndexFileLocation> handled = new HashSet<IIndexFileLocation>(); + ArrayList<IIndexInclude> list = new ArrayList<>(); + HashSet<IIndexFileLocation> handled = new HashSet<>(); for (IIndexFile file : files) { final IIndexInclude[] includes = index.findIncludes(file); for (IIndexInclude indexInclude : includes) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBConversions.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBConversions.java index 21dda2df7a5..c5db6d3a0d2 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBConversions.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBConversions.java @@ -60,7 +60,7 @@ public class IBConversions { public static ISelection nodeSelectionToRepresentedTUSelection(ISelection sel) { if (sel instanceof IStructuredSelection) { IStructuredSelection ssel = (IStructuredSelection) sel; - ArrayList<ITranslationUnit> tus = new ArrayList<ITranslationUnit>(); + ArrayList<ITranslationUnit> tus = new ArrayList<>(); for (Iterator<?> iter = ssel.iterator(); iter.hasNext();) { Object obj = iter.next(); if (obj instanceof IBNode) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBDragSourceListener.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBDragSourceListener.java index 06dcdfa3a42..32a070efd12 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBDragSourceListener.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBDragSourceListener.java @@ -30,7 +30,7 @@ import org.eclipse.ui.part.ResourceTransfer; public class IBDragSourceListener implements DragSourceListener { private TreeViewer fTreeViewer; - private ArrayList<IBNode> fSelectedNodes = new ArrayList<IBNode>(); + private ArrayList<IBNode> fSelectedNodes = new ArrayList<>(); private IBDropTargetListener fDropTargetListener; public IBDragSourceListener(TreeViewer viewer) { @@ -69,7 +69,7 @@ public class IBDragSourceListener implements DragSourceListener { } private String[] getFiles() { - ArrayList<String> files = new ArrayList<String>(fSelectedNodes.size()); + ArrayList<String> files = new ArrayList<>(fSelectedNodes.size()); for (Iterator<IBNode> iter = fSelectedNodes.iterator(); iter.hasNext();) { IBNode node = iter.next(); IIndexFileLocation ifl = (IIndexFileLocation) node.getAdapter(IIndexFileLocation.class); @@ -84,7 +84,7 @@ public class IBDragSourceListener implements DragSourceListener { } private IFile[] getResources() { - ArrayList<IFile> files = new ArrayList<IFile>(fSelectedNodes.size()); + ArrayList<IFile> files = new ArrayList<>(fSelectedNodes.size()); for (Iterator<IBNode> iter = fSelectedNodes.iterator(); iter.hasNext();) { IBNode node = iter.next(); IFile file = (IFile) node.getAdapter(IFile.class); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBHistoryListAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBHistoryListAction.java index 8ab41797e34..fdb0fcc5b9e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBHistoryListAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBHistoryListAction.java @@ -72,7 +72,7 @@ public class IBHistoryListAction extends Action { ILabelProvider labelProvider = new CUILabelProvider(CElementLabels.APPEND_ROOT_PATH, CElementImageProvider.OVERLAY_ICONS); - fHistoryList = new ListDialogField<ITranslationUnit>(adapter, buttonLabels, labelProvider); + fHistoryList = new ListDialogField<>(adapter, buttonLabels, labelProvider); fHistoryList.setLabelText(IBMessages.IBHistoryListAction_HistoryList_label); fHistoryList.setElements(Arrays.asList(elements)); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBLabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBLabelProvider.java index b6023892642..166390e5f81 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBLabelProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBLabelProvider.java @@ -35,7 +35,7 @@ public class IBLabelProvider extends LabelProvider implements IColorProvider { private CElementLabelProvider fCLabelProvider = new CElementLabelProvider(); private Color fColorInactive; private IBContentProvider fContentProvider; - private HashMap<String, Image> fCachedImages = new HashMap<String, Image>(); + private HashMap<String, Image> fCachedImages = new HashMap<>(); private boolean fShowFolders; public IBLabelProvider(Display display, IBContentProvider cp) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBViewPart.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBViewPart.java index 8156f731c12..6090b5ab3f3 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBViewPart.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBViewPart.java @@ -131,7 +131,7 @@ public class IBViewPart extends ViewPart implements IShowInSource, IShowInTarget private IMemento fMemento; private boolean fShowsMessage; private IBNode fLastNavigationNode; - private ArrayList<ITranslationUnit> fHistoryEntries = new ArrayList<ITranslationUnit>(MAX_HISTORY_SIZE); + private ArrayList<ITranslationUnit> fHistoryEntries = new ArrayList<>(MAX_HISTORY_SIZE); // widgets private PageBook fPagebook; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/indexview/IndexView.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/indexview/IndexView.java index 8dfde297732..13b005fa171 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/indexview/IndexView.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/indexview/IndexView.java @@ -79,7 +79,7 @@ public class IndexView extends ViewPart implements PDOM.IListener, IElementChang Filter filter = new Filter(); public boolean isLinking = false; private volatile boolean fUpdateRequested = false; - private Map<String, Long> fTimestampPerProject = new HashMap<String, Long>(); + private Map<String, Long> fTimestampPerProject = new HashMap<>(); private IndexContentProvider contentProvider; public void toggleExternalDefs() { @@ -153,7 +153,7 @@ public class IndexView extends ViewPart implements PDOM.IListener, IElementChang private ArrayList<IPDOMNode> fNodes; public Children() { - fNodes = new ArrayList<IPDOMNode>(); + fNodes = new ArrayList<>(); } @Override diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/ContentTypeMappingDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/ContentTypeMappingDialog.java index 852f0f1a1d3..86b0b332557 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/ContentTypeMappingDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/ContentTypeMappingDialog.java @@ -42,8 +42,8 @@ public abstract class ContentTypeMappingDialog extends Dialog { public ContentTypeMappingDialog(Shell parentShell) { super(parentShell); - fContentTypeNamesToIDsMap = new HashMap<String, String>(); - fLanguageNamesToIDsMap = new HashMap<String, String>(); + fContentTypeNamesToIDsMap = new HashMap<>(); + fLanguageNamesToIDsMap = new HashMap<>(); } public String getSelectedContentTypeName() { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/FileLanguageMappingPropertyPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/FileLanguageMappingPropertyPage.java index 56f2a8fa273..22666c8c08c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/FileLanguageMappingPropertyPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/FileLanguageMappingPropertyPage.java @@ -326,7 +326,7 @@ public class FileLanguageMappingPropertyPage extends PropertyPage { LanguageManager manager = LanguageManager.getInstance(); ProjectLanguageConfiguration config = manager.getLanguageConfiguration(project); - Map<String, String> mappings = new TreeMap<String, String>(); + Map<String, String> mappings = new TreeMap<>(); TableItem[] items = fTable.getItems(); for (int i = 0; i < items.length; i++) { TableItem item = items[i]; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/LanguageMappingWidget.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/LanguageMappingWidget.java index f3fb938ff1f..61760ada7e6 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/LanguageMappingWidget.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/LanguageMappingWidget.java @@ -53,7 +53,7 @@ public abstract class LanguageMappingWidget { fOverriddenContentTypes = Collections.emptySet(); // keep a mapping of all registered content types and their names - fContentTypeNamesToIDsMap = new HashMap<String, String>(); + fContentTypeNamesToIDsMap = new HashMap<>(); String[] contentTypesIDs = LanguageManager.getInstance().getRegisteredContentTypeIds(); IContentTypeManager contentTypeManager = Platform.getContentTypeManager(); @@ -68,7 +68,7 @@ public abstract class LanguageMappingWidget { fContentTypeNamesToIDsMap.put(name, contentTypesIDs[i]); } - fAffectedContentTypes = new HashSet<IContentType>(); + fAffectedContentTypes = new HashSet<>(); } public IAdaptable getElement() { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/LanguageVerifier.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/LanguageVerifier.java index 84750c2389f..c48668f0a40 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/LanguageVerifier.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/LanguageVerifier.java @@ -37,7 +37,7 @@ public class LanguageVerifier { public static Map<String, ILanguage> computeAvailableLanguages() { ILanguage[] registeredLanguages = LanguageManager.getInstance().getRegisteredLanguages(); - Map<String, ILanguage> languages = new TreeMap<String, ILanguage>(); + Map<String, ILanguage> languages = new TreeMap<>(); for (int i = 0; i < registeredLanguages.length; i++) { languages.put(registeredLanguages[i].getId(), registeredLanguages[i]); } @@ -56,7 +56,7 @@ public class LanguageVerifier { public static Set<String> removeMissingLanguages(ProjectLanguageConfiguration config, ICProjectDescription description, Map<String, ILanguage> availableLanguages) { - Set<String> missingLanguages = new TreeSet<String>(); + Set<String> missingLanguages = new TreeSet<>(); // Check file mappings Iterator<Entry<String, Map<String, String>>> fileConfigurationMappings = config.getFileMappings().entrySet() @@ -103,11 +103,11 @@ public class LanguageVerifier { public static Set<String> removeMissingLanguages(WorkspaceLanguageConfiguration config, Map<String, ILanguage> availableLanguages) { - Set<String> missingLanguages = new TreeSet<String>(); + Set<String> missingLanguages = new TreeSet<>(); // Check content type mappings Iterator<Entry<String, String>> contentTypeMappings = config.getWorkspaceMappings().entrySet().iterator(); - List<String> removals = new ArrayList<String>(); + List<String> removals = new ArrayList<>(); while (contentTypeMappings.hasNext()) { Entry<String, String> entry = contentTypeMappings.next(); String languageId = entry.getValue(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/ProjectContentTypeMappingDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/ProjectContentTypeMappingDialog.java index d05d7790ba2..14d0c81097a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/ProjectContentTypeMappingDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/ProjectContentTypeMappingDialog.java @@ -138,7 +138,7 @@ public class ProjectContentTypeMappingDialog extends ContentTypeMappingDialog { private void configureContentTypes(Combo combo, ICConfigurationDescription configuration) { combo.removeAll(); IContentTypeManager contentTypeManager = Platform.getContentTypeManager(); - List<String> names = new LinkedList<String>(); + List<String> names = new LinkedList<>(); for (int i = 0; i < fContentTypesIDs.length; i++) { String contentTypeId = fContentTypesIDs[i]; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/ProjectLanguageMappingWidget.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/ProjectLanguageMappingWidget.java index 8805c3f63fb..93a52254bf0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/ProjectLanguageMappingWidget.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/ProjectLanguageMappingWidget.java @@ -134,7 +134,7 @@ public class ProjectLanguageMappingWidget extends LanguageMappingWidget { } Map<String, String> contentTypeMappings = fConfigurationContentTypeMappings.get(configuration); if (contentTypeMappings == null) { - contentTypeMappings = new TreeMap<String, String>(); + contentTypeMappings = new TreeMap<>(); fConfigurationContentTypeMappings.put(configuration, contentTypeMappings); } contentTypeMappings.put(contentType, language); @@ -189,7 +189,7 @@ public class ProjectLanguageMappingWidget extends LanguageMappingWidget { } private Set<String> createContentTypeFilter(Map<String, Map<String, String>> mappings) { - Set<String> filter = new HashSet<String>(); + Set<String> filter = new HashSet<>(); Iterator<Entry<String, Map<String, String>>> configurationContentTypeMappings = mappings.entrySet().iterator(); while (configurationContentTypeMappings.hasNext()) { Entry<String, Map<String, String>> entry = configurationContentTypeMappings.next(); @@ -253,7 +253,7 @@ public class ProjectLanguageMappingWidget extends LanguageMappingWidget { } if (fChild != null) { - Set<String> overrides = new HashSet<String>( + Set<String> overrides = new HashSet<>( createWorkspaceContentTypeFilter(fConfigurationContentTypeMappings)); fChild.setOverriddenContentTypes(overrides); fChild.refreshMappings(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/WorkspaceLanguageMappingWidget.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/WorkspaceLanguageMappingWidget.java index a46dc2accbc..93115b83626 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/WorkspaceLanguageMappingWidget.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/WorkspaceLanguageMappingWidget.java @@ -47,7 +47,7 @@ public class WorkspaceLanguageMappingWidget extends LanguageMappingWidget { public WorkspaceLanguageMappingWidget() { super(); - fContentTypeMappings = new TreeMap<String, String>(); + fContentTypeMappings = new TreeMap<>(); } @Override @@ -174,7 +174,7 @@ public class WorkspaceLanguageMappingWidget extends LanguageMappingWidget { } if (fChild != null) { - Set<String> overrides = new HashSet<String>(fContentTypeMappings.keySet()); + Set<String> overrides = new HashSet<>(fContentTypeMappings.keySet()); overrides.addAll(fOverriddenContentTypes); fChild.setOverriddenContentTypes(overrides); fChild.refreshMappings(); @@ -182,7 +182,7 @@ public class WorkspaceLanguageMappingWidget extends LanguageMappingWidget { } public void setMappings(Map<String, String> mappings) { - fContentTypeMappings = new TreeMap<String, String>(mappings); + fContentTypeMappings = new TreeMap<>(mappings); } public Map<String, String> getContentTypeMappings() { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsEntriesTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsEntriesTab.java index c6d6a1cd8b0..d085ab5de40 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsEntriesTab.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsEntriesTab.java @@ -116,7 +116,7 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab { private static final String CLEAR_STR = Messages.LanguageSettingsProviderTab_Clear; - private Map<String, List<ILanguageSettingsProvider>> initialProvidersMap = new HashMap<String, List<ILanguageSettingsProvider>>(); + private Map<String, List<ILanguageSettingsProvider>> initialProvidersMap = new HashMap<>(); /** * Label provider for language settings providers displayed by this tab. @@ -205,7 +205,7 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab { } // convert to modifiable list - entriesList = new ArrayList<ICLanguageSettingEntry>(entriesList); + entriesList = new ArrayList<>(entriesList); if (builtInCheckBox.getSelection() == false) { for (Iterator<ICLanguageSettingEntry> iter = entriesList.iterator(); iter.hasNext();) { @@ -771,7 +771,7 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab { if (entries == null) { entries = getSettingEntriesUpResourceTree(provider); } - entries = new ArrayList<ICLanguageSettingEntry>(entries); + entries = new ArrayList<>(entries); return entries; } @@ -802,7 +802,7 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab { ICConfigurationDescription cfgDescription = getConfigurationDescription(); List<ILanguageSettingsProvider> initialProviders = initialProvidersMap.get(cfgDescription.getId()); if (initialProviders.contains(provider)) { - List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>( + List<ILanguageSettingsProvider> providers = new ArrayList<>( ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders()); int pos = providers.indexOf(provider); if (pos >= 0) { @@ -883,7 +883,7 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab { private void clearProvider(ILanguageSettingsProvider provider) { if (provider != null) { String providerId = provider.getId(); - List<ICLanguageSettingEntry> empty = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> empty = new ArrayList<>(); saveEntries(provider, empty); updateTreeForEntries(providerId, null); } @@ -1002,7 +1002,7 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab { * Get list of providers to display in the settings entry tree. */ private List<ILanguageSettingsProvider> getProviders(String languageSettingId) { - List<ILanguageSettingsProvider> itemsList = new LinkedList<ILanguageSettingsProvider>(); + List<ILanguageSettingsProvider> itemsList = new LinkedList<>(); IResource rc = getResource(); ICConfigurationDescription cfgDescription = getConfigurationDescription(); if (rc != null && cfgDescription instanceof ILanguageSettingsProvidersKeeper) { @@ -1083,7 +1083,7 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab { // Use a TreeMap to sort the languages by name. // For each name we keep a list of ids in case of name overlap. - Map<String, List<String>> map = new TreeMap<String, List<String>>(); + Map<String, List<String>> map = new TreeMap<>(); for (String langId : languageIds) { ILanguage language = LanguageManager.getInstance().getLanguage(langId); @@ -1093,7 +1093,7 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab { continue; List<String> langIds = map.get(langName); if (langIds == null) { - langIds = new ArrayList<String>(); + langIds = new ArrayList<>(); map.put(langName, langIds); } langIds.add(langId); @@ -1190,7 +1190,7 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab { IResource rc = getResource(); List<ILanguageSettingsProvider> oldProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription) .getLanguageSettingProviders(); - List<ILanguageSettingsProvider> newProviders = new ArrayList<ILanguageSettingsProvider>( + List<ILanguageSettingsProvider> newProviders = new ArrayList<>( oldProviders.size()); // clear entries for a given resource for all languages where applicable diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsProviderAssociationManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsProviderAssociationManager.java index 6e54203427b..27a02463aa9 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsProviderAssociationManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsProviderAssociationManager.java @@ -52,14 +52,14 @@ public class LanguageSettingsProviderAssociationManager { private static final String ATTR_UI_EDIT_ENTRIES = "ui-edit-entries"; //$NON-NLS-1$ private static boolean isLoaded = false; - private static List<URL> loadedIcons = new ArrayList<URL>(); - private static Map<String, URL> fImagesUrlById = new HashMap<String, URL>(); - private static Map<String, URL> fImagesUrlByClass = new HashMap<String, URL>(); - private static List<String> fRegirestedIds = new ArrayList<String>(); - private static List<String> fRegisteredClasses = new ArrayList<String>(); + private static List<URL> loadedIcons = new ArrayList<>(); + private static Map<String, URL> fImagesUrlById = new HashMap<>(); + private static Map<String, URL> fImagesUrlByClass = new HashMap<>(); + private static List<String> fRegirestedIds = new ArrayList<>(); + private static List<String> fRegisteredClasses = new ArrayList<>(); - private static Map<String, Map<String, String>> fAssociationsById = new HashMap<String, Map<String, String>>(); - private static Map<String, Map<String, String>> fAssociationsByClass = new HashMap<String, Map<String, String>>(); + private static Map<String, Map<String, String>> fAssociationsById = new HashMap<>(); + private static Map<String, Map<String, String>> fAssociationsByClass = new HashMap<>(); /** * Load extensions into memory maps. @@ -85,7 +85,7 @@ public class LanguageSettingsProviderAssociationManager { fImagesUrlById.put(id, url); fRegirestedIds.add(id); - Map<String, String> properties = new HashMap<String, String>(); + Map<String, String> properties = new HashMap<>(); putNotEmpty(properties, ATTR_PAGE, cfgEl.getAttribute(ATTR_PAGE)); putNotEmpty(properties, ATTR_UI_CLEAR_ENTRIES, cfgEl.getAttribute(ATTR_UI_CLEAR_ENTRIES)); putNotEmpty(properties, ATTR_UI_EDIT_ENTRIES, cfgEl.getAttribute(ATTR_UI_EDIT_ENTRIES)); @@ -99,7 +99,7 @@ public class LanguageSettingsProviderAssociationManager { fRegisteredClasses.add(className); } - Map<String, String> properties = new HashMap<String, String>(); + Map<String, String> properties = new HashMap<>(); putNotEmpty(properties, ATTR_PAGE, cfgEl.getAttribute(ATTR_PAGE)); putNotEmpty(properties, ATTR_UI_CLEAR_ENTRIES, cfgEl.getAttribute(ATTR_UI_CLEAR_ENTRIES)); putNotEmpty(properties, ATTR_UI_EDIT_ENTRIES, cfgEl.getAttribute(ATTR_UI_EDIT_ENTRIES)); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsProviderTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsProviderTab.java index 7e3bfb174fc..0e92b496b0f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsProviderTab.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsProviderTab.java @@ -108,8 +108,8 @@ public class LanguageSettingsProviderTab extends AbstractCPropertyTab { * not raw providers. */ private List<ILanguageSettingsProvider> presentedProviders = null; - private final Map<String, ICOptionPage> optionsPageMap = new HashMap<String, ICOptionPage>(); - private Map<String/*cfgId*/, List<ILanguageSettingsProvider>> initialProvidersByCfg = new HashMap<String, List<ILanguageSettingsProvider>>(); + private final Map<String, ICOptionPage> optionsPageMap = new HashMap<>(); + private Map<String/*cfgId*/, List<ILanguageSettingsProvider>> initialProvidersByCfg = new HashMap<>(); /** * Label provider for language settings providers displayed by this tab. @@ -908,18 +908,18 @@ public class LanguageSettingsProviderTab extends AbstractCPropertyTab { // The providers list is formed to consist of configuration providers (checked elements on top of the table) // and after that other providers which could be possible added (unchecked) sorted by name. - List<String> idsList = new ArrayList<String>(); + List<String> idsList = new ArrayList<>(); List<ILanguageSettingsProvider> providers; ICConfigurationDescription cfgDescription = getConfigurationDescription(); if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) { - providers = new ArrayList<ILanguageSettingsProvider>( + providers = new ArrayList<>( ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders()); for (ILanguageSettingsProvider provider : providers) { idsList.add(provider.getId()); } } else { - providers = new ArrayList<ILanguageSettingsProvider>(); + providers = new ArrayList<>(); } List<ILanguageSettingsProvider> allAvailableProvidersSet = LanguageSettingsManager.getWorkspaceProviders(); @@ -1137,7 +1137,7 @@ public class LanguageSettingsProviderTab extends AbstractCPropertyTab { ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(null)); ICConfigurationDescription cfgDescription = getConfigurationDescription(); if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) { - List<ILanguageSettingsProvider> cfgProviders = new ArrayList<ILanguageSettingsProvider>( + List<ILanguageSettingsProvider> cfgProviders = new ArrayList<>( ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders()); String[] defaultIds = ((ILanguageSettingsProvidersKeeper) cfgDescription) .getDefaultLanguageSettingsProvidersIds(); @@ -1150,7 +1150,7 @@ public class LanguageSettingsProviderTab extends AbstractCPropertyTab { } } else if (page.isForPrefs()) { - presentedProviders = new ArrayList<ILanguageSettingsProvider>(); + presentedProviders = new ArrayList<>(); for (String id : LanguageSettingsManager.getExtensionProviderIds()) { ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(id); ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(provider); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorContentProvider.java index 44718c42cdd..c6591ab41ae 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorContentProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorContentProvider.java @@ -420,7 +420,7 @@ public class CNavigatorContentProvider extends CViewContentProvider implements I * @return <code>true</code> if the input set was modified */ private boolean convertToCElements(Set<Object> currentChildren) { - LinkedHashSet<ICElement> convertedChildren = new LinkedHashSet<ICElement>(); + LinkedHashSet<ICElement> convertedChildren = new LinkedHashSet<>(); ICElement newChild; for (Iterator<Object> iter = currentChildren.iterator(); iter.hasNext();) { Object child = iter.next(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorDragAdapterAssistant.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorDragAdapterAssistant.java index bed23aaff9e..559df1409c5 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorDragAdapterAssistant.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorDragAdapterAssistant.java @@ -73,7 +73,7 @@ public class CNavigatorDragAdapterAssistant extends CommonDragAdapterAssistant { return true; } } else if (FileTransfer.getInstance().isSupportedType(event.dataType)) { - List<String> files = new ArrayList<String>(); + List<String> files = new ArrayList<>(); for (Iterator<?> iter = (selection).iterator(); iter.hasNext();) { Object element = iter.next(); if (element instanceof ITranslationUnit) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorDropAdapterAssistant.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorDropAdapterAssistant.java index 0e1af1c23e0..5bf9be83ce5 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorDropAdapterAssistant.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorDropAdapterAssistant.java @@ -429,7 +429,7 @@ public class CNavigatorDropAdapterAssistant extends CommonDropAdapterAssistant { return null; } List<?> elements = ((IStructuredSelection) selection).toList(); - List<Object> resources = new ArrayList<Object>(elements.size()); + List<Object> resources = new ArrayList<>(elements.size()); for (Object element : elements) { if (element instanceof ITranslationUnit) { continue; @@ -500,7 +500,7 @@ public class CNavigatorDropAdapterAssistant extends CommonDropAdapterAssistant { * @return the resource selection from the LocalSelectionTransfer */ private IResource[] getSelectedResources(IStructuredSelection selection) { - ArrayList<Object> selectedResources = new ArrayList<Object>(); + ArrayList<Object> selectedResources = new ArrayList<>(); for (Iterator<?> i = selection.iterator(); i.hasNext();) { Object o = i.next(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/AbstractConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/AbstractConfigurationBlock.java index c38c278c6e6..cc0392c9adc 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/AbstractConfigurationBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/AbstractConfigurationBlock.java @@ -73,7 +73,7 @@ abstract class AbstractConfigurationBlock implements IPreferenceConfigurationBlo protected final class SectionManager { /** The preference setting for keeping no section open. */ private static final String __NONE = "__none"; //$NON-NLS-1$ - private final Set<ExpandableComposite> fSections = new HashSet<ExpandableComposite>(); + private final Set<ExpandableComposite> fSections = new HashSet<>(); private boolean fIsBeingManaged = false; private final ExpansionAdapter fListener = new ExpansionAdapter() { @Override @@ -210,7 +210,7 @@ abstract class AbstractConfigurationBlock implements IPreferenceConfigurationBlo protected static final int INDENT = 20; private final OverlayPreferenceStore fStore; - private final Map<Object, String> fCheckBoxes = new HashMap<Object, String>(); + private final Map<Object, String> fCheckBoxes = new HashMap<>(); private final SelectionListener fCheckBoxListener = new SelectionListener() { @Override public void widgetDefaultSelected(SelectionEvent e) { @@ -223,7 +223,7 @@ abstract class AbstractConfigurationBlock implements IPreferenceConfigurationBlo } }; - private final Map<Object, String> fTextFields = new HashMap<Object, String>(); + private final Map<Object, String> fTextFields = new HashMap<>(); private final ModifyListener fTextFieldListener = new ModifyListener() { @Override public void modifyText(ModifyEvent e) { @@ -232,7 +232,7 @@ abstract class AbstractConfigurationBlock implements IPreferenceConfigurationBlo } }; - private final ArrayList<Text> fNumberFields = new ArrayList<Text>(); + private final ArrayList<Text> fNumberFields = new ArrayList<>(); private final ModifyListener fNumberFieldListener = new ModifyListener() { @Override public void modifyText(ModifyEvent e) { @@ -246,7 +246,7 @@ abstract class AbstractConfigurationBlock implements IPreferenceConfigurationBlo * @see #createDependency(Button, Control) * @since 3.0 */ - private final ArrayList<Object> fMasterSlaveListeners = new ArrayList<Object>(); + private final ArrayList<Object> fMasterSlaveListeners = new ArrayList<>(); private StatusInfo fStatus; private final PreferencePage fMainPage; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/AbstractMixedPreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/AbstractMixedPreferencePage.java index 909c4a555ea..4fb8c6b1122 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/AbstractMixedPreferencePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/AbstractMixedPreferencePage.java @@ -35,7 +35,7 @@ public abstract class AbstractMixedPreferencePage extends AbstractPreferencePage protected OverlayPreferenceStore corePrefsOverlayStore; - private Map<Button, String> corePrefsCheckBoxes = new HashMap<Button, String>(); + private Map<Button, String> corePrefsCheckBoxes = new HashMap<>(); private SelectionListener corePrefsCheckBoxListener = new SelectionListener() { @Override public void widgetDefaultSelected(SelectionEvent e) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorColoringConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorColoringConfigurationBlock.java index 6986ce85fe6..99427b5e4eb 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorColoringConfigurationBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorColoringConfigurationBlock.java @@ -360,7 +360,7 @@ class CEditorColoringConfigurationBlock extends AbstractConfigurationBlock { /** * Highlighting color list */ - private final java.util.List<HighlightingColorListItem> fListModel = new ArrayList<HighlightingColorListItem>(); + private final java.util.List<HighlightingColorListItem> fListModel = new ArrayList<>(); /** * Highlighting color list viewer */ @@ -414,7 +414,7 @@ class CEditorColoringConfigurationBlock extends AbstractConfigurationBlock { } private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys() { - List<OverlayPreferenceStore.OverlayKey> overlayKeys = new ArrayList<OverlayPreferenceStore.OverlayKey>(); + List<OverlayPreferenceStore.OverlayKey> overlayKeys = new ArrayList<>(); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_ENABLED)); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorHoverConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorHoverConfigurationBlock.java index a56853ecadf..a02b0d5dc6c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorHoverConfigurationBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorHoverConfigurationBlock.java @@ -186,7 +186,7 @@ public class CEditorHoverConfigurationBlock implements IPreferenceConfigurationB private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys() { - ArrayList<OverlayKey> overlayKeys = new ArrayList<OverlayKey>(); + ArrayList<OverlayKey> overlayKeys = new ArrayList<>(); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_ANNOTATION_ROLL_OVER)); @@ -469,7 +469,7 @@ public class CEditorHoverConfigurationBlock implements IPreferenceConfigurationB StringTokenizer tokenizer = new StringTokenizer(compiledTextHoverModifiers, CEditorTextHoverDescriptor.VALUE_SEPARATOR); - HashMap<String, String> idToModifier = new HashMap<String, String>(tokenizer.countTokens() / 2); + HashMap<String, String> idToModifier = new HashMap<>(tokenizer.countTokens() / 2); while (tokenizer.hasMoreTokens()) { String id = tokenizer.nextToken(); @@ -481,7 +481,7 @@ public class CEditorHoverConfigurationBlock implements IPreferenceConfigurationB .getString(PreferenceConstants.EDITOR_TEXT_HOVER_MODIFIER_MASKS); tokenizer = new StringTokenizer(compiledTextHoverModifierMasks, CEditorTextHoverDescriptor.VALUE_SEPARATOR); - HashMap<String, String> idToModifierMask = new HashMap<String, String>(tokenizer.countTokens() / 2); + HashMap<String, String> idToModifierMask = new HashMap<>(tokenizer.countTokens() / 2); while (tokenizer.hasMoreTokens()) { String id = tokenizer.nextToken(); @@ -569,7 +569,7 @@ public class CEditorHoverConfigurationBlock implements IPreferenceConfigurationB fStatus = new StatusInfo(); int i = 0; - HashMap<Integer, String> stateMasks = new HashMap<Integer, String>(fHoverConfigs.length); + HashMap<Integer, String> stateMasks = new HashMap<>(fHoverConfigs.length); while (fStatus.isOK() && i < fHoverConfigs.length) { if (fHoverConfigs[i].fIsEnabled) { String label = getContributedHovers()[i].getLabel(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypeDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypeDialog.java index 153b09c2078..3e04b634ca1 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypeDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypeDialog.java @@ -116,7 +116,7 @@ public class CFileTypeDialog extends Dialog { private void populateTypesCombo() { IContentTypeManager manager = Platform.getContentTypeManager(); String[] ids = CoreModel.getRegistedContentTypeIds(); - ArrayList<IContentType> list = new ArrayList<IContentType>(ids.length); + ArrayList<IContentType> list = new ArrayList<>(ids.length); for (String id : ids) { IContentType ctype = manager.getContentType(id); if (ctype != null) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBlock.java index 3e4ce9d14f9..be91aa9f2e7 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBlock.java @@ -181,8 +181,8 @@ public class CFileTypesPreferenceBlock { } public CFileTypesPreferenceBlock(IProject input) { - fAddAssoc = new ArrayList<CFileTypeAssociation>(); - fRemoveAssoc = new ArrayList<CFileTypeAssociation>(); + fAddAssoc = new ArrayList<>(); + fRemoveAssoc = new ArrayList<>(); fInput = input; setDirty(false); } @@ -327,7 +327,7 @@ public class CFileTypesPreferenceBlock { } private CFileTypeAssociation[] getCFileTypeAssociations() { - ArrayList<CFileTypeAssociation> list = new ArrayList<CFileTypeAssociation>(); + ArrayList<CFileTypeAssociation> list = new ArrayList<>(); if (fInput == null) { fillWithUserDefinedCFileTypeAssociations(list); fillWithPredefinedCFileTypeAssociations(list); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPropertyPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPropertyPage.java index d17771c47b7..a136e368014 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPropertyPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPropertyPage.java @@ -48,7 +48,7 @@ import org.eclipse.ui.dialogs.PropertyPage; public class CFileTypesPropertyPage extends PropertyPage { class FixCFileTypesPreferenceBlock extends CFileTypesPreferenceBlock { - ArrayList<ContentTypeChangeEvent> list = new ArrayList<ContentTypeChangeEvent>(); + ArrayList<ContentTypeChangeEvent> list = new ArrayList<>(); public FixCFileTypesPreferenceBlock() { super(); @@ -232,7 +232,7 @@ public class CFileTypesPropertyPage extends PropertyPage { void computeEvents(IProject project) { IScopeContext projectScope = new ProjectScope(project); IContentType[] ctypes = getRegistedContentTypes(); - ArrayList<IContentType> list = new ArrayList<IContentType>(ctypes.length); + ArrayList<IContentType> list = new ArrayList<>(ctypes.length); for (IContentType ctype : ctypes) { try { IContentTypeSettings projectSettings = ctype.getSettings(projectScope); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CPluginPreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CPluginPreferencePage.java index d9202bb33c9..9231cf9e1b4 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CPluginPreferencePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CPluginPreferencePage.java @@ -60,7 +60,7 @@ public class CPluginPreferencePage extends PreferencePage implements IWorkbenchP setPreferenceStore(CUIPlugin.getDefault().getPreferenceStore()); setDescription(PreferencesMessages.CPluginPreferencePage_description); - fCheckBoxes = new ArrayList<Button>(); + fCheckBoxes = new ArrayList<>(); } @Override diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeAssistAdvancedConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeAssistAdvancedConfigurationBlock.java index 21596d0ae17..86927a8c57f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeAssistAdvancedConfigurationBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeAssistAdvancedConfigurationBlock.java @@ -172,7 +172,7 @@ final class CodeAssistAdvancedConfigurationBlock extends OptionsConfigurationBlo public PreferenceModel(CompletionProposalComputerRegistry registry) { List<CompletionProposalCategory> categories = registry.getProposalCategories(); - fElements = new ArrayList<ModelElement>(); + fElements = new ArrayList<>(); for (CompletionProposalCategory category : categories) { if (category.hasComputers()) { fElements.add(new ModelElement(category, this)); @@ -340,7 +340,7 @@ final class CodeAssistAdvancedConfigurationBlock extends OptionsConfigurationBlo /** element type: {@link ModelElement}. */ private final PreferenceModel fModel; - private final Map<ImageDescriptor, Image> fImages = new HashMap<ImageDescriptor, Image>(); + private final Map<ImageDescriptor, Image> fImages = new HashMap<>(); private CheckboxTableViewer fDefaultViewer; private CheckboxTableViewer fSeparateViewer; @@ -654,8 +654,8 @@ final class CodeAssistAdvancedConfigurationBlock extends OptionsConfigurationBlo private void updateCheckedState() { final int size = fModel.elements.size(); - List<ModelElement> defaultChecked = new ArrayList<ModelElement>(size); - List<ModelElement> separateChecked = new ArrayList<ModelElement>(size); + List<ModelElement> defaultChecked = new ArrayList<>(size); + List<ModelElement> separateChecked = new ArrayList<>(size); for (Object element2 : fModel.elements) { ModelElement element = (ModelElement) element2; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeTemplateBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeTemplateBlock.java index 892ff6674ab..429499ce061 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeTemplateBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeTemplateBlock.java @@ -350,7 +350,7 @@ public class CodeTemplateBlock extends OptionsConfigurationBlock { PreferencesMessages.CodeTemplateBlock_templates_import_button, PreferencesMessages.CodeTemplateBlock_templates_export_button, PreferencesMessages.CodeTemplateBlock_templates_exportall_button }; - fCodeTemplateTree = new TreeListDialogField<Object>(adapter, buttonLabels, new CodeTemplateLabelProvider()); + fCodeTemplateTree = new TreeListDialogField<>(adapter, buttonLabels, new CodeTemplateLabelProvider()); fCodeTemplateTree.setDialogFieldListener(adapter); fCodeTemplateTree.setLabelText(PreferencesMessages.CodeTemplateBlock_templates_label); fCodeTemplateTree.setViewerComparator(adapter); @@ -467,7 +467,7 @@ public class CodeTemplateBlock extends OptionsConfigurationBlock { } protected TemplatePersistenceData[] getCodeTemplatesOfCategory(boolean isComment) { - ArrayList<TemplatePersistenceData> res = new ArrayList<TemplatePersistenceData>(); + ArrayList<TemplatePersistenceData> res = new ArrayList<>(); TemplatePersistenceData[] templates = fTemplateStore.getTemplateData(); for (TemplatePersistenceData curr : templates) { boolean isUserAdded = curr.getId() == null; @@ -486,7 +486,7 @@ public class CodeTemplateBlock extends OptionsConfigurationBlock { } protected TemplatePersistenceData[] getTemplatesOfContextType(String contextTypeId) { - ArrayList<TemplatePersistenceData> res = new ArrayList<TemplatePersistenceData>(); + ArrayList<TemplatePersistenceData> res = new ArrayList<>(); TemplatePersistenceData[] templates = fTemplateStore.getTemplateData(); for (TemplatePersistenceData curr : templates) { if (contextTypeId.equals(curr.getTemplate().getContextTypeId())) { @@ -514,7 +514,7 @@ public class CodeTemplateBlock extends OptionsConfigurationBlock { protected TemplateContextType[] getFileTemplateContextTypes() { Iterator<?> iter = getFileTemplateContextRegistry().contextTypes(); - ArrayList<TemplateContextType> result = new ArrayList<TemplateContextType>(); + ArrayList<TemplateContextType> result = new ArrayList<>(); while (iter.hasNext()) { TemplateContextType contextType = (TemplateContextType) iter.next(); if (getTemplatesOfContextType(contextType).length > 0) { @@ -719,7 +719,7 @@ public class CodeTemplateBlock extends OptionsConfigurationBlock { } private void export(List<Object> selected) { - Set<Object> datas = new HashSet<Object>(); + Set<Object> datas = new HashSet<>(); for (int i = 0; i < selected.size(); i++) { Object curr = selected.get(i); if (curr instanceof TemplatePersistenceData) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/EditTemplateDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/EditTemplateDialog.java index 30abbfc6849..15e1a41824f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/EditTemplateDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/EditTemplateDialog.java @@ -161,8 +161,8 @@ public class EditTemplateDialog extends StatusDialog { private StatusInfo fValidationStatus; private boolean fSuppressError = true; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=4354 - private final Map<String, TextViewerAction> fGlobalActions = new HashMap<String, TextViewerAction>(10); - private final List<String> fSelectionActions = new ArrayList<String>(3); + private final Map<String, TextViewerAction> fGlobalActions = new HashMap<>(10); + private final List<String> fSelectionActions = new ArrayList<>(3); private String[][] fContextTypes; private ContextTypeRegistry fContextTypeRegistry; @@ -193,7 +193,7 @@ public class EditTemplateDialog extends StatusDialog { // String delim= new Document().getLegalLineDelimiters()[0]; - List<String[]> contexts = new ArrayList<String[]>(); + List<String[]> contexts = new ArrayList<>(); for (Iterator<?> it = registry.contextTypes(); it.hasNext();) { TemplateContextType type = (TemplateContextType) it.next(); // TODO cppdoc? doxygen? @@ -485,7 +485,7 @@ public class EditTemplateDialog extends StatusDialog { } private void initializeActions() { - final ArrayList<IHandlerActivation> handlerActivations = new ArrayList<IHandlerActivation>(3); + final ArrayList<IHandlerActivation> handlerActivations = new ArrayList<>(3); final IHandlerService handlerService = PlatformUI.getWorkbench().getAdapter(IHandlerService.class); getShell().addDisposeListener(new DisposeListener() { @Override diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/FoldingConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/FoldingConfigurationBlock.java index 07ce2a42f6d..f54e28277d4 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/FoldingConfigurationBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/FoldingConfigurationBlock.java @@ -110,15 +110,15 @@ class FoldingConfigurationBlock implements IPreferenceConfigurationBlock { fStore = store; fStore.addKeys(createOverlayStoreKeys()); fProviderDescriptors = createListModel(); - fProviderPreferences = new HashMap<String, ICFoldingPreferenceBlock>(); - fProviderControls = new HashMap<String, Control>(); + fProviderPreferences = new HashMap<>(); + fProviderControls = new HashMap<>(); } private Map<String, CFoldingStructureProviderDescriptor> createListModel() { CFoldingStructureProviderRegistry reg = CUIPlugin.getDefault().getFoldingStructureProviderRegistry(); reg.reloadExtensions(); CFoldingStructureProviderDescriptor[] descs = reg.getFoldingProviderDescriptors(); - Map<String, CFoldingStructureProviderDescriptor> map = new HashMap<String, CFoldingStructureProviderDescriptor>(); + Map<String, CFoldingStructureProviderDescriptor> map = new HashMap<>(); for (int i = 0; i < descs.length; i++) { map.put(descs[i].getId(), descs[i]); } @@ -127,7 +127,7 @@ class FoldingConfigurationBlock implements IPreferenceConfigurationBlock { private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys() { - ArrayList<OverlayKey> overlayKeys = new ArrayList<OverlayKey>(); + ArrayList<OverlayKey> overlayKeys = new ArrayList<>(); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_FOLDING_ENABLED)); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/HeaderSubstitutionBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/HeaderSubstitutionBlock.java index 41cec642bf2..a717ecebbe7 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/HeaderSubstitutionBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/HeaderSubstitutionBlock.java @@ -105,7 +105,7 @@ public class HeaderSubstitutionBlock extends OptionsConfigurationBlock { PreferencesMessages.HeaderSubstitutionBlock_remove_button, PreferencesMessages.HeaderSubstitutionBlock_up_button, PreferencesMessages.HeaderSubstitutionBlock_down_button, }; - fHeaderMapsList = new ListDialogField<HeaderSubstitutionMap>(adapter, buttons, new HeaderMapLabelProvider()); + fHeaderMapsList = new ListDialogField<>(adapter, buttons, new HeaderMapLabelProvider()); fHeaderMapsList.setLabelText(PreferencesMessages.HeaderSubstitutionBlock_header_substitution_maps); fHeaderMapsList.setDialogFieldListener(adapter); fHeaderMapsList.setRemoveButtonIndex(IDX_REMOVE); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/HeaderSubstitutionMapEditDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/HeaderSubstitutionMapEditDialog.java index 7611512731b..9d8faa6a295 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/HeaderSubstitutionMapEditDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/HeaderSubstitutionMapEditDialog.java @@ -237,7 +237,7 @@ public class HeaderSubstitutionMapEditDialog extends ResizableStatusDialog { List<HeaderSubstitutionMap> existingEntries) { super(parent); - fExistingNames = new HashSet<String>(); + fExistingNames = new HashSet<>(); for (HeaderSubstitutionMap exising : existingEntries) { if (!exising.equals(map)) { fExistingNames.add(exising.getName()); @@ -319,7 +319,7 @@ public class HeaderSubstitutionMapEditDialog extends ResizableStatusDialog { } private List<HeaderSubstitutionRule> getSubstitutionRules(IncludeMap map) { - ArrayList<HeaderSubstitutionRule> result = new ArrayList<HeaderSubstitutionRule>(); + ArrayList<HeaderSubstitutionRule> result = new ArrayList<>(); for (Entry<IncludeInfo, List<IncludeInfo>> entry : map.getMap().entrySet()) { String source = stripQuotes(entry.getKey().toString()); for (IncludeInfo target : entry.getValue()) { @@ -542,7 +542,7 @@ public class HeaderSubstitutionMapEditDialog extends ResizableStatusDialog { for (HeaderSubstitutionRule rule : fOptionalSubstitutionsField.getElements()) { if (rule.getSource().equals(newRule.getSource())) { if (rulesToDelete == null) - rulesToDelete = new ArrayList<HeaderSubstitutionRule>(); + rulesToDelete = new ArrayList<>(); rulesToDelete.add(rule); } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/IncludeCategoriesBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/IncludeCategoriesBlock.java index 03a1f839b23..06556a4ed9b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/IncludeCategoriesBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/IncludeCategoriesBlock.java @@ -47,7 +47,7 @@ import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer; */ public class IncludeCategoriesBlock extends OptionsConfigurationBlock { private final List<IncludeGroupStyle> styles; - private final Map<IncludeKind, Category> categories = new HashMap<IncludeKind, Category>(); + private final Map<IncludeKind, Category> categories = new HashMap<>(); private TreeListDialogField<Category> categoryTree; private PixelConverter pixelConverter; private StackLayout editorAreaStack; @@ -100,7 +100,7 @@ public class IncludeCategoriesBlock extends OptionsConfigurationBlock { composite.setLayout(layout); IncludeStyleAdapter adapter = new IncludeStyleAdapter(); - categoryTree = new TreeListDialogField<Category>(adapter, null, new IncludeStyleLabelProvider()); + categoryTree = new TreeListDialogField<>(adapter, null, new IncludeStyleLabelProvider()); categoryTree.setDialogFieldListener(adapter); categoryTree.setLabelText(PreferencesMessages.IncludeCategoriesBlock_header_categories); categoryTree.setViewerComparator(adapter); @@ -134,7 +134,7 @@ public class IncludeCategoriesBlock extends OptionsConfigurationBlock { editorArea.setFont(parent.getFont()); editorAreaStack = new StackLayout(); editorArea.setLayout(editorAreaStack); - Map<IncludeKind, IncludeGroupStyle> stylesByKind = new HashMap<IncludeKind, IncludeGroupStyle>(); + Map<IncludeKind, IncludeGroupStyle> stylesByKind = new HashMap<>(); for (IncludeGroupStyle style : styles) { if (style.getIncludeKind() != IncludeKind.MATCHING_PATTERN) stylesByKind.put(style.getIncludeKind(), style); @@ -188,7 +188,7 @@ public class IncludeCategoriesBlock extends OptionsConfigurationBlock { Category(IncludeKind includeKind, Category parent) { this.includeKind = includeKind; this.parent = parent; - children = new ArrayList<Category>(); + children = new ArrayList<>(); index = parent != null ? parent.addChild(this) : 0; } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/IncludeOrderBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/IncludeOrderBlock.java index 64a8b570dcf..f2aa7a59831 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/IncludeOrderBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/IncludeOrderBlock.java @@ -93,9 +93,9 @@ public class IncludeOrderBlock extends OptionsConfigurationBlock { protected void updateControls() { super.updateControls(); stylesByKind = getStylesByKind(styles); - List<IncludeGroupStyle> orderedStyles = new ArrayList<IncludeGroupStyle>(styles); + List<IncludeGroupStyle> orderedStyles = new ArrayList<>(styles); Collections.sort(orderedStyles); // Sort according to values returned by getOrder() method. - List<IncludeGroupStyle> groupedStyles = new ArrayList<IncludeGroupStyle>(); + List<IncludeGroupStyle> groupedStyles = new ArrayList<>(); int order = 0; for (IncludeGroupStyle style : orderedStyles) { style.setOrder(order++); @@ -146,7 +146,7 @@ public class IncludeOrderBlock extends OptionsConfigurationBlock { } private static Map<IncludeKind, IncludeGroupStyle> getStylesByKind(List<IncludeGroupStyle> styles) { - Map<IncludeKind, IncludeGroupStyle> stylesByKind = new HashMap<IncludeKind, IncludeGroupStyle>(); + Map<IncludeKind, IncludeGroupStyle> stylesByKind = new HashMap<>(); for (IncludeGroupStyle style : styles) { if (style.getIncludeKind() != IncludeKind.MATCHING_PATTERN) stylesByKind.put(style.getIncludeKind(), style); @@ -236,7 +236,7 @@ public class IncludeOrderBlock extends OptionsConfigurationBlock { } private List<IncludeGroupStyle> reverse(List<IncludeGroupStyle> p) { - List<IncludeGroupStyle> reverse = new ArrayList<IncludeGroupStyle>(p.size()); + List<IncludeGroupStyle> reverse = new ArrayList<>(p.size()); for (int i = p.size(); --i >= 0;) { reverse.add(p.get(i)); } @@ -267,8 +267,8 @@ public class IncludeOrderBlock extends OptionsConfigurationBlock { private List<IncludeGroupStyle> moveUp(List<IncludeGroupStyle> elements, boolean[] selected) { int nElements = elements.size(); - List<IncludeGroupStyle> res = new ArrayList<IncludeGroupStyle>(nElements); - List<IncludeGroupStyle> floating = new ArrayList<IncludeGroupStyle>(); + List<IncludeGroupStyle> res = new ArrayList<>(nElements); + List<IncludeGroupStyle> floating = new ArrayList<>(); for (int i = 0; i < nElements; i++) { IncludeGroupStyle curr = elements.get(i); if (selected[i]) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/IncludeStyleBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/IncludeStyleBlock.java index db02beeae87..59751b644b3 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/IncludeStyleBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/IncludeStyleBlock.java @@ -72,7 +72,7 @@ public class IncludeStyleBlock extends TabConfigurationBlock { } private static Map<IncludeKind, Key> createKeyMap() { - Map<IncludeKind, Key> map = new HashMap<IncludeKind, Key>(); + Map<IncludeKind, Key> map = new HashMap<>(); map.put(IncludeKind.RELATED, KEY_STYLE_RELATED); map.put(IncludeKind.PARTNER, KEY_STYLE_PARTNER); map.put(IncludeKind.IN_SAME_FOLDER, KEY_STYLE_SAME_FOLDER); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/MarkOccurrencesConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/MarkOccurrencesConfigurationBlock.java index 41b97419cc0..aa5341e15b9 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/MarkOccurrencesConfigurationBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/MarkOccurrencesConfigurationBlock.java @@ -46,7 +46,7 @@ import org.eclipse.ui.dialogs.PreferencesUtil; class MarkOccurrencesConfigurationBlock implements IPreferenceConfigurationBlock { private final OverlayPreferenceStore fStore; - private final Map<Object, String> fCheckBoxes = new HashMap<Object, String>(); + private final Map<Object, String> fCheckBoxes = new HashMap<>(); private final SelectionListener fCheckBoxListener = new SelectionListener() { @Override public void widgetDefaultSelected(SelectionEvent e) { @@ -64,7 +64,7 @@ class MarkOccurrencesConfigurationBlock implements IPreferenceConfigurationBlock * * @see #createDependency(Button, String, Control) */ - private final ArrayList<Object> fMasterSlaveListeners = new ArrayList<Object>(); + private final ArrayList<Object> fMasterSlaveListeners = new ArrayList<>(); private StatusInfo fStatus; @@ -77,7 +77,7 @@ class MarkOccurrencesConfigurationBlock implements IPreferenceConfigurationBlock private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys() { - ArrayList<OverlayKey> overlayKeys = new ArrayList<OverlayKey>(); + ArrayList<OverlayKey> overlayKeys = new ArrayList<>(); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_MARK_OCCURRENCES)); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/NameStyleBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/NameStyleBlock.java index 192b3a83f22..769d3b1030a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/NameStyleBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/NameStyleBlock.java @@ -229,7 +229,7 @@ public class NameStyleBlock extends OptionsConfigurationBlock { composite.setLayout(layout); NameStyleAdapter adapter = new NameStyleAdapter(); - categoryTree = new TreeListDialogField<Category>(adapter, null, new NameStyleLabelProvider()); + categoryTree = new TreeListDialogField<>(adapter, null, new NameStyleLabelProvider()); categoryTree.setDialogFieldListener(adapter); categoryTree.setLabelText(PreferencesMessages.NameStyleBlock_categories_label); categoryTree.setViewerComparator(adapter); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/OptionsConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/OptionsConfigurationBlock.java index 40a1b9220a6..39face13b8a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/OptionsConfigurationBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/OptionsConfigurationBlock.java @@ -206,7 +206,7 @@ public abstract class OptionsConfigurationBlock { if (fProject == null || hasProjectSpecificOptions(fProject)) { fDisabledProjectSettings = null; } else { - fDisabledProjectSettings = new IdentityHashMap<Key, String>(); + fDisabledProjectSettings = new IdentityHashMap<>(); for (int i = 0; i < allKeys.length; i++) { Key curr = allKeys[i]; fDisabledProjectSettings.put(curr, curr.getStoredValue(fLookupOrder, false, fManager)); @@ -215,11 +215,11 @@ public abstract class OptionsConfigurationBlock { settingsUpdated(); - fCheckBoxes = new ArrayList<Button>(); - fComboBoxes = new ArrayList<Combo>(); - fTextBoxes = new ArrayList<Text>(2); - fLabels = new HashMap<Control, Label>(); - fExpandedComposites = new ArrayList<ExpandableComposite>(); + fCheckBoxes = new ArrayList<>(); + fComboBoxes = new ArrayList<>(); + fTextBoxes = new ArrayList<>(2); + fLabels = new HashMap<>(); + fExpandedComposites = new ArrayList<>(); fRebuildCount = getRebuildCount(); } @@ -717,7 +717,7 @@ public abstract class OptionsConfigurationBlock { updateControls(); validateSettings(null, null, null); } else { - fDisabledProjectSettings = new IdentityHashMap<Key, String>(); + fDisabledProjectSettings = new IdentityHashMap<>(); for (int i = 0; i < fAllKeys.length; i++) { Key curr = fAllKeys[i]; String oldSetting = curr.getStoredValue(fLookupOrder, false, fManager); @@ -743,7 +743,7 @@ public abstract class OptionsConfigurationBlock { protected boolean processChanges(IWorkbenchPreferenceContainer container) { IScopeContext currContext = fLookupOrder[0]; - List<Key> changedOptions = new ArrayList<Key>(); + List<Key> changedOptions = new ArrayList<>(); boolean needsBuild = getChanges(currContext, changedOptions); if (changedOptions.isEmpty()) { return true; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PropertyAndPreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PropertyAndPreferencePage.java index 8b0dfe7c68b..e51f2ffde44 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PropertyAndPreferencePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PropertyAndPreferencePage.java @@ -199,13 +199,13 @@ public abstract class PropertyAndPreferencePage extends PreferencePage * @param link the link */ final void doLinkActivated(Link link) { - Map<String, Boolean> data = new HashMap<String, Boolean>(); + Map<String, Boolean> data = new HashMap<>(); data.put(DATA_NO_LINK, Boolean.TRUE); if (isProjectPreferencePage()) { openWorkspacePreferences(data); } else { - HashSet<ICProject> projectsWithSpecifics = new HashSet<ICProject>(); + HashSet<ICProject> projectsWithSpecifics = new HashSet<>(); try { ICProject[] projects = CoreModel.getDefault().getCModel().getCProjects(); for (ICProject curr : projects) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ProposalFilterPreferencesUtil.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ProposalFilterPreferencesUtil.java index f20b09d3797..c2fca344b27 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ProposalFilterPreferencesUtil.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ProposalFilterPreferencesUtil.java @@ -43,7 +43,7 @@ public class ProposalFilterPreferencesUtil { * to fill into the Combo) */ public static String[] getProposalFilterNames() { - ArrayList<String> names = new ArrayList<String>(); + ArrayList<String> names = new ArrayList<>(); try { IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(CUIPlugin.PLUGIN_ID, "ProposalFilter"); //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SaveActionsPreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SaveActionsPreferencePage.java index fb7a521b658..b7cc72aeae9 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SaveActionsPreferencePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SaveActionsPreferencePage.java @@ -48,7 +48,7 @@ public class SaveActionsPreferencePage extends AbstractPreferencePage { @Override protected OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys() { - ArrayList<OverlayKey> overlayKeys = new ArrayList<OverlayKey>(); + ArrayList<OverlayKey> overlayKeys = new ArrayList<>(); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, FORMAT_SOURCE_CODE)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ScalabilityPreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ScalabilityPreferencePage.java index be3a1a33e4b..b84655022ab 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ScalabilityPreferencePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ScalabilityPreferencePage.java @@ -70,14 +70,14 @@ public class ScalabilityPreferencePage extends PreferencePage implements IWorkbe private ScalabilityIntegerFieldEditor fMaximumTokens; - private final Map<Object, String> fCheckBoxes = new HashMap<Object, String>(); + private final Map<Object, String> fCheckBoxes = new HashMap<>(); /** * List of master/slave listeners when there's a dependency. * * @see #createDependency(Button, String, Control) */ - private final ArrayList<Object> fMasterSlaveListeners = new ArrayList<Object>(); + private final ArrayList<Object> fMasterSlaveListeners = new ArrayList<>(); public ScalabilityPreferencePage() { setPreferenceStore(PreferenceConstants.getPreferenceStore()); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SpellingConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SpellingConfigurationBlock.java index 613b5bbad27..32b0dad7e9d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SpellingConfigurationBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SpellingConfigurationBlock.java @@ -312,7 +312,7 @@ public class SpellingConfigurationBlock extends OptionsConfigurationBlock { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout()); - List<Control> allControls = new ArrayList<Control>(); + List<Control> allControls = new ArrayList<>(); final PixelConverter converter = new PixelConverter(parent); final String[] trueFalse = new String[] { IPreferenceStore.TRUE, IPreferenceStore.FALSE }; @@ -657,7 +657,7 @@ public class SpellingConfigurationBlock extends OptionsConfigurationBlock { fEnabledControls = null; } if (!enabled && fEnabledControls == null) { - List<Control> enabledControls = new ArrayList<Control>(); + List<Control> enabledControls = new ArrayList<>(); for (int i = fAllControls.length - 1; i >= 0; i--) { Control control = fAllControls[i]; if (control.isEnabled()) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TabConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TabConfigurationBlock.java index 669324b517d..2760aeba143 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TabConfigurationBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TabConfigurationBlock.java @@ -65,7 +65,7 @@ public class TabConfigurationBlock extends OptionsConfigurationBlock { } private static Key[] getAllKeys(OptionsConfigurationBlock[] tabs) { - ArrayList<Key> keys = new ArrayList<Key>(); + ArrayList<Key> keys = new ArrayList<>(); for (OptionsConfigurationBlock tab : tabs) { ArrayUtil.addAll(keys, tab.fAllKeys); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskConfigurationBlock.java index 255e3312434..4dda1668aaf 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskConfigurationBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskConfigurationBlock.java @@ -140,7 +140,7 @@ public class TodoTaskConfigurationBlock extends OptionsConfigurationBlock { PreferencesMessages.TodoTaskConfigurationBlock_markers_tasks_edit_button, PreferencesMessages.TodoTaskConfigurationBlock_markers_tasks_remove_button, null, PreferencesMessages.TodoTaskConfigurationBlock_markers_tasks_setdefault_button, }; - fTodoTasksList = new ListDialogField<TodoTask>(adapter, buttons, new TodoTaskLabelProvider()); + fTodoTasksList = new ListDialogField<>(adapter, buttons, new TodoTaskLabelProvider()); fTodoTasksList.setDialogFieldListener(adapter); fTodoTasksList.setRemoveButtonIndex(IDX_REMOVE); @@ -302,7 +302,7 @@ public class TodoTaskConfigurationBlock extends OptionsConfigurationBlock { String currPrios = getValue(PREF_TODO_TASK_PRIORITIES); String[] tags = getTokens(currTags, ","); //$NON-NLS-1$ String[] prios = getTokens(currPrios, ","); //$NON-NLS-1$ - ArrayList<TodoTask> elements = new ArrayList<TodoTask>(tags.length); + ArrayList<TodoTask> elements = new ArrayList<>(tags.length); for (int i = 0; i < tags.length; i++) { TodoTask task = new TodoTask(); task.name = tags[i].trim(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskInputDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskInputDialog.java index 6b3235b6137..8e122df081f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskInputDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskInputDialog.java @@ -54,7 +54,7 @@ public class TodoTaskInputDialog extends StatusDialog { public TodoTaskInputDialog(Shell parent, TodoTask task, List<TodoTask> existingEntries) { super(parent); - fExistingNames = new ArrayList<String>(existingEntries.size()); + fExistingNames = new ArrayList<>(existingEntries.size()); for (int i = 0; i < existingEntries.size(); i++) { TodoTask curr = existingEntries.get(i); if (!curr.equals(task)) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/WorkInProgressPreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/WorkInProgressPreferencePage.java index 3275b97d942..6b06b1cbdad 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/WorkInProgressPreferencePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/WorkInProgressPreferencePage.java @@ -46,9 +46,9 @@ public class WorkInProgressPreferencePage extends PreferencePage implements IWor */ public WorkInProgressPreferencePage() { setPreferenceStore(getPreferenceStore()); - fRadioButtons = new ArrayList<Button>(); - fCheckBoxes = new ArrayList<Button>(); - fTextControls = new ArrayList<Text>(); + fRadioButtons = new ArrayList<>(); + fCheckBoxes = new ArrayList<>(); + fTextControls = new ArrayList<>(); } Button addCheckBox(Composite parent, String label, String key) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/CreateProfileDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/CreateProfileDialog.java index 0e49a80617c..1175fdb1bf6 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/CreateProfileDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/CreateProfileDialog.java @@ -191,7 +191,7 @@ public class CreateProfileDialog extends StatusDialog { CUIPlugin.getDefault().getDialogSettings().put(PREF_OPEN_EDIT_DIALOG, fOpenEditDialog); - final Map<String, String> baseSettings = new HashMap<String, String>( + final Map<String, String> baseSettings = new HashMap<>( (fSortedProfiles.get(fProfileCombo.getSelectionIndex())).getSettings()); final String profileName = fNameText.getText(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterProfileManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterProfileManager.java index d453f64a3d4..0cde7e371cd 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterProfileManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterProfileManager.java @@ -41,7 +41,7 @@ public class FormatterProfileManager extends ProfileManager { private final static KeySet[] KEY_SETS = new KeySet[] { new KeySet(CCorePlugin.PLUGIN_ID, - new ArrayList<String>(DefaultCodeFormatterConstants.getDefaultSettings().keySet())), + new ArrayList<>(DefaultCodeFormatterConstants.getDefaultSettings().keySet())), new KeySet(CUIPlugin.PLUGIN_ID, EMPTY_LIST) }; private final static String PROFILE_KEY = PreferenceConstants.FORMATTER_PROFILE; @@ -75,7 +75,7 @@ public class FormatterProfileManager extends ProfileManager { List<Profile> defaultProfiles = new FormatterProfileStore(profileVersioner) .readProfiles(DefaultScope.INSTANCE); if (defaultProfiles != null) { - Map<String, Profile> profMap = new LinkedHashMap<String, Profile>(); + Map<String, Profile> profMap = new LinkedHashMap<>(); // Add the already loaded / created profiles to a map for (Profile p : profiles) profMap.put(p.getID(), p); @@ -84,7 +84,7 @@ public class FormatterProfileManager extends ProfileManager { for (Profile p : defaultProfiles) profMap.put(p.getID(), new BuiltInProfile(p.getName(), p.getName(), p.getSettings(), 2, profileVersioner.getCurrentVersion(), profileVersioner.getProfileKind())); - profiles = new ArrayList<Profile>(profMap.values()); + profiles = new ArrayList<>(profMap.values()); } } catch (CoreException e) { CUIPlugin.log(e); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/LineWrappingTabPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/LineWrappingTabPage.java index e7bd57fb3c0..d01c56d97a6 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/LineWrappingTabPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/LineWrappingTabPage.java @@ -75,7 +75,7 @@ public class LineWrappingTabPage extends FormatterTabPage { this.prologue = prologue; this.previewText = previewText != null ? createPreviewHeader(name) + previewText : null; this.description = description; - children = new ArrayList<Category>(); + children = new ArrayList<>(); } public Category(String key, String previewText, String name, String description) { @@ -103,7 +103,7 @@ public class LineWrappingTabPage extends FormatterTabPage { private int fIndex = 0; public CategoryListener(List<Category> categoriesTree) { - fCategoriesList = new ArrayList<Category>(); + fCategoriesList = new ArrayList<>(); flatten(fCategoriesList, categoriesTree); } @@ -190,12 +190,12 @@ public class LineWrappingTabPage extends FormatterTabPage { } private class SelectionState { - private List<Category> fElements = new ArrayList<Category>(); + private List<Category> fElements = new ArrayList<>(); public void refreshState(IStructuredSelection selection) { - Map<Object, Integer> wrappingStyleMap = new HashMap<Object, Integer>(); - Map<Object, Integer> indentStyleMap = new HashMap<Object, Integer>(); - Map<Object, Integer> forceWrappingMap = new HashMap<Object, Integer>(); + Map<Object, Integer> wrappingStyleMap = new HashMap<>(); + Map<Object, Integer> indentStyleMap = new HashMap<>(); + Map<Object, Integer> forceWrappingMap = new HashMap<>(); fElements.clear(); evaluateElements(selection.iterator()); evaluateMaps(wrappingStyleMap, indentStyleMap, forceWrappingMap); @@ -611,7 +611,7 @@ public class LineWrappingTabPage extends FormatterTabPage { final String previewLineWidth = fDialogSettings.get(PREF_PREVIEW_LINE_WIDTH); - fPreviewPreferences = new HashMap<String, String>(); + fPreviewPreferences = new HashMap<>(); fPreviewPreferences.put(LINE_SPLIT, previewLineWidth != null ? previewLineWidth : String.valueOf(DEFAULT_PREVIEW_WINDOW_LINE_WIDTH)); @@ -665,7 +665,7 @@ public class LineWrappingTabPage extends FormatterTabPage { // final Category statements= new Category(FormatterMessages.LineWrappingTabPage_statements); // statements.children.add(fCompactIfCategory); - final List<Category> root = new ArrayList<Category>(); + final List<Category> root = new ArrayList<>(); root.add(classDeclarations); // root.add(constructorDeclarations); root.add(methodDeclarations); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialog.java index b6c53a9059e..6b17b472355 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialog.java @@ -113,9 +113,9 @@ public abstract class ModifyDialog extends StatusDialog implements IModifyDialog fProfile = profile; setTitle(Messages.format(FormatterMessages.ModifyDialog_dialog_title, profile.getName())); - fWorkingValues = new HashMap<String, String>(fProfile.getSettings()); + fWorkingValues = new HashMap<>(fProfile.getSettings()); setStatusLineAboveButtons(false); - fTabPages = new ArrayList<IModifyDialogTabPage>(); + fTabPages = new ArrayList<>(); fDialogSettings = CUIPlugin.getDefault().getDialogSettings(); } @@ -270,13 +270,13 @@ public abstract class ModifyDialog extends StatusDialog implements IModifyDialog if (!fProfile.getName().equals(fProfileNameField.getText())) { fProfile = fProfile.rename(fProfileNameField.getText(), fProfileManager); } - fProfile.setSettings(new HashMap<String, String>(fWorkingValues)); + fProfile.setSettings(new HashMap<>(fWorkingValues)); fProfileManager.setSelected(fProfile); doValidate(); } private void saveButtonPressed() { - Profile selected = new CustomProfile(fProfileNameField.getText(), new HashMap<String, String>(fWorkingValues), + Profile selected = new CustomProfile(fProfileNameField.getText(), new HashMap<>(fWorkingValues), fProfile.getVersion(), fProfileManager.getProfileVersioner().getProfileKind()); final FileDialog dialog = new FileDialog(getShell(), SWT.SAVE); @@ -303,7 +303,7 @@ public abstract class ModifyDialog extends StatusDialog implements IModifyDialog final IContentType type = Platform.getContentTypeManager().getContentType("org.eclipse.core.runtime.xml"); //$NON-NLS-1$ if (type != null) encoding = type.getDefaultCharset(); - final Collection<Profile> profiles = new ArrayList<Profile>(); + final Collection<Profile> profiles = new ArrayList<>(); profiles.add(selected); try { fProfileStore.writeProfilesToFile(profiles, file, encoding); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialogTabPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialogTabPage.java index ec7e2d02deb..4401c3080c0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialogTabPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialogTabPage.java @@ -491,8 +491,8 @@ public abstract class ModifyDialogTabPage implements IModifyDialogTabPage { public DefaultFocusManager() { fDialogSettings = CUIPlugin.getDefault().getDialogSettings(); - fItemMap = new HashMap<Control, Integer>(); - fItemList = new ArrayList<Control>(); + fItemMap = new HashMap<>(); + fItemList = new ArrayList<>(); fIndex = 0; } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileConfigurationBlock.java index 25d19714f3f..023a141d508 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileConfigurationBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileConfigurationBlock.java @@ -297,7 +297,7 @@ public abstract class ProfileConfigurationBlock { } if (profiles == null) - profiles = new ArrayList<Profile>(); + profiles = new ArrayList<>(); fProfileManager = createProfileManager(profiles, fCurrContext, access, fProfileVersioner); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileManager.java index a5ae96512f2..bd7ad804d5c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileManager.java @@ -370,8 +370,8 @@ public abstract class ProfileManager extends Observable { fProfileKey = profileKey; fProfileVersionKey = profileVersionKey; - fProfiles = new HashMap<String, Profile>(); - fProfilesByName = new ArrayList<Profile>(); + fProfiles = new HashMap<>(); + fProfilesByName = new ArrayList<>(); for (Object element : profiles) { final Profile profile = (Profile) element; @@ -396,7 +396,7 @@ public abstract class ProfileManager extends Observable { Map<String, String> map = readFromPreferenceStore(context, profile); if (map != null) { - List<String> allKeys = new ArrayList<String>(); + List<String> allKeys = new ArrayList<>(); for (KeySet keySet : fKeySets) { allKeys.addAll(keySet.getKeys()); } @@ -488,12 +488,12 @@ public abstract class ProfileManager extends Observable { * @param context The project context */ public Map<String, String> readFromPreferenceStore(IScopeContext context, Profile workspaceProfile) { - final Map<String, String> profileOptions = new HashMap<String, String>(); + final Map<String, String> profileOptions = new HashMap<>(); IEclipsePreferences uiPrefs = context.getNode(CUIPlugin.PLUGIN_ID); int version = uiPrefs.getInt(fProfileVersionKey, fProfileVersioner.getFirstVersion()); if (version != fProfileVersioner.getCurrentVersion()) { - Map<String, String> allOptions = new HashMap<String, String>(); + Map<String, String> allOptions = new HashMap<>(); for (KeySet keySet : fKeySets) { addAll(context.getNode(keySet.getNodeName()), allOptions); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileStore.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileStore.java index 597771ab9c3..bacafcf0c80 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileStore.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileStore.java @@ -93,11 +93,11 @@ public class ProfileStore { if (fKind == null) //Can only be an CodeFormatterProfile created pre 20061106 fKind = ProfileVersioner.CODE_FORMATTER_PROFILE_KIND; - fSettings = new HashMap<String, String>(200); + fSettings = new HashMap<>(200); } else if (qName.equals(XML_NODE_ROOT)) { - fProfiles = new ArrayList<Profile>(); + fProfiles = new ArrayList<>(); try { fVersion = Integer.parseInt(attributes.getValue(XML_ATTRIBUTE_VERSION)); } catch (NumberFormatException ex) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/SnippetPreview.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/SnippetPreview.java index ec75985f893..5ca5c0e039b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/SnippetPreview.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/SnippetPreview.java @@ -44,7 +44,7 @@ public class SnippetPreview extends CPreview { public SnippetPreview(Map<String, String> workingValues, Composite parent) { super(workingValues, parent); - fSnippets = new ArrayList<PreviewSnippet>(); + fSnippets = new ArrayList<>(); } @Override diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/TranslationUnitPreview.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/TranslationUnitPreview.java index b7a281f266a..780e890fde8 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/TranslationUnitPreview.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/TranslationUnitPreview.java @@ -61,7 +61,7 @@ public class TranslationUnitPreview extends CPreview { final IContentFormatterExtension extension = (IContentFormatterExtension) formatter; Map<String, String> prefs = fWorkingValues; if (fFormatterId != null) { - prefs = new HashMap<String, String>(fWorkingValues); + prefs = new HashMap<>(fWorkingValues); prefs.put(CCorePreferenceConstants.CODE_FORMATTER, fFormatterId); } context.setProperty(FormattingContextProperties.CONTEXT_PREFERENCES, prefs); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/WhiteSpaceOptions.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/WhiteSpaceOptions.java index 66afa66eb86..a544d85313a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/WhiteSpaceOptions.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/WhiteSpaceOptions.java @@ -49,7 +49,7 @@ public final class WhiteSpaceOptions { fParent = parent; fWorkingValues = workingValues; fName = message; - fChildren = new ArrayList<Node>(); + fChildren = new ArrayList<>(); if (fParent != null) fParent.add(this); } @@ -99,7 +99,7 @@ public final class WhiteSpaceOptions { @Override public List<PreviewSnippet> getSnippets() { - final ArrayList<PreviewSnippet> snippets = new ArrayList<PreviewSnippet>(fChildren.size()); + final ArrayList<PreviewSnippet> snippets = new ArrayList<>(fChildren.size()); for (Object element : fChildren) { final List<PreviewSnippet> childSnippets = ((Node) element).getSnippets(); for (PreviewSnippet snippet : childSnippets) { @@ -129,7 +129,7 @@ public final class WhiteSpaceOptions { PreviewSnippet snippet) { super(parent, workingValues, messageKey); fKey = key; - fSnippets = new ArrayList<PreviewSnippet>(1); + fSnippets = new ArrayList<>(1); fSnippets.add(snippet); } @@ -232,7 +232,7 @@ public final class WhiteSpaceOptions { * @return returns roots (type <code>Node</code>) */ public List<InnerNode> createTreeBySyntaxElem(Map<String, String> workingValues) { - final ArrayList<InnerNode> roots = new ArrayList<InnerNode>(); + final ArrayList<InnerNode> roots = new ArrayList<>(); InnerNode element; @@ -334,7 +334,7 @@ public final class WhiteSpaceOptions { */ public List<InnerNode> createAltTree(Map<String, String> workingValues) { - final ArrayList<InnerNode> roots = new ArrayList<InnerNode>(); + final ArrayList<InnerNode> roots = new ArrayList<>(); InnerNode parent; @@ -482,7 +482,7 @@ public final class WhiteSpaceOptions { createTemplateArgumentTree(workingValues, templates); createTemplateParameterTree(workingValues, templates); - final ArrayList<InnerNode> roots = new ArrayList<InnerNode>(); + final ArrayList<InnerNode> roots = new ArrayList<>(); roots.add(declarations); roots.add(statements); roots.add(expressions); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/WhiteSpaceTabPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/WhiteSpaceTabPage.java index 6111e3e8eab..51724b9bd0b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/WhiteSpaceTabPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/WhiteSpaceTabPage.java @@ -71,7 +71,7 @@ public class WhiteSpaceTabPage extends FormatterTabPage { private Node fLastSelected = null; public SyntaxComponent() { - fIndexedNodeList = new ArrayList<Node>(); + fIndexedNodeList = new ArrayList<>(); fTree = new WhiteSpaceOptions().createAltTree(fWorkingValues); WhiteSpaceOptions.makeIndexForNodes(fTree, fIndexedNodeList); } @@ -129,7 +129,7 @@ public class WhiteSpaceTabPage extends FormatterTabPage { } public void refreshState() { - final ArrayList<OptionNode> checked = new ArrayList<OptionNode>(100); + final ArrayList<OptionNode> checked = new ArrayList<>(100); for (Node node : fTree) (node).getCheckedLeafs(checked); fTreeViewer.setGrayedElements(new Object[0]); @@ -212,7 +212,7 @@ public class WhiteSpaceTabPage extends FormatterTabPage { private Composite fComposite; public CElementComponent() { - fIndexedNodeList = new ArrayList<Node>(); + fIndexedNodeList = new ArrayList<>(); fTree = new WhiteSpaceOptions().createTreeByCElement(fWorkingValues); WhiteSpaceOptions.makeIndexForNodes(fTree, fIndexedNodeList); } @@ -240,7 +240,7 @@ public class WhiteSpaceTabPage extends FormatterTabPage { @Override public Object[] getChildren(Object parentElement) { final List<Node> children = ((Node) parentElement).getChildren(); - final ArrayList<Object> innerChildren = new ArrayList<Object>(); + final ArrayList<Object> innerChildren = new ArrayList<>(); for (Object o : children) { if (o instanceof InnerNode) innerChildren.add(o); @@ -368,7 +368,7 @@ public class WhiteSpaceTabPage extends FormatterTabPage { final List<Node> children = selectedNode.getChildren(); - final ArrayList<OptionNode> optionsChildren = new ArrayList<OptionNode>(); + final ArrayList<OptionNode> optionsChildren = new ArrayList<>(); for (Object o : children) { if (o instanceof OptionNode) optionsChildren.add((OptionNode) o); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/CRefactoring.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/CRefactoring.java index 002c53a4f52..e1971b4efc5 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/CRefactoring.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/CRefactoring.java @@ -206,7 +206,7 @@ public abstract class CRefactoring extends Refactoring { } protected List<IASTName> findAllMarkedNames(IASTTranslationUnit ast) { - final List<IASTName> names = new ArrayList<IASTName>(); + final List<IASTName> names = new ArrayList<>(); ast.accept(new ASTVisitor() { { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/ChangeParametersControl.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/ChangeParametersControl.java index 2d613137201..bc487e036e5 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/ChangeParametersControl.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/ChangeParametersControl.java @@ -104,7 +104,7 @@ public class ChangeParametersControl extends Composite { } private NameInformation[] removeMarkedAsDeleted(List<NameInformation> params) { - List<NameInformation> result = new ArrayList<NameInformation>(params.size()); + List<NameInformation> result = new ArrayList<>(params.size()); for (Iterator<NameInformation> iter = params.iterator(); iter.hasNext();) { NameInformation info = iter.next(); if (!info.isDeleted()) @@ -309,7 +309,7 @@ public class ChangeParametersControl extends Composite { fTypeContext = typeContext; fParamNameProposals = paramNameProposals; - ArrayList<String> properties = new ArrayList<String>(); + ArrayList<String> properties = new ArrayList<>(); indexType = properties.size(); properties.add("type"); //$NON-NLS-1$ @@ -584,7 +584,7 @@ public class ChangeParametersControl extends Composite { button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - Set<String> excludedParamNames = new HashSet<String>(fParameters.size()); + Set<String> excludedParamNames = new HashSet<>(fParameters.size()); for (int i = 0; i < fParameters.size(); i++) { NameInformation info = fParameters.get(i); excludedParamNames.add(info.getNewName()); @@ -675,7 +675,7 @@ public class ChangeParametersControl extends Composite { private void addCellEditors() { fTableViewer.setColumnProperties(columnProperties); - ArrayList<CellEditor> editors = new ArrayList<CellEditor>(); + ArrayList<CellEditor> editors = new ArrayList<>(); TableTextCellEditor cellEditorType = new TableTextCellEditor(fTableViewer, indexType); editors.add(cellEditorType); if (indexDirection >= 0) { @@ -747,8 +747,8 @@ public class ChangeParametersControl extends Composite { } private static void moveUp(List<NameInformation> elements, List<NameInformation> move) { - List<NameInformation> res = new ArrayList<NameInformation>(elements.size()); - List<NameInformation> deleted = new ArrayList<NameInformation>(); + List<NameInformation> res = new ArrayList<>(elements.size()); + List<NameInformation> deleted = new ArrayList<>(); NameInformation floating = null; for (Iterator<NameInformation> iter = elements.iterator(); iter.hasNext();) { NameInformation curr = iter.next(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/ChangeTreeSet.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/ChangeTreeSet.java index c0bd74049cb..b05cd519f85 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/ChangeTreeSet.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/ChangeTreeSet.java @@ -36,7 +36,7 @@ public class ChangeTreeSet { } } - private final TreeSet<CTextFileChange> changes = new TreeSet<CTextFileChange>(new ChangePositionComparator()); + private final TreeSet<CTextFileChange> changes = new TreeSet<>(new ChangePositionComparator()); public void add(CTextFileChange change) { changes.add(change); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/DocumentAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/DocumentAdapter.java index 3e2df59de98..edd24975b41 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/DocumentAdapter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/DocumentAdapter.java @@ -223,7 +223,7 @@ public class DocumentAdapter implements IBuffer, IAdaptable, IDocumentListener { private Set<String> fLegalLineDelimiters; - private List<IBufferChangedListener> fBufferListeners = new ArrayList<IBufferChangedListener>(3); + private List<IBufferChangedListener> fBufferListeners = new ArrayList<>(3); private IStatus fStatus; public DocumentAdapter(IWorkingCopy owner, IFile file) { @@ -495,7 +495,7 @@ public class DocumentAdapter implements IBuffer, IAdaptable, IDocumentListener { private void validateLineDelimiters(String contents) { if (fLegalLineDelimiters == null) { // collect all line delimiters in the document - HashSet<String> existingDelimiters = new HashSet<String>(); + HashSet<String> existingDelimiters = new HashSet<>(); for (int i = fDocument.getNumberOfLines() - 1; i >= 0; i--) { try { @@ -555,7 +555,7 @@ public class DocumentAdapter implements IBuffer, IAdaptable, IDocumentListener { private void fireBufferChanged(BufferChangedEvent event) { if (fBufferListeners != null && fBufferListeners.size() > 0) { - Iterator<IBufferChangedListener> e = new ArrayList<IBufferChangedListener>(fBufferListeners).iterator(); + Iterator<IBufferChangedListener> e = new ArrayList<>(fBufferListeners).iterator(); while (e.hasNext()) e.next().bufferChanged(event); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/NodeContainer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/NodeContainer.java index 276119220d6..ee93fc0ce12 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/NodeContainer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/NodeContainer.java @@ -63,7 +63,7 @@ public class NodeContainer { public NodeContainer() { super(); - nodes = new ArrayList<IASTNode>(); + nodes = new ArrayList<>(); } public final int size() { @@ -82,7 +82,7 @@ public class NodeContainer { if (names != null) { return; } - names = new ArrayList<NameInformation>(); + names = new ArrayList<>(); final int startOffset = getStartOffset(); final int endOffset = getEndOffset(); @@ -163,8 +163,8 @@ public class NodeContainer { Set<IVariable> externalReads = getVariablesReadOutside(); - Set<IASTName> declarations = new HashSet<IASTName>(); - interfaceNames = new ArrayList<NameInformation>(); + Set<IASTName> declarations = new HashSet<>(); + interfaceNames = new ArrayList<>(); for (NameInformation nameInfo : names) { IASTName declarationName = nameInfo.getDeclarationName(); @@ -251,7 +251,7 @@ public class NodeContainer { for (NameInformation nameInfo : getInterfaceNames()) { if (nameInfo.mustBeReturnValue() == isReturnValue) { if (selectedNames == null) { - selectedNames = new ArrayList<NameInformation>(); + selectedNames = new ArrayList<>(); } selectedNames.add(nameInfo); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/VariableNameInformation.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/VariableNameInformation.java index 1f39ea694ab..25a3ba4d80e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/VariableNameInformation.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/VariableNameInformation.java @@ -23,7 +23,7 @@ import java.util.List; */ public class VariableNameInformation { private String name = ""; //$NON-NLS-1$ - private final ArrayList<String> usedNames = new ArrayList<String>(); + private final ArrayList<String> usedNames = new ArrayList<>(); public String getName() { return name; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/dialogs/ValidatingLabeledTextField.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/dialogs/ValidatingLabeledTextField.java index 4f7bb1d699d..321eb5d1658 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/dialogs/ValidatingLabeledTextField.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/dialogs/ValidatingLabeledTextField.java @@ -43,9 +43,9 @@ public class ValidatingLabeledTextField extends Composite { private static final String EMPTY_STRING = ""; //$NON-NLS-1$ - private final Map<Text, Boolean> validationStatus = new HashMap<Text, Boolean>(); + private final Map<Text, Boolean> validationStatus = new HashMap<>(); - private final ArrayList<Listener> inputTextListeners = new ArrayList<Listener>(); + private final ArrayList<Listener> inputTextListeners = new ArrayList<>(); private final Color errorColor = new Color(getShell().getDisplay(), new RGB(255, 208, 196)); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExpressionExtractor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExpressionExtractor.java index f8fbe8e2eb1..c7a4c5dcec6 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExpressionExtractor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExpressionExtractor.java @@ -108,7 +108,7 @@ public class ExpressionExtractor extends FunctionExtractor { } private List<ITypedef> getTypedefs(IASTNode extractedNode) { - final ArrayList<ITypedef> typeDefs = new ArrayList<ITypedef>(); + final ArrayList<ITypedef> typeDefs = new ArrayList<>(); extractedNode.accept(new ASTVisitor() { { shouldVisitExpressions = true; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExtractFunctionInformation.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExtractFunctionInformation.java index c810cc7d8cd..c03789b336c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExtractFunctionInformation.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExtractFunctionInformation.java @@ -91,7 +91,7 @@ public class ExtractFunctionInformation { } public void setParameters(List<NameInformation> parameters) { - this.parameters = new ArrayList<NameInformation>(parameters); + this.parameters = new ArrayList<>(parameters); } public VisibilityEnum getVisibility() { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExtractFunctionRefactoring.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExtractFunctionRefactoring.java index b75ba36aaee..50d829b3757 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExtractFunctionRefactoring.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExtractFunctionRefactoring.java @@ -753,9 +753,9 @@ public class ExtractFunctionRefactoring extends CRefactoring { IASTFunctionCallExpression callExpression = new CPPASTFunctionCallExpression(); IASTIdExpression idExpression = new CPPASTIdExpression(); idExpression.setName(astMethodName); - List<IASTInitializerClause> args = new ArrayList<IASTInitializerClause>(); + List<IASTInitializerClause> args = new ArrayList<>(); - Set<IASTName> declarations = new HashSet<IASTName>(); + Set<IASTName> declarations = new HashSet<>(); IASTName retName = null; boolean theRetName = false; @@ -929,8 +929,8 @@ public class ExtractFunctionRefactoring extends CRefactoring { } public List<IASTInitializerClause> getCallParameters() { - List<IASTInitializerClause> args = new ArrayList<IASTInitializerClause>(); - Set<IASTName> declarations = new HashSet<IASTName>(); + List<IASTInitializerClause> args = new ArrayList<>(); + Set<IASTName> declarations = new HashSet<>(); for (NameInformation nameInfo : info.getParameters()) { addParameterIfPossible(args, declarations, nameInfo); } @@ -960,7 +960,7 @@ public class ExtractFunctionRefactoring extends CRefactoring { } private Map<String, String> getArgumentMap() { - Map<String, String> arguments = new HashMap<String, String>(); + Map<String, String> arguments = new HashMap<>(); arguments.put(CRefactoringDescriptor.FILE_NAME, tu.getLocationURI().toString()); arguments.put(CRefactoringDescriptor.SELECTION, selectedRegion.getOffset() + "," + selectedRegion.getLength()); //$NON-NLS-1$ arguments.put(ExtractFunctionRefactoringDescriptor.NAME, info.getMethodName()); @@ -990,8 +990,8 @@ public class ExtractFunctionRefactoring extends CRefactoring { public RefactoringStatus checkParameterNames() { RefactoringStatus result = new RefactoringStatus(); List<NameInformation> parameters = info.getParameters(); - Set<String> usedNames = new HashSet<String>(); - Set<IASTName> declarations = new HashSet<IASTName>(); + Set<String> usedNames = new HashSet<>(); + Set<IASTName> declarations = new HashSet<>(); for (NameInformation nameInfo : container.getNames()) { IASTName declaration = nameInfo.getDeclarationName(); if (declarations.add(declaration) && !parameters.contains(nameInfo)) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/SimilarFinderVisitor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/SimilarFinderVisitor.java index cb577825346..2dcd844bf53 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/SimilarFinderVisitor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/SimilarFinderVisitor.java @@ -29,7 +29,7 @@ abstract class SimilarFinderVisitor extends ASTVisitor { protected final ExtractFunctionRefactoring refactoring; protected final NodeContainer extractedNodes; protected NodeContainer similarContainer; - protected final List<IASTStatement> stmtToReplace = new ArrayList<IASTStatement>(); + protected final List<IASTStatement> stmtToReplace = new ArrayList<>(); private final List<IASTNode> trail; private final List<IASTNode> statements; private int statementCount; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractlocalvariable/ExtractLocalVariableRefactoring.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractlocalvariable/ExtractLocalVariableRefactoring.java index de9364071a3..8d153c408ab 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractlocalvariable/ExtractLocalVariableRefactoring.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractlocalvariable/ExtractLocalVariableRefactoring.java @@ -141,7 +141,7 @@ public class ExtractLocalVariableRefactoring extends CRefactoring { } private ArrayList<String> findAllDeclaredNames() { - ArrayList<String> names = new ArrayList<String>(); + ArrayList<String> names = new ArrayList<>(); IASTFunctionDefinition funcDef = ASTQueries.findAncestorWithType(target, IASTFunctionDefinition.class); ICPPASTCompositeTypeSpecifier comTypeSpec = getCompositeTypeSpecifier(funcDef); if (comTypeSpec != null) { @@ -326,8 +326,8 @@ public class ExtractLocalVariableRefactoring extends CRefactoring { * proposal should be used as "best guess" (if it exists). */ public String[] guessTempNames() { - final List<String> guessedTempNames = new ArrayList<String>(); - final List<String> usedNames = new ArrayList<String>(); + final List<String> guessedTempNames = new ArrayList<>(); + final List<String> usedNames = new ArrayList<>(); IASTFunctionDefinition funcDef = ASTQueries.findAncestorWithType(target, IASTFunctionDefinition.class); final IScope scope; if (funcDef != null && funcDef.getBody() instanceof IASTCompoundStatement) { @@ -475,7 +475,7 @@ public class ExtractLocalVariableRefactoring extends CRefactoring { } private String makeTempName(List<String> usedNames, IScope scope) { - List<String> noNames = new ArrayList<String>(); + List<String> noNames = new ArrayList<>(); for (int i = 0; i < 10; i++) { for (String used : usedNames) { String name = used + i; // such as "i2" @@ -496,7 +496,7 @@ public class ExtractLocalVariableRefactoring extends CRefactoring { } private Map<String, String> getArgumentMap() { - Map<String, String> arguments = new HashMap<String, String>(); + Map<String, String> arguments = new HashMap<>(); arguments.put(CRefactoringDescriptor.FILE_NAME, tu.getLocationURI().toString()); arguments.put(CRefactoringDescriptor.SELECTION, selectedRegion.getOffset() + "," + selectedRegion.getLength()); //$NON-NLS-1$ arguments.put(ExtractLocalVariableRefactoringDescriptor.NAME, info.getName()); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/FieldDescriptor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/FieldDescriptor.java index 7a28555ca5a..114f651edeb 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/FieldDescriptor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/FieldDescriptor.java @@ -52,7 +52,7 @@ class FieldDescriptor { name = null; this.setter = new AccessorDescriptor(AccessorKind.SETTER, name, this); - List<AccessorDescriptor> children = new ArrayList<AccessorDescriptor>(2); + List<AccessorDescriptor> children = new ArrayList<>(2); if (getter.canBeGenerated()) { children.add(getter); } @@ -63,7 +63,7 @@ class FieldDescriptor { } private Set<String> getNamesToAvoid() { - Set<String> namesToAvoid = new HashSet<String>(); + Set<String> namesToAvoid = new HashSet<>(); // Add field names. for (IASTDeclarator fieldDeclarator : context.existingFields) { namesToAvoid.add(String.valueOf(GetterSetterContext.getDeclaratorName(fieldDeclarator).getSimpleID())); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/GenerateGettersAndSettersRefactoring.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/GenerateGettersAndSettersRefactoring.java index 67bf4606271..460d09588c7 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/GenerateGettersAndSettersRefactoring.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/GenerateGettersAndSettersRefactoring.java @@ -131,7 +131,7 @@ public class GenerateGettersAndSettersRefactoring extends CRefactoring { } private IFile[] getAllFilesToModify() { - List<IFile> files = new ArrayList<IFile>(2); + List<IFile> files = new ArrayList<>(2); IFile file = (IFile) tu.getResource(); if (file != null) { files.add(file); @@ -164,7 +164,7 @@ public class GenerateGettersAndSettersRefactoring extends CRefactoring { private IASTCompositeTypeSpecifier findCurrentCompositeTypeSpecifier(IASTTranslationUnit ast) throws OperationCanceledException, CoreException { final int start = selectedRegion.getOffset(); - Container<IASTCompositeTypeSpecifier> container = new Container<IASTCompositeTypeSpecifier>(); + Container<IASTCompositeTypeSpecifier> container = new Container<>(); ast.accept(new CompositeTypeSpecFinder(start, container)); return container.getObject(); } @@ -222,8 +222,8 @@ public class GenerateGettersAndSettersRefactoring extends CRefactoring { @Override protected void collectModifications(IProgressMonitor pm, ModificationCollector collector) throws CoreException, OperationCanceledException { - List<IASTNode> getterAndSetters = new ArrayList<IASTNode>(); - List<IASTFunctionDefinition> definitions = new ArrayList<IASTFunctionDefinition>(); + List<IASTNode> getterAndSetters = new ArrayList<>(); + List<IASTFunctionDefinition> definitions = new ArrayList<>(); ICPPASTCompositeTypeSpecifier classDefinition = ASTQueries.findAncestorWithType(context.existingFields.get(0), ICPPASTCompositeTypeSpecifier.class); for (AccessorDescriptor accessor : context.selectedAccessors) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/GetterSetterContext.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/GetterSetterContext.java index e6207f5c1ab..1db18ba99a3 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/GetterSetterContext.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/GetterSetterContext.java @@ -29,10 +29,10 @@ import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.Viewer; public class GetterSetterContext implements ITreeContentProvider { - final List<IASTDeclarator> existingFields = new ArrayList<IASTDeclarator>(); - final List<IASTFunctionDefinition> existingFunctionDefinitions = new ArrayList<IASTFunctionDefinition>(); - final List<IASTSimpleDeclaration> existingFunctionDeclarations = new ArrayList<IASTSimpleDeclaration>(); - final SortedSet<AccessorDescriptor> selectedAccessors = new TreeSet<AccessorDescriptor>(); + final List<IASTDeclarator> existingFields = new ArrayList<>(); + final List<IASTFunctionDefinition> existingFunctionDefinitions = new ArrayList<>(); + final List<IASTSimpleDeclaration> existingFunctionDeclarations = new ArrayList<>(); + final SortedSet<AccessorDescriptor> selectedAccessors = new TreeSet<>(); IASTName selectedName; private List<FieldDescriptor> fieldDescriptors; private boolean definitionSeparate; @@ -75,7 +75,7 @@ public class GetterSetterContext implements ITreeContentProvider { public void recreateFieldDescriptors() { // Delete field descriptors so that they are recreated by the next getFieldDescriptors call. fieldDescriptors = null; - SortedSet<AccessorDescriptor> oldSelected = new TreeSet<AccessorDescriptor>(selectedAccessors); + SortedSet<AccessorDescriptor> oldSelected = new TreeSet<>(selectedAccessors); selectedAccessors.clear(); for (FieldDescriptor descriptor : getFieldDescriptors()) { for (AccessorDescriptor accessor : descriptor.getChildNodes()) { @@ -110,7 +110,7 @@ public class GetterSetterContext implements ITreeContentProvider { private List<FieldDescriptor> getFieldDescriptors() { if (fieldDescriptors == null) { - fieldDescriptors = new ArrayList<FieldDescriptor>(); + fieldDescriptors = new ArrayList<>(); for (IASTDeclarator field : existingFields) { FieldDescriptor descriptor = new FieldDescriptor(field, this); if (descriptor.missingGetterOrSetter()) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/GetterSetterNameGenerator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/GetterSetterNameGenerator.java index 38530599bbd..29dc2578f78 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/GetterSetterNameGenerator.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/GetterSetterNameGenerator.java @@ -28,7 +28,7 @@ import org.eclipse.cdt.internal.corext.codemanipulation.StubUtility; import org.eclipse.cdt.ui.PreferenceConstants; public class GetterSetterNameGenerator { - private static Set<String> generateGetterSettersPreferenceKeys = new HashSet<String>(); + private static Set<String> generateGetterSettersPreferenceKeys = new HashSet<>(); static { generateGetterSettersPreferenceKeys.add(PreferenceConstants.NAME_STYLE_GETTER_CAPITALIZATION); generateGetterSettersPreferenceKeys.add(PreferenceConstants.NAME_STYLE_GETTER_WORD_DELIMITER); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/hidemethod/HideMethodRefactoring.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/hidemethod/HideMethodRefactoring.java index 691bb01141a..dc0e3078ce4 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/hidemethod/HideMethodRefactoring.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/hidemethod/HideMethodRefactoring.java @@ -192,8 +192,8 @@ public class HideMethodRefactoring extends CRefactoring { IIndexBinding methodBinding = index.adaptBinding(methodName.resolveBinding()); if (methodBinding == null) return null; - List<IASTName> references = new ArrayList<IASTName>(); - Set<String> searchedFiles = new HashSet<String>(); + List<IASTName> references = new ArrayList<>(); + Set<String> searchedFiles = new HashSet<>(); IEditorPart[] dirtyEditors = EditorUtility.getDirtyEditors(true); SubMonitor loopProgress = sm.newChild(3).setWorkRemaining(dirtyEditors.length); for (IEditorPart editor : dirtyEditors) { @@ -257,7 +257,7 @@ public class HideMethodRefactoring extends CRefactoring { } private List<IASTName> findAllMarkedNames() throws OperationCanceledException, CoreException { - final ArrayList<IASTName> namesVector = new ArrayList<IASTName>(); + final ArrayList<IASTName> namesVector = new ArrayList<>(); IASTTranslationUnit ast = getAST(tu, null); ast.accept(new ASTVisitor() { @@ -288,7 +288,7 @@ public class HideMethodRefactoring extends CRefactoring { } private Map<String, String> getArgumentMap() { - Map<String, String> arguments = new HashMap<String, String>(); + Map<String, String> arguments = new HashMap<>(); arguments.put(CRefactoringDescriptor.FILE_NAME, tu.getLocationURI().toString()); arguments.put(CRefactoringDescriptor.SELECTION, selectedRegion.getOffset() + "," + selectedRegion.getLength()); //$NON-NLS-1$ return arguments; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodData.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodData.java index 183beafda38..42ede03fe7b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodData.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodData.java @@ -33,7 +33,7 @@ public class ImplementMethodData implements ITreeContentProvider { private List<MethodToImplementConfig> methodDeclarations; public void setMethodDeclarations(List<IASTSimpleDeclaration> methodDeclarations) { - this.methodDeclarations = new ArrayList<MethodToImplementConfig>(); + this.methodDeclarations = new ArrayList<>(); for (IASTSimpleDeclaration declaration : methodDeclarations) { this.methodDeclarations.add(new MethodToImplementConfig(declaration, new ParameterHandler(declaration))); @@ -79,7 +79,7 @@ public class ImplementMethodData implements ITreeContentProvider { } public List<MethodToImplementConfig> getMethodsToImplement() { - List<MethodToImplementConfig> ret = new ArrayList<MethodToImplementConfig>(); + List<MethodToImplementConfig> ret = new ArrayList<>(); for (MethodToImplementConfig config : methodDeclarations) { if (config.isChecked()) { ret.add(config); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodRefactoring.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodRefactoring.java index 7ede8de5c8b..6574bb089ae 100755 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodRefactoring.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodRefactoring.java @@ -84,7 +84,7 @@ public class ImplementMethodRefactoring extends CRefactoring { super(element, selection, project); data = new ImplementMethodData(); methodDefinitionInsertLocationFinder = new MethodDefinitionInsertLocationFinder(); - insertLocations = new HashMap<IASTSimpleDeclaration, InsertLocation>(); + insertLocations = new HashMap<>(); } @Override @@ -121,7 +121,7 @@ public class ImplementMethodRefactoring extends CRefactoring { throws OperationCanceledException, CoreException { final SubMonitor sm = SubMonitor.convert(pm, 2); IASTTranslationUnit ast = getAST(tu, sm.newChild(1)); - final List<IASTSimpleDeclaration> list = new ArrayList<IASTSimpleDeclaration>(); + final List<IASTSimpleDeclaration> list = new ArrayList<>(); ast.accept(new ASTVisitor() { { shouldVisitDeclarations = true; @@ -318,7 +318,7 @@ public class ImplementMethodRefactoring extends CRefactoring { } private IFile[] getAllFilesToModify() { - List<IFile> files = new ArrayList<IFile>(2); + List<IFile> files = new ArrayList<>(2); IFile file = (IFile) tu.getResource(); if (file != null) { files.add(file); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodWizard.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodWizard.java index 907bb5fee0a..857e0abb0fe 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodWizard.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodWizard.java @@ -29,7 +29,7 @@ import org.eclipse.ltk.ui.refactoring.RefactoringWizard; */ public class ImplementMethodWizard extends RefactoringWizard { private final ImplementMethodRefactoring refactoring; - private Map<MethodToImplementConfig, ParameterNamesInputPage> pagesMap = new HashMap<MethodToImplementConfig, ParameterNamesInputPage>(); + private Map<MethodToImplementConfig, ParameterNamesInputPage> pagesMap = new HashMap<>(); public ImplementMethodWizard(ImplementMethodRefactoring refactoring) { super(refactoring, DIALOG_BASED_USER_INTERFACE | PREVIEW_EXPAND_FIRST_NODE); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/MethodDefinitionInsertLocationFinder.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/MethodDefinitionInsertLocationFinder.java index 9b17fae211e..9261859b492 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/MethodDefinitionInsertLocationFinder.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/MethodDefinitionInsertLocationFinder.java @@ -50,7 +50,7 @@ public class MethodDefinitionInsertLocationFinder { // might want to find multiple insert locations in the same translation unit. This prevents // many redundant calls to DefinitionFinder.getDefinition and speeds up the process quite // a bit. Unfortunately, this has the minor side-effect or having to instantiate this class. - Map<IASTSimpleDeclaration, IASTName> cachedDeclarationToDefinition = new HashMap<IASTSimpleDeclaration, IASTName>(); + Map<IASTSimpleDeclaration, IASTName> cachedDeclarationToDefinition = new HashMap<>(); public InsertLocation find(ITranslationUnit declarationTu, IASTFileLocation methodDeclarationLocation, IASTNode parent, CRefactoringContext refactoringContext, IProgressMonitor pm) throws CoreException { @@ -155,7 +155,7 @@ public class MethodDefinitionInsertLocationFinder { */ private static Collection<IASTSimpleDeclaration> getAllPreviousSimpleDeclarationsFromClassInReverseOrder( IASTDeclaration[] declarations, IASTFileLocation methodPosition, IProgressMonitor pm) { - ArrayList<IASTSimpleDeclaration> outputDeclarations = new ArrayList<IASTSimpleDeclaration>(); + ArrayList<IASTSimpleDeclaration> outputDeclarations = new ArrayList<>(); if (declarations.length >= 0) { for (IASTDeclaration decl : declarations) { if (pm != null && pm.isCanceled()) { @@ -175,7 +175,7 @@ public class MethodDefinitionInsertLocationFinder { private static Collection<IASTSimpleDeclaration> getAllFollowingSimpleDeclarationsFromClass( IASTDeclaration[] declarations, IASTFileLocation methodPosition, IProgressMonitor pm) { - ArrayList<IASTSimpleDeclaration> outputDeclarations = new ArrayList<IASTSimpleDeclaration>(); + ArrayList<IASTSimpleDeclaration> outputDeclarations = new ArrayList<>(); if (declarations.length >= 0) { for (IASTDeclaration decl : declarations) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ParameterHandler.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ParameterHandler.java index 9d320158df1..eb067f44f58 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ParameterHandler.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ParameterHandler.java @@ -50,7 +50,7 @@ public class ParameterHandler { return; } needsAditionalArgumentNames = false; - parameterInfos = new ArrayList<ParameterInfo>(); + parameterInfos = new ArrayList<>(); for (IASTParameterDeclaration actParam : getParametersFromMethodNode()) { String actName = actParam.getDeclarator().getName().toString(); boolean isChangable = false; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/HeaderSubstitutionMap.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/HeaderSubstitutionMap.java index 16b3212078a..917420a5d21 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/HeaderSubstitutionMap.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/HeaderSubstitutionMap.java @@ -165,7 +165,7 @@ public class HeaderSubstitutionMap { return Collections.emptyList(); } - List<HeaderSubstitutionMap> maps = new ArrayList<HeaderSubstitutionMap>(); + List<HeaderSubstitutionMap> maps = new ArrayList<>(); for (IMemento element : memento.getChildren(TAG_HEADER_SUBSTITUTION_MAP)) { maps.add(fromMemento(element)); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeGroupStyle.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeGroupStyle.java index 60d03ec8597..7857b1d2f78 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeGroupStyle.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeGroupStyle.java @@ -61,7 +61,7 @@ public class IncludeGroupStyle implements Comparable<IncludeGroupStyle> { public final String name; public final String description; public final IncludeKind parent; - public final List<IncludeKind> children = new ArrayList<IncludeKind>(); + public final List<IncludeKind> children = new ArrayList<>(); private IncludeKind(String name, String description, IncludeKind parent) { this.name = name; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeMap.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeMap.java index 744754b40b8..be61a48f3a2 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeMap.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeMap.java @@ -173,7 +173,7 @@ public class IncludeMap { public static IncludeMap fromMemento(boolean unconditionalSubstitution, IMemento memento) { IncludeMap includeMap = new IncludeMap(unconditionalSubstitution); - Set<String> keys = unconditionalSubstitution ? new HashSet<String>() : Collections.<String>emptySet(); + Set<String> keys = unconditionalSubstitution ? new HashSet<>() : Collections.<String>emptySet(); for (IMemento mapping : memento.getChildren(TAG_MAPPING)) { String key = mapping.getString(TAG_KEY); // There can be no more than one unconditional substitution for any header file. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/SymbolExportMap.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/SymbolExportMap.java index 18ce3a2594c..fc581dbb5c0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/SymbolExportMap.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/SymbolExportMap.java @@ -47,7 +47,7 @@ public class SymbolExportMap { private final Map<String, Set<IncludeInfo>> map; public SymbolExportMap() { - this.map = new HashMap<String, Set<IncludeInfo>>(); + this.map = new HashMap<>(); } /** @@ -58,7 +58,7 @@ public class SymbolExportMap { public SymbolExportMap(String[] keysAndValues) { if (keysAndValues.length % 2 != 0) throw new IllegalArgumentException("More keys than values"); //$NON-NLS-1$ - this.map = new HashMap<String, Set<IncludeInfo>>(keysAndValues.length / 2); + this.map = new HashMap<>(keysAndValues.length / 2); for (int i = 0; i < keysAndValues.length;) { String key = keysAndValues[i++]; addMapping(key, keysAndValues[i++]); @@ -66,7 +66,7 @@ public class SymbolExportMap { } public SymbolExportMap(SymbolExportMap other) { - this.map = new HashMap<String, Set<IncludeInfo>>(other.map.size()); + this.map = new HashMap<>(other.map.size()); addAllMappings(other); } @@ -81,7 +81,7 @@ public class SymbolExportMap { return; // Don't allow mapping to itself. Set<IncludeInfo> list = map.get(symbol); if (list == null) { - list = new LinkedHashSet<IncludeInfo>(); + list = new LinkedHashSet<>(); map.put(symbol, list); } list.add(header); @@ -128,10 +128,10 @@ public class SymbolExportMap { * Writes the map to a memento. */ public void saveToMemento(IMemento memento) { - List<String> keys = new ArrayList<String>(map.keySet()); + List<String> keys = new ArrayList<>(map.keySet()); Collections.sort(keys, COLLATOR); for (String key : keys) { - List<IncludeInfo> values = new ArrayList<IncludeInfo>(map.get(key)); + List<IncludeInfo> values = new ArrayList<>(map.get(key)); Collections.sort(values); for (IncludeInfo value : values) { IMemento mapping = memento.createChild(TAG_MAPPING); @@ -156,7 +156,7 @@ public class SymbolExportMap { Set<IncludeInfo> otherTargets = entry.getValue(); Set<IncludeInfo> targets = map.get(source); if (targets == null) { - targets = new LinkedHashSet<IncludeInfo>(otherTargets); + targets = new LinkedHashSet<>(otherTargets); map.put(source, targets); } else { targets.addAll(otherTargets); @@ -168,13 +168,13 @@ public class SymbolExportMap { @Override public String toString() { StringBuilder buf = new StringBuilder(); - ArrayList<String> symbols = new ArrayList<String>(map.keySet()); + ArrayList<String> symbols = new ArrayList<>(map.keySet()); Collections.sort(symbols); for (String symbol : symbols) { buf.append('\n'); buf.append(symbol); buf.append(" exported by "); //$NON-NLS-1$ - List<IncludeInfo> targets = new ArrayList<IncludeInfo>(map.get(symbol)); + List<IncludeInfo> targets = new ArrayList<>(map.get(symbol)); for (int i = 0; i < targets.size(); i++) { if (i > 0) buf.append(", "); //$NON-NLS-1$ @@ -211,7 +211,7 @@ public class SymbolExportMap { return Collections.emptyList(); } - List<SymbolExportMap> maps = new ArrayList<SymbolExportMap>(); + List<SymbolExportMap> maps = new ArrayList<>(); for (IMemento element : memento.getChildren(TAG_SYMBOL_EXPORT_MAP)) { maps.add(fromMemento(element)); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRefactory.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRefactory.java index 09b4cfd03f7..9ea3f198600 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRefactory.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRefactory.java @@ -118,7 +118,7 @@ public class CRefactory { public String[] getCCppPatterns() { IContentType[] cts = Platform.getContentTypeManager().getAllContentTypes(); - HashSet<String> all = new HashSet<String>(); + HashSet<String> all = new HashSet<>(); for (IContentType candidate : cts) { IContentType type = candidate; boolean useIt = false; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/TextSearchWrapper.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/TextSearchWrapper.java index ab0f46e8e28..3c397a168e7 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/TextSearchWrapper.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/TextSearchWrapper.java @@ -67,7 +67,7 @@ public class TextSearchWrapper { private static class SearchScope extends TextSearchScope { public static SearchScope newSearchScope(IFile[] files, IWorkingSet ws) { IAdaptable[] adaptables = ws.getElements(); - ArrayList<IResource> resources = new ArrayList<IResource>(); + ArrayList<IResource> resources = new ArrayList<>(); for (int i = 0; i < adaptables.length; i++) { IAdaptable adaptable = adaptables[i]; IResource resource = adaptable.getAdapter(IResource.class); @@ -80,7 +80,7 @@ public class TextSearchWrapper { public static SearchScope newSearchScope(IFile[] files, IResource[] roots) { if (files != null) { - ArrayList<IResource> resources = new ArrayList<IResource>(files.length + roots.length); + ArrayList<IResource> resources = new ArrayList<>(files.length + roots.length); for (IFile file : files) { if (!isInForest(file, roots)) { resources.add(file); @@ -106,7 +106,7 @@ public class TextSearchWrapper { } private IResource[] fRootResources; - private ArrayList<Matcher> fFileMatcher = new ArrayList<Matcher>(); + private ArrayList<Matcher> fFileMatcher = new ArrayList<>(); private SearchScope(IResource[] roots) { fRootResources = roots; @@ -199,8 +199,8 @@ public class TextSearchWrapper { } private TextSearchScope defineRelatedProjectsAsSearchScope(IFile[] files, IProject project, String[] patterns) { - HashSet<IProject> projects = new HashSet<IProject>(); - LinkedList<IProject> workThrough = new LinkedList<IProject>(); + HashSet<IProject> projects = new HashSet<>(); + LinkedList<IProject> workThrough = new LinkedList<>(); workThrough.add(project); while (!workThrough.isEmpty()) { IProject proj = workThrough.removeLast(); @@ -300,7 +300,7 @@ public class TextSearchWrapper { IFile tfile = match.getFile(); if (file == null || !file.equals(tfile)) { file = tfile; - locations = new ArrayList<int[]>(); + locations = new ArrayList<>(); computeLocations(file, locations); } match.setLocation(findLocation(match, locations)); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/InsertionPointFinder.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/InsertionPointFinder.java index 0ad5f210d74..7bce00e643f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/InsertionPointFinder.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/InsertionPointFinder.java @@ -83,7 +83,7 @@ public class InsertionPointFinder { * @param ast the translation unit where to find the definitions */ private static void findAllDefinitionsoutSideClass(IASTTranslationUnit ast) { - final ArrayList<ICPPASTFunctionDefinition> definitions = new ArrayList<ICPPASTFunctionDefinition>(); + final ArrayList<ICPPASTFunctionDefinition> definitions = new ArrayList<>(); if (ast == null) { alldefinitionsoutside = definitions; return; @@ -110,7 +110,7 @@ public class InsertionPointFinder { private static ArrayList<ICPPASTFunctionDeclarator> getDeclarationsInClass(ICPPASTCompositeTypeSpecifier klass, final IASTFunctionDeclarator selected) { - final ArrayList<ICPPASTFunctionDeclarator> declarations = new ArrayList<ICPPASTFunctionDeclarator>(); + final ArrayList<ICPPASTFunctionDeclarator> declarations = new ArrayList<>(); klass.accept(new ASTVisitor() { { @@ -137,7 +137,7 @@ public class InsertionPointFinder { } private static ICPPASTCompositeTypeSpecifier getklass(IASTTranslationUnit unit) { - final Container<ICPPASTCompositeTypeSpecifier> result = new Container<ICPPASTCompositeTypeSpecifier>(); + final Container<ICPPASTCompositeTypeSpecifier> result = new Container<>(); unit.accept(new ASTVisitor() { { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/ToggleFromInHeaderToImplementationStrategy.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/ToggleFromInHeaderToImplementationStrategy.java index 28314bd929a..c7c2ee9417a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/ToggleFromInHeaderToImplementationStrategy.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/ToggleFromInHeaderToImplementationStrategy.java @@ -397,14 +397,14 @@ public class ToggleFromInHeaderToImplementationStrategy implements IToggleRefact } private IASTNode searchNamespaceInImplementation(final List<ICPPASTNamespaceDefinition> namespaces) { - final Container<IASTNode> result = new Container<IASTNode>(); + final Container<IASTNode> result = new Container<>(); ASTVisitor visitor = new NamespaceFinderVisitor(namespaces, result); this.implAst.accept(visitor); return result.getObject(); } private List<ICPPASTNamespaceDefinition> getNamespacesToAdd(final List<ICPPASTNamespaceDefinition> namespaces) { - final List<ICPPASTNamespaceDefinition> result = new ArrayList<ICPPASTNamespaceDefinition>(); + final List<ICPPASTNamespaceDefinition> result = new ArrayList<>(); this.implAst.accept(new NamespaceFinderVisitor(namespaces, new Container<IASTNode>()) { { shouldVisitTranslationUnit = true; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/ToggleNodeHelper.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/ToggleNodeHelper.java index 4217cebe4f2..9cd68fb4cc0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/ToggleNodeHelper.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/ToggleNodeHelper.java @@ -84,7 +84,7 @@ public class ToggleNodeHelper extends NodeHelper { } private static List<ICPPASTConstructorChainInitializer> getInitializerList(IASTFunctionDefinition definition) { - ArrayList<ICPPASTConstructorChainInitializer> initalizers = new ArrayList<ICPPASTConstructorChainInitializer>(); + ArrayList<ICPPASTConstructorChainInitializer> initalizers = new ArrayList<>(); for (IASTNode node : definition.getChildren()) { if (node instanceof ICPPASTConstructorChainInitializer) { @@ -286,7 +286,7 @@ public class ToggleNodeHelper extends NodeHelper { } private static ArrayList<ICPPASTTemplateDeclaration> getAllTemplateDeclarations(IASTNode node) { - ArrayList<ICPPASTTemplateDeclaration> templdecs = new ArrayList<ICPPASTTemplateDeclaration>(); + ArrayList<ICPPASTTemplateDeclaration> templdecs = new ArrayList<>(); while (node.getParent() != null) { node = node.getParent(); if (node instanceof ICPPASTTemplateDeclaration) { @@ -363,7 +363,7 @@ public class ToggleNodeHelper extends NodeHelper { private static Stack<IASTNode> getQualifiedNames(IASTFunctionDeclarator declarator, IASTNode limiter, IASTNode node) { IASTName lastName = declarator.getName(); - Stack<IASTNode> nodes = new Stack<IASTNode>(); + Stack<IASTNode> nodes = new Stack<>(); while (node.getParent() != null && node.getParent() != limiter) { node = node.getParent(); if (node instanceof IASTCompositeTypeSpecifier) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ASTHelper.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ASTHelper.java index e2f8aee9d61..30a3a0733ac 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ASTHelper.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ASTHelper.java @@ -108,7 +108,7 @@ public class ASTHelper { } public static Collection<IASTDeclSpecifier> getCompositeTypeSpecifiers(IASTNode baseNode) { - final Collection<IASTDeclSpecifier> specifiers = new ArrayList<IASTDeclSpecifier>(); + final Collection<IASTDeclSpecifier> specifiers = new ArrayList<>(); ASTVisitor visitor = new ASTVisitor() { @Override public int visit(IASTDeclSpecifier declSpec) { @@ -123,7 +123,7 @@ public class ASTHelper { public static Collection<IASTPreprocessorStatement> getAllInFilePreprocessorStatements(IASTTranslationUnit unit, String aktFileName) { - Collection<IASTPreprocessorStatement> statements = new ArrayList<IASTPreprocessorStatement>(); + Collection<IASTPreprocessorStatement> statements = new ArrayList<>(); for (IASTPreprocessorStatement aktStatement : unit.getAllPreprocessorStatements()) { if (aktStatement.getFileLocation() != null && aktStatement.getFileLocation().getFileName().equals(aktFileName)) { @@ -134,7 +134,7 @@ public class ASTHelper { } public static Collection<IASTDeclaration> getAllInFileDeclarations(IASTTranslationUnit unit, String aktFileName) { - Collection<IASTDeclaration> decls = new ArrayList<IASTDeclaration>(); + Collection<IASTDeclaration> decls = new ArrayList<>(); for (IASTDeclaration aktDecl : unit.getDeclarations()) { if (aktDecl.getFileLocation() != null && aktDecl.getFileLocation().getFileName().equals(aktFileName)) { decls.add(aktDecl); @@ -157,7 +157,7 @@ public class ASTHelper { } public static Collection<ICPPASTUsingDeclaration> getUsingDeclarations(IASTTranslationUnit unit) { - Collection<ICPPASTUsingDeclaration> usingDecls = new ArrayList<ICPPASTUsingDeclaration>(); + Collection<ICPPASTUsingDeclaration> usingDecls = new ArrayList<>(); for (IASTDeclaration aktDecl : unit.getDeclarations()) { if (aktDecl instanceof ICPPASTUsingDeclaration) { usingDecls.add((ICPPASTUsingDeclaration) aktDecl); @@ -177,7 +177,7 @@ public class ASTHelper { } public static Collection<IASTFunctionDeclarator> getFunctionDeclaratorsForClass(IASTCompositeTypeSpecifier klass) { - Collection<IASTFunctionDeclarator> declarators = new ArrayList<IASTFunctionDeclarator>(); + Collection<IASTFunctionDeclarator> declarators = new ArrayList<>(); for (IASTDeclaration aktDeclaration : klass.getMembers()) { if (aktDeclaration instanceof IASTSimpleDeclaration) { for (IASTDeclarator aktDeclarator : ((IASTSimpleDeclaration) aktDeclaration).getDeclarators()) { @@ -191,7 +191,7 @@ public class ASTHelper { } public static Collection<IASTFunctionDefinition> getFunctionDefinitionsForClass(IASTCompositeTypeSpecifier klass) { - Collection<IASTFunctionDefinition> definitions = new ArrayList<IASTFunctionDefinition>(); + Collection<IASTFunctionDefinition> definitions = new ArrayList<>(); for (IASTFunctionDeclarator aktDeclarator : getFunctionDeclaratorsForClass(klass)) { IBinding binding = aktDeclarator.getName().resolveBinding(); for (IASTName aktName : aktDeclarator.getTranslationUnit().getDefinitionsInAST(binding)) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/DefinitionFinder.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/DefinitionFinder.java index ce34bf04972..00564d10904 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/DefinitionFinder.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/DefinitionFinder.java @@ -91,8 +91,8 @@ public class DefinitionFinder { IIndexBinding indexBinding = index.adaptBinding(binding); if (binding == null) return null; - Set<String> searchedFiles = new HashSet<String>(); - List<IASTName> definitions = new ArrayList<IASTName>(); + Set<String> searchedFiles = new HashSet<>(); + List<IASTName> definitions = new ArrayList<>(); IIndexName[] definitionsFromIndex = index.findNames(indexBinding, IIndex.FIND_DEFINITIONS | IIndex.SEARCH_ACROSS_LANGUAGE_BOUNDARIES); int remainingCount = definitionsFromIndex.length; @@ -156,7 +156,7 @@ public class DefinitionFinder { IIndexBinding indexBinding = index.adaptBinding(binding); if (binding == null) return false; - Set<String> dirtyFiles = new HashSet<String>(); + Set<String> dirtyFiles = new HashSet<>(); IEditorPart[] dirtyEditors = EditorUtility.getDirtyEditors(true); for (IEditorPart editor : dirtyEditors) { IEditorInput editorInput = editor.getEditorInput(); @@ -166,7 +166,7 @@ public class DefinitionFinder { } } - Set<String> searchedFiles = new HashSet<String>(); + Set<String> searchedFiles = new HashSet<>(); IIndexName[] definitionsFromIndex = index.findNames(indexBinding, IIndex.FIND_DEFINITIONS | IIndex.SEARCH_ACROSS_LANGUAGE_BOUNDARIES); int remainingCount = definitionsFromIndex.length; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ExpressionFinder.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ExpressionFinder.java index 8cd31c1adbe..4841bb9a9a1 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ExpressionFinder.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ExpressionFinder.java @@ -28,7 +28,7 @@ import org.eclipse.core.runtime.Path; public class ExpressionFinder { public static IASTName findExpressionInTranslationUnit(IASTTranslationUnit transUnit, final IIndexName indexName) { - final Container<IASTName> expName = new Container<IASTName>(); + final Container<IASTName> expName = new Container<>(); transUnit.accept(new ASTVisitor() { { shouldVisitNames = true; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/PseudoNameGenerator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/PseudoNameGenerator.java index f9171854df7..ca665b6747c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/PseudoNameGenerator.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/PseudoNameGenerator.java @@ -25,7 +25,7 @@ import java.util.Set; */ public class PseudoNameGenerator { - private final Set<String> names = new HashSet<String>(); + private final Set<String> names = new HashSet<>(); public void addExistingName(String name) { names.add(name); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/resources/ResourceExclusionContributor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/resources/ResourceExclusionContributor.java index 62381c86297..a7f2835f9a0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/resources/ResourceExclusionContributor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/resources/ResourceExclusionContributor.java @@ -103,8 +103,8 @@ public class ResourceExclusionContributor extends RefreshExclusionContributor { gridData.minimumWidth = 275; exceptionsList.setLayoutData(gridData); - final HashMap<String, ExclusionInstance> exclusionInstanceStrings = new LinkedHashMap<String, ExclusionInstance>(); - final HashMap<String, Object> exclusionInstanceResources = new LinkedHashMap<String, Object>(); + final HashMap<String, ExclusionInstance> exclusionInstanceStrings = new LinkedHashMap<>(); + final HashMap<String, Object> exclusionInstanceResources = new LinkedHashMap<>(); java.util.List<ExclusionInstance> exclusionInstances = exclusion.getExclusionInstances(); @@ -156,7 +156,7 @@ public class ResourceExclusionContributor extends RefreshExclusionContributor { IContainer container = (IContainer) parentElement; if (container.isAccessible()) { try { - java.util.List<IResource> children = new ArrayList<IResource>(); + java.util.List<IResource> children = new ArrayList<>(); IResource[] members = container.members(); for (int i = 0; i < members.length; i++) { if (members[i].getType() == IResource.FOLDER) { @@ -208,7 +208,7 @@ public class ResourceExclusionContributor extends RefreshExclusionContributor { Object[] selection = dialog.getResult(); exceptionsList.removeAll(); exclusionInstanceResources.clear(); - final HashMap<String, ExclusionInstance> oldExclusionInstanceStrings = new LinkedHashMap<String, ExclusionInstance>( + final HashMap<String, ExclusionInstance> oldExclusionInstanceStrings = new LinkedHashMap<>( exclusionInstanceStrings); exclusionInstanceStrings.clear(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchListContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchListContentProvider.java index 811dfd17e03..1e51dfd6ab4 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchListContentProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchListContentProvider.java @@ -45,12 +45,12 @@ public class CSearchListContentProvider implements IStructuredContentProvider, I @Override public Object[] getElements(Object inputElement) { - Set<String> uncoveredProjects = new HashSet<String>(); + Set<String> uncoveredProjects = new HashSet<>(); CSearchResult result = (CSearchResult) inputElement; Object[] results = result.getElements(); - List<Object> resultList = new ArrayList<Object>(); + List<Object> resultList = new ArrayList<>(); // see which projects returned results for (int i = 0; i < results.length; i++) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java index ef3d3f77786..1573ae076b3 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java @@ -176,7 +176,7 @@ public class CSearchPage extends DialogPage implements ISearchPage { } // get the list of elements for the scope - Set<ICElement> elements = new HashSet<ICElement>(); + Set<ICElement> elements = new HashSet<>(); String scopeDescription = ""; //$NON-NLS-1$ switch (getContainer().getSelectedScope()) { case ISearchPageContainer.SELECTED_PROJECTS_SCOPE: diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPatternQuery.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPatternQuery.java index 1829ce2c1a8..5ac68d0b04d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPatternQuery.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPatternQuery.java @@ -77,7 +77,7 @@ public class CSearchPatternQuery extends CSearchQuery { this.patternStr = patternStr.trim(); // Parse the pattern string - List<Pattern> patternList = new ArrayList<Pattern>(); + List<Pattern> patternList = new ArrayList<>(); StringBuilder buff = new StringBuilder(); int n = patternStr.length(); for (int i = 0; i < n; ++i) { @@ -143,7 +143,7 @@ public class CSearchPatternQuery extends CSearchQuery { try { IndexFilter filter = IndexFilter.ALL; IIndexBinding[] bindings = index.findBindings(pattern, false, filter, monitor); - ArrayList<IIndexBinding> matchedBindings = new ArrayList<IIndexBinding>(); + ArrayList<IIndexBinding> matchedBindings = new ArrayList<>(); for (int i = 0; i < bindings.length; ++i) { IIndexBinding pdomBinding = bindings[i]; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchProviderManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchProviderManager.java index 50ae63025eb..df2e208d8fc 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchProviderManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchProviderManager.java @@ -43,7 +43,7 @@ public class CSearchProviderManager { public List<IExternalSearchProvider> getExternalSearchProviders() { if (externalSearchProviders == null) { - externalSearchProviders = new ArrayList<IExternalSearchProvider>(); + externalSearchProviders = new ArrayList<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint indexProviderPoint = registry.getExtensionPoint(SEARCH_PROVIDERS); for (IExtension extension : indexProviderPoint.getExtensions()) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchTreeContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchTreeContentProvider.java index 421778d7374..9721c95cebc 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchTreeContentProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchTreeContentProvider.java @@ -47,7 +47,7 @@ import org.eclipse.jface.viewers.Viewer; public class CSearchTreeContentProvider implements ITreeContentProvider, IPDOMSearchContentProvider { private TreeViewer viewer; private CSearchResult result; - private final Map<Object, Set<Object>> tree = new HashMap<Object, Set<Object>>(); + private final Map<Object, Set<Object>> tree = new HashMap<>(); private final CSearchViewPage fPage; CSearchTreeContentProvider(CSearchViewPage page) { @@ -119,7 +119,7 @@ public class CSearchTreeContentProvider implements ITreeContentProvider, IPDOMSe private boolean insertChild(Object parent, Object child) { Set<Object> children = tree.get(parent); if (children == null) { - children = new HashSet<Object>(); + children = new HashSet<>(); tree.put(parent, children); } return children.add(child); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LRUWorkingSets.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LRUWorkingSets.java index aba35cb0b71..e6fe418b577 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LRUWorkingSets.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LRUWorkingSets.java @@ -40,7 +40,7 @@ public class LRUWorkingSets { int size = 0; public LRUWorkingSets(int size) { - workingSetsCache = new ArrayList<IWorkingSet[]>(size); + workingSetsCache = new ArrayList<>(size); this.size = size; } @@ -56,11 +56,11 @@ public class LRUWorkingSets { } private IWorkingSet[] find(ArrayList<IWorkingSet[]> list, IWorkingSet[] workingSet) { - Set<IWorkingSet> workingSetList = new HashSet<IWorkingSet>(Arrays.asList(workingSet)); + Set<IWorkingSet> workingSetList = new HashSet<>(Arrays.asList(workingSet)); Iterator<IWorkingSet[]> iter = list.iterator(); while (iter.hasNext()) { IWorkingSet[] lruWorkingSets = iter.next(); - Set<IWorkingSet> lruWorkingSetList = new HashSet<IWorkingSet>(Arrays.asList(lruWorkingSets)); + Set<IWorkingSet> lruWorkingSetList = new HashSet<>(Arrays.asList(lruWorkingSets)); if (lruWorkingSetList.equals(workingSetList)) return lruWorkingSets; } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LineSearchElement.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LineSearchElement.java index 35a17dc1c08..2a65e70c469 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LineSearchElement.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LineSearchElement.java @@ -172,8 +172,8 @@ public class LineSearchElement extends CSearchElement { // Sort matches according to their offsets Arrays.sort(matches, MATCHES_COMPARATOR); // Group all matches by lines and create LineSearchElements - List<LineSearchElement> result = new ArrayList<LineSearchElement>(); - List<Match> matchCollector = new ArrayList<Match>(); + List<LineSearchElement> result = new ArrayList<>(); + List<Match> matchCollector = new ArrayList<>(); int minOffset = 0; int lineNumber = 0; int lineOffset = 0; @@ -223,8 +223,8 @@ public class LineSearchElement extends CSearchElement { private static LineSearchElement[] collectLineElements(AbstractCharArray buf, Match[] matches, IIndexFileLocation fileLocation) { - List<LineSearchElement> result = new ArrayList<LineSearchElement>(); - List<Match> matchCollector = new ArrayList<Match>(); + List<LineSearchElement> result = new ArrayList<>(); + List<Match> matchCollector = new ArrayList<>(); boolean skipLF = false; int lineNumber = 1; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LinkedNamesFinder.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LinkedNamesFinder.java index d904757b565..c6fa83f76b6 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LinkedNamesFinder.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LinkedNamesFinder.java @@ -77,7 +77,7 @@ public class LinkedNamesFinder { public BindingFinder(IASTTranslationUnit root, IASTNode point) { this.root = root; - locations = new ArrayList<IRegion>(); + locations = new ArrayList<>(); } public void find(IBinding target) { @@ -191,7 +191,7 @@ public class LinkedNamesFinder { private void findMacro(IMacroBinding target) { findBinding(target); char[] nameChars = target.getNameCharArray(); - List<IASTName> ifdefNameStack = new ArrayList<IASTName>(); + List<IASTName> ifdefNameStack = new ArrayList<>(); IASTPreprocessorStatement[] statements = root.getAllPreprocessorStatements(); for (IASTPreprocessorStatement statement : statements) { if (!statement.isPartOfTranslationUnitFile()) { @@ -308,8 +308,8 @@ public class LinkedNamesFinder { } private final ICPPClassType baseClass; - private Set<ICPPClassType> subclasses = new HashSet<ICPPClassType>(); - private Set<IBinding> seenClasses = new HashSet<IBinding>(); + private Set<ICPPClassType> subclasses = new HashSet<>(); + private Set<IBinding> seenClasses = new HashSet<>(); SubclassFinder(ICPPClassType baseClass) { this.baseClass = baseClass; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/DeclarationsSearchGroup.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/DeclarationsSearchGroup.java index 79628b24431..7e188aaccbf 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/DeclarationsSearchGroup.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/DeclarationsSearchGroup.java @@ -111,7 +111,7 @@ public class DeclarationsSearchGroup extends ActionGroup { } private FindAction[] getWorkingSetActions() { - ArrayList<FindAction> actions = new ArrayList<FindAction>(CSearchUtil.LRU_WORKINGSET_LIST_SIZE); + ArrayList<FindAction> actions = new ArrayList<>(CSearchUtil.LRU_WORKINGSET_LIST_SIZE); Iterator<IWorkingSet[]> iter = CSearchUtil.getLRUWorkingSets().iterator(); while (iter.hasNext()) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/FindInWorkingSetAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/FindInWorkingSetAction.java index 5e03c3e1d5a..21cd67b8d7a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/FindInWorkingSetAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/FindInWorkingSetAction.java @@ -71,7 +71,7 @@ public abstract class FindInWorkingSetAction extends FindAction { if (fWorkingSets == null) { return ICElement.EMPTY_ARRAY; } - List<ICElement> scope = new ArrayList<ICElement>(); + List<ICElement> scope = new ArrayList<>(); for (int i = 0; i < fWorkingSets.length; ++i) { IAdaptable[] elements = fWorkingSets[i].getElements(); for (int j = 0; j < elements.length; ++j) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/ReferencesSearchGroup.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/ReferencesSearchGroup.java index 1a5e10a7bfa..f93aa22ae68 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/ReferencesSearchGroup.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/ReferencesSearchGroup.java @@ -104,7 +104,7 @@ public class ReferencesSearchGroup extends ActionGroup { } private FindAction[] getWorkingSetActions() { - ArrayList<FindAction> actions = new ArrayList<FindAction>(CSearchUtil.LRU_WORKINGSET_LIST_SIZE); + ArrayList<FindAction> actions = new ArrayList<>(CSearchUtil.LRU_WORKINGSET_LIST_SIZE); Iterator<IWorkingSet[]> iter = CSearchUtil.getLRUWorkingSets().iterator(); while (iter.hasNext()) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCodeScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCodeScanner.java index 31ceaff2d51..89808e7427a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCodeScanner.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCodeScanner.java @@ -55,7 +55,7 @@ public final class CCodeScanner extends AbstractCScanner { */ protected List<IRule> createRules() { - List<IRule> rules = new ArrayList<IRule>(); + List<IRule> rules = new ArrayList<>(); IToken token; token = getToken(ICColorConstants.C_DEFAULT); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CHelpProviderDescriptor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CHelpProviderDescriptor.java index 40b7ab39df3..3a82ebb4031 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CHelpProviderDescriptor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CHelpProviderDescriptor.java @@ -83,7 +83,7 @@ public class CHelpProviderDescriptor { private static Map<String, ICHelpProvider> getProvidersMap() { if (fProvidersMap == null) { - fProvidersMap = new HashMap<String, ICHelpProvider>(); + fProvidersMap = new HashMap<>(); } return fProvidersMap; } @@ -137,7 +137,7 @@ public class CHelpProviderDescriptor { if (provider != null && fProject != null) { ICHelpBook books[] = provider.getCHelpBooks(); if (books != null) { - List<CHelpBookDescriptor> descriptorList = new ArrayList<CHelpBookDescriptor>(); + List<CHelpBookDescriptor> descriptorList = new ArrayList<>(); for (int i = 0; i < books.length; i++) { CHelpBookDescriptor des = new CHelpBookDescriptor(books[i], projectElement); if (des.matches(fProject)) @@ -160,7 +160,7 @@ public class CHelpProviderDescriptor { CHelpBookDescriptor bookDescriptors[] = getCHelpBookDescriptors(); if (bookDescriptors.length == 0) return null; - List<ICHelpBook> bookList = new ArrayList<ICHelpBook>(); + List<ICHelpBook> bookList = new ArrayList<>(); for (int i = 0; i < bookDescriptors.length; i++) { if (bookDescriptors[i].isEnabled() && bookDescriptors[i].matches(context)) bookList.add(bookDescriptors[i].getCHelpBook()); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CHelpSettings.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CHelpSettings.java index c15fa38cf4d..b94da6d98ea 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CHelpSettings.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CHelpSettings.java @@ -96,7 +96,7 @@ public class CHelpSettings { if (providerDescriptors.length == 0) return new CHelpBookDescriptor[0]; - List<CHelpBookDescriptor> bookList = new ArrayList<CHelpBookDescriptor>(); + List<CHelpBookDescriptor> bookList = new ArrayList<>(); for (int i = 0; i < providerDescriptors.length; i++) { CHelpBookDescriptor bookDescriptors[] = providerDescriptors[i].getCHelpBookDescriptors(); if (bookDescriptors.length != 0) @@ -133,7 +133,7 @@ public class CHelpSettings { public IFunctionSummary[] getMatchingFunctions(ICHelpInvocationContext context, String frag) { CHelpProviderDescriptor providerDescriptors[] = getCHelpProviderDescriptors(); - List<IFunctionSummary> sumaryList = new ArrayList<IFunctionSummary>(); + List<IFunctionSummary> sumaryList = new ArrayList<>(); for (int i = 0; i < providerDescriptors.length; i++) { ICHelpBook books[] = providerDescriptors[i].getEnabledMatchedCHelpBooks(context); if (books != null && books.length != 0) { @@ -153,7 +153,7 @@ public class CHelpSettings { public ICHelpResourceDescriptor[] getHelpResources(ICHelpInvocationContext context, String name) { CHelpProviderDescriptor providerDescriptors[] = getCHelpProviderDescriptors(); - List<ICHelpResourceDescriptor> resourcesList = new ArrayList<ICHelpResourceDescriptor>(); + List<ICHelpResourceDescriptor> resourcesList = new ArrayList<>(); for (int i = 0; i < providerDescriptors.length; i++) { ICHelpBook books[] = providerDescriptors[i].getEnabledMatchedCHelpBooks(context); if (books != null && books.length != 0) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPreprocessorScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPreprocessorScanner.java index 13763e2c701..8b4cc1835ba 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPreprocessorScanner.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPreprocessorScanner.java @@ -55,7 +55,7 @@ public class CPreprocessorScanner extends AbstractCScanner { protected List<IRule> createRules() { IToken defaultToken = getToken(ICColorConstants.PP_DEFAULT); - List<IRule> rules = new ArrayList<IRule>(); + List<IRule> rules = new ArrayList<>(); IToken token; // Add generic white space rule. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CombinedWordRule.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CombinedWordRule.java index 5da2ece78f8..dd166b348e4 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CombinedWordRule.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CombinedWordRule.java @@ -49,7 +49,7 @@ public class CombinedWordRule implements IRule { */ public static class WordMatcher { /** The table of predefined words and token for this matcher */ - private Map<CharacterBuffer, IToken> fWords = new HashMap<CharacterBuffer, IToken>(); + private Map<CharacterBuffer, IToken> fWords = new HashMap<>(); /** * Adds a word and the token to be returned if it is detected. @@ -236,7 +236,7 @@ public class CombinedWordRule implements IRule { private CharacterBuffer fBuffer = new CharacterBuffer(16); /** List of word matchers */ - private List<WordMatcher> fMatchers = new ArrayList<WordMatcher>(); + private List<WordMatcher> fMatchers = new ArrayList<>(); /** * Creates a rule which, with the help of an word detector, will return the token diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/TaskTagRule.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/TaskTagRule.java index ed220f88de6..adab694b9cb 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/TaskTagRule.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/TaskTagRule.java @@ -55,7 +55,7 @@ public final class TaskTagRule extends CombinedWordRule implements IPropertyChan /** * Uppercase words */ - private Map<CharacterBuffer, IToken> fUppercaseWords = new HashMap<CharacterBuffer, IToken>(); + private Map<CharacterBuffer, IToken> fUppercaseWords = new HashMap<>(); /** * <code>true</code> if task tag detection is case-sensitive. */ diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/TokenStore.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/TokenStore.java index 3b1af804352..b36ef5f7c2d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/TokenStore.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/TokenStore.java @@ -43,7 +43,7 @@ public class TokenStore implements ITokenStore { private IColorManager fColorManager; private IPreferenceStore fPreferenceStore; - private Map<String, IToken> fTokenMap = new HashMap<String, IToken>(); + private Map<String, IToken> fTokenMap = new HashMap<>(); private String[] fPropertyNamesColor; private boolean fNeedsLazyColorLoading; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/BestMatchHover.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/BestMatchHover.java index eae08ba039f..85e470629db 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/BestMatchHover.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/BestMatchHover.java @@ -63,8 +63,8 @@ public class BestMatchHover extends AbstractCEditorTextHover { CEditorTextHoverDescriptor[] hoverDescs = CUIPlugin.getDefault().getCEditorTextHoverDescriptors(); // Initialize lists - indicates that the initialization happened - fTextHoverSpecifications = new ArrayList<CEditorTextHoverDescriptor>(hoverDescs.length - 1); - fInstantiatedTextHovers = new ArrayList<ITextHover>(hoverDescs.length - 1); + fTextHoverSpecifications = new ArrayList<>(hoverDescs.length - 1); + fInstantiatedTextHovers = new ArrayList<>(hoverDescs.length - 1); // Populate list for (int i = 0; i < hoverDescs.length; i++) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CEditorTextHoverDescriptor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CEditorTextHoverDescriptor.java index 307be739cad..9ac0a9f8b26 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CEditorTextHoverDescriptor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CEditorTextHoverDescriptor.java @@ -192,7 +192,7 @@ public class CEditorTextHoverDescriptor implements Comparable<CEditorTextHoverDe } private static CEditorTextHoverDescriptor[] createDescriptors(IConfigurationElement[] elements) { - List<CEditorTextHoverDescriptor> result = new ArrayList<CEditorTextHoverDescriptor>(elements.length); + List<CEditorTextHoverDescriptor> result = new ArrayList<>(elements.length); for (IConfigurationElement element : elements) { if (HOVER_TAG.equals(element.getName())) { CEditorTextHoverDescriptor desc = new CEditorTextHoverDescriptor(element); @@ -208,7 +208,7 @@ public class CEditorTextHoverDescriptor implements Comparable<CEditorTextHoverDe .getString(PreferenceConstants.EDITOR_TEXT_HOVER_MODIFIERS); StringTokenizer tokenizer = new StringTokenizer(compiledTextHoverModifiers, VALUE_SEPARATOR); - HashMap<String, String> idToModifier = new HashMap<String, String>(tokenizer.countTokens() / 2); + HashMap<String, String> idToModifier = new HashMap<>(tokenizer.countTokens() / 2); while (tokenizer.hasMoreTokens()) { String id = tokenizer.nextToken(); @@ -220,7 +220,7 @@ public class CEditorTextHoverDescriptor implements Comparable<CEditorTextHoverDe .getString(PreferenceConstants.EDITOR_TEXT_HOVER_MODIFIER_MASKS); tokenizer = new StringTokenizer(compiledTextHoverModifierMasks, VALUE_SEPARATOR); - HashMap<String, String> idToModifierMask = new HashMap<String, String>(tokenizer.countTokens() / 2); + HashMap<String, String> idToModifierMask = new HashMap<>(tokenizer.countTokens() / 2); while (tokenizer.hasMoreTokens()) { String id = tokenizer.nextToken(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionExplorationControl.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionExplorationControl.java index 4e894185ff6..a5224704305 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionExplorationControl.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionExplorationControl.java @@ -326,7 +326,7 @@ public class CMacroExpansionExplorationControl extends AbstractCompareViewerInfo fHandlerService = workbench.getService(IHandlerService.class); fContextService = workbench.getService(IContextService.class); fContextActivation = fContextService.activateContext(CONTEXT_ID_MACRO_EXPANSION_HOVER); - fHandlerActivations = new ArrayList<IHandlerActivation>(); + fHandlerActivations = new ArrayList<>(); fHandlerActivations.add(fHandlerService.activateHandler(COMMAND_ID_EXPANSION_BACK, backwardHandler)); fHandlerActivations.add(fHandlerService.activateHandler(COMMAND_ID_EXPANSION_FORWARD, forwardHandler)); fHandlerActivations diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionInput.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionInput.java index 1c542160723..46cef06cea7 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionInput.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionInput.java @@ -81,7 +81,7 @@ public class CMacroExpansionInput { private final Position fTextRegion; private final boolean fAllowSelection; private IASTNode fEnclosingNode; - private List<IASTNode> fExpansionNodes = new ArrayList<IASTNode>(); + private List<IASTNode> fExpansionNodes = new ArrayList<>(); private MacroExpansionExplorer fExplorer; private IRegion fExpansionRegion; @@ -177,7 +177,7 @@ public class CMacroExpansionInput { if (node == other) { return other; } - List<IASTNode> ancestors = new ArrayList<IASTNode>(); + List<IASTNode> ancestors = new ArrayList<>(); while (node != null) { node = node.getParent(); ancestors.add(node); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/ProblemHover.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/ProblemHover.java index 7e1f33f21e2..f3315c1e89b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/ProblemHover.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/ProblemHover.java @@ -85,7 +85,7 @@ public class ProblemHover extends AbstractAnnotationHover { if (!SpellingAnnotation.TYPE.equals(cAnnotation.getType())) return NO_PROPOSALS; - List<ICCompletionProposal> proposals = new ArrayList<ICCompletionProposal>(); + List<ICCompletionProposal> proposals = new ArrayList<>(); CCorrectionProcessor.collectCorrections(context, new IProblemLocation[] { location }, proposals); Collections.sort(proposals, new CCompletionProposalComparator()); @@ -121,7 +121,7 @@ public class ProblemHover extends AbstractAnnotationHover { CorrectionContext context = new CorrectionContext(tu, sourceViewer, position.getOffset(), position.getLength()); - List<ICCompletionProposal> proposals = new ArrayList<ICCompletionProposal>(); + List<ICCompletionProposal> proposals = new ArrayList<>(); CCorrectionProcessor.collectProposals(context, model, new Annotation[] { markerAnnotation }, true, false, proposals); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerDescriptor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerDescriptor.java index 9eaa7ddc221..67ac911e7f7 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerDescriptor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerDescriptor.java @@ -80,7 +80,7 @@ final class CompletionProposalComputerDescriptor { private static final String SESSION_ENDED = "sessionEnded()"; //$NON-NLS-1$ static { - Set<String> partitions = new HashSet<String>(); + Set<String> partitions = new HashSet<>(); partitions.add(IDocument.DEFAULT_CONTENT_TYPE); partitions.addAll(Arrays.asList(ICPartitions.ALL_CPARTITIONS)); @@ -142,7 +142,7 @@ final class CompletionProposalComputerDescriptor { else fName = name; - Set<String> partitions = new HashSet<String>(); + Set<String> partitions = new HashSet<>(); IConfigurationElement[] children = element.getChildren(PARTITION); if (children.length == 0) { fPartitions = PARTITION_SET; // add to all partition types if no partition is configured diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerRegistry.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerRegistry.java index 268639f0f3d..12c66d662e1 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerRegistry.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerRegistry.java @@ -83,26 +83,26 @@ public final class CompletionProposalComputerRegistry { * {@link String}, value type: * {@linkplain List List<CompletionProposalComputerDescriptor>}). */ - private final Map<String, List<CompletionProposalComputerDescriptor>> fDescriptorsByPartition = new HashMap<String, List<CompletionProposalComputerDescriptor>>(); + private final Map<String, List<CompletionProposalComputerDescriptor>> fDescriptorsByPartition = new HashMap<>(); /** * Unmodifiable versions of the sets stored in * <code>fDescriptorsByPartition</code> (key type: {@link String}, * value type: * {@linkplain List List<CompletionProposalComputerDescriptor>}). */ - private final Map<String, List<CompletionProposalComputerDescriptor>> fPublicDescriptorsByPartition = new HashMap<String, List<CompletionProposalComputerDescriptor>>(); + private final Map<String, List<CompletionProposalComputerDescriptor>> fPublicDescriptorsByPartition = new HashMap<>(); /** * All descriptors (element type: * {@link CompletionProposalComputerDescriptor}). */ - private final List<CompletionProposalComputerDescriptor> fDescriptors = new ArrayList<CompletionProposalComputerDescriptor>(); + private final List<CompletionProposalComputerDescriptor> fDescriptors = new ArrayList<>(); /** * Unmodifiable view of <code>fDescriptors</code> */ private final List<CompletionProposalComputerDescriptor> fPublicDescriptors = Collections .unmodifiableList(fDescriptors); - private final List<CompletionProposalCategory> fCategories = new ArrayList<CompletionProposalCategory>(); + private final List<CompletionProposalCategory> fCategories = new ArrayList<>(); private final List<CompletionProposalCategory> fPublicCategories = Collections.unmodifiableList(fCategories); /** * <code>true</code> if this registry has been loaded. @@ -209,11 +209,11 @@ public final class CompletionProposalComputerRegistry { */ public void reload() { IExtensionRegistry registry = Platform.getExtensionRegistry(); - List<IConfigurationElement> elements = new ArrayList<IConfigurationElement>( + List<IConfigurationElement> elements = new ArrayList<>( Arrays.asList(registry.getConfigurationElementsFor(CUIPlugin.getPluginId(), EXTENSION_POINT))); - Map<String, List<CompletionProposalComputerDescriptor>> map = new HashMap<String, List<CompletionProposalComputerDescriptor>>(); - List<CompletionProposalComputerDescriptor> all = new ArrayList<CompletionProposalComputerDescriptor>(); + Map<String, List<CompletionProposalComputerDescriptor>> map = new HashMap<>(); + List<CompletionProposalComputerDescriptor> all = new ArrayList<>(); List<CompletionProposalCategory> categories = getCategories(elements); for (IConfigurationElement element : elements) { @@ -225,7 +225,7 @@ public final class CompletionProposalComputerRegistry { String partition = (String) element2; List<CompletionProposalComputerDescriptor> list = map.get(partition); if (list == null) { - list = new ArrayList<CompletionProposalComputerDescriptor>(); + list = new ArrayList<>(); map.put(partition, list); } list.add(desc); @@ -273,11 +273,11 @@ public final class CompletionProposalComputerRegistry { private List<CompletionProposalCategory> getCategories(List<IConfigurationElement> elements) { IPreferenceStore store = CUIPlugin.getDefault().getPreferenceStore(); String preference = store.getString(PreferenceConstants.CODEASSIST_EXCLUDED_CATEGORIES); - Set<String> disabled = new HashSet<String>(); + Set<String> disabled = new HashSet<>(); StringTokenizer tok = new StringTokenizer(preference, "\0"); //$NON-NLS-1$ while (tok.hasMoreTokens()) disabled.add(tok.nextToken()); - Map<String, Integer> ordered = new HashMap<String, Integer>(); + Map<String, Integer> ordered = new HashMap<>(); preference = store.getString(PreferenceConstants.CODEASSIST_CATEGORY_ORDER); tok = new StringTokenizer(preference, "\0"); //$NON-NLS-1$ while (tok.hasMoreTokens()) { @@ -287,7 +287,7 @@ public final class CompletionProposalComputerRegistry { ordered.put(id, Integer.valueOf(rank)); } - List<CompletionProposalCategory> categories = new ArrayList<CompletionProposalCategory>(); + List<CompletionProposalCategory> categories = new ArrayList<>(); for (Iterator<IConfigurationElement> iter = elements.iterator(); iter.hasNext();) { IConfigurationElement element = iter.next(); try { @@ -382,7 +382,7 @@ public final class CompletionProposalComputerRegistry { * @return the names of the contributors other than <code>culprit</code> that contribute to <code>category</code> (element type: {@link String}) */ private Set<String> getAffectedContributors(CompletionProposalCategory category, IContributor culprit) { - Set<String> affectedPlugins = new HashSet<String>(); + Set<String> affectedPlugins = new HashSet<>(); for (CompletionProposalComputerDescriptor desc : getProposalComputerDescriptors()) { CompletionProposalCategory cat = desc.getCategory(); if (cat.equals(category)) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistComputerParameter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistComputerParameter.java index c22f5ff5716..90873817348 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistComputerParameter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistComputerParameter.java @@ -33,7 +33,7 @@ public final class ContentAssistComputerParameter implements IParameterValues { public Map<String, String> getParameterValues() { Collection<CompletionProposalCategory> descriptors = CompletionProposalComputerRegistry.getDefault() .getProposalCategories(); - Map<String, String> map = new HashMap<String, String>(descriptors.size()); + Map<String, String> map = new HashMap<>(descriptors.size()); for (CompletionProposalCategory category : descriptors) { map.put(category.getDisplayName(), category.getId()); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/HelpCompletionProposalComputer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/HelpCompletionProposalComputer.java index aeb25719866..dd7b1084dfe 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/HelpCompletionProposalComputer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/HelpCompletionProposalComputer.java @@ -110,7 +110,7 @@ public class HelpCompletionProposalComputer extends ParsingBasedProposalComputer // not generate prefix matches to begin with if it's set. boolean requireExactMatch = cContext.isContextInformationStyle(); - List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(); + List<ICompletionProposal> proposals = new ArrayList<>(); for (IFunctionSummary summary : summaries) { if (requireExactMatch && !summary.getName().equals(prefix)) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/InclusionProposalComputer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/InclusionProposalComputer.java index c4867ebaeb5..725ebb7ba1d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/InclusionProposalComputer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/InclusionProposalComputer.java @@ -71,7 +71,7 @@ public class InclusionProposalComputer implements ICompletionProposalComputer { CContentAssistInvocationContext cContext = (CContentAssistInvocationContext) context; if (inIncludeDirective(cContext)) { // add include file proposals - proposals = new ArrayList<ICompletionProposal>(); + proposals = new ArrayList<>(); try { addInclusionProposals(cContext, proposals); } catch (Exception exc) { @@ -157,7 +157,7 @@ public class InclusionProposalComputer implements ICompletionProposalComputer { PotentialInclude[] potentialIncludes = collectIncludeFiles(tu, prefixPath, angleBrackets); if (potentialIncludes.length > 0) { IInclude[] includes = tu.getIncludes(); - Set<String> alreadyIncluded = new HashSet<String>(); + Set<String> alreadyIncluded = new HashSet<>(); for (IInclude includeDirective : includes) { alreadyIncluded.add(includeDirective.getElementName()); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/KeywordCompletionProposalComputer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/KeywordCompletionProposalComputer.java index c153fd1d8d6..2b7ca4b0c93 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/KeywordCompletionProposalComputer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/KeywordCompletionProposalComputer.java @@ -59,7 +59,7 @@ public class KeywordCompletionProposalComputer extends ParsingBasedProposalCompu // keywords are matched case-sensitive final int relevance = RelevanceConstants.CASE_MATCH_RELEVANCE + RelevanceConstants.KEYWORD_TYPE_RELEVANCE; - List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(); + List<ICompletionProposal> proposals = new ArrayList<>(); ICLanguageKeywords languageKeywords = null; ITranslationUnit tu = context.getTranslationUnit(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ParsingBasedProposalComputer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ParsingBasedProposalComputer.java index 2c5a6fa02e2..1c0f7cb6c28 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ParsingBasedProposalComputer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ParsingBasedProposalComputer.java @@ -71,8 +71,8 @@ public abstract class ParsingBasedProposalComputer implements ICompletionProposa IProgressMonitor monitor) { Collection<ICompletionProposal> proposals = computeCompletionProposals(context, monitor); // Remove duplicates - proposals = (new LinkedHashSet<ICompletionProposal>(proposals)); - List<IContextInformation> result = new ArrayList<IContextInformation>(); + proposals = (new LinkedHashSet<>(proposals)); + List<IContextInformation> result = new ArrayList<>(); for (ICompletionProposal proposal : proposals) { IContextInformation contextInformation = proposal.getContextInformation(); if (contextInformation != null) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CCorrectionAssistant.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CCorrectionAssistant.java index bec6504b00a..330a904f621 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CCorrectionAssistant.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CCorrectionAssistant.java @@ -153,7 +153,7 @@ public class CCorrectionAssistant extends QuickAssistAssistant { // Let superclass deal with this return super.showPossibleQuickAssists(); - ArrayList<Annotation> resultingAnnotations = new ArrayList<Annotation>(20); + ArrayList<Annotation> resultingAnnotations = new ArrayList<>(20); try { Point selectedRange = fViewer.getSelectedRange(); int currOffset = selectedRange.x; @@ -205,8 +205,8 @@ public class CCorrectionAssistant extends QuickAssistAssistant { int rangeStart = lineInfo.getOffset(); int rangeEnd = rangeStart + lineInfo.getLength(); - ArrayList<Annotation> allAnnotations = new ArrayList<Annotation>(); - ArrayList<Position> allPositions = new ArrayList<Position>(); + ArrayList<Annotation> allAnnotations = new ArrayList<>(); + ArrayList<Position> allPositions = new ArrayList<>(); int bestOffset = Integer.MAX_VALUE; while (iter.hasNext()) { Annotation annot = (Annotation) iter.next(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CCorrectionProcessor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CCorrectionProcessor.java index 09a058afb0f..d47a00021eb 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CCorrectionProcessor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CCorrectionProcessor.java @@ -64,7 +64,7 @@ public class CCorrectionProcessor implements org.eclipse.jface.text.quickassist. boolean testMarkerTypes) { IConfigurationElement[] elements = Platform.getExtensionRegistry() .getConfigurationElementsFor(CUIPlugin.PLUGIN_ID, contributionId); - ArrayList<ContributedProcessorDescriptor> res = new ArrayList<ContributedProcessorDescriptor>(elements.length); + ArrayList<ContributedProcessorDescriptor> res = new ArrayList<>(elements.length); for (int i = 0; i < elements.length; i++) { ContributedProcessorDescriptor desc = new ContributedProcessorDescriptor(elements[i], testMarkerTypes); @@ -208,7 +208,7 @@ public class CCorrectionProcessor implements org.eclipse.jface.text.quickassist. ICCompletionProposal[] res = null; if (model != null && annotations != null) { - ArrayList<ICCompletionProposal> proposals = new ArrayList<ICCompletionProposal>(10); + ArrayList<ICCompletionProposal> proposals = new ArrayList<>(10); IStatus status = collectProposals(context, model, annotations, true, !fAssistant.isUpdatedOffset(), proposals); res = proposals.toArray(new ICCompletionProposal[proposals.size()]); @@ -230,7 +230,7 @@ public class CCorrectionProcessor implements org.eclipse.jface.text.quickassist. public static IStatus collectProposals(CorrectionContext context, IAnnotationModel model, Annotation[] annotations, boolean addQuickFixes, boolean addQuickAssists, Collection<ICCompletionProposal> proposals) { - ArrayList<ProblemLocation> problems = new ArrayList<ProblemLocation>(); + ArrayList<ProblemLocation> problems = new ArrayList<>(); // collect problem locations and corrections from marker annotations for (int i = 0; i < annotations.length; i++) { @@ -461,13 +461,13 @@ public class CCorrectionProcessor implements org.eclipse.jface.text.quickassist. if (processor.canHandleMarkerType(curr.getMarkerType())) { if (!allHandled) { // first handled problem if (res == null) { - res = new ArrayList<IProblemLocation>(locations.length - i); + res = new ArrayList<>(locations.length - i); } res.add(curr); } } else if (allHandled) { if (i > 0) { // first non handled problem - res = new ArrayList<IProblemLocation>(locations.length - i); + res = new ArrayList<>(locations.length - i); for (int k = 0; k < i; k++) { res.add(locations[k]); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/ContributedProcessorDescriptor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/ContributedProcessorDescriptor.java index 26be1a8fbeb..b324e6f20bf 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/ContributedProcessorDescriptor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/ContributedProcessorDescriptor.java @@ -56,7 +56,7 @@ public final class ContributedProcessorDescriptor { } private Set<String> getHandledMarkerTypes(IConfigurationElement element) { - HashSet<String> map = new HashSet<String>(7); + HashSet<String> map = new HashSet<>(7); IConfigurationElement[] children = element.getChildren(HANDLED_MARKER_TYPES); for (IConfigurationElement element2 : children) { IConfigurationElement[] types = element2.getChildren(MARKER_TYPE); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CorrectionCommandHandler.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CorrectionCommandHandler.java index 29c2c4d133c..0e3b8f8419c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CorrectionCommandHandler.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CorrectionCommandHandler.java @@ -102,7 +102,7 @@ public class CorrectionCommandHandler extends AbstractHandler { private ICompletionProposal findCorrection(String id, boolean isAssist, ITextSelection selection, ITranslationUnit tu, IAnnotationModel model) { CorrectionContext context = new CorrectionContext(tu, selection.getOffset(), selection.getLength()); - Collection<ICCompletionProposal> proposals = new ArrayList<ICCompletionProposal>(10); + Collection<ICCompletionProposal> proposals = new ArrayList<>(10); if (isAssist) { if (id.equals(LinkedNamesAssistProposal.ASSIST_ID)) { return getLocalRenameProposal(context); // shortcut for local rename @@ -129,7 +129,7 @@ public class CorrectionCommandHandler extends AbstractHandler { } private Annotation[] getAnnotations(int offset, boolean goToClosest) throws BadLocationException { - ArrayList<Annotation> resultingAnnotations = new ArrayList<Annotation>(); + ArrayList<Annotation> resultingAnnotations = new ArrayList<>(); CCorrectionAssistant.collectQuickFixableAnnotations(fEditor, offset, goToClosest, resultingAnnotations); return resultingAnnotations.toArray(new Annotation[resultingAnnotations.size()]); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CorrectionCommandInstaller.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CorrectionCommandInstaller.java index ec7361a3e7d..a57eb6a374c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CorrectionCommandInstaller.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CorrectionCommandInstaller.java @@ -56,7 +56,7 @@ public class CorrectionCommandInstaller { if (fCorrectionHandlerActivations != null) { CUIPlugin.logError("Correction handler activations not released"); //$NON-NLS-1$ } - fCorrectionHandlerActivations = new ArrayList<IHandlerActivation>(); + fCorrectionHandlerActivations = new ArrayList<>(); @SuppressWarnings("unchecked") Collection<String> definedCommandIds = commandService.getDefinedCommandIds(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/QuickAssistProcessor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/QuickAssistProcessor.java index d2c3605c556..972b39fc6a0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/QuickAssistProcessor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/QuickAssistProcessor.java @@ -76,7 +76,7 @@ public class QuickAssistProcessor implements IQuickAssistProcessor { @Override public ICCompletionProposal[] getAssists(final IInvocationContext context, final IProblemLocation[] problemLocations) throws CoreException { - final ArrayList<ICCompletionProposal> proposals = new ArrayList<ICCompletionProposal>(); + final ArrayList<ICCompletionProposal> proposals = new ArrayList<>(); ASTProvider.getASTProvider().runOnAST(context.getTranslationUnit(), ASTProvider.WAIT_ACTIVE_ONLY, new NullProgressMonitor(), new ASTRunnable() { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/doctools/DocCommentOwnerManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/doctools/DocCommentOwnerManager.java index 021e5a921d1..4919f6ca576 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/doctools/DocCommentOwnerManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/doctools/DocCommentOwnerManager.java @@ -69,12 +69,12 @@ public class DocCommentOwnerManager { private Map<String, IDocCommentOwner> fOwners; private IDocCommentOwner fWorkspaceOwner; - private Map<IProject, ProjectMap> prj2map = new HashMap<IProject, ProjectMap>(); + private Map<IProject, ProjectMap> prj2map = new HashMap<>(); private static List<IDocCommentOwnershipListener> fListeners; private DocCommentOwnerManager() { fOwners = getCommentOwnerExtensions(); - fListeners = new ArrayList<IDocCommentOwnershipListener>(); + fListeners = new ArrayList<>(); Preferences defaultPrefs = DefaultScope.INSTANCE.getNode(QUALIFIER).node(WORKSPACE_DOC_TOOL_NODE); Preferences prefs = InstanceScope.INSTANCE.getNode(QUALIFIER).node(WORKSPACE_DOC_TOOL_NODE); @@ -227,7 +227,7 @@ public class DocCommentOwnerManager { * via the DocCommentOwner extension point */ private static Map<String, IDocCommentOwner> getCommentOwnerExtensions() { - Map<String, IDocCommentOwner> result = new HashMap<String, IDocCommentOwner>(); + Map<String, IDocCommentOwner> result = new HashMap<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint indexProviders = registry.getExtensionPoint(CUIPlugin.ID_COMMENT_OWNER); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/doctools/EditorReopener.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/doctools/EditorReopener.java index e68a3af1e6e..f8b1eee67a5 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/doctools/EditorReopener.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/doctools/EditorReopener.java @@ -97,7 +97,7 @@ public class EditorReopener implements IDocCommentOwnershipListener { * This could be smarter in determining smaller sets of editors to re-open */ private IEditorPart[] getEditorsToRepon(IWorkbenchWindow window, IResource resource) { - List<IEditorPart> needReopening = new ArrayList<IEditorPart>(); + List<IEditorPart> needReopening = new ArrayList<>(); if (window.getActivePage() != null) { IEditorReference[] es = window.getActivePage().getEditorReferences(); for (int i = 0; i < es.length; i++) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/doctools/ProjectMap.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/doctools/ProjectMap.java index 5949cf86e9e..3cb15089465 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/doctools/ProjectMap.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/doctools/ProjectMap.java @@ -61,7 +61,7 @@ class ProjectMap { fMap = load(project); } catch (CoreException ce) { CUIPlugin.log(ce); - fMap = new HashMap<IPath, String>(); + fMap = new HashMap<>(); } fProject = project; } @@ -116,7 +116,7 @@ class ProjectMap { } private static Map<IPath, String> load(IProject project) throws CoreException { - Map<IPath, String> result = new HashMap<IPath, String>(); + Map<IPath, String> result = new HashMap<>(); ICProjectDescription pd = CCorePlugin.getDefault().getProjectDescription(project, false); if (pd != null) { ICStorageElement element = pd.getStorage(ATTRVAL_STORAGEID, false); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/CFoldingStructureProviderRegistry.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/CFoldingStructureProviderRegistry.java index a1b2912af25..c90bcddd39a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/CFoldingStructureProviderRegistry.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/CFoldingStructureProviderRegistry.java @@ -105,7 +105,7 @@ public class CFoldingStructureProviderRegistry { */ public void reloadExtensions() { IExtensionRegistry registry = Platform.getExtensionRegistry(); - Map<String, CFoldingStructureProviderDescriptor> map = new HashMap<String, CFoldingStructureProviderDescriptor>(); + Map<String, CFoldingStructureProviderDescriptor> map = new HashMap<>(); IConfigurationElement[] elements = registry.getConfigurationElementsFor(CUIPlugin.getPluginId(), EXTENSION_POINT); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingPreferenceBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingPreferenceBlock.java index 1a2c0194442..c2de9c7071e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingPreferenceBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingPreferenceBlock.java @@ -44,7 +44,7 @@ public class DefaultCFoldingPreferenceBlock implements ICFoldingPreferenceBlock private IPreferenceStore fStore; protected OverlayPreferenceStore fOverlayStore; private OverlayKey[] fKeys; - protected Map<Button, String> fCheckBoxes = new HashMap<Button, String>(); + protected Map<Button, String> fCheckBoxes = new HashMap<>(); private SelectionListener fCheckBoxListener = new SelectionListener() { @Override @@ -71,7 +71,7 @@ public class DefaultCFoldingPreferenceBlock implements ICFoldingPreferenceBlock } private OverlayKey[] createKeys() { - ArrayList<OverlayKey> overlayKeys = new ArrayList<OverlayKey>(); + ArrayList<OverlayKey> overlayKeys = new ArrayList<>(); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_FOLDING_MACROS)); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingStructureProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingStructureProvider.java index bd0d41fabd3..8e826eb549a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingStructureProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingStructureProvider.java @@ -124,7 +124,7 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi } private final Stack<StatementRegion> fStatements; int fLevel = 0; - Stack<String> fScope = new Stack<String>(); + Stack<String> fScope = new Stack<>(); private StatementVisitor(Stack<StatementRegion> statements) { fStatements = statements; @@ -372,7 +372,7 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi private ISourceReference fFirstType; private boolean fHasHeaderComment; - private LinkedHashMap<CProjectionAnnotation, Position> fMap = new LinkedHashMap<CProjectionAnnotation, Position>(); + private LinkedHashMap<CProjectionAnnotation, Position> fMap = new LinkedHashMap<>(); private IASTTranslationUnit fAST; FoldingStructureComputationContext(IDocument document, ProjectionAnnotationModel model, @@ -1079,9 +1079,9 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi fSelectionListener = null; } - Map<CProjectionAnnotation, Position> additions = new HashMap<CProjectionAnnotation, Position>(); - List<CProjectionAnnotation> deletions = new ArrayList<CProjectionAnnotation>(); - List<CProjectionAnnotation> updates = new ArrayList<CProjectionAnnotation>(); + Map<CProjectionAnnotation, Position> additions = new HashMap<>(); + List<CProjectionAnnotation> deletions = new ArrayList<>(); + List<CProjectionAnnotation> updates = new ArrayList<>(); computeFoldingStructure(ctx); Map<CProjectionAnnotation, Position> updated = ctx.fMap; @@ -1183,8 +1183,8 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi if (deletions.isEmpty() || (additions.isEmpty() && changes.isEmpty())) return; - List<CProjectionAnnotation> newDeletions = new ArrayList<CProjectionAnnotation>(); - List<CProjectionAnnotation> newChanges = new ArrayList<CProjectionAnnotation>(); + List<CProjectionAnnotation> newDeletions = new ArrayList<>(); + List<CProjectionAnnotation> newChanges = new ArrayList<>(); Iterator<CProjectionAnnotation> deletionIterator = deletions.iterator(); while (deletionIterator.hasNext()) { @@ -1277,7 +1277,7 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi boolean includeBranches = fPreprocessorBranchFoldingEnabled && ctx.fAST != null; boolean includeStmts = fStatementsFoldingEnabled && ctx.fAST != null; boolean includeCModel = ctx.fAST != null || !(fPreprocessorBranchFoldingEnabled || fStatementsFoldingEnabled); - Map<Object, List<Tuple>> map = new HashMap<Object, List<Tuple>>(); + Map<Object, List<Tuple>> map = new HashMap<>(); ProjectionAnnotationModel model = ctx.getModel(); Iterator<?> e = model.getAnnotationIterator(); while (e.hasNext()) { @@ -1304,7 +1304,7 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi if (include || position.length < 5) { List<Tuple> list = map.get(cAnnotation.getElement()); if (list == null) { - list = new ArrayList<Tuple>(2); + list = new ArrayList<>(2); map.put(cAnnotation.getElement(), list); } list.add(new Tuple(cAnnotation, position)); @@ -1401,7 +1401,7 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi * @param ctx */ private void computeStatementFoldingStructure(IASTTranslationUnit ast, FoldingStructureComputationContext ctx) { - final Stack<StatementRegion> iral = new Stack<StatementRegion>(); + final Stack<StatementRegion> iral = new Stack<>(); ast.accept(new StatementVisitor(iral)); while (!iral.empty()) { StatementRegion mr = iral.pop(); @@ -1446,8 +1446,8 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi * @param ctx */ private void computePreprocessorFoldingStructure(IASTTranslationUnit ast, FoldingStructureComputationContext ctx) { - List<Branch> branches = new ArrayList<Branch>(); - Stack<Branch> branchStack = new Stack<Branch>(); + List<Branch> branches = new ArrayList<>(); + Stack<Branch> branchStack = new Stack<>(); IASTPreprocessorStatement[] preprocStmts = ast.getAllPreprocessorStatements(); @@ -1512,7 +1512,7 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi branches.add(branch); } - Map<String, Counter> keys = new HashMap<String, Counter>(branches.size()); + Map<String, Counter> keys = new HashMap<>(branches.size()); for (Branch branch : branches) { IRegion aligned = alignRegion(branch, ctx, branch.fInclusive); if (aligned != null) { @@ -1564,7 +1564,7 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi int startLine = -1; int endLine = -1; boolean startLineIsDocComment = false; - List<Tuple> comments = new ArrayList<Tuple>(); + List<Tuple> comments = new ArrayList<>(); ModifiableRegion commentRange = new ModifiableRegion(); for (ITypedRegion partition : partitions) { boolean singleLine = false; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/CSpellingProblem.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/CSpellingProblem.java index eaf44cb24fc..dc30c0ca9e0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/CSpellingProblem.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/CSpellingProblem.java @@ -123,7 +123,7 @@ public class CSpellingProblem extends SpellingProblem { result = new ICCompletionProposal[] { new ChangeCaseProposal(arguments, getOffset(), getLength(), context, engine.getLocale()) }; } else { - proposals = new ArrayList<RankedWordProposal>(checker.getProposals(arguments[0], sentence)); + proposals = new ArrayList<>(checker.getProposals(arguments[0], sentence)); size = proposals.size(); if (threshold > 0 && size > threshold) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/SpellCheckEngine.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/SpellCheckEngine.java index d0f6c1c38b7..765ae321621 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/SpellCheckEngine.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/SpellCheckEngine.java @@ -92,7 +92,7 @@ public class SpellCheckEngine implements ISpellCheckEngine, IPropertyChangeListe return fgLocalesWithInstalledDictionaries = Collections.emptySet(); } - fgLocalesWithInstalledDictionaries = new HashSet<Locale>(); + fgLocalesWithInstalledDictionaries = new HashSet<>(); int fileNameCount = fileNames.length; for (int i = 0; i < fileNameCount; i++) { String fileName = fileNames[i]; @@ -215,13 +215,13 @@ public class SpellCheckEngine implements ISpellCheckEngine, IPropertyChangeListe } /** The registered locale insensitive dictionaries */ - private Set<ISpellDictionary> fGlobalDictionaries = new HashSet<ISpellDictionary>(); + private Set<ISpellDictionary> fGlobalDictionaries = new HashSet<>(); /** The spell checker for fLocale */ private ISpellChecker fChecker = null; /** The registered locale sensitive dictionaries */ - private Map<Locale, ISpellDictionary> fLocaleDictionaries = new HashMap<Locale, ISpellDictionary>(); + private Map<Locale, ISpellDictionary> fLocaleDictionaries = new HashMap<>(); /** The user dictionary */ private ISpellDictionary fUserDictionary = null; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/SpellCheckIterator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/SpellCheckIterator.java index 7a399bbb04d..52ed410dbc9 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/SpellCheckIterator.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/SpellCheckIterator.java @@ -48,7 +48,7 @@ public class SpellCheckIterator implements ISpellCheckIterator { protected int fPrevious = 0; /** The sentence breaks */ - private final LinkedList<Integer> fSentenceBreaks = new LinkedList<Integer>(); + private final LinkedList<Integer> fSentenceBreaks = new LinkedList<>(); /** Does the current word start a sentence? */ private boolean fStartsSentence = false; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/SpellingEngineDispatcher.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/SpellingEngineDispatcher.java index 822659eb4e7..4b128941a58 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/SpellingEngineDispatcher.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/SpellingEngineDispatcher.java @@ -52,7 +52,7 @@ public class SpellingEngineDispatcher implements ISpellingEngine { .getContentType(CCorePlugin.CONTENT_TYPE_CXXSOURCE); /** Available spelling engines by content type */ - private Map<IContentType, SpellingEngine> fEngines = new HashMap<IContentType, SpellingEngine>(); + private Map<IContentType, SpellingEngine> fEngines = new HashMap<>(); private ISpellingEngine defaultEngine; /** diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/WordCompletionProposalComputer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/WordCompletionProposalComputer.java index 0755e2613f2..913e1dc2402 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/WordCompletionProposalComputer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/WordCompletionProposalComputer.java @@ -70,9 +70,9 @@ public final class WordCompletionProposalComputer implements ICompletionProposal final ISpellChecker checker = engine.getSpellChecker(); if (checker != null) { - final List<RankedWordProposal> proposals = new ArrayList<RankedWordProposal>( + final List<RankedWordProposal> proposals = new ArrayList<>( checker.getProposals(candidate, Character.isUpperCase(candidate.charAt(0)))); - final List<ICompletionProposal> result = new ArrayList<ICompletionProposal>(proposals.size()); + final List<ICompletionProposal> result = new ArrayList<>(proposals.size()); for (Object element : proposals) { RankedWordProposal word = (RankedWordProposal) element; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/WordQuickFixProcessor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/WordQuickFixProcessor.java index e116029138d..50a5685bc48 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/WordQuickFixProcessor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/WordQuickFixProcessor.java @@ -77,7 +77,7 @@ public class WordQuickFixProcessor implements IQuickFixProcessor { result = new ICCompletionProposal[] { new ChangeCaseProposal(arguments, location.getOffset(), location.getLength(), context, engine.getLocale()) }; } else { - proposals = new ArrayList<RankedWordProposal>(checker.getProposals(arguments[0], sentence)); + proposals = new ArrayList<>(checker.getProposals(arguments[0], sentence)); size = proposals.size(); if (threshold > 0 && size > threshold) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/engine/AbstractSpellDictionary.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/engine/AbstractSpellDictionary.java index acc7adccf03..5fb4cc09ce3 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/engine/AbstractSpellDictionary.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/engine/AbstractSpellDictionary.java @@ -62,7 +62,7 @@ public abstract class AbstractSpellDictionary implements ISpellDictionary { private IPhoneticDistanceAlgorithm fDistanceAlgorithm = new DefaultPhoneticDistanceAlgorithm(); /** The mapping from phonetic hashes to word lists */ - private final Map<String, Serializable> fHashBuckets = new HashMap<String, Serializable>(HASH_CAPACITY); + private final Map<String, Serializable> fHashBuckets = new HashMap<>(HASH_CAPACITY); /** The phonetic hash provider */ private IPhoneticHashProvider fHashProvider = new DefaultPhoneticHashProvider(); @@ -110,7 +110,7 @@ public abstract class AbstractSpellDictionary implements ISpellDictionary { String hash = null; final StringBuilder buffer = new StringBuilder(BUFFER_CAPACITY); - final HashSet<RankedWordProposal> result = new HashSet<RankedWordProposal>(BUCKET_CAPACITY * hashs.size()); + final HashSet<RankedWordProposal> result = new HashSet<>(BUCKET_CAPACITY * hashs.size()); for (int index = 0; index < hashs.size(); index++) { @@ -190,7 +190,7 @@ public abstract class AbstractSpellDictionary implements ISpellDictionary { @SuppressWarnings("unchecked") final ArrayList<String> candidateList = (ArrayList<String>) candidates; - final ArrayList<RankedWordProposal> matches = new ArrayList<RankedWordProposal>(candidateList.size()); + final ArrayList<RankedWordProposal> matches = new ArrayList<>(candidateList.size()); for (int index = 0; index < candidateList.size(); index++) { String candidate = candidateList.get(index); @@ -265,7 +265,7 @@ public abstract class AbstractSpellDictionary implements ISpellDictionary { final String hash = fHashProvider.getHash(word); final char[] mutators = fHashProvider.getMutators(); - final ArrayList<String> neighborhood = new ArrayList<String>((word.length() + 1) * (mutators.length + 2)); + final ArrayList<String> neighborhood = new ArrayList<>((word.length() + 1) * (mutators.length + 2)); neighborhood.add(hash); final Set<RankedWordProposal> candidates = getCandidates(word, sentence, neighborhood); @@ -383,7 +383,7 @@ public abstract class AbstractSpellDictionary implements ISpellDictionary { final ArrayList<Object> bucket2 = (ArrayList) bucket; bucket2.add(word); } else { - ArrayList<Object> list = new ArrayList<Object>(BUCKET_CAPACITY); + ArrayList<Object> list = new ArrayList<>(BUCKET_CAPACITY); list.add(bucket); list.add(word); fHashBuckets.put(hash, list); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/engine/DefaultSpellChecker.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/engine/DefaultSpellChecker.java index 07862f2b2e6..d48012a2cae 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/engine/DefaultSpellChecker.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/engine/DefaultSpellChecker.java @@ -174,7 +174,7 @@ public class DefaultSpellChecker implements ISpellChecker { // the modifying methods add/checkWord (?) Set<ISpellDictionary> copy; synchronized (fDictionaries) { - copy = new HashSet<ISpellDictionary>(fDictionaries); + copy = new HashSet<>(fDictionaries); } ISpellDictionary dictionary = null; @@ -194,7 +194,7 @@ public class DefaultSpellChecker implements ISpellChecker { // synchronizing is necessary as this is a write access Set<ISpellDictionary> copy; synchronized (fDictionaries) { - copy = new HashSet<ISpellDictionary>(fDictionaries); + copy = new HashSet<>(fDictionaries); } final String addable = word.toLowerCase(); @@ -272,7 +272,7 @@ public class DefaultSpellChecker implements ISpellChecker { // synchronizing is necessary as this is called from execute Set<ISpellEventListener> copy; synchronized (fListeners) { - copy = new HashSet<ISpellEventListener>(fListeners); + copy = new HashSet<>(fListeners); } for (ISpellEventListener spellEventListener : copy) { spellEventListener.handle(event); @@ -289,11 +289,11 @@ public class DefaultSpellChecker implements ISpellChecker { // the modifying methods add/removeDictionary (?) Set<ISpellDictionary> copy; synchronized (fDictionaries) { - copy = new HashSet<ISpellDictionary>(fDictionaries); + copy = new HashSet<>(fDictionaries); } ISpellDictionary dictionary = null; - final HashSet<RankedWordProposal> proposals = new HashSet<RankedWordProposal>(); + final HashSet<RankedWordProposal> proposals = new HashSet<>(); for (final Iterator<ISpellDictionary> iterator = copy.iterator(); iterator.hasNext();) { dictionary = iterator.next(); @@ -319,7 +319,7 @@ public class DefaultSpellChecker implements ISpellChecker { // synchronizing is necessary as this is called from execute Set<ISpellDictionary> copy; synchronized (fDictionaries) { - copy = new HashSet<ISpellDictionary>(fDictionaries); + copy = new HashSet<>(fDictionaries); } if (fIgnored.contains(word.toLowerCase())) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateEngine.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateEngine.java index 968e479546f..7721f48fbc3 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateEngine.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateEngine.java @@ -59,9 +59,9 @@ public class TemplateEngine { /** The context type. */ private final TemplateContextType fContextType; /** The result proposals. */ - private final ArrayList<ICompletionProposal> fProposals = new ArrayList<ICompletionProposal>(); + private final ArrayList<ICompletionProposal> fProposals = new ArrayList<>(); /** Positions created on the key documents to remove in reset. */ - private final Map<IDocument, Position> fPositions = new HashMap<IDocument, Position>(); + private final Map<IDocument, Position> fPositions = new HashMap<>(); /** Pattern to match the start of a line content */ private final Pattern fStartOfLineContentPattern = Pattern.compile("[^ \t]"); //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProcessor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProcessor.java index 18684e39229..bbf956e0aaf 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProcessor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProcessor.java @@ -72,7 +72,7 @@ public class TemplateVariableProcessor implements IContentAssistProcessor { if (fContextType == null) return null; - List<TemplateVariableProposal> proposals = new ArrayList<TemplateVariableProposal>(); + List<TemplateVariableProposal> proposals = new ArrayList<>(); String text = viewer.getDocument().get(); int start = getStart(text, documentOffset); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/typehierarchy/THHistoryListAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/typehierarchy/THHistoryListAction.java index 777d04c465b..4a45321a7a4 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/typehierarchy/THHistoryListAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/typehierarchy/THHistoryListAction.java @@ -71,7 +71,7 @@ public class THHistoryListAction extends Action { ILabelProvider labelProvider = new CUILabelProvider(THHistoryAction.LABEL_OPTIONS, CElementImageProvider.OVERLAY_ICONS); - fHistoryList = new ListDialogField<ICElement>(adapter, buttonLabels, labelProvider); + fHistoryList = new ListDialogField<>(adapter, buttonLabels, labelProvider); fHistoryList.setLabelText(Messages.THHistoryListAction_HistoryList_label); fHistoryList.setElements(Arrays.asList(historyEntries)); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/typehierarchy/THLabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/typehierarchy/THLabelProvider.java index fbbe24e1c24..d3dae3d0133 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/typehierarchy/THLabelProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/typehierarchy/THLabelProvider.java @@ -41,7 +41,7 @@ public class THLabelProvider extends AppearanceAwareLabelProvider { private CUILabelProvider fCLabelProvider = new CUILabelProvider(LABEL_OPTIONS_SIMPLE, 0); private THHierarchyModel fModel; - private HashMap<String, Image> fCachedImages = new HashMap<String, Image>(); + private HashMap<String, Image> fCachedImages = new HashMap<>(); private Color fColorInactive; private boolean fMarkImplementers = true; private boolean fHideNonImplementers = false; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/typehierarchy/THViewPart.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/typehierarchy/THViewPart.java index 05ef4a1e877..e3b1fcd4334 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/typehierarchy/THViewPart.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/typehierarchy/THViewPart.java @@ -141,7 +141,7 @@ public class THViewPart extends ViewPart implements ITHModelPresenter { private boolean fShowsMessage = true; private int fCurrentViewOrientation = -1; private boolean fInComputeOrientation = false; - private ArrayList<ICElement> fHistoryEntries = new ArrayList<ICElement>(MAX_HISTORY_SIZE); + private ArrayList<ICElement> fHistoryEntries = new ArrayList<>(MAX_HISTORY_SIZE); private int fIgnoreSelectionChanges = 0; // widgets diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/AbstractResourceActionHandler.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/AbstractResourceActionHandler.java index 9857ff16194..717b12897da 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/AbstractResourceActionHandler.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/AbstractResourceActionHandler.java @@ -139,7 +139,7 @@ public abstract class AbstractResourceActionHandler extends AbstractHandler { } private static Collection<IResource> getSelectedResources(IStructuredSelection selection) { - Set<IResource> result = new LinkedHashSet<IResource>(); + Set<IResource> result = new LinkedHashSet<>(); for (Object obj : selection.toList()) { IResource resource = AdapterUtil.adapt(obj, IResource.class); if (resource != null) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/CHelpDisplayContext.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/CHelpDisplayContext.java index ca22190e2ec..84d07dc1452 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/CHelpDisplayContext.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/CHelpDisplayContext.java @@ -70,7 +70,7 @@ public class CHelpDisplayContext implements IContext { public CHelpDisplayContext(IContext context, final ITextEditor editor, String selected) throws CoreException { - List<IHelpResource> helpResources = new ArrayList<IHelpResource>(); + List<IHelpResource> helpResources = new ArrayList<>(); ICHelpInvocationContext invocationContext = new ICHelpInvocationContext() { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/DeleteIProblemMarkerAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/DeleteIProblemMarkerAction.java index f7a454ae26a..fd7d2d6d3e0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/DeleteIProblemMarkerAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/DeleteIProblemMarkerAction.java @@ -47,7 +47,7 @@ public class DeleteIProblemMarkerAction extends ActionDelegate implements IObjec } try { List<?> list = selection.toList(); - List<IMarker> listMarkers = new ArrayList<IMarker>(); + List<IMarker> listMarkers = new ArrayList<>(); Iterator<?> iterator = list.iterator(); while (iterator.hasNext()) { IMarker marker = (IMarker) iterator.next(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/DeleteTaskAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/DeleteTaskAction.java index ed81ed4d321..d9e4bedd86c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/DeleteTaskAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/DeleteTaskAction.java @@ -43,7 +43,7 @@ public class DeleteTaskAction extends ActionDelegate implements IObjectActionDel } try { List<?> list = selection.toList(); - List<IMarker> listMarkers = new ArrayList<IMarker>(); + List<IMarker> listMarkers = new ArrayList<>(); Iterator<?> iterator = list.iterator(); while (iterator.hasNext()) { IMarker marker = (IMarker) iterator.next(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ImageDescriptorRegistry.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ImageDescriptorRegistry.java index 70076b62dc7..8dfa618e90a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ImageDescriptorRegistry.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ImageDescriptorRegistry.java @@ -27,7 +27,7 @@ import org.eclipse.swt.widgets.Display; */ public class ImageDescriptorRegistry { - private HashMap<ImageDescriptor, Image> fRegistry = new HashMap<ImageDescriptor, Image>(10); + private HashMap<ImageDescriptor, Image> fRegistry = new HashMap<>(10); private Display fDisplay; /** diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemMarkerManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemMarkerManager.java index 241b56731ef..2c0c7899fb1 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemMarkerManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemMarkerManager.java @@ -105,7 +105,7 @@ public class ProblemMarkerManager @Override public void resourceChanged(IResourceChangeEvent event) { - HashSet<IResource> changedElements = new HashSet<IResource>(); + HashSet<IResource> changedElements = new HashSet<>(); try { IResourceDelta delta = event.getDelta(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemTableViewer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemTableViewer.java index 7887c2fdbb9..81c7acfcd8e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemTableViewer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemTableViewer.java @@ -112,7 +112,7 @@ public class ProblemTableViewer extends TableViewer { Object[] changed = event.getElements(); if (changed != null && !fResourceToItemsMapper.isEmpty()) { - ArrayList<Object> others = new ArrayList<Object>(changed.length); + ArrayList<Object> others = new ArrayList<>(changed.length); for (int i = 0; i < changed.length; i++) { Object curr = changed[i]; if (curr instanceof IResource) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemTreeViewer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemTreeViewer.java index 724a7573380..ce5df2eb490 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemTreeViewer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemTreeViewer.java @@ -111,7 +111,7 @@ public class ProblemTreeViewer extends TreeViewer { } Object[] changed = event.getElements(); if (changed != null && !fResourceToItemsMapper.isEmpty()) { - ArrayList<Object> others = new ArrayList<Object>(changed.length); + ArrayList<Object> others = new ArrayList<>(changed.length); for (int i = 0; i < changed.length; i++) { Object curr = changed[i]; if (curr instanceof IResource) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/RemoteTreeContentManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/RemoteTreeContentManager.java index 3e38e94f0e3..35a66dfdf24 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/RemoteTreeContentManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/RemoteTreeContentManager.java @@ -52,9 +52,9 @@ public class RemoteTreeContentManager { * Queue of parents to fetch children for, and * associated element collectors and deferred adapters. */ - private List<Object> fElementQueue = new ArrayList<Object>(); - private List<IElementCollector> fCollectors = new ArrayList<IElementCollector>(); - private List<IDeferredWorkbenchAdapter> fAdapaters = new ArrayList<IDeferredWorkbenchAdapter>(); + private List<Object> fElementQueue = new ArrayList<>(); + private List<IElementCollector> fCollectors = new ArrayList<>(); + private List<IDeferredWorkbenchAdapter> fAdapaters = new ArrayList<>(); /** * Fetching children is done in a single background job. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/RemoteTreeViewer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/RemoteTreeViewer.java index d5d879d3165..190aa898c4b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/RemoteTreeViewer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/RemoteTreeViewer.java @@ -42,7 +42,7 @@ public class RemoteTreeViewer extends ProblemTreeViewer { class ExpansionJob extends UIJob { private Object element; - private List<Object> parents = new ArrayList<Object>(); // top down + private List<Object> parents = new ArrayList<>(); // top down /** * Constucts a job to expand the given element. @@ -111,7 +111,7 @@ public class RemoteTreeViewer extends ProblemTreeViewer { private IStructuredSelection selection; private Object first; - private List<Object> parents = new ArrayList<Object>(); // top down + private List<Object> parents = new ArrayList<>(); // top down /** * Constucts a job to select the given element. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ResourceToItemsMapper.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ResourceToItemsMapper.java index 246f0372f37..8b789bec0cc 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ResourceToItemsMapper.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ResourceToItemsMapper.java @@ -45,8 +45,8 @@ public class ResourceToItemsMapper { private ContentViewer fContentViewer; public ResourceToItemsMapper(ContentViewer viewer) { - fResourceToItem = new HashMap<IResource, Object>(); - fReuseLists = new Stack<List<Item>>(); + fResourceToItem = new HashMap<>(); + fReuseLists = new Stack<>(); fContentViewer = viewer; } @@ -158,7 +158,7 @@ public class ResourceToItemsMapper { if (!fReuseLists.isEmpty()) { return fReuseLists.pop(); } - return new ArrayList<Item>(2); + return new ArrayList<>(2); } private void releaseList(List<Item> list) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/StringMatcher.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/StringMatcher.java index 272f5ea6887..84d453cf51b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/StringMatcher.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/StringMatcher.java @@ -248,7 +248,7 @@ public class StringMatcher { } } - Vector<String> temp = new Vector<String>(); + Vector<String> temp = new Vector<>(); int pos = 0; StringBuilder buf = new StringBuilder(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/TableLayoutComposite.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/TableLayoutComposite.java index 4c2692ea3c9..fd5562fde5d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/TableLayoutComposite.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/TableLayoutComposite.java @@ -36,7 +36,7 @@ import org.eclipse.swt.widgets.TableColumn; */ public class TableLayoutComposite extends Composite { - private List<ColumnLayoutData> columns = new ArrayList<ColumnLayoutData>(); + private List<ColumnLayoutData> columns = new ArrayList<>(); /** * Creates a new <code>TableLayoutComposite</code>. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/AdaptingSelectionProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/AdaptingSelectionProvider.java index 149cdd430c7..434d2677d4b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/AdaptingSelectionProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/AdaptingSelectionProvider.java @@ -47,7 +47,7 @@ public class AdaptingSelectionProvider implements ISelectionProvider, ISelection if (selection != null) { if (selection instanceof IStructuredSelection) { IStructuredSelection ss = (IStructuredSelection) selection; - ArrayList<Object> adapted = new ArrayList<Object>(); + ArrayList<Object> adapted = new ArrayList<>(); for (Iterator<?> iter = ss.iterator(); iter.hasNext();) { Object elem = adaptElem(iter.next()); if (elem != null) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/AsyncTreeContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/AsyncTreeContentProvider.java index 13eb49e83c9..9094dc48069 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/AsyncTreeContentProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/AsyncTreeContentProvider.java @@ -45,10 +45,10 @@ public abstract class AsyncTreeContentProvider implements ITreeContentProvider { protected static final Object[] NO_CHILDREN = new Object[0]; private Object fInput; - private HashMap<Object, Object[]> fChildNodes = new HashMap<Object, Object[]>(); - private HashSet<Object> fHighPriorityTasks = new HashSet<Object>(); - private HashSet<Object> fLowPriorityTasks = new HashSet<Object>(); - private HashMap<Object, Object[]> fViewUpdates = new HashMap<Object, Object[]>(); + private HashMap<Object, Object[]> fChildNodes = new HashMap<>(); + private HashSet<Object> fHighPriorityTasks = new HashSet<>(); + private HashSet<Object> fLowPriorityTasks = new HashSet<>(); + private HashMap<Object, Object[]> fViewUpdates = new HashMap<>(); private int fViewUpdateDelta; private Job fJob; private Display fDisplay; @@ -137,7 +137,7 @@ public abstract class AsyncTreeContentProvider implements ITreeContentProvider { */ public void recompute() { if (getInput() != null) { - fAutoexpand = new HashSet<Object>(); + fAutoexpand = new HashSet<>(); fAutoexpand.addAll(Arrays.asList(fTreeViewer.getVisibleExpandedElements())); fAutoSelect = null; fAutoSelect = ((IStructuredSelection) fTreeViewer.getSelection()).getFirstElement(); @@ -260,7 +260,7 @@ public abstract class AsyncTreeContentProvider implements ITreeContentProvider { return; } updates = fViewUpdates; - fViewUpdates = new HashMap<Object, Object[]>(); + fViewUpdates = new HashMap<>(); } fChildNodes.putAll(updates); if (fTreeViewer instanceof ExtendedTreeViewer) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/CDTContextActivator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/CDTContextActivator.java index e5c2b610a0e..cd03c30e052 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/CDTContextActivator.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/CDTContextActivator.java @@ -50,9 +50,9 @@ import org.eclipse.ui.views.contentoutline.ContentOutline; public class CDTContextActivator implements IWindowListener, IPartListener2 { private static CDTContextActivator sInstance = new CDTContextActivator(); - private Map<ContentOutline, IContextActivation> fActivationPerOutline = new HashMap<ContentOutline, IContextActivation>(); - private Map<CommonNavigator, SelectionListener> fActivationPerNavigator = new HashMap<CommonNavigator, SelectionListener>(); - private Collection<IWorkbenchWindow> fWindows = new HashSet<IWorkbenchWindow>(); + private Map<ContentOutline, IContextActivation> fActivationPerOutline = new HashMap<>(); + private Map<CommonNavigator, SelectionListener> fActivationPerNavigator = new HashMap<>(); + private Collection<IWorkbenchWindow> fWindows = new HashSet<>(); private CDTContextActivator() { } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/CUILabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/CUILabelProvider.java index 1badfde7f18..5c36b407178 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/CUILabelProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/CUILabelProvider.java @@ -68,7 +68,7 @@ public class CUILabelProvider extends LabelProvider implements IColorProvider, I */ public void addLabelDecorator(ILabelDecorator decorator) { if (fLabelDecorators == null) { - fLabelDecorators = new ArrayList<ILabelDecorator>(2); + fLabelDecorators = new ArrayList<>(2); } fLabelDecorators.add(decorator); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/ColoredViewersManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/ColoredViewersManager.java index 08bd86e56d6..250e5689855 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/ColoredViewersManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/ColoredViewersManager.java @@ -36,7 +36,7 @@ public class ColoredViewersManager implements IPropertyChangeListener { private Set<ColoringLabelProvider> fManagedLabelProviders; public ColoredViewersManager() { - fManagedLabelProviders = new HashSet<ColoringLabelProvider>(); + fManagedLabelProviders = new HashSet<>(); } public void installColoredLabels(ColoringLabelProvider labelProvider) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/IndexedFilesCache.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/IndexedFilesCache.java index 5da71f678f1..a100cadd85b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/IndexedFilesCache.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/IndexedFilesCache.java @@ -63,7 +63,7 @@ class IndexedFilesCache implements IIndexChangeListener, IIndexerStateListener, return INSTANCE; } - private final HashMap<String, Set<Integer>> fIndexedFiles = new HashMap<String, Set<Integer>>(); + private final HashMap<String, Set<Integer>> fIndexedFiles = new HashMap<>(); private boolean fIsDirty = false; private boolean fActive = false; @@ -125,7 +125,7 @@ class IndexedFilesCache implements IIndexChangeListener, IIndexerStateListener, final protected void initialize(ICProject prj) throws CoreException, InterruptedException { IIndex index = CCorePlugin.getIndexManager().getIndex(prj); - List<IIndexFileLocation> list = new ArrayList<IIndexFileLocation>(); + List<IIndexFileLocation> list = new ArrayList<>(); index.acquireReadLock(); try { IIndexFile[] files = index.getAllFiles(); @@ -139,7 +139,7 @@ class IndexedFilesCache implements IIndexChangeListener, IIndexerStateListener, synchronized (fIndexedFiles) { Set<Integer> cache = fIndexedFiles.get(prjName); if (cache == null) { - cache = new HashSet<Integer>(); + cache = new HashSet<>(); fIndexedFiles.put(prjName, cache); } else { if (!cache.isEmpty()) { @@ -185,7 +185,7 @@ class IndexedFilesCache implements IIndexChangeListener, IIndexerStateListener, if (!(filesCleared.isEmpty() && filesWritten.isEmpty())) { Set<Integer> cache = fIndexedFiles.get(prjName); if (cache == null) { - cache = new HashSet<Integer>(); + cache = new HashSet<>(); fIndexedFiles.put(prjName, cache); } for (IIndexFileLocation ifl : filesCleared) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/ProblemsLabelDecorator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/ProblemsLabelDecorator.java index 9c90653bcd3..146229becc3 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/ProblemsLabelDecorator.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/ProblemsLabelDecorator.java @@ -120,7 +120,7 @@ public class ProblemsLabelDecorator implements ILabelDecorator, ILightweightLabe private IProblemChangedListener fProblemChangedListener; private ListenerList<ILabelProviderListener> fListeners; - private Map<MarkersCacheKey, IMarker[]> fMarkersCache = new HashMap<MarkersCacheKey, IMarker[]>(); + private Map<MarkersCacheKey, IMarker[]> fMarkersCache = new HashMap<>(); /** * Creates a new <code>ProblemsLabelDecorator</code>. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/ProjectTemplateStore.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/ProjectTemplateStore.java index 01459df915c..645ba51dd72 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/ProjectTemplateStore.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/ProjectTemplateStore.java @@ -110,7 +110,7 @@ public final class ProjectTemplateStore { if (fProjectStore != null) { fProjectStore.load(); - Set<String> datas = new HashSet<String>(); + Set<String> datas = new HashSet<>(); TemplatePersistenceData[] data = fProjectStore.getTemplateData(false); for (TemplatePersistenceData element : data) { String id = element.getId(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/SelectionListenerWithASTManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/SelectionListenerWithASTManager.java index 0bcab5882c5..91552f75bbd 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/SelectionListenerWithASTManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/SelectionListenerWithASTManager.java @@ -194,7 +194,7 @@ public class SelectionListenerWithASTManager { private Map<ITextEditor, PartListenerGroup> fListenerGroups; private SelectionListenerWithASTManager() { - fListenerGroups = new HashMap<ITextEditor, PartListenerGroup>(); + fListenerGroups = new HashMap<>(); } /** diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/SelectionProviderMediator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/SelectionProviderMediator.java index 706a45da22c..239f60ad2c1 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/SelectionProviderMediator.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/SelectionProviderMediator.java @@ -29,7 +29,7 @@ import org.eclipse.swt.events.FocusListener; import org.eclipse.swt.widgets.Control; public class SelectionProviderMediator implements ISelectionProvider { - private Map<Control, ISelectionProvider> fProviders = new HashMap<Control, ISelectionProvider>(); + private Map<Control, ISelectionProvider> fProviders = new HashMap<>(); private ISelectionProvider fActiveProvider = null; private ISelectionChangedListener fSelectionChangedListener; private FocusListener fFocusListener; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/StorageLabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/StorageLabelProvider.java index 79d74e8e82b..f9c78dd80a3 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/StorageLabelProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/StorageLabelProvider.java @@ -33,7 +33,7 @@ import org.eclipse.ui.PlatformUI; public class StorageLabelProvider extends LabelProvider { private IEditorRegistry fEditorRegistry = PlatformUI.getWorkbench().getEditorRegistry(); - private Map<String, Image> fJarImageMap = new HashMap<String, Image>(10); + private Map<String, Image> fJarImageMap = new HashMap<>(10); private Image fDefaultImage; /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/WorkingSetFilter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/WorkingSetFilter.java index 9194937ba8e..f38b9683c3d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/WorkingSetFilter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/WorkingSetFilter.java @@ -81,7 +81,7 @@ public class WorkingSetFilter { fResourceFilter = null; } else { IAdaptable[] input = workingSetFilter.getElements(); - fResourceFilter = new HashMap<IPath, Object>(); + fResourceFilter = new HashMap<>(); for (int i = 0; i < input.length; i++) { IAdaptable adaptable = input[i]; IResource res = adaptable.getAdapter(IResource.class); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/WorkingSetFilterUI.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/WorkingSetFilterUI.java index 98b832dd589..59ff57c6fbc 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/WorkingSetFilterUI.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/WorkingSetFilterUI.java @@ -169,7 +169,7 @@ public abstract class WorkingSetFilterUI { public List<String> getRecent() { IWorkingSet[] workingSets = fWSManager.getRecentWorkingSets(); - ArrayList<String> result = new ArrayList<String>(workingSets.length); + ArrayList<String> result = new ArrayList<>(workingSets.length); for (int i = 0; i < workingSets.length; i++) { result.add(workingSets[i].getName()); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/CWizardRegistry.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/CWizardRegistry.java index 1284b7bdc81..f1211bba560 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/CWizardRegistry.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/CWizardRegistry.java @@ -97,7 +97,7 @@ public class CWizardRegistry { * @return an array of IConfigurationElement */ public static IConfigurationElement[] getProjectWizardElements() { - List<IConfigurationElement> elemList = new ArrayList<IConfigurationElement>(); + List<IConfigurationElement> elemList = new ArrayList<>(); IConfigurationElement[] elements = getAllWizardElements(); for (int i = 0; i < elements.length; ++i) { IConfigurationElement element = elements[i]; @@ -164,7 +164,7 @@ public class CWizardRegistry { * @return an array of IConfigurationElement */ public static IConfigurationElement[] getTypeWizardElements() { - List<IConfigurationElement> elemList = new ArrayList<IConfigurationElement>(); + List<IConfigurationElement> elemList = new ArrayList<>(); IConfigurationElement[] elements = getAllWizardElements(); for (int i = 0; i < elements.length; ++i) { IConfigurationElement element = elements[i]; @@ -224,7 +224,7 @@ public class CWizardRegistry { * @return an array of IConfigurationElement */ public static IConfigurationElement[] getFileWizardElements() { - List<IConfigurationElement> elemList = new ArrayList<IConfigurationElement>(); + List<IConfigurationElement> elemList = new ArrayList<>(); IConfigurationElement[] elements = getAllWizardElements(); for (int i = 0; i < elements.length; ++i) { IConfigurationElement element = elements[i]; @@ -284,7 +284,7 @@ public class CWizardRegistry { * @return an array of IConfigurationElement */ public static IConfigurationElement[] getFolderWizardElements() { - List<IConfigurationElement> elemList = new ArrayList<IConfigurationElement>(); + List<IConfigurationElement> elemList = new ArrayList<>(); IConfigurationElement[] elements = getAllWizardElements(); for (int i = 0; i < elements.length; ++i) { IConfigurationElement element = elements[i]; @@ -318,7 +318,7 @@ public class CWizardRegistry { } private static String[] getWizardIDs(IConfigurationElement[] elements) { - List<String> idList = new ArrayList<String>(); + List<String> idList = new ArrayList<>(); // add C wizards first for (int i = 0; i < elements.length; ++i) { @@ -345,8 +345,8 @@ public class CWizardRegistry { } private static IAction[] createActions(IConfigurationElement[] elements) { - List<String> idList = new ArrayList<String>(); - List<IAction> actionList = new ArrayList<IAction>(); + List<String> idList = new ArrayList<>(); + List<IAction> actionList = new ArrayList<>(); // add C wizards first for (int i = 0; i < elements.length; ++i) { @@ -411,7 +411,7 @@ public class CWizardRegistry { * @return an array of IConfigurationElement */ public static IConfigurationElement[] getAllWizardElements() { - List<IConfigurationElement> elemList = new ArrayList<IConfigurationElement>(); + List<IConfigurationElement> elemList = new ArrayList<>(); IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(PlatformUI.PLUGIN_ID, PL_NEW); if (extensionPoint != null) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewBaseClassSelectionDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewBaseClassSelectionDialog.java index 4c2ffe403de..fa641c0f69b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewBaseClassSelectionDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewBaseClassSelectionDialog.java @@ -48,8 +48,8 @@ public class NewBaseClassSelectionDialog extends ElementSelectionDialog { setDialogSettings(DIALOG_SETTINGS); setVisibleTypes(VISIBLE_TYPES); setStatusLineAboveButtons(true); - fTypeList = new ArrayList<ITypeInfo>(); - fTypeListeners = new ArrayList<ITypeSelectionListener>(); + fTypeList = new ArrayList<>(); + fTypeListeners = new ArrayList<>(); } public void addListener(ITypeSelectionListener listener) { @@ -63,7 +63,7 @@ public class NewBaseClassSelectionDialog extends ElementSelectionDialog { private void notifyTypeAddedListeners(ITypeInfo type) { // first copy listeners in case one calls removeListener - List<ITypeSelectionListener> list = new ArrayList<ITypeSelectionListener>(fTypeListeners); + List<ITypeSelectionListener> list = new ArrayList<>(fTypeListeners); for (Iterator<ITypeSelectionListener> i = list.iterator(); i.hasNext();) { ITypeSelectionListener listener = i.next(); listener.typeAdded(type); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassCodeGenerator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassCodeGenerator.java index d8d840bc140..b5bbb7e4933 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassCodeGenerator.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassCodeGenerator.java @@ -329,7 +329,7 @@ public class NewClassCodeGenerator { */ private String formatSource(String content, ITranslationUnit tu) throws CModelException { String lineDelimiter = StubUtility.getLineDelimiterUsed(tu); - Map<String, Object> options = new HashMap<String, Object>(tu.getCProject().getOptions(true)); + Map<String, Object> options = new HashMap<>(tu.getCProject().getOptions(true)); options.put(DefaultCodeFormatterConstants.FORMATTER_TRANSLATION_UNIT, tu); TextEdit edit = CodeFormatterUtil.format(CodeFormatter.K_TRANSLATION_UNIT, content, 0, lineDelimiter, options); if (edit != null) { @@ -622,7 +622,7 @@ public class NewClassCodeGenerator { } private List<IMethodStub> getStubs(ASTAccessVisibility access, boolean skipInline) { - List<IMethodStub> list = new ArrayList<IMethodStub>(); + List<IMethodStub> list = new ArrayList<>(); if (fMethodStubs != null) { for (int i = 0; i < fMethodStubs.length; ++i) { IMethodStub stub = fMethodStubs[i]; @@ -689,7 +689,7 @@ public class NewClassCodeGenerator { } InclusionContext inclusionContext = new InclusionContext(headerTU); - List<StyledInclude> includes = new ArrayList<StyledInclude>(); + List<StyledInclude> includes = new ArrayList<>(); for (IPath baseClassLocation : baseClassPaths) { IncludeInfo includeInfo = inclusionContext.getIncludeForHeaderFile(baseClassLocation); if (includeInfo != null) { @@ -739,8 +739,8 @@ public class NewClassCodeGenerator { //TODO prefs option whether to add to project or parent source folder? IPath addToResourcePath = cProject.getPath(); try { - List<IPathEntry> pathEntryList = new ArrayList<IPathEntry>(); - List<IPathEntry> checkEntryList = new ArrayList<IPathEntry>(); + List<IPathEntry> pathEntryList = new ArrayList<>(); + List<IPathEntry> checkEntryList = new ArrayList<>(); IPathEntry[] checkEntries = cProject.getResolvedPathEntries(); IPathEntry[] pathEntries = cProject.getRawPathEntries(); @@ -787,7 +787,7 @@ public class NewClassCodeGenerator { private List<IPath> getMissingIncludePaths(IPath projectLocation, List<IPath> includePaths, List<IPath> baseClassPaths) { // check for missing include paths - List<IPath> newIncludePaths = new ArrayList<IPath>(); + List<IPath> newIncludePaths = new ArrayList<>(); for (IPath baseClassLocation : baseClassPaths) { // skip any paths inside the same project //TODO possibly a preferences option? @@ -849,7 +849,7 @@ public class NewClassCodeGenerator { if (info != null) { String[] includePaths = info.getIncludePaths(); if (includePaths != null) { - List<IPath> list = new ArrayList<IPath>(); + List<IPath> list = new ArrayList<>(); for (int i = 0; i < includePaths.length; ++i) { //TODO do we need to canonicalize these paths first? IPath path = new Path(includePaths[i]); @@ -865,7 +865,7 @@ public class NewClassCodeGenerator { } private List<IPath> getBaseClassPaths(boolean verifyLocation) throws CodeGeneratorException { - List<IPath> list = new ArrayList<IPath>(); + List<IPath> list = new ArrayList<>(); for (int i = 0; i < fBaseClasses.length; ++i) { IBaseClassInfo baseClass = fBaseClasses[i]; ITypeReference ref = baseClass.getType().getResolvedReference(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/SourceFileSelectionDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/SourceFileSelectionDialog.java index 45f497ed471..e9bc4c7d7a9 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/SourceFileSelectionDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/SourceFileSelectionDialog.java @@ -199,7 +199,7 @@ public class SourceFileSelectionDialog extends SelectionStatusDialog { fFileNameDialogField.setDialogFieldListener(fFieldsAdapter); fFileNameDialogField.setLabelText(NewClassWizardMessages.SourceFileSelectionDialog_fileName_label); - setResult(new ArrayList<Object>(0)); + setResult(new ArrayList<>(0)); setStatusLineAboveButtons(true); int shellStyle = getShellStyle(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/CheckedListDialogField.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/CheckedListDialogField.java index cacac52cb17..d052d9dcb8a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/CheckedListDialogField.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/CheckedListDialogField.java @@ -42,7 +42,7 @@ public class CheckedListDialogField<T> extends ListDialogField<T> { public CheckedListDialogField(IListAdapter<T> adapter, String[] customButtonLabels, IBaseLabelProvider lprovider) { super(adapter, customButtonLabels, lprovider); - fCheckElements = new ArrayList<T>(); + fCheckElements = new ArrayList<>(); fCheckAllButtonIndex = -1; fUncheckAllButtonIndex = -1; @@ -113,7 +113,7 @@ public class CheckedListDialogField<T> extends ListDialogField<T> { * Gets the checked elements. */ public List<T> getCheckedElements() { - return new ArrayList<T>(fCheckElements); + return new ArrayList<>(fCheckElements); } /** @@ -134,7 +134,7 @@ public class CheckedListDialogField<T> extends ListDialogField<T> { * Sets the checked elements. */ public void setCheckedElements(Collection<T> list) { - fCheckElements = new ArrayList<T>(list); + fCheckElements = new ArrayList<>(list); if (fTable != null) { ((CheckboxTableViewer) fTable).setCheckedElements(list.toArray()); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/ListDialogField.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/ListDialogField.java index b70848e6b2e..d9c74fcbf85 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/ListDialogField.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/ListDialogField.java @@ -130,7 +130,7 @@ public class ListDialogField<T> extends DialogField { fListViewerAdapter = new ListViewerAdapter(); fParentElement = this; - fElements = new ArrayList<T>(10); + fElements = new ArrayList<>(10); fButtonLabels = buttonLabels; if (fButtonLabels != null) { @@ -541,7 +541,7 @@ public class ListDialogField<T> extends DialogField { * Sets the elements shown in the list. */ public void setElements(List<? extends T> elements) { - fElements = new ArrayList<T>(elements); + fElements = new ArrayList<>(elements); if (fTable != null) { fTable.refresh(); } @@ -553,7 +553,7 @@ public class ListDialogField<T> extends DialogField { * The list returned is a copy, so it can be modified by the user. */ public List<T> getElements() { - return new ArrayList<T>(fElements); + return new ArrayList<>(fElements); } /** @@ -613,7 +613,7 @@ public class ListDialogField<T> extends DialogField { if (nElements > 0) { // filter duplicated - ArrayList<T> elementsToAdd = new ArrayList<T>(nElements); + ArrayList<T> elementsToAdd = new ArrayList<>(nElements); for (int i = 0; i < nElements; i++) { T elem = elements.get(i); @@ -743,7 +743,7 @@ public class ListDialogField<T> extends DialogField { private List<T> moveUp(List<? extends T> elements, List<? extends T> move) { int nElements = elements.size(); - List<T> res = new ArrayList<T>(nElements); + List<T> res = new ArrayList<>(nElements); T floating = null; for (int i = 0; i < nElements; i++) { T curr = elements.get(i); @@ -777,7 +777,7 @@ public class ListDialogField<T> extends DialogField { } private List<T> reverse(List<? extends T> p) { - List<T> reverse = new ArrayList<T>(p.size()); + List<T> reverse = new ArrayList<>(p.size()); for (int i = p.size() - 1; i >= 0; i--) { reverse.add(p.get(i)); } @@ -825,7 +825,7 @@ public class ListDialogField<T> extends DialogField { * Returns the selected elements. */ public List<T> getSelectedElements() { - List<T> result = new ArrayList<T>(); + List<T> result = new ArrayList<>(); if (fTable != null) { ISelection selection = fTable.getSelection(); if (selection instanceof IStructuredSelection) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/TreeListDialogField.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/TreeListDialogField.java index a28325dca17..3f394d86025 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/TreeListDialogField.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/TreeListDialogField.java @@ -91,7 +91,7 @@ public class TreeListDialogField<T> extends DialogField { fTreeViewerAdapter = new TreeViewerAdapter(); fParentElement = this; - fElements = new ArrayList<T>(10); + fElements = new ArrayList<>(10); fButtonLabels = buttonLabels; if (fButtonLabels != null) { @@ -517,7 +517,7 @@ public class TreeListDialogField<T> extends DialogField { * Sets the elements shown in the list. */ public void setElements(List<T> elements) { - fElements = new ArrayList<T>(elements); + fElements = new ArrayList<>(elements); refresh(); if (fTree != null) { fTree.expandToLevel(fTreeExpandLevel); @@ -530,7 +530,7 @@ public class TreeListDialogField<T> extends DialogField { * can be modified by the user. */ public List<T> getElements() { - return new ArrayList<T>(fElements); + return new ArrayList<>(fElements); } /** @@ -596,7 +596,7 @@ public class TreeListDialogField<T> extends DialogField { if (nElements > 0) { // filter duplicated - ArrayList<T> elementsToAdd = new ArrayList<T>(nElements); + ArrayList<T> elementsToAdd = new ArrayList<>(nElements); for (int i = 0; i < nElements; i++) { T elem = elements.get(i); @@ -739,7 +739,7 @@ public class TreeListDialogField<T> extends DialogField { private List<T> moveUp(List<T> elements, List<?> move) { int nElements = elements.size(); - List<T> res = new ArrayList<T>(nElements); + List<T> res = new ArrayList<>(nElements); T floating = null; for (int i = 0; i < nElements; i++) { T curr = elements.get(i); @@ -773,7 +773,7 @@ public class TreeListDialogField<T> extends DialogField { } private List<T> reverse(List<T> p) { - List<T> reverse = new ArrayList<T>(p.size()); + List<T> reverse = new ArrayList<>(p.size()); for (int i = p.size() - 1; i >= 0; i--) { reverse.add(p.get(i)); } @@ -823,7 +823,7 @@ public class TreeListDialogField<T> extends DialogField { * Returns the selected elements. */ public List<Object> getSelectedElements() { - ArrayList<Object> result = new ArrayList<Object>(); + ArrayList<Object> result = new ArrayList<>(); if (fTree != null) { ISelection selection = fTree.getSelection(); if (selection instanceof IStructuredSelection) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/filewizard/AbstractFileCreationWizardPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/filewizard/AbstractFileCreationWizardPage.java index d2b60d853ba..110a8da384c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/filewizard/AbstractFileCreationWizardPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/filewizard/AbstractFileCreationWizardPage.java @@ -232,7 +232,7 @@ public abstract class AbstractFileCreationWizardPage extends NewElementWizardPag templateName = template.getName(); } if (templateName != null) { - data = new HashMap<String, String>(); + data = new HashMap<>(); data.put(CodeTemplatePreferencePage.DATA_SELECT_TEMPLATE, templateName); } PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), prefPageId, diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/filewizard/WizardNewFileFromTemplateCreationPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/filewizard/WizardNewFileFromTemplateCreationPage.java index cebda1487ff..d5d0d5633e8 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/filewizard/WizardNewFileFromTemplateCreationPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/filewizard/WizardNewFileFromTemplateCreationPage.java @@ -125,7 +125,7 @@ public class WizardNewFileFromTemplateCreationPage extends WizardNewFileCreation templateName = template.getName(); } if (templateName != null) { - data = new HashMap<String, String>(); + data = new HashMap<>(); data.put(CodeTemplatePreferencePage.DATA_SELECT_TEMPLATE, templateName); } PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), prefPageId, @@ -253,7 +253,7 @@ public class WizardNewFileFromTemplateCreationPage extends WizardNewFileCreation } } IContentType[] contentTypes = matcher.findContentTypesFor(fileName); - List<String> result = new ArrayList<String>(contentTypes.length * 2); + List<String> result = new ArrayList<>(contentTypes.length * 2); for (int i = 0; i < contentTypes.length; i++) { IContentType contentType = contentTypes[i]; String id = contentType.getId(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/indexwizards/TeamProjectIndexExportWizardPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/indexwizards/TeamProjectIndexExportWizardPage.java index 11722d41f4f..9bf3abc2c9b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/indexwizards/TeamProjectIndexExportWizardPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/indexwizards/TeamProjectIndexExportWizardPage.java @@ -195,7 +195,7 @@ public class TeamProjectIndexExportWizardPage extends WizardPage implements List } private void initProjects() { - ArrayList<ICProject> input = new ArrayList<ICProject>(); + ArrayList<ICProject> input = new ArrayList<>(); ICProject[] projects; try { projects = CoreModel.getDefault().getCModel().getCProjects(); @@ -211,7 +211,7 @@ public class TeamProjectIndexExportWizardPage extends WizardPage implements List } private void setupBasedOnInitialSelections() { - HashSet<String> names = new HashSet<String>(); + HashSet<String> names = new HashSet<>(); Iterator<?> it = fInitialSelection.iterator(); while (it.hasNext()) { IProject project = (IProject) it.next(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/IncludePathsSettingsProcessor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/IncludePathsSettingsProcessor.java index 261adf78e00..1df9bd7106e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/IncludePathsSettingsProcessor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/IncludePathsSettingsProcessor.java @@ -85,7 +85,7 @@ public class IncludePathsSettingsProcessor extends SettingsProcessor { @Override protected void readSettings(ICLanguageSetting setting, Element language) throws SettingsImportExportException { - List<ICLanguageSettingEntry> includes = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> includes = new ArrayList<>(); List<Element> includeNodes = XMLUtils.extractChildElements(language, INCLUDE_PATH_ELEMENT); for (Element includeElement : includeNodes) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/MacroSettingsProcessor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/MacroSettingsProcessor.java index b52eb3b7dac..5dd69f82ab8 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/MacroSettingsProcessor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/MacroSettingsProcessor.java @@ -95,7 +95,7 @@ public class MacroSettingsProcessor extends SettingsProcessor { @Override protected void readSettings(ICLanguageSetting setting, Element language) throws SettingsImportExportException { - List<ICLanguageSettingEntry> macros = new ArrayList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> macros = new ArrayList<>(); List<Element> macrosNodes = XMLUtils.extractChildElements(language, MACRO_ELEMENT); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/ProjectSettingsImportStrategy.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/ProjectSettingsImportStrategy.java index e95cad4f445..11d6e650060 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/ProjectSettingsImportStrategy.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/ProjectSettingsImportStrategy.java @@ -91,7 +91,7 @@ public class ProjectSettingsImportStrategy implements IProjectSettingsWizardPage page.setMessage(Messages.ProjectSettingsWizardPage_Import_parseError, IMessageProvider.ERROR); } - List<ISettingsProcessor> importersToDisplay = new ArrayList<ISettingsProcessor>(); + List<ISettingsProcessor> importersToDisplay = new ArrayList<>(); for (ImporterSectionPair pair : pairs) { importersToDisplay.add(pair.importer); } @@ -168,7 +168,7 @@ public class ProjectSettingsImportStrategy implements IProjectSettingsWizardPage String filePath = page.getDestinationFilePath(); // get all the importers - Map<String, ISettingsProcessor> importers = new HashMap<String, ISettingsProcessor>(); + Map<String, ISettingsProcessor> importers = new HashMap<>(); for (ISettingsProcessor processor : page.getSettingsProcessors()) { importers.put(processor.getSectionName(), processor); } @@ -182,7 +182,7 @@ public class ProjectSettingsImportStrategy implements IProjectSettingsWizardPage Element root = document.getDocumentElement(); List<Element> sections = XMLUtils.extractChildElements(root, ProjectSettingsExportStrategy.SECTION_ELEMENT); - List<ImporterSectionPair> pairs = new ArrayList<ImporterSectionPair>(); + List<ImporterSectionPair> pairs = new ArrayList<>(); // associate an importer with each section for (Element section : sections) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/ProjectSettingsWizardPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/ProjectSettingsWizardPage.java index 38402a67994..04863d64ea2 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/ProjectSettingsWizardPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/ProjectSettingsWizardPage.java @@ -133,7 +133,7 @@ abstract public class ProjectSettingsWizardPage extends WizardPage implements IP @Override public List<ISettingsProcessor> getSelectedSettingsProcessors() { - List<ISettingsProcessor> selected = new ArrayList<ISettingsProcessor>(); + List<ISettingsProcessor> selected = new ArrayList<>(); for (Object element : settingsViewer.getCheckedElements()) { selected.add((ISettingsProcessor) element); } @@ -300,7 +300,7 @@ abstract public class ProjectSettingsWizardPage extends WizardPage implements IP } private static List<ICProject> getAllOpenCProjects() { - List<ICProject> projects = new ArrayList<ICProject>(); + List<ICProject> projects = new ArrayList<>(); try { for (ICProject project : CoreModel.getDefault().getCModel().getCProjects()) { if (project.getProject().isOpen()) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/SettingsProcessor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/SettingsProcessor.java index 36cc7c2f722..0ce07081dea 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/SettingsProcessor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/SettingsProcessor.java @@ -95,7 +95,7 @@ public abstract class SettingsProcessor implements ISettingsProcessor { public void readSectionXML(ICFolderDescription projectRoot, Element section) throws SettingsImportExportException { ICLanguageSetting[] languageSettings = projectRoot.getLanguageSettings(); - Map<String, ICLanguageSetting> languageMap = new HashMap<String, ICLanguageSetting>(); + Map<String, ICLanguageSetting> languageMap = new HashMap<>(); for (ICLanguageSetting language : languageSettings) { languageMap.put(language.getName(), language); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/XMLUtils.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/XMLUtils.java index e99f73b4aa8..2cdddb6aabf 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/XMLUtils.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/XMLUtils.java @@ -28,7 +28,7 @@ public class XMLUtils { public static List<Element> extractChildElements(Element node, String childElementName) throws SettingsImportExportException { - List<Element> extracted = new ArrayList<Element>(); + List<Element> extracted = new ArrayList<>(); NodeList children = node.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/AbstractWorkingSetConfigsContribution.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/AbstractWorkingSetConfigsContribution.java index 388e5d372d5..617f67bda28 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/AbstractWorkingSetConfigsContribution.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/AbstractWorkingSetConfigsContribution.java @@ -74,7 +74,7 @@ abstract class AbstractWorkingSetConfigsContribution extends CompoundContributio } // sort the configurations by name - List<IWorkingSetConfiguration> configs = new java.util.ArrayList<IWorkingSetConfiguration>( + List<IWorkingSetConfiguration> configs = new java.util.ArrayList<>( getWorkingSet().getConfigurations()); Collections.sort(configs, configOrdering); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/AbstractWorkingSetsContribution.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/AbstractWorkingSetsContribution.java index 14a75d970be..5d08b86f784 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/AbstractWorkingSetsContribution.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/AbstractWorkingSetsContribution.java @@ -57,7 +57,7 @@ abstract class AbstractWorkingSetsContribution extends CompoundContributionItem @Override protected IContributionItem[] getContributionItems() { // at most 5 recent working sets - List<IContributionItem> result = new java.util.ArrayList<IContributionItem>(5); + List<IContributionItem> result = new java.util.ArrayList<>(5); int i = 0; for (IWorkingSet recent : getWorkingsetManager().getRecentWorkingSets()) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/BuildJob.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/BuildJob.java index 567946f9682..b1862d26aa8 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/BuildJob.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/BuildJob.java @@ -44,7 +44,7 @@ public final class BuildJob extends Job { */ public BuildJob(Collection<IProject> projects) { super(Messages.WorkingSetConfigAction_21); - this.projects = new java.util.ArrayList<IProject>(projects); + this.projects = new java.util.ArrayList<>(projects); } /** diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetPage.java index 0bf1127b3cf..e368a3e7d60 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetPage.java @@ -185,7 +185,7 @@ public class CElementWorkingSetPage extends WizardPage implements IWorkingSetPag @Override public void finish() { String workingSetName = fWorkingSetName.getText(); - ArrayList<Object> elements = new ArrayList<Object>(10); + ArrayList<Object> elements = new ArrayList<>(10); findCheckedElements(elements, fTree.getInput()); if (fWorkingSet == null) { IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); @@ -194,7 +194,7 @@ public class CElementWorkingSetPage extends WizardPage implements IWorkingSetPag } else { // Add inaccessible resources IAdaptable[] oldItems = fWorkingSet.getElements(); - HashSet<IProject> closedWithChildren = new HashSet<IProject>(elements.size()); + HashSet<IProject> closedWithChildren = new HashSet<>(elements.size()); for (IAdaptable oldItem : oldItems) { IResource oldResource = null; if (oldItem instanceof IResource) { @@ -341,7 +341,7 @@ public class CElementWorkingSetPage extends WizardPage implements IWorkingSetPag } } fTree.setCheckedElements(elements); - HashSet<Object> parents = new HashSet<Object>(); + HashSet<Object> parents = new HashSet<>(); for (Object element : elements) { if (isExpandable(element)) setSubtreeChecked(element, true, true); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetPageContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetPageContentProvider.java index 66df9c9b5b0..7531989dd13 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetPageContentProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetPageContentProvider.java @@ -33,7 +33,7 @@ class CElementWorkingSetPageContentProvider extends BaseCElementContentProvider if (element instanceof IWorkspaceRoot) { IWorkspaceRoot root = (IWorkspaceRoot) element; IProject[] projects = root.getProjects(); - List<ICProject> list = new ArrayList<ICProject>(projects.length); + List<ICProject> list = new ArrayList<>(projects.length); for (int i = 0; i < projects.length; i++) { if (CoreModel.hasCNature(projects[i])) { list.add(CoreModel.getDefault().create(projects[i])); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetUpdater.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetUpdater.java index 7e7f150c476..b5e21652776 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetUpdater.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetUpdater.java @@ -88,7 +88,7 @@ public class CElementWorkingSetUpdater implements IWorkingSetUpdater, IElementCh public WorkingSetDelta(IWorkingSet workingSet) { fWorkingSet = workingSet; synchronized (fWorkingSet) { - fElements = new ArrayList<Object>(Arrays.asList(fWorkingSet.getElements())); + fElements = new ArrayList<>(Arrays.asList(fWorkingSet.getElements())); } } @@ -119,7 +119,7 @@ public class CElementWorkingSetUpdater implements IWorkingSetUpdater, IElementCh } public CElementWorkingSetUpdater() { - fWorkingSets = new ArrayList<IWorkingSet>(); + fWorkingSets = new ArrayList<>(); CoreModel.getDefault().addElementChangedListener(this); } @@ -278,7 +278,7 @@ public class CElementWorkingSetUpdater implements IWorkingSetUpdater, IElementCh } private static void checkElementExistence(IWorkingSet workingSet) { - List<IAdaptable> elements = new ArrayList<IAdaptable>(Arrays.asList(workingSet.getElements())); + List<IAdaptable> elements = new ArrayList<>(Arrays.asList(workingSet.getElements())); boolean changed = false; for (Iterator<IAdaptable> iter = elements.iterator(); iter.hasNext();) { IAdaptable element = iter.next(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/IWorkingSetProjectConfigurationFactory.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/IWorkingSetProjectConfigurationFactory.java index 17750350fcb..728ed011d2b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/IWorkingSetProjectConfigurationFactory.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/IWorkingSetProjectConfigurationFactory.java @@ -118,8 +118,8 @@ public interface IWorkingSetProjectConfigurationFactory { public static Registry INSTANCE = new Registry(); private final IWorkingSetProjectConfigurationFactory defaultFactory = new Default(); - private final Map<String, IWorkingSetProjectConfigurationFactory> factoriesByID = new java.util.HashMap<String, IWorkingSetProjectConfigurationFactory>(); - private final Map<String, IWorkingSetProjectConfigurationFactory> factoriesByNature = new java.util.HashMap<String, IWorkingSetProjectConfigurationFactory>(); + private final Map<String, IWorkingSetProjectConfigurationFactory> factoriesByID = new java.util.HashMap<>(); + private final Map<String, IWorkingSetProjectConfigurationFactory> factoriesByNature = new java.util.HashMap<>(); private Map<String, Set<String>> projectNaturePartOrdering; @@ -205,13 +205,13 @@ public interface IWorkingSetProjectConfigurationFactory { } private Map<String, Set<String>> computeProjectNaturePartOrdering() { - Map<String, Set<String>> result = new java.util.HashMap<String, Set<String>>(); + Map<String, Set<String>> result = new java.util.HashMap<>(); // first pass to populate the map with immediate requireds IWorkspace ws = ResourcesPlugin.getWorkspace(); for (IProjectNatureDescriptor next : ws.getNatureDescriptors()) { result.put(next.getNatureId(), - new java.util.HashSet<String>(Arrays.asList(next.getRequiredNatureIds()))); + new java.util.HashSet<>(Arrays.asList(next.getRequiredNatureIds()))); } // now, iterate to add transitive requireds @@ -221,7 +221,7 @@ public interface IWorkingSetProjectConfigurationFactory { for (Map.Entry<String, Set<String>> next : result.entrySet()) { Set<String> requireds = next.getValue(); - Set<String> newRequireds = new java.util.HashSet<String>(requireds); + Set<String> newRequireds = new java.util.HashSet<>(requireds); boolean changed = false; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/ProjectConfigsController.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/ProjectConfigsController.java index b6803dbf4ca..3e676614445 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/ProjectConfigsController.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/ProjectConfigsController.java @@ -193,9 +193,9 @@ class ProjectConfigsController implements ICheckStateListener, DisposeListener { private Map<IWorkingSetProjectConfigurationController, ILabelProvider> labelProviders; ControllerContext(Viewer viewer) { - elementToControllerMap = new java.util.IdentityHashMap<Object, IWorkingSetProjectConfigurationController>(); - contentProviders = new java.util.HashMap<IWorkingSetProjectConfigurationController, ITreeContentProvider>(); - labelProviders = new java.util.HashMap<IWorkingSetProjectConfigurationController, ILabelProvider>(); + elementToControllerMap = new java.util.IdentityHashMap<>(); + contentProviders = new java.util.HashMap<>(); + labelProviders = new java.util.HashMap<>(); for (IWorkingSetProjectConfiguration next : getWorkingSetConfiguration().getProjectConfigurations()) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/ProjectConfigurationController.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/ProjectConfigurationController.java index 05b58893d97..2baebcf2a92 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/ProjectConfigurationController.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/ProjectConfigurationController.java @@ -126,7 +126,7 @@ public class ProjectConfigurationController implements IWorkingSetProjectConfigu ContentProvider(IWorkingSetProjectConfiguration project) { this.project = project; - this.configs = new java.util.HashSet<ICConfigurationDescription>(project.resolveConfigurations()); + this.configs = new java.util.HashSet<>(project.resolveConfigurations()); } @Override diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetConfigsController.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetConfigsController.java index ee19a6f010d..1ec07330293 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetConfigsController.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetConfigsController.java @@ -369,7 +369,7 @@ class WorkingSetConfigsController implements SelectionListener, ISelectionChange */ private void updateForActivation() { // update all working-set configs that intersect this config - Collection<IWorkingSetProxy.ISnapshot> unaffectedWorkingSets = new java.util.HashSet<IWorkingSetProxy.ISnapshot>( + Collection<IWorkingSetProxy.ISnapshot> unaffectedWorkingSets = new java.util.HashSet<>( workspace.getWorkingSets()); for (IProject project : currentConfig.getWorkingSet().resolveProjects()) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetConfiguration.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetConfiguration.java index 4cc2b0bb9a9..e18a4ed0140 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetConfiguration.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetConfiguration.java @@ -113,7 +113,7 @@ public class WorkingSetConfiguration implements IWorkingSetConfiguration { private Map<String, IWorkingSetProjectConfiguration> getProjects() { if (projects == null) { - projects = new java.util.HashMap<String, IWorkingSetProjectConfiguration>(); + projects = new java.util.HashMap<>(); for (IProject next : workingSet.resolveProjects()) { IWorkingSetProjectConfiguration child = createProjectConfiguration(next); @@ -130,7 +130,7 @@ public class WorkingSetConfiguration implements IWorkingSetConfiguration { protected void basicAddProjectConfiguration(IWorkingSetProjectConfiguration projectConfig) { if (projects == null) { - projects = new java.util.HashMap<String, IWorkingSetProjectConfiguration>(); + projects = new java.util.HashMap<>(); } projects.put(projectConfig.getProjectName(), projectConfig); @@ -181,7 +181,7 @@ public class WorkingSetConfiguration implements IWorkingSetConfiguration { public IStatus build(IProgressMonitor monitor) { MultiStatus result = new MultiStatus(CUIPlugin.PLUGIN_ID, 0, WorkingSetMessages.WSConfig_build_problems, null); - List<IWorkingSetProjectConfiguration> toBuild = new java.util.ArrayList<IWorkingSetProjectConfiguration>( + List<IWorkingSetProjectConfiguration> toBuild = new java.util.ArrayList<>( getProjectConfigurations().size()); for (IWorkingSetProjectConfiguration next : getProjectConfigurations()) { IProject project = next.resolveProject(); @@ -229,7 +229,7 @@ public class WorkingSetConfiguration implements IWorkingSetConfiguration { public void loadState(IMemento memento) { setName(memento.getString(ATTR_NAME)); - Map<String, IMemento> projectMementos = new java.util.HashMap<String, IMemento>(); + Map<String, IMemento> projectMementos = new java.util.HashMap<>(); for (IMemento next : memento.getChildren(KEY_PROJECT)) { projectMementos.put(next.getString(ATTR_NAME), next); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetConfigurationBlock.java index 539a72de0bc..77f01d6ac58 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetConfigurationBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetConfigurationBlock.java @@ -346,7 +346,7 @@ public class WorkingSetConfigurationBlock { return workingSets; } - Collection<IWorkingSetProxy> result = new java.util.ArrayList<IWorkingSetProxy>(); + Collection<IWorkingSetProxy> result = new java.util.ArrayList<>(); for (IWorkingSetProxy next : workingSets) { if (workingSetFilter.select(next)) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetConfigurationManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetConfigurationManager.java index ac65057e1db..4d8d2ad4d51 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetConfigurationManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetConfigurationManager.java @@ -153,7 +153,7 @@ public class WorkingSetConfigurationManager { * </p> */ private void load() { - workingSets = new java.util.HashMap<String, IWorkingSetProxy>(); + workingSets = new java.util.HashMap<>(); for (IMemento next : store.getChildren(KEY_WORKING_SET)) { WorkingSetProxy ws = new WorkingSetProxy(); @@ -291,7 +291,7 @@ public class WorkingSetConfigurationManager { result = XMLMemento.createWriteRoot(TYPE_WORKING_SET_CONFIGS); // collect the unordered entries by working set - Map<String, IMemento> configMap = new HashMap<String, IMemento>(); + Map<String, IMemento> configMap = new HashMap<>(); for (String next : configSetStrings) { String[] bits = next.split(" "); //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetProxy.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetProxy.java index a4c2ed7ff37..c776dcc8f93 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetProxy.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkingSetProxy.java @@ -73,7 +73,7 @@ public class WorkingSetProxy implements IWorkingSetProxy { @Override public Collection<IProject> resolveProjects() { - Set<IProject> result = new java.util.HashSet<IProject>(); + Set<IProject> result = new java.util.HashSet<>(); IWorkingSet resolvedWS = resolve(); if (resolvedWS != null) { @@ -96,7 +96,7 @@ public class WorkingSetProxy implements IWorkingSetProxy { private Map<String, IWorkingSetConfiguration> getConfigurationsMap() { if (configurations == null) { - configurations = new java.util.HashMap<String, IWorkingSetConfiguration>(); + configurations = new java.util.HashMap<>(); } return configurations; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkspaceSnapshot.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkspaceSnapshot.java index 379e1343a51..e598e3f3c13 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkspaceSnapshot.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/WorkspaceSnapshot.java @@ -57,8 +57,8 @@ import org.eclipse.ui.IWorkingSet; * */ public class WorkspaceSnapshot { - private Map<String, IWorkingSetProxy.ISnapshot> workingSets = new java.util.HashMap<String, IWorkingSetProxy.ISnapshot>(); - private Map<IProject, ProjectState> projectStates = new java.util.HashMap<IProject, ProjectState>(); + private Map<String, IWorkingSetProxy.ISnapshot> workingSets = new java.util.HashMap<>(); + private Map<IProject, ProjectState> projectStates = new java.util.HashMap<>(); /** * Initializes me. I capture the current C/C++ active configuration state of the projects in the @@ -297,7 +297,7 @@ public class WorkspaceSnapshot { * @return the projects needing to be re-built */ public Collection<IProject> getProjectsToBuild() { - Collection<IProject> result = new java.util.ArrayList<IProject>(); + Collection<IProject> result = new java.util.ArrayList<>(); for (ProjectState next : projectStates.values()) { if (next.needsBuild()) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CDTUIImages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CDTUIImages.java index c7648a21542..2db48152210 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CDTUIImages.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CDTUIImages.java @@ -31,7 +31,7 @@ import org.eclipse.swt.graphics.Image; public class CDTUIImages { private static final String ICONS = "icons/"; //$NON-NLS-1$ /** Converter from CPluginImages key to CDTSharedImages key */ - private static Map<String, String> fPathMap = new HashMap<String, String>(); + private static Map<String, String> fPathMap = new HashMap<>(); private static final String NAME_PREFIX = CUIPlugin.PLUGIN_ID + '.'; private static final int NAME_PREFIX_LENGTH = NAME_PREFIX.length(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementContentProvider.java index fd6eb6efa9f..1eabfae8979 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementContentProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementContentProvider.java @@ -76,7 +76,7 @@ public class CElementContentProvider extends BaseCElementContentProvider protected Object fInput; /** Remember what refreshes we already have pending so we don't post them again. */ - protected HashSet<IRefreshable> pendingRefreshes = new HashSet<IRefreshable>(); + protected HashSet<IRefreshable> pendingRefreshes = new HashSet<>(); /** * Creates a new content provider for C elements. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPlugin.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPlugin.java index e8d68df1d6f..406e2322840 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPlugin.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPlugin.java @@ -803,8 +803,8 @@ public class CUIPlugin extends AbstractUIPlugin { * @return an array of all dirty editor parts. */ public static IEditorPart[] getDirtyEditors() { - Set<IEditorInput> inputs = new HashSet<IEditorInput>(); - List<IEditorPart> result = new ArrayList<IEditorPart>(0); + Set<IEditorInput> inputs = new HashSet<>(); + List<IEditorPart> result = new ArrayList<>(0); IWorkbench workbench = getDefault().getWorkbench(); for (IWorkbenchWindow window : workbench.getWorkbenchWindows()) { for (IWorkbenchPage page : window.getPages()) { @@ -827,7 +827,7 @@ public class CUIPlugin extends AbstractUIPlugin { * Returns an array of all instantiated editors. */ public static IEditorPart[] getInstanciatedEditors() { - List<IEditorPart> result = new ArrayList<IEditorPart>(0); + List<IEditorPart> result = new ArrayList<>(0); IWorkbench workbench = getDefault().getWorkbench(); IWorkbenchWindow[] windows = workbench.getWorkbenchWindows(); for (IWorkbenchWindow window : windows) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/NamespacesGrouping.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/NamespacesGrouping.java index 7c8c1effc28..ff070922ea1 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/NamespacesGrouping.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/NamespacesGrouping.java @@ -70,7 +70,7 @@ public class NamespacesGrouping extends CElementGrouping { */ @Override public Object[] getChildren(Object object) { - Set<Object> list = new LinkedHashSet<Object>(); + Set<Object> list = new LinkedHashSet<>(); try { INamespace[] namespaces = getNamespaces(); for (INamespace iNamespace : namespaces) { @@ -87,7 +87,7 @@ public class NamespacesGrouping extends CElementGrouping { * @since 5.1 */ public INamespace[] getNamespaces() { - List<INamespace> list = new ArrayList<INamespace>(); + List<INamespace> list = new ArrayList<>(); try { List<ICElement> namespaces = fUnit.getChildrenOfType(ICElement.C_NAMESPACE); for (ICElement icElement : namespaces) { @@ -108,9 +108,9 @@ public class NamespacesGrouping extends CElementGrouping { if (!fMemberGrouping) { return Arrays.asList(children); } - List<Object> list = new ArrayList<Object>(children.length); + List<Object> list = new ArrayList<>(children.length); // check if there is another member with the same namespace for the same parent - Map<String, MembersGrouping> map = new HashMap<String, MembersGrouping>(); + Map<String, MembersGrouping> map = new HashMap<>(); for (int i = 0; i < children.length; ++i) { if (children[i] instanceof IMember) { final ICElement member = (ICElement) children[i]; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/SharedImagesFactory.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/SharedImagesFactory.java index ea39946ba4e..8e70abe3550 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/SharedImagesFactory.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/SharedImagesFactory.java @@ -51,7 +51,7 @@ public class SharedImagesFactory { private Bundle bundle; private ImageRegistry imageRegistry; - private Map<String, URL> urlMap = new HashMap<String, URL>(); + private Map<String, URL> urlMap = new HashMap<>(); /** * Constructor. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ChangeBuildConfigActionBase.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ChangeBuildConfigActionBase.java index 074fbdb038f..35316325084 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ChangeBuildConfigActionBase.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ChangeBuildConfigActionBase.java @@ -53,7 +53,7 @@ public class ChangeBuildConfigActionBase { /** * List of selected managed-built projects */ - protected HashSet<IProject> fProjects = new HashSet<IProject>(); + protected HashSet<IProject> fProjects = new HashSet<>(); /** * Fills the menu with build configurations which are common for all selected projects @@ -68,7 +68,7 @@ public class ChangeBuildConfigActionBase { for (MenuItem item2 : items) item2.dispose(); - SortedSet<String> configNames = new TreeSet<String>(); + SortedSet<String> configNames = new TreeSet<>(); String sCurrentConfig = null; boolean bCurrentConfig = true; for (IProject prj : fProjects) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/CustomFiltersActionGroup.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/CustomFiltersActionGroup.java index 94cc721f6e5..820ee8ba3b1 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/CustomFiltersActionGroup.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/CustomFiltersActionGroup.java @@ -224,7 +224,7 @@ public class CustomFiltersActionGroup extends ActionGroup { fTargetId = ownerId; fViewer = viewer; - fLRUFilterIdsStack = new Stack<String>(); + fLRUFilterIdsStack = new Stack<>(); initializeWithPluginContributions(); initializeWithViewDefaults(); @@ -243,7 +243,7 @@ public class CustomFiltersActionGroup extends ActionGroup { public String[] removeFiltersFor(Object parent, Object element, IContentProvider contentProvider) { String[] enabledFilters = getEnabledFilterIds(); - Set<String> newFilters = new HashSet<String>(); + Set<String> newFilters = new HashSet<>(); for (String filterName : enabledFilters) { ViewerFilter filter = fInstalledBuiltInFilters.get(filterName); if (filter == null) @@ -293,7 +293,7 @@ public class CustomFiltersActionGroup extends ActionGroup { } private String[] getEnabledFilterIds() { - Set<String> enabledFilterIds = new HashSet<String>(fEnabledFilterIds.size()); + Set<String> enabledFilterIds = new HashSet<>(fEnabledFilterIds.size()); Iterator<Map.Entry<String, Boolean>> iter = fEnabledFilterIds.entrySet().iterator(); while (iter.hasNext()) { Map.Entry<String, Boolean> entry = iter.next(); @@ -327,7 +327,7 @@ public class CustomFiltersActionGroup extends ActionGroup { * @since 3.0 */ private void setRecentlyChangedFilters(Stack<FilterDescriptor> changeHistory) { - Stack<String> oldestFirstStack = new Stack<String>(); + Stack<String> oldestFirstStack = new Stack<>(); int length = Math.min(changeHistory.size(), MAX_FILTER_MENU_ENTRIES); for (int i = 0; i < length; i++) @@ -389,7 +389,7 @@ public class CustomFiltersActionGroup extends ActionGroup { return; } - SortedSet<Object> sortedFilters = new TreeSet<Object>(fLRUFilterIdsStack); + SortedSet<Object> sortedFilters = new TreeSet<>(fLRUFilterIdsStack); String[] recentlyChangedFilterIds = sortedFilters.toArray(new String[sortedFilters.size()]); fFilterIdsUsedInLastViewMenu = new String[recentlyChangedFilterIds.length]; @@ -421,8 +421,8 @@ public class CustomFiltersActionGroup extends ActionGroup { fUserDefinedPatternsEnabled = false; FilterDescriptor[] filterDescs = FilterDescriptor.getFilterDescriptors(fTargetId); - fFilterDescriptorMap = new HashMap<String, FilterDescriptor>(filterDescs.length); - fEnabledFilterIds = new HashMap<String, Boolean>(filterDescs.length); + fFilterDescriptorMap = new HashMap<>(filterDescs.length); + fEnabledFilterIds = new HashMap<>(filterDescs.length); for (FilterDescriptor filterDesc : filterDescs) { String id = filterDesc.getId(); Boolean isEnabled = filterDesc.isEnabled(); @@ -436,7 +436,7 @@ public class CustomFiltersActionGroup extends ActionGroup { // ---------- viewer filter handling ---------- private void installFilters() { - fInstalledBuiltInFilters = new HashMap<String, ViewerFilter>(fEnabledFilterIds.size()); + fInstalledBuiltInFilters = new HashMap<>(fEnabledFilterIds.size()); fPatternFilter = new NamePatternFilter(); fPatternFilter.setPatterns(getUserAndBuiltInPatterns()); fViewer.addFilter(fPatternFilter); @@ -455,8 +455,8 @@ public class CustomFiltersActionGroup extends ActionGroup { private void updateBuiltInFilters() { Set<String> installedFilters = fInstalledBuiltInFilters.keySet(); - Set<String> filtersToAdd = new HashSet<String>(fEnabledFilterIds.size()); - Set<String> filtersToRemove = new HashSet<String>(fEnabledFilterIds.size()); + Set<String> filtersToAdd = new HashSet<>(fEnabledFilterIds.size()); + Set<String> filtersToRemove = new HashSet<>(fEnabledFilterIds.size()); Iterator<Map.Entry<String, Boolean>> iter = fEnabledFilterIds.entrySet().iterator(); while (iter.hasNext()) { Map.Entry<String, Boolean> entry = iter.next(); @@ -491,7 +491,7 @@ public class CustomFiltersActionGroup extends ActionGroup { } private String[] getUserAndBuiltInPatterns() { - List<String> patterns = new ArrayList<String>(fUserDefinedPatterns.length); + List<String> patterns = new ArrayList<>(fUserDefinedPatterns.length); if (areUserDefinedPatternsEnabled()) patterns.addAll(Arrays.asList(fUserDefinedPatterns)); FilterDescriptor[] filterDescs = FilterDescriptor.getFilterDescriptors(fTargetId); @@ -698,7 +698,7 @@ public class CustomFiltersActionGroup extends ActionGroup { private void cleanUpPatternDuplicates() { if (!areUserDefinedPatternsEnabled()) return; - List<String> userDefinedPatterns = new ArrayList<String>(Arrays.asList(fUserDefinedPatterns)); + List<String> userDefinedPatterns = new ArrayList<>(Arrays.asList(fUserDefinedPatterns)); FilterDescriptor[] filters = FilterDescriptor.getFilterDescriptors(fTargetId); for (FilterDescriptor filter : filters) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/DeleteResConfigsAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/DeleteResConfigsAction.java index 2845b52eac0..1de2e3cfdf2 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/DeleteResConfigsAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/DeleteResConfigsAction.java @@ -96,7 +96,7 @@ public class DeleteResConfigsAction implements IWorkbenchWindowPulldownDelegate2 ICResourceDescription rd = cfgd.getResourceDescription(path, true); if (rd != null) { if (objects == null) - objects = new ArrayList<IResource>(); + objects = new ArrayList<>(); objects.add(res); break; // stop configurations scanning } @@ -172,7 +172,7 @@ public class DeleteResConfigsAction implements IWorkbenchWindowPulldownDelegate2 if (outData != null) return outData.toArray(); - outData = new ArrayList<ResCfgData>(); + outData = new ArrayList<>(); List<?> ls = (List<?>) inputElement; Iterator<?> it = ls.iterator(); IProject proj = null; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ExcludeFromBuildAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ExcludeFromBuildAction.java index 9dc5d753036..71ba1b511ac 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ExcludeFromBuildAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ExcludeFromBuildAction.java @@ -91,10 +91,10 @@ public class ExcludeFromBuildAction implements IWorkbenchWindowPulldownDelegate2 continue; if (objects == null) - objects = new ArrayList<IResource>(); + objects = new ArrayList<>(); objects.add(res); if (cfgNames == null) { - cfgNames = new ArrayList<String>(cfgds.length); + cfgNames = new ArrayList<>(cfgds.length); for (int j = 0; j < cfgds.length; j++) { if (!canExclude(res, cfgds[j])) { cfgNames = null; @@ -179,7 +179,7 @@ public class ExcludeFromBuildAction implements IWorkbenchWindowPulldownDelegate2 status[i] = true; } } - ArrayList<String> lst = new ArrayList<String>(); + ArrayList<String> lst = new ArrayList<>(); for (int i = 0; i < status.length; i++) if (status[i]) lst.add(cfgNames.get(i)); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/FormatAllAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/FormatAllAction.java index 124850684c0..56105d1ddad 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/FormatAllAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/FormatAllAction.java @@ -146,7 +146,7 @@ public class FormatAllAction extends SelectionDispatchAction { } private ITranslationUnit[] getTranslationUnits(IStructuredSelection selection) { - HashSet<ICElement> result = new HashSet<ICElement>(); + HashSet<ICElement> result = new HashSet<>(); Object[] selected = selection.toArray(); for (int i = 0; i < selected.length; i++) { try { @@ -296,7 +296,7 @@ public class FormatAllAction extends SelectionDispatchAction { } private static Map<String, Object> getFomatterSettings(ICProject project) { - return new HashMap<String, Object>(project.getOptions(true)); + return new HashMap<>(project.getOptions(true)); } private void doFormat(IDocument document, Map<String, Object> options) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/GenerateActionGroup.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/GenerateActionGroup.java index b2d369aea9e..9039ada687d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/GenerateActionGroup.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/GenerateActionGroup.java @@ -114,7 +114,7 @@ public class GenerateActionGroup extends ActionGroup implements ISelectionChange private IWorkbenchSite fSite; private String fGroupName = IContextMenuConstants.GROUP_REORGANIZE; private List<ISelectionChangedListener> fRegisteredSelectionListeners; - private List<RefactoringAction> fRefactorActions = new ArrayList<RefactoringAction>(); + private List<RefactoringAction> fRefactorActions = new ArrayList<>(); private AddIncludeAction fAddInclude; // private OverrideMethodsAction fOverrideMethods; @@ -366,7 +366,7 @@ public class GenerateActionGroup extends ActionGroup implements ISelectionChange private void registerSelectionListener(ISelectionProvider provider, ISelectionChangedListener listener) { if (fRegisteredSelectionListeners == null) - fRegisteredSelectionListeners = new ArrayList<ISelectionChangedListener>(10); + fRegisteredSelectionListeners = new ArrayList<>(10); provider.addSelectionChangedListener(listener); fRegisteredSelectionListeners.add(listener); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/MemberFilterActionGroup.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/MemberFilterActionGroup.java index 17aecc4fe77..33b2b3e6e20 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/MemberFilterActionGroup.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/MemberFilterActionGroup.java @@ -184,7 +184,7 @@ public class MemberFilterActionGroup extends ActionGroup { fFilter = new MemberFilter(); String title, helpContext; - ArrayList<MemberFilterAction> actions = new ArrayList<MemberFilterAction>(4); + ArrayList<MemberFilterAction> actions = new ArrayList<>(4); // fields int filterProperty = FILTER_FIELDS; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractBinaryParserPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractBinaryParserPage.java index 9fc01e9cdf6..171de36b46c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractBinaryParserPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractBinaryParserPage.java @@ -70,7 +70,7 @@ public abstract class AbstractBinaryParserPage extends AbstractCOptionPage { } private void initializeParserPageMap() { - fParserPageMap = new HashMap<String, BinaryParserPageConfiguration>(5); + fParserPageMap = new HashMap<>(5); IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(CUIPlugin.PLUGIN_ID, "BinaryParserPage"); //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java index ce82e16113b..5ee47eba6ee 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java @@ -52,7 +52,7 @@ public abstract class AbstractErrorParserBlock extends AbstractCOptionPage { private static String[] EMPTY = new String[0]; private Preferences fPrefs; - protected HashMap<String, String> mapParsers = new HashMap<String, String>(); + protected HashMap<String, String> mapParsers = new HashMap<>(); private CheckedListDialogField<String> fErrorParserList; protected boolean listDirty = false; @@ -139,7 +139,7 @@ public abstract class AbstractErrorParserBlock extends AbstractCOptionPage { String[] empty = new String[0]; if (parserIDs != null && parserIDs.length() > 0) { StringTokenizer tok = new StringTokenizer(parserIDs, ";"); //$NON-NLS-1$ - List<String> list = new ArrayList<String>(tok.countTokens()); + List<String> list = new ArrayList<>(tok.countTokens()); while (tok.hasMoreElements()) { list.add(tok.nextToken()); } @@ -271,7 +271,7 @@ public abstract class AbstractErrorParserBlock extends AbstractCOptionPage { null, CUIMessages.AbstractErrorParserBlock_label_selectAll, CUIMessages.AbstractErrorParserBlock_label_unselectAll }; - fErrorParserList = new CheckedListDialogField<String>(null, buttonLabels, getLabelProvider()); + fErrorParserList = new CheckedListDialogField<>(null, buttonLabels, getLabelProvider()); fErrorParserList.setDialogFieldListener(getFieldListenerAdapter()); fErrorParserList.setLabelText(CUIMessages.AbstractErrorParserBlock_label_errorParsers); fErrorParserList.setUpButtonIndex(0); @@ -295,7 +295,7 @@ public abstract class AbstractErrorParserBlock extends AbstractCOptionPage { monitor.beginTask(CUIMessages.AbstractErrorParserBlock_task_setErrorParser, 1); List<String> elements = fErrorParserList.getElements(); int count = elements.size(); - List<Object> list = new ArrayList<Object>(count); + List<Object> list = new ArrayList<>(count); for (int i = 0; i < count; i++) { Object obj = elements.get(i); if (fErrorParserList.isChecked(obj)) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java index 0aeb9c93126..3df74d0573a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java @@ -162,7 +162,7 @@ public class BinaryParserBlock extends AbstractBinaryParserPage { CCorePlugin.BINARY_PARSER_SIMPLE_ID); if (point != null) { IExtension[] exts = point.getExtensions(); - configMap = new HashMap<String, BinaryParserConfiguration>(exts.length); + configMap = new HashMap<>(exts.length); for (IExtension ext : exts) { if (isExtensionVisible(ext)) { configMap.put(ext.getUniqueIdentifier(), new BinaryParserConfiguration(ext)); @@ -230,7 +230,7 @@ public class BinaryParserBlock extends AbstractBinaryParserPage { } monitor.beginTask(CUIMessages.BinaryParserBlock_settingBinaryParser, 2); List<BinaryParserConfiguration> parsers = binaryList.getElements(); - final List<BinaryParserConfiguration> selected = new ArrayList<BinaryParserConfiguration>(); // must do this to get proper order. + final List<BinaryParserConfiguration> selected = new ArrayList<>(); // must do this to get proper order. for (int i = 0; i < parsers.size(); i++) { if (binaryList.isChecked(parsers.get(i))) { selected.add(parsers.get(i)); @@ -286,13 +286,13 @@ public class BinaryParserBlock extends AbstractBinaryParserPage { public void setContainer(ICOptionContainer container) { super.setContainer(container); - List<BinaryParserConfiguration> elements = new ArrayList<BinaryParserConfiguration>(); + List<BinaryParserConfiguration> elements = new ArrayList<>(); if (getContainer().getProject() != null) { try { ICConfigExtensionReference[] ref = CCorePlugin.getDefault() .getDefaultBinaryParserExtensions(getContainer().getProject()); - initialSelected = new ArrayList<BinaryParserConfiguration>(ref.length); + initialSelected = new ArrayList<>(ref.length); for (ICConfigExtensionReference element : ref) { if (configMap.get(element.getID()) != null) { initialSelected.add(configMap.get(element.getID())); @@ -319,7 +319,7 @@ public class BinaryParserBlock extends AbstractBinaryParserPage { if (id != null && id.length() > 0) { String[] ids = parseStringToArray(id); - initialSelected = new ArrayList<BinaryParserConfiguration>(ids.length); + initialSelected = new ArrayList<>(ids.length); for (String id2 : ids) { if (configMap.get(id2) != null) { initialSelected.add(configMap.get(id2)); @@ -352,7 +352,7 @@ public class BinaryParserBlock extends AbstractBinaryParserPage { private String[] parseStringToArray(String syms) { if (syms != null && syms.length() > 0) { StringTokenizer tok = new StringTokenizer(syms, ";"); //$NON-NLS-1$ - ArrayList<String> list = new ArrayList<String>(tok.countTokens()); + ArrayList<String> list = new ArrayList<>(tok.countTokens()); while (tok.hasMoreElements()) { list.add(tok.nextToken()); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/CHelpConfigurationPropertyPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/CHelpConfigurationPropertyPage.java index bf71b40ba87..3451e6d51ec 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/CHelpConfigurationPropertyPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/CHelpConfigurationPropertyPage.java @@ -89,7 +89,7 @@ public class CHelpConfigurationPropertyPage extends PropertyPage implements IWor /* 0 */ CUIMessages.CHelpConfigurationPropertyPage_buttonLabels_CheckAll, /* 1 */ CUIMessages.CHelpConfigurationPropertyPage_buttonLabels_UncheckAll }; - fCHelpBookList = new CheckedListDialogField<CHelpBookDescriptor>(null, buttonLabels, + fCHelpBookList = new CheckedListDialogField<>(null, buttonLabels, new CHelpBookListLabelProvider()); fCHelpBookList.setLabelText(CUIMessages.CHelpConfigurationPropertyPage_HelpBooks); fCHelpBookList.setCheckAllButtonIndex(0); @@ -136,7 +136,7 @@ public class CHelpConfigurationPropertyPage extends PropertyPage implements IWor private List<CHelpBookDescriptor> getEnabledEntries(List<CHelpBookDescriptor> list) { int size = list.size(); - List<CHelpBookDescriptor> desList = new ArrayList<CHelpBookDescriptor>(); + List<CHelpBookDescriptor> desList = new ArrayList<>(); for (int i = 0; i < size; i++) { CHelpBookDescriptor el = list.get(i); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/DocCommentOwnerCombo.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/DocCommentOwnerCombo.java index 4c2422634c2..5ca135269fe 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/DocCommentOwnerCombo.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/DocCommentOwnerCombo.java @@ -53,7 +53,7 @@ public class DocCommentOwnerCombo extends Composite { * test plug-in. */ private static IDocCommentOwner[] getNontestOwners() { - List<IDocCommentOwner> result = new ArrayList<IDocCommentOwner>(); + List<IDocCommentOwner> result = new ArrayList<>(); for (IDocCommentOwner owner : DocCommentOwnerManager.getInstance().getRegisteredOwners()) { if (owner.getID().indexOf(".test.") == -1) //$NON-NLS-1$ result.add(owner); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/IndexerBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/IndexerBlock.java index 205e50c643e..dd7cf4c4bf3 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/IndexerBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/IndexerBlock.java @@ -508,7 +508,7 @@ public class IndexerBlock extends AbstractCOptionPage { * Adds all the contributed Indexer Pages to a map */ private void initializeIndexerConfigMap() { - fIndexerConfigMap = new HashMap<String, IndexerConfig>(5); + fIndexerConfigMap = new HashMap<>(5); IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(CUIPlugin.getPluginId(), "IndexerPage"); //$NON-NLS-1$ IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ReferenceBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ReferenceBlock.java index 6f4e7f27e8c..08275cb8469 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ReferenceBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ReferenceBlock.java @@ -80,7 +80,7 @@ public class ReferenceBlock extends AbstractCOptionPage { public Object[] getChildren(Object element) { if (!(element instanceof IWorkspace)) return new Object[0]; - ArrayList<IProject> aList = new ArrayList<IProject>(15); + ArrayList<IProject> aList = new ArrayList<>(15); final IProject[] projects = ((IWorkspace) element).getRoot().getProjects(); for (int i = 0; i < projects.length; i++) { if (CoreModel.hasCNature(projects[i])) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/RegexErrorParserOptionPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/RegexErrorParserOptionPage.java index 22e31359a26..d12833e3f14 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/RegexErrorParserOptionPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/RegexErrorParserOptionPage.java @@ -97,7 +97,7 @@ public final class RegexErrorParserOptionPage extends AbstractCOptionPage { private RegexErrorParser fErrorParser; private boolean fEditable; - private List<Listener> fListeners = new ArrayList<Listener>(); + private List<Listener> fListeners = new ArrayList<>(); /** * Provides generic implementation for overridden methods. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/TabFolderOptionBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/TabFolderOptionBlock.java index 7bd1059fc37..3f9d4e10a4d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/TabFolderOptionBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/TabFolderOptionBlock.java @@ -46,7 +46,7 @@ public abstract class TabFolderOptionBlock { private boolean bIsValid = true; private Label messageLabel; - private ArrayList<ICOptionPage> pages = new ArrayList<ICOptionPage>(); + private ArrayList<ICOptionPage> pages = new ArrayList<>(); protected ICOptionContainer fParent; private ICOptionPage fCurrentPage; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractExportTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractExportTab.java index 0cf3b39b36c..c8b09f4c3c3 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractExportTab.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractExportTab.java @@ -71,8 +71,8 @@ public abstract class AbstractExportTab extends AbstractCPropertyTab { public static final Image IMG_MK = CDTSharedImages.getImage(CDTSharedImages.IMG_OBJS_MACRO); private static final String ALL = Messages.AbstractExportTab_0; private static final String LIST = Messages.AbstractExportTab_1; - private static Map<String, String> names_l = new HashMap<String, String>(); - private static Map<String, String> names_t = new HashMap<String, String>(); + private static Map<String, String> names_l = new HashMap<>(); + private static Map<String, String> names_t = new HashMap<>(); private static String[] names_ls; private static String[] names_ts; private List<String> namesList; @@ -193,8 +193,8 @@ public abstract class AbstractExportTab extends AbstractCPropertyTab { if (x == -1) x = 0; - namesList = new ArrayList<String>(); - ArrayList<ExtData> lst = new ArrayList<ExtData>(); + namesList = new ArrayList<>(); + ArrayList<ExtData> lst = new ArrayList<>(); ICExternalSetting[] vals = cfg.getExternalSettings(); if (vals == null || vals.length == 0) { tv.setInput(null); @@ -309,7 +309,7 @@ public abstract class AbstractExportTab extends AbstractCPropertyTab { if (old.entry.isReadOnly() || old.entry.isBuiltIn()) continue; ICSettingEntry[] ls = old.setting.getEntries(getKind()); - ArrayList<ICSettingEntry> lst = new ArrayList<ICSettingEntry>(); + ArrayList<ICSettingEntry> lst = new ArrayList<>(); outer: for (ICSettingEntry se : ls) { for (int y = t; y < its.length; y++) { if (its[y] == null) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractLangsListTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractLangsListTab.java index 971b62c0df0..0624b22caad 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractLangsListTab.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractLangsListTab.java @@ -406,7 +406,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab { } protected LinkedList<ICLanguageSettingEntry> getIncs() { - LinkedList<ICLanguageSettingEntry> l = new LinkedList<ICLanguageSettingEntry>(); + LinkedList<ICLanguageSettingEntry> l = new LinkedList<>(); List<ICLanguageSettingEntry> lst = getSettingEntriesList(getKind()); if (lst != null) { for (ICLanguageSettingEntry ent : lst) { @@ -473,7 +473,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab { } private void updateExport() { - exported = new ArrayList<ICSettingEntry>(); + exported = new ArrayList<>(); ICExternalSetting[] extSettings = getResDesc().getConfiguration().getExternalSettings(); if (!(extSettings == null || extSettings.length == 0)) { for (ICExternalSetting extSetting : extSettings) { @@ -531,7 +531,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab { ICLanguageSetting[] langSettings = (ICLanguageSetting[]) ms.getItems(); ICLanguageSettingEntry[][] es = ms.getSettingEntriesM(getKind()); for (int i = 0; i < langSettings.length; i++) { - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(Arrays.asList(es[i])); + List<ICLanguageSettingEntry> entries = new ArrayList<>(Arrays.asList(es[i])); if (del != null) { for (ICLanguageSettingEntry entry : entries) { if (entry.getName().equals(del.getName())) { @@ -842,7 +842,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab { ICLanguageSetting[] fs = conv2LS(CDTPrefUtil.getListForDisplay(lsArray2D, comp)); lsets = new ICLanguageSetting[fs.length]; for (int i = 0; i < fs.length; i++) { - ArrayList<ICLanguageSetting> list = new ArrayList<ICLanguageSetting>(lsArray2D.length); + ArrayList<ICLanguageSetting> list = new ArrayList<>(lsArray2D.length); for (ICLanguageSetting[] lsArray : lsArray2D) { int x = Arrays.binarySearch(lsArray, fs[i], comp); if (x >= 0) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java index 56129b8b31e..4afc24e5cf0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java @@ -151,8 +151,8 @@ public abstract class AbstractPage extends PropertyPage implements IPreferencePa private static final String PREF_ASK_REINDEX = "askReindex"; //$NON-NLS-1$ - private Map<URL, Image> loadedIcons = new HashMap<URL, Image>(); - private static Map<Class<? extends AbstractPage>, Class<? extends ICPropertyTab>> recentTabs = new HashMap<Class<? extends AbstractPage>, Class<? extends ICPropertyTab>>(); + private Map<URL, Image> loadedIcons = new HashMap<>(); + private static Map<Class<? extends AbstractPage>, Class<? extends ICPropertyTab>> recentTabs = new HashMap<>(); private final Image IMG_WARN = CDTSharedImages.getImage(CDTSharedImages.IMG_OBJS_REFACTORING_WARNING); /* @@ -177,7 +177,7 @@ public abstract class AbstractPage extends PropertyPage implements IPreferencePa // tabs protected TabFolder folder; - protected ArrayList<InternalTab> itabs = new ArrayList<InternalTab>(); + protected ArrayList<InternalTab> itabs = new ArrayList<>(); protected ICPropertyTab currentTab; private static boolean isNewOpening = true; @@ -1124,7 +1124,7 @@ public abstract class AbstractPage extends PropertyPage implements IPreferencePa if (extensions == null) return; - List<IConfigurationElement> elements = new ArrayList<IConfigurationElement>(); + List<IConfigurationElement> elements = new ArrayList<>(); for (IExtension ext : extensions) elements.addAll(Arrays.asList(ext.getConfigurationElements())); Collections.sort(elements, CDTUIListComparator.getInstance()); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/BinaryParsTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/BinaryParsTab.java index 53c89f7c3c8..2aa6d8ebd2b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/BinaryParsTab.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/BinaryParsTab.java @@ -238,7 +238,7 @@ public class BinaryParsTab extends AbstractCPropertyTab { ids = CoreModelUtil.getBinaryParserIds(cfgs); } Object[] data = new Object[configMap.size()]; - HashMap<String, BinaryParserConfiguration> clone = new HashMap<String, BinaryParserConfiguration>(configMap); + HashMap<String, BinaryParserConfiguration> clone = new HashMap<>(configMap); // add checked elements int i; for (i = 0; i < ids.length; i++) { @@ -268,7 +268,7 @@ public class BinaryParsTab extends AbstractCPropertyTab { CCorePlugin.BINARY_PARSER_SIMPLE_ID); if (point != null) { IExtension[] exts = point.getExtensions(); - configMap = new HashMap<String, BinaryParserConfiguration>(exts.length); + configMap = new HashMap<>(exts.length); for (IExtension ext : exts) { if (isExtensionVisible(ext)) { configMap.put(ext.getUniqueIdentifier(), new BinaryParserConfiguration(ext)); @@ -278,7 +278,7 @@ public class BinaryParsTab extends AbstractCPropertyTab { } private void initializeParserPageMap() { - fParserPageMap = new HashMap<String, BinaryParserPageConfiguration>(5); + fParserPageMap = new HashMap<>(5); IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(CUIPlugin.PLUGIN_ID, "BinaryParserPage"); //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CDTPrefUtil.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CDTPrefUtil.java index 7e15cb2e43f..5a967bf4567 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CDTPrefUtil.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CDTPrefUtil.java @@ -110,7 +110,7 @@ public class CDTPrefUtil { // up-level methods public static void readPreferredTCs() { - preferredTCs = new LinkedList<String>(Arrays.asList(getStr(KEY_PREFTC).split(DELIMITER))); + preferredTCs = new LinkedList<>(Arrays.asList(getStr(KEY_PREFTC).split(DELIMITER))); } public static List<String> getPreferredTCs() { @@ -303,7 +303,7 @@ public class CDTPrefUtil { return EMPTY_ARRAY; if (getMultiCfgStringListDisplayMode() == DMODE_CONJUNCTION) { - ArrayList<Object> lst = new ArrayList<Object>(); + ArrayList<Object> lst = new ArrayList<>(); for (int i = 0; i < s1.length; i++) { if (s1[i] == null) continue; @@ -327,7 +327,7 @@ public class CDTPrefUtil { } return lst.toArray(); } - TreeSet<Object> lst = new TreeSet<Object>(cmp); // set, to avoid doubles + TreeSet<Object> lst = new TreeSet<>(cmp); // set, to avoid doubles for (Object[] element : input) { if (element == null || element.length == 0) { continue; @@ -346,7 +346,7 @@ public class CDTPrefUtil { */ @Deprecated public static List<String> readConfigSets() { - return new LinkedList<String>(Arrays.asList(getStr(KEY_CONFSET).split(CONFSETDEL))); + return new LinkedList<>(Arrays.asList(getStr(KEY_CONFSET).split(CONFSETDEL))); } /** diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CDTPropertyManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CDTPropertyManager.java index b900b0fb276..6894685ee8a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CDTPropertyManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CDTPropertyManager.java @@ -53,7 +53,7 @@ import org.eclipse.ui.dialogs.PropertyPage; */ public class CDTPropertyManager { - private static ArrayList<Object> pages = new ArrayList<Object>(); + private static ArrayList<Object> pages = new ArrayList<>(); private static ICProjectDescription prjd = null; private static boolean saveDone = false; private static IProject project = null; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CLocationTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CLocationTab.java index 7fd9b9e553c..79569eba077 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CLocationTab.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CLocationTab.java @@ -303,7 +303,7 @@ public abstract class CLocationTab extends AbstractCPropertyTab { setAllVisible(true, null); - src = new ArrayList<_Entry>(); + src = new ArrayList<>(); _Entry selectedSourcePath = null; for (ICExclusionPatternPathEntry e : getEntries(cfgd)) { _Entry entry = new _Entry(e); @@ -355,7 +355,7 @@ public abstract class CLocationTab extends AbstractCPropertyTab { } private String[] getProjectDialog(Shell shell) { - Set<IPath> set = new HashSet<IPath>(src.size()); + Set<IPath> set = new HashSet<>(src.size()); for (_Entry e : src) set.add(e.getPath()); @@ -531,7 +531,7 @@ public abstract class CLocationTab extends AbstractCPropertyTab { if (page.getElement() instanceof IFolder) { IFolder folder = (IFolder) page.getElement(); - List<Holder> list = new ArrayList<Holder>(); + List<Holder> list = new ArrayList<>(); list.add(new Holder(folder)); for (IContainer parentFolder = folder .getParent(); parentFolder instanceof IFolder; parentFolder = parentFolder.getParent()) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/EnvironmentTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/EnvironmentTab.java index fb22ddaf045..1884ab32b44 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/EnvironmentTab.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/EnvironmentTab.java @@ -74,7 +74,7 @@ public class EnvironmentTab extends AbstractCPropertyTab { private Table table; private TableViewer tv; - private ArrayList<TabData> data = new ArrayList<TabData>(); + private ArrayList<TabData> data = new ArrayList<>(); private Button b1, b2; private StringListModeControl stringListModeControl; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/ErrorParsTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/ErrorParsTab.java index af0bf848796..86c060992f0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/ErrorParsTab.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/ErrorParsTab.java @@ -99,8 +99,8 @@ public class ErrorParsTab extends AbstractCPropertyTab { private static Map<String, IErrorParserNamed> fExtensionErrorParsers = null; - private final Map<String, IErrorParserNamed> fAvailableErrorParsers = new LinkedHashMap<String, IErrorParserNamed>(); - private final Map<String, ICOptionPage> fOptionsPageMap = new HashMap<String, ICOptionPage>(); + private final Map<String, IErrorParserNamed> fAvailableErrorParsers = new LinkedHashMap<>(); + private final Map<String, ICOptionPage> fOptionsPageMap = new HashMap<>(); private ICOptionPage fCurrentOptionsPage = null; private Composite fCompositeForOptionsPage; @@ -235,7 +235,7 @@ public class ErrorParsTab extends AbstractCPropertyTab { private void initMapParsers() { if (fExtensionErrorParsers == null) { - fExtensionErrorParsers = new LinkedHashMap<String, IErrorParserNamed>(); + fExtensionErrorParsers = new LinkedHashMap<>(); String[] idsExt = ErrorParserManager.getErrorParserExtensionIds(); for (String idExt : idsExt) { IErrorParserNamed errorParserExt = ErrorParserManager.getErrorParserExtensionCopy(idExt); @@ -259,7 +259,7 @@ public class ErrorParsTab extends AbstractCPropertyTab { } else { ids = srcCfgDesc.getBuildSetting().getErrorParserIDs(); } - Set<String> setIds = new LinkedHashSet<String>(Arrays.asList(ids)); + Set<String> setIds = new LinkedHashSet<>(Arrays.asList(ids)); setIds.addAll(fAvailableErrorParsers.keySet()); fTableViewer.setInput(setIds.toArray(new String[0])); } else { @@ -551,7 +551,7 @@ public class ErrorParsTab extends AbstractCPropertyTab { if (fCfgDesc == null) { // Build Settings page try { - List<IErrorParserNamed> errorParsersList = new ArrayList<IErrorParserNamed>(fTable.getItemCount()); + List<IErrorParserNamed> errorParsersList = new ArrayList<>(fTable.getItemCount()); for (TableItem item : fTable.getItems()) { if (item.getData() instanceof String) { String id = (String) item.getData(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/ExPatternDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/ExPatternDialog.java index 95c91ea2779..d8f5aba476d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/ExPatternDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/ExPatternDialog.java @@ -88,7 +88,7 @@ public class ExPatternDialog extends StatusDialog { ExclusionPatternAdapter adapter = new ExclusionPatternAdapter(); - fExclusionPatternList = new ListDialogField<String>(adapter, buttonLabels, new ExPatternLabelProvider()); + fExclusionPatternList = new ListDialogField<>(adapter, buttonLabels, new ExPatternLabelProvider()); fExclusionPatternList.setDialogFieldListener(adapter); fExclusionPatternList.setLabelText(label); fExclusionPatternList.setRemoveButtonIndex(IDX_REMOVE); @@ -100,7 +100,7 @@ public class ExPatternDialog extends StatusDialog { fCurrSourceFolder = (IContainer) res; } - ArrayList<String> elements = new ArrayList<String>(pattern.length); + ArrayList<String> elements = new ArrayList<>(pattern.length); for (IPath p : pattern) elements.add(p.toString()); fExclusionPatternList.setElements(elements); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/ManageConfigSelector.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/ManageConfigSelector.java index bb74ad4ea89..fa50ec6c52c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/ManageConfigSelector.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/ManageConfigSelector.java @@ -78,7 +78,7 @@ public class ManageConfigSelector { * @return array with only new-style projects included */ public static IProject[] getProjects(Object[] obs) { - ArrayList<IProject> lst = new ArrayList<IProject>(); + ArrayList<IProject> lst = new ArrayList<>(); if (obs != null) { for (Object ob : obs) { IProject prj = null; @@ -121,7 +121,7 @@ public class ManageConfigSelector { if (extensions == null) return; - ArrayList<IConfigManager> list = new ArrayList<IConfigManager>(); + ArrayList<IConfigManager> list = new ArrayList<>(); for (int i = 0; i < extensions.length; ++i) { IConfigurationElement[] elements = extensions[i].getConfigurationElements(); for (int k = 0; k < elements.length; k++) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/RefsTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/RefsTab.java index 3bff85563e7..c2785f03f3c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/RefsTab.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/RefsTab.java @@ -158,7 +158,7 @@ public class RefsTab extends AbstractCPropertyTab { Map<String, String> oldMapping = getResDesc().getConfiguration().getReferenceInfo(); TreeItem ti = tree.getSelection()[0]; String projectName = ti.getText(); - List<String> projNames = new ArrayList<String>(oldMapping.keySet()); + List<String> projNames = new ArrayList<>(oldMapping.keySet()); int index = projNames.indexOf(projectName); if (n == MOVEUP_BUTTON) { if (index > 0) { @@ -171,7 +171,7 @@ public class RefsTab extends AbstractCPropertyTab { projNames.set(index + 1, projectName); } } - Map<String, String> newMapping = new LinkedHashMap<String, String>(oldMapping.size()); + Map<String, String> newMapping = new LinkedHashMap<>(oldMapping.size()); for (String name : projNames) newMapping.put(name, oldMapping.get(name)); getResDesc().getConfiguration().setReferenceInfo(newMapping); @@ -200,7 +200,7 @@ public class RefsTab extends AbstractCPropertyTab { * Persist the checked configurations */ private void saveChecked() { - Map<String, String> refs = new LinkedHashMap<String, String>(); + Map<String, String> refs = new LinkedHashMap<>(); for (TreeItem project : tree.getItems()) { if (project.getChecked()) { if (project.getData() instanceof String) { @@ -237,7 +237,7 @@ public class RefsTab extends AbstractCPropertyTab { private void initData() { // Persist the current select / expand state to restore... String currentSelection = tree.getSelectionCount() == 1 ? tree.getSelection()[0].getText() : null; - Set<String> currentExpanded = new HashSet<String>(); + Set<String> currentExpanded = new HashSet<>(); for (TreeItem ti : tree.getItems()) if (ti.getExpanded()) currentExpanded.add(ti.getText()); @@ -251,7 +251,7 @@ public class RefsTab extends AbstractCPropertyTab { Map<String, String> refs = getResDesc().getConfiguration().getReferenceInfo(); // Preserve project order. All linked to projects occur before others - Set<String> projects = new LinkedHashSet<String>(refs.keySet()); + Set<String> projects = new LinkedHashSet<>(refs.keySet()); for (IProject prj : p.getWorkspace().getRoot().getProjects()) projects.add(prj.getName()); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/StringListModeControl.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/StringListModeControl.java index a320348da8e..3ac3979fa07 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/StringListModeControl.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/StringListModeControl.java @@ -37,7 +37,7 @@ public class StringListModeControl { private static final String STRING_LIST_MODE_PREFERENCE_PAGE = "org.eclipse.cdt.managedbuilder.ui.preferences.PrefPage_MultiConfig"; //$NON-NLS-1$ private ICPropertyProvider page; private Link linkStringListMode; - private List<Listener> listeners = new ArrayList<Listener>(); + private List<Listener> listeners = new ArrayList<>(); /** * Constructor. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/refactoring/actions/CRefactoringActionGroup.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/refactoring/actions/CRefactoringActionGroup.java index 66149813d43..c68c0a5a6cf 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/refactoring/actions/CRefactoringActionGroup.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/refactoring/actions/CRefactoringActionGroup.java @@ -120,7 +120,7 @@ public class CRefactoringActionGroup extends ActionGroup implements ISelectionCh private RefactoringAction fToggleFunctionAction; private RefactoringAction fHideMethodAction; private IWorkbenchSite fSite; - private List<RefactoringAction> fAllActions = new ArrayList<RefactoringAction>(); + private List<RefactoringAction> fAllActions = new ArrayList<>(); public CRefactoringActionGroup(IWorkbenchPart part) { this(part, null); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/resources/RefreshExclusionContributionManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/resources/RefreshExclusionContributionManager.java index 90cc789b062..4d8c0015046 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/resources/RefreshExclusionContributionManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/resources/RefreshExclusionContributionManager.java @@ -50,7 +50,7 @@ public class RefreshExclusionContributionManager { private LinkedHashMap<String, RefreshExclusionContributor> fIDtoContributorsMap; private RefreshExclusionContributionManager() { - fIDtoContributorsMap = new LinkedHashMap<String, RefreshExclusionContributor>(); + fIDtoContributorsMap = new LinkedHashMap<>(); loadExtensions(); } @@ -63,7 +63,7 @@ public class RefreshExclusionContributionManager { } public List<RefreshExclusionContributor> getContributors(boolean returnTestContributors) { - List<RefreshExclusionContributor> retVal = new LinkedList<RefreshExclusionContributor>(); + List<RefreshExclusionContributor> retVal = new LinkedList<>(); if (!returnTestContributors) { for (RefreshExclusionContributor contributor : fIDtoContributorsMap.values()) { @@ -76,7 +76,7 @@ public class RefreshExclusionContributionManager { } else { - return new LinkedList<RefreshExclusionContributor>(fIDtoContributorsMap.values()); + return new LinkedList<>(fIDtoContributorsMap.values()); } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/AbstractCScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/AbstractCScanner.java index c72e22b2e63..bcd10fedd78 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/AbstractCScanner.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/AbstractCScanner.java @@ -46,7 +46,7 @@ public abstract class AbstractCScanner extends BufferedRuleBasedScanner implemen */ public AbstractCScanner(ITokenStore tokenStore) { fTokenStore = tokenStore; - fParticipants = new ArrayList<IPropertyChangeParticipant>(); + fParticipants = new ArrayList<>(); } /** diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/doctools/doxygen/DoxygenHelper.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/doctools/doxygen/DoxygenHelper.java index 8737f6ba99c..1826a6e2299 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/doctools/doxygen/DoxygenHelper.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/doctools/doxygen/DoxygenHelper.java @@ -61,7 +61,7 @@ public class DoxygenHelper extends AbstractPreferenceInitializer { if (fTags == null) { InputStream is = null; try { - List<GenericDocTag> temp = new ArrayList<GenericDocTag>(); + List<GenericDocTag> temp = new ArrayList<>(); is = FileLocator.openStream(CUIPlugin.getDefault().getBundle(), TAGS_CSV, false); BufferedReader br = new BufferedReader(new InputStreamReader(is)); StringBuilder content = new StringBuilder(2000); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/doctools/doxygen/DoxygenMultilineAutoEditStrategy.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/doctools/doxygen/DoxygenMultilineAutoEditStrategy.java index a8a7da71f0e..adb34568c6a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/doctools/doxygen/DoxygenMultilineAutoEditStrategy.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/doctools/doxygen/DoxygenMultilineAutoEditStrategy.java @@ -281,7 +281,7 @@ public class DoxygenMultilineAutoEditStrategy extends DefaultMultilineCommentAut } boolean noCollisions = true; - LinkedHashSet<Entry> entries = new LinkedHashSet<Entry>(); + LinkedHashSet<Entry> entries = new LinkedHashSet<>(); for (IASTEnumerator enumerator : enms) { IASTNodeLocation loc = enumerator.getName().getFileLocation(); if (loc != null) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/doctools/generic/GenericTagCommentScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/doctools/generic/GenericTagCommentScanner.java index 35e14a98362..ada55329c91 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/doctools/generic/GenericTagCommentScanner.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/doctools/generic/GenericTagCommentScanner.java @@ -81,7 +81,7 @@ public class GenericTagCommentScanner extends BufferedRuleBasedScanner implement * @return the rules to use in this scanner */ protected IRule[] createRules() { - List<IRule> result = new ArrayList<IRule>(); + List<IRule> result = new ArrayList<>(); class TagDetector implements IWordDetector { @Override diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/doctools/generic/GenericTagCompletionProposalComputer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/doctools/generic/GenericTagCompletionProposalComputer.java index ade04e42cc3..e5b9b502f09 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/doctools/generic/GenericTagCompletionProposalComputer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/doctools/generic/GenericTagCompletionProposalComputer.java @@ -73,7 +73,7 @@ public class GenericTagCompletionProposalComputer implements ICompletionProposal firstNonWS--; String prefix = doc.get(firstNonWS, ivcOffset - firstNonWS); if (prefix.length() > 0 && isTagMarker(prefix.charAt(0))) { - List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(); + List<ICompletionProposal> proposals = new ArrayList<>(); char tagMarker = prefix.charAt(0); for (GenericDocTag tag2 : tags) { String tag = tag2.getTagName(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java index d56120c4087..eccdec4095e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java @@ -400,7 +400,7 @@ public abstract class CDTCommonProjectWizard extends BasicNewResourceWizard String[] contentTypeIds = getContentTypeIDs(); if (contentTypeIds.length > 0) { IContentTypeManager manager = Platform.getContentTypeManager(); - List<String> languageIDs = new ArrayList<String>(); + List<String> languageIDs = new ArrayList<>(); for (int i = 0; i < contentTypeIds.length; ++i) { IContentType contentType = manager.getContentType(contentTypeIds[i]); if (null != contentType) { @@ -425,7 +425,7 @@ public abstract class CDTCommonProjectWizard extends BasicNewResourceWizard String[] contentTypeIds = getContentTypeIDs(); if (contentTypeIds.length > 0) { IContentTypeManager manager = Platform.getContentTypeManager(); - List<String> extensions = new ArrayList<String>(); + List<String> extensions = new ArrayList<>(); for (int i = 0; i < contentTypeIds.length; ++i) { IContentType contentType = manager.getContentType(contentTypeIds[i]); if (null != contentType) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTMainWizardPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTMainWizardPage.java index ea368304025..59a335cb7b2 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTMainWizardPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTMainWizardPage.java @@ -276,7 +276,7 @@ public class CDTMainWizardPage extends WizardNewProjectCreationPage implements I if (extensions == null) return null; - List<EntryDescriptor> items = new ArrayList<EntryDescriptor>(); + List<EntryDescriptor> items = new ArrayList<>(); for (int i = 0; i < extensions.length; ++i) { IConfigurationElement[] elements = extensions[i].getConfigurationElements(); for (IConfigurationElement element : elements) { @@ -310,7 +310,7 @@ public class CDTMainWizardPage extends WizardNewProjectCreationPage implements I // items filtering if (ls != null) { // NULL means call from prefs List<EntryDescriptor> filteredItems = ls.filterItems(items); - List<EntryDescriptor> newItems = new ArrayList<EntryDescriptor>(filteredItems); + List<EntryDescriptor> newItems = new ArrayList<>(filteredItems); // Add parent folders for (EntryDescriptor ed : filteredItems) { @@ -397,8 +397,8 @@ public class CDTMainWizardPage extends WizardNewProjectCreationPage implements I // Sorting is disabled because of users requests // Collections.sort(items, CDTListComparator.getInstance()); - ArrayList<TreeItem> placedTreeItemsList = new ArrayList<TreeItem>(items.size()); - ArrayList<EntryDescriptor> placedEntryDescriptorsList = new ArrayList<EntryDescriptor>(items.size()); + ArrayList<TreeItem> placedTreeItemsList = new ArrayList<>(items.size()); + ArrayList<EntryDescriptor> placedEntryDescriptorsList = new ArrayList<>(items.size()); for (EntryDescriptor wd : items) { if (wd.getParentId() == null) { wd.setPath(wd.getId()); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConvertProjectWizardPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConvertProjectWizardPage.java index ad968200931..7ec5f86869a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConvertProjectWizardPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConvertProjectWizardPage.java @@ -402,7 +402,7 @@ public abstract class ConvertProjectWizardPage extends WizardPage { IWorkspace workspace = CUIPlugin.getWorkspace(); IProject[] projects = workspace.getRoot().getProjects(); - Vector<IProject> candidates = new Vector<IProject>(projects.length); + Vector<IProject> candidates = new Vector<>(projects.length); IProject next = null; // ensure we only present open, valid candidates to the user diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/internal/templateengine/wizard/TemplateCNewWizard.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/internal/templateengine/wizard/TemplateCNewWizard.java index ce3ffc21394..e0ded3105d1 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/internal/templateengine/wizard/TemplateCNewWizard.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/internal/templateengine/wizard/TemplateCNewWizard.java @@ -34,7 +34,7 @@ public class TemplateCNewWizard extends CNewWizard { @Override public EntryDescriptor[] createItems(boolean supportedOnly, IWizard wizard) { Template[] templates = TemplateEngineUI.getDefault().getTemplates(); - ArrayList<EntryDescriptor> items = new ArrayList<EntryDescriptor>(); + ArrayList<EntryDescriptor> items = new ArrayList<>(); for (int k = 0; k < templates.length; k++) { TemplateInfo templateInfo = templates[k].getTemplateInfo(); diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/ProjectSelectionPage.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/ProjectSelectionPage.java index e754ed63a0a..8b0e896dfe6 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/ProjectSelectionPage.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/ProjectSelectionPage.java @@ -147,7 +147,7 @@ public class ProjectSelectionPage extends WizardPage implements IWizardDataPage } } - private Map<String, String> data = new HashMap<String, String>(2); + private Map<String, String> data = new HashMap<>(2); @Override public Map<String, String> getPageData() { diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/Template.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/Template.java index f287022e901..df2a0c5c842 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/Template.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/Template.java @@ -74,7 +74,7 @@ public class Template extends TemplateCore { */ public Map<String, UIWizardPage> getUIPages() { if (pageMap == null) { - pageMap = new HashMap<String, UIWizardPage>(); + pageMap = new HashMap<>(); List<Element> rootPropertyGrouplist = templateDescriptor.getPropertyGroupList(); uiPagesProvider.clearOrderVector(); @@ -94,7 +94,7 @@ public class Template extends TemplateCore { } public IWizardPage[] getTemplateWizardPages(IWizardPage predatingPage, IWizardPage followingPage, IWizard wizard) { - List<IWizardDataPage> pages = new ArrayList<IWizardDataPage>(); + List<IWizardDataPage> pages = new ArrayList<>(); // if (predatingPage != null) { // pages.add(predatingPage); // } diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/TemplateClassWizard.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/TemplateClassWizard.java index d17f212888d..01e3dc822ea 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/TemplateClassWizard.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/TemplateClassWizard.java @@ -81,7 +81,7 @@ public class TemplateClassWizard extends TemplatesChoiceWizard implements INewWi @Override public Template[] getTemplates() { - SortedSet<TemplateCore> templateList = new TreeSet<TemplateCore>( + SortedSet<TemplateCore> templateList = new TreeSet<>( TemplateCore.TEMPLATE_ID_CASE_INSENSITIVE_COMPARATOR); templateList.addAll(Arrays.asList(TemplateEngineUI.getDefault().getTemplates())); return templateList.toArray(new Template[templateList.size()]); diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/TemplateDrivenWizard.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/TemplateDrivenWizard.java index 6477c4e8ada..2008ed1d221 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/TemplateDrivenWizard.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/TemplateDrivenWizard.java @@ -38,8 +38,8 @@ import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation; * */ public abstract class TemplateDrivenWizard extends Wizard { - protected List<IWizardPage> pagesBeforeTemplatePages = new ArrayList<IWizardPage>(); - protected List<IWizardPage> pagesAfterTemplatePages = new ArrayList<IWizardPage>(); + protected List<IWizardPage> pagesBeforeTemplatePages = new ArrayList<>(); + protected List<IWizardPage> pagesAfterTemplatePages = new ArrayList<>(); protected Template template; protected int pageIndex; diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/TemplateEngineUI.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/TemplateEngineUI.java index 7f3c53dbee9..6b919fa3225 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/TemplateEngineUI.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/TemplateEngineUI.java @@ -45,7 +45,7 @@ public class TemplateEngineUI { public Template[] getTemplates(String projectType, String toolChain, String usageFilter) { TemplateInfo[] templateInfoArray = TemplateEngine.getDefault().getTemplateInfos(projectType, toolChain, usageFilter); - List<Template> templatesList = new ArrayList<Template>(); + List<Template> templatesList = new ArrayList<>(); for (int i = 0; i < templateInfoArray.length; i++) { TemplateInfo info = templateInfoArray[i]; try { @@ -70,7 +70,7 @@ public class TemplateEngineUI { */ public Template[] getTemplates() { TemplateInfo[] templateInfoArray = TemplateEngine.getDefault().getTemplateInfos(); - List<Template> templatesList = new ArrayList<Template>(); + List<Template> templatesList = new ArrayList<>(); for (int i = 0; i < templateInfoArray.length; i++) { try { templatesList.add(new Template(templateInfoArray[i])); diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/TemplatesChoiceWizard.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/TemplatesChoiceWizard.java index 8d61d888253..8271091e0da 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/TemplatesChoiceWizard.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/TemplatesChoiceWizard.java @@ -88,7 +88,7 @@ public abstract class TemplatesChoiceWizard extends Wizard implements ITemplates IPagesAfterTemplateSelectionProvider extraPagesProvider = (IPagesAfterTemplateSelectionProvider) templateInfo .getExtraPagesProvider(); if (extraPagesProvider != null) { - List<IWizardDataPage> pageList = new ArrayList<IWizardDataPage>(Arrays.asList(pages)); + List<IWizardDataPage> pageList = new ArrayList<>(Arrays.asList(pages)); IWizardDataPage[] extraPages = extraPagesProvider.createAdditionalPages(this, workbench, selection); pageList.addAll(Arrays.asList(extraPages)); pages = pageList.toArray(new IWizardDataPage[pageList.size()]); @@ -102,7 +102,7 @@ public abstract class TemplatesChoiceWizard extends Wizard implements ITemplates IPagesAfterTemplateSelectionProvider extraPagesProvider = (IPagesAfterTemplateSelectionProvider) templateInfo .getExtraPagesProvider(); if (extraPagesProvider != null) { - List<IWizardDataPage> pageList = new ArrayList<IWizardDataPage>(); + List<IWizardDataPage> pageList = new ArrayList<>(); IWizardDataPage[] extraPages = extraPagesProvider.getCreatedPages(this); pageList.addAll(Arrays.asList(extraPages)); return pageList.toArray(new IWizardDataPage[pageList.size()]); @@ -149,7 +149,7 @@ public abstract class TemplatesChoiceWizard extends Wizard implements ITemplates * @return Map, */ public Map<String, String> getAllDataInNonTemplatePages() { - Map<String, String> map = new HashMap<String, String>(); + Map<String, String> map = new HashMap<>(); IWizardDataPage[] pages = getPagesBeforeTemplatePages(); for (IWizardDataPage page : pages) { diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/NewProjectCreationPage.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/NewProjectCreationPage.java index 6fbe9ac4619..e2a280c6422 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/NewProjectCreationPage.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/NewProjectCreationPage.java @@ -37,7 +37,7 @@ public class NewProjectCreationPage extends WizardNewProjectCreationPage impleme public NewProjectCreationPage(String name) { super(name); - data = new HashMap<String, String>(); + data = new HashMap<>(); this.setDescription(Messages.getString("NewProjectCreationPage.3")); //$NON-NLS-1$ } diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/UIPagesProvider.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/UIPagesProvider.java index 80ebff276b8..511517fce85 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/UIPagesProvider.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/UIPagesProvider.java @@ -38,7 +38,7 @@ public class UIPagesProvider { private List<String> orderVector; public UIPagesProvider() { - orderVector = new ArrayList<String>(); + orderVector = new ArrayList<>(); } /** @@ -54,7 +54,7 @@ public class UIPagesProvider { * re-initialize the Vector. */ public void clearOrderVector() { - orderVector = new ArrayList<String>(); + orderVector = new ArrayList<>(); } /** @@ -79,7 +79,7 @@ public class UIPagesProvider { } // HashMap of UIPages - HashMap<String, UIWizardPage> pageMap = new HashMap<String, UIWizardPage>(); + HashMap<String, UIWizardPage> pageMap = new HashMap<>(); // If uiElement contains other group elements as children. if (hasChildUIGroupElement(uiElement)) { diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/UIWizardPage.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/UIWizardPage.java index bcef5c63752..002a819f1b0 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/UIWizardPage.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/UIWizardPage.java @@ -79,7 +79,7 @@ public class UIWizardPage extends UIPage implements IWizardDataPage, PatternEven public UIWizardPage(String title, String pageName, UIElement uiElement, Map<String, String> valueStore) { super(title, uiElement, valueStore); name = pageName; - validInvalid = new HashMap<Object, String>(); + validInvalid = new HashMap<>(); isPageComplete = uiElement.isValid(); } diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/GenericUIElementGroup.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/GenericUIElementGroup.java index c5cdfe85226..7f9df75c027 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/GenericUIElementGroup.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/GenericUIElementGroup.java @@ -60,7 +60,7 @@ public class GenericUIElementGroup extends UIElement { public GenericUIElementGroup(UIGroupTypeEnum type, UIAttributes attributes) { super(attributes); this.type = type; - this.childList = new ArrayList<UIElement>(); + this.childList = new ArrayList<>(); } /* @@ -80,7 +80,7 @@ public class GenericUIElementGroup extends UIElement { */ @Override public Map<String, String> getValues() { - HashMap<String, String> valueMap = new HashMap<String, String>(); + HashMap<String, String> valueMap = new HashMap<>(); int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIBooleanWidget.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIBooleanWidget.java index 3fda9a8f62a..47231a9afef 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIBooleanWidget.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIBooleanWidget.java @@ -65,7 +65,7 @@ public class UIBooleanWidget extends InputUIElement { */ @Override public Map<String, String> getValues() { - Map<String, String> values = new HashMap<String, String>(); + Map<String, String> values = new HashMap<>(); values.put(uiAttributes.get(UIElement.ID), Boolean.toString(booleanValue)); return values; } diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIComposite.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIComposite.java index e330034a315..3a7e3964337 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIComposite.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIComposite.java @@ -52,7 +52,7 @@ public class UIComposite extends Composite { public UIComposite(Composite parent, UIElement uiElement, Map<String, String> valueStore) { super(parent, SWT.NONE); - vector = new Vector<PatternEventListener>(); + vector = new Vector<>(); GridLayout layout = new GridLayout(2, false); layout.marginWidth = 10; layout.marginHeight = 5; diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UISelectWidget.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UISelectWidget.java index 79ccc792ac7..bbb9d35beaa 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UISelectWidget.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UISelectWidget.java @@ -71,7 +71,7 @@ public class UISelectWidget extends InputUIElement { */ @Override public Map<String, String> getValues() { - Map<String, String> values = new HashMap<String, String>(); + Map<String, String> values = new HashMap<>(); if (currentValue != null) { values.put(uiAttributes.get(UIElement.ID), currentValue); } diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIStringListWidget.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIStringListWidget.java index 4347b2f78d1..e2f6185f7a4 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIStringListWidget.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIStringListWidget.java @@ -61,7 +61,7 @@ public class UIStringListWidget extends InputUIElement { */ public UIStringListWidget(UIAttributes attribute) { super(attribute); - itemsList = new ArrayList<String>(); + itemsList = new ArrayList<>(); } /** @@ -69,7 +69,7 @@ public class UIStringListWidget extends InputUIElement { */ @Override public Map<String, String> getValues() { - Map<String, String> retMap = new HashMap<String, String>(); + Map<String, String> retMap = new HashMap<>(); String itemString = ""; //$NON-NLS-1$ for (int i = 0; i < itemsList.size(); i++) { itemString = itemString + itemsList.get(i) + "|"; //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UITextWidget.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UITextWidget.java index 1f6767c4aa9..ce86b1faed0 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UITextWidget.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UITextWidget.java @@ -81,7 +81,7 @@ public class UITextWidget extends InputUIElement implements ModifyListener { */ @Override public Map<String, String> getValues() { - Map<String, String> retMap = new HashMap<String, String>(); + Map<String, String> retMap = new HashMap<>(); retMap.put(uiAttributes.get(UIElement.ID), textValue); return retMap; diff --git a/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/FileListControl.java b/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/FileListControl.java index 84eeb5e162b..3e925ef48e7 100644 --- a/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/FileListControl.java +++ b/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/FileListControl.java @@ -546,7 +546,7 @@ public class FileListControl { IUndoContext undoContext; IOperationHistory operationHistory = OperationHistoryFactory.getOperationHistory(); - private java.util.List<IFileListChangeListener> listeners = new ArrayList<IFileListChangeListener>(); + private java.util.List<IFileListChangeListener> listeners = new ArrayList<>(); private String[] oldValue; //images diff --git a/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/RadioButtonsArea.java b/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/RadioButtonsArea.java index 3df894cd163..be86c8a1f91 100644 --- a/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/RadioButtonsArea.java +++ b/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/RadioButtonsArea.java @@ -60,7 +60,7 @@ public class RadioButtonsArea extends Composite { private SelectionListener listener; - private List<SelectionListener> externalListeners = new ArrayList<SelectionListener>(); + private List<SelectionListener> externalListeners = new ArrayList<>(); private Composite area = null; /** diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java index ea9e5f3ba87..086036bd4c9 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java @@ -195,7 +195,7 @@ public class CDIDebugModel { */ public static ICLineBreakpoint createLineBreakpoint(String sourceHandle, IResource resource, int type, int lineNumber, boolean enabled, int ignoreCount, String condition, boolean register) throws CoreException { - HashMap<String, Object> attributes = new HashMap<String, Object>(10); + HashMap<String, Object> attributes = new HashMap<>(10); setLineBreakpointAttributes(attributes, sourceHandle, type, lineNumber, enabled, ignoreCount, condition); return new CLineBreakpoint(resource, attributes, register); } @@ -219,7 +219,7 @@ public class CDIDebugModel { */ public static ICLineBreakpoint createLineTracepoint(String sourceHandle, IResource resource, int type, int lineNumber, boolean enabled, int ignoreCount, String condition, boolean register) throws CoreException { - HashMap<String, Object> attributes = new HashMap<String, Object>(10); + HashMap<String, Object> attributes = new HashMap<>(10); setLineBreakpointAttributes(attributes, sourceHandle, type, lineNumber, enabled, ignoreCount, condition); return new CLineTracepoint(resource, attributes, register); } @@ -244,7 +244,7 @@ public class CDIDebugModel { public static ICLineBreakpoint createLineDynamicPrintf(String sourceHandle, IResource resource, int type, int lineNumber, boolean enabled, int ignoreCount, String condition, String printfStr, boolean register) throws CoreException { - HashMap<String, Object> attributes = new HashMap<String, Object>(10); + HashMap<String, Object> attributes = new HashMap<>(10); setLineBreakpointAttributes(attributes, sourceHandle, type, lineNumber, enabled, ignoreCount, condition); attributes.put(ICDynamicPrintf.PRINTF_STRING, printfStr); return new CLineDynamicPrintf(resource, attributes, register); @@ -436,7 +436,7 @@ public class CDIDebugModel { public static ICAddressBreakpoint createAddressBreakpoint(String module, String sourceHandle, IResource resource, int type, int lineNumber, IAddress address, boolean enabled, int ignoreCount, String condition, boolean register) throws CoreException { - HashMap<String, Object> attributes = new HashMap<String, Object>(10); + HashMap<String, Object> attributes = new HashMap<>(10); setAddressBreakpointAttributes(attributes, module, sourceHandle, type, lineNumber, address, enabled, ignoreCount, condition); return new CAddressBreakpoint(resource, attributes, register); @@ -462,7 +462,7 @@ public class CDIDebugModel { public static ICAddressBreakpoint createAddressTracepoint(String module, String sourceHandle, IResource resource, int type, int lineNumber, IAddress address, boolean enabled, int ignoreCount, String condition, boolean register) throws CoreException { - HashMap<String, Object> attributes = new HashMap<String, Object>(10); + HashMap<String, Object> attributes = new HashMap<>(10); setAddressBreakpointAttributes(attributes, module, sourceHandle, type, lineNumber, address, enabled, ignoreCount, condition); return new CAddressTracepoint(resource, attributes, register); @@ -488,7 +488,7 @@ public class CDIDebugModel { public static ICAddressBreakpoint createAddressDynamicPrintf(String module, String sourceHandle, IResource resource, int type, int lineNumber, IAddress address, boolean enabled, int ignoreCount, String condition, String printfStr, boolean register) throws CoreException { - HashMap<String, Object> attributes = new HashMap<String, Object>(10); + HashMap<String, Object> attributes = new HashMap<>(10); setAddressBreakpointAttributes(attributes, module, sourceHandle, type, lineNumber, address, enabled, ignoreCount, condition); attributes.put(ICDynamicPrintf.PRINTF_STRING, printfStr); @@ -598,7 +598,7 @@ public class CDIDebugModel { public static ICWatchpoint createWatchpoint(String sourceHandle, IResource resource, boolean writeAccess, boolean readAccess, String expression, boolean enabled, int ignoreCount, String condition, boolean register) throws CoreException { - HashMap<String, Object> attributes = new HashMap<String, Object>(10); + HashMap<String, Object> attributes = new HashMap<>(10); setWatchPointAttributes(attributes, sourceHandle, resource, writeAccess, readAccess, expression, "", //$NON-NLS-1$ BigInteger.ZERO, enabled, ignoreCount, condition); return new CWatchpoint(resource, attributes, register); @@ -644,7 +644,7 @@ public class CDIDebugModel { public static ICWatchpoint createWatchpoint(String sourceHandle, IResource resource, int type, boolean writeAccess, boolean readAccess, String expression, boolean enabled, int ignoreCount, String condition, boolean register) throws CoreException { - HashMap<String, Object> attributes = new HashMap<String, Object>(10); + HashMap<String, Object> attributes = new HashMap<>(10); setWatchPointAttributes(attributes, sourceHandle, resource, type, writeAccess, readAccess, expression, "", //$NON-NLS-1$ BigInteger.ZERO, enabled, ignoreCount, condition); return new CWatchpoint(resource, attributes, register); @@ -703,7 +703,7 @@ public class CDIDebugModel { int lineNumber, boolean writeAccess, boolean readAccess, String expression, String memorySpace, BigInteger range, boolean enabled, int ignoreCount, String condition, boolean register) throws CoreException { - HashMap<String, Object> attributes = new HashMap<String, Object>(10); + HashMap<String, Object> attributes = new HashMap<>(10); setWatchPointAttributes(attributes, sourceHandle, resource, writeAccess, readAccess, expression, memorySpace, range, enabled, ignoreCount, condition); attributes.put(IMarker.CHAR_START, Integer.valueOf(charStart)); @@ -753,7 +753,7 @@ public class CDIDebugModel { public static ICWatchpoint createWatchpoint(String sourceHandle, IResource resource, boolean writeAccess, boolean readAccess, String expression, String memorySpace, BigInteger range, boolean enabled, int ignoreCount, String condition, boolean register) throws CoreException { - HashMap<String, Object> attributes = new HashMap<String, Object>(10); + HashMap<String, Object> attributes = new HashMap<>(10); setWatchPointAttributes(attributes, sourceHandle, resource, writeAccess, readAccess, expression, memorySpace, range, enabled, ignoreCount, condition); return new CWatchpoint(resource, attributes, register); @@ -943,7 +943,7 @@ public class CDIDebugModel { public static ICFunctionBreakpoint createFunctionBreakpoint(String sourceHandle, IResource resource, int type, String function, int charStart, int charEnd, int lineNumber, boolean enabled, int ignoreCount, String condition, boolean register) throws CoreException { - HashMap<String, Object> attributes = new HashMap<String, Object>(10); + HashMap<String, Object> attributes = new HashMap<>(10); setFunctionBreakpointAttributes(attributes, sourceHandle, type, function, charStart, charEnd, lineNumber, enabled, ignoreCount, condition); return new CFunctionBreakpoint(resource, attributes, register); @@ -1010,7 +1010,7 @@ public class CDIDebugModel { public static ICFunctionBreakpoint createFunctionTracepoint(String sourceHandle, IResource resource, int type, String function, int charStart, int charEnd, int lineNumber, boolean enabled, int ignoreCount, String condition, boolean register) throws CoreException { - HashMap<String, Object> attributes = new HashMap<String, Object>(10); + HashMap<String, Object> attributes = new HashMap<>(10); setFunctionBreakpointAttributes(attributes, sourceHandle, type, function, charStart, charEnd, lineNumber, enabled, ignoreCount, condition); return new CFunctionTracepoint(resource, attributes, register); @@ -1036,7 +1036,7 @@ public class CDIDebugModel { public static ICFunctionBreakpoint createFunctionDynamicPrintf(String sourceHandle, IResource resource, int type, String function, int charStart, int charEnd, int lineNumber, boolean enabled, int ignoreCount, String condition, String printfStr, boolean register) throws CoreException { - HashMap<String, Object> attributes = new HashMap<String, Object>(10); + HashMap<String, Object> attributes = new HashMap<>(10); setFunctionBreakpointAttributes(attributes, sourceHandle, type, function, charStart, charEnd, lineNumber, enabled, ignoreCount, condition); attributes.put(ICDynamicPrintf.PRINTF_STRING, printfStr); @@ -1292,7 +1292,7 @@ public class CDIDebugModel { public static ICEventBreakpoint createEventBreakpoint(String type, String arg, boolean register) throws CoreException { final IResource resource = ResourcesPlugin.getWorkspace().getRoot(); - final Map<String, Object> attributes = new HashMap<String, Object>(); + final Map<String, Object> attributes = new HashMap<>(); setEventBreakpointAttributes(attributes, type, arg); return new CEventBreakpoint(resource, attributes, register); diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java index a719b6ca825..1702cec334d 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java @@ -279,7 +279,7 @@ public class CDebugUtils { } public static List<IProject> getReferencedProjects(IProject project) { - ArrayList<IProject> list = new ArrayList<IProject>(10); + ArrayList<IProject> list = new ArrayList<>(10); if (project != null && project.exists() && project.isOpen()) { IProject[] refs = new IProject[0]; try { diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/breakpointactions/BreakpointActionManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/breakpointactions/BreakpointActionManager.java index bc5778d3dc9..1cef56047b6 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/breakpointactions/BreakpointActionManager.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/breakpointactions/BreakpointActionManager.java @@ -176,7 +176,7 @@ public class BreakpointActionManager { public ArrayList<IBreakpointAction> getBreakpointActions() { if (breakpointActions == null) { - breakpointActions = new ArrayList<IBreakpointAction>(); + breakpointActions = new ArrayList<>(); CDebugCorePlugin.getDefault().getBreakpointActionManager().loadActionData(); } return breakpointActions; diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/Executable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/Executable.java index fa76df42d0c..bb806fa6c99 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/Executable.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/Executable.java @@ -139,8 +139,8 @@ public class Executable extends PlatformObject { this.name = new File(path.toOSString()).getName(); this.resource = resource; this.remappers = sourceFileRemappings; - remappedPaths = new HashMap<ITranslationUnit, String>(); - sourceFiles = new ArrayList<ITranslationUnit>(); + remappedPaths = new HashMap<>(); + sourceFiles = new ArrayList<>(); refreshSourceFiles = true; remapSourceFiles = true; } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/ExecutablesManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/ExecutablesManager.java index 803eab9b2c4..6dd93561fcc 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/ExecutablesManager.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/ExecutablesManager.java @@ -78,7 +78,7 @@ import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant; public class ExecutablesManager extends PlatformObject implements ICProjectDescriptionListener, IElementChangedListener, IResourceChangeListener { - private Map<IProject, IProjectExecutablesProvider> executablesProviderMap = new HashMap<IProject, IProjectExecutablesProvider>(); + private Map<IProject, IProjectExecutablesProvider> executablesProviderMap = new HashMap<>(); private List<IExecutablesChangeListener> changeListeners = Collections .synchronizedList(new ArrayList<IExecutablesChangeListener>()); private List<IProjectExecutablesProvider> executableProviders; @@ -92,7 +92,7 @@ public class ExecutablesManager extends PlatformObject * notification. We use this to ensure we flush source file mappings only * when the launch config change involves a change to the source locators. */ - private Map<String, String> locatorMementos = new HashMap<String, String>(); + private Map<String, String> locatorMementos = new HashMap<>(); /** * A cache of the executables in the workspace, categorized by project. @@ -106,7 +106,7 @@ public class ExecutablesManager extends PlatformObject * <p> * The same Executable may appear more than once. */ - private Map<IProject, List<Executable>> executablesMap = new HashMap<IProject, List<Executable>>(); + private Map<IProject, List<Executable>> executablesMap = new HashMap<>(); /** * Provide a flat list of the executables in {@link #executablesMap}, with @@ -116,7 +116,7 @@ public class ExecutablesManager extends PlatformObject * @return */ private List<Executable> flattenExecutablesMap() { - List<Executable> result = new ArrayList<Executable>(executablesMap.size() * 5); // most projects will have less than five executables + List<Executable> result = new ArrayList<>(executablesMap.size() * 5); // most projects will have less than five executables synchronized (executablesMap) { for (List<Executable> exes : executablesMap.values()) { for (Executable exe : exes) { @@ -159,7 +159,7 @@ public class ExecutablesManager extends PlatformObject // Get the CDT projects in the workspace that we have no cached // results for (are not in 'executablesMap'). Also, we may have been // asked to refresh the cache for some projects we've search before - List<IProject> projects = new ArrayList<IProject>(); + List<IProject> projects = new ArrayList<>(); synchronized (executablesMap) { if (projectsToRefresh == null) { executablesMap.clear(); @@ -209,7 +209,7 @@ public class ExecutablesManager extends PlatformObject // executables list. If so, notify listeners. List<Executable> after = flattenExecutablesMap(); List<Executable> removed = before; - List<Executable> added = new ArrayList<Executable>(after.size()); + List<Executable> added = new ArrayList<>(after.size()); for (Executable a : after) { if (!removed.remove(a)) { added.add(a); @@ -486,7 +486,7 @@ public class ExecutablesManager extends PlatformObject * @return collection of executables which may be empty */ public Collection<Executable> getExecutablesForProject(IProject project) { - List<Executable> executables = new ArrayList<Executable>(); + List<Executable> executables = new ArrayList<>(); synchronized (executablesMap) { List<Executable> exes = executablesMap.get(project); @@ -931,9 +931,9 @@ public class ExecutablesManager extends PlatformObject Trace.getTrace().trace(null, "event = \n" + event); // must be done separately because of traceEntry() limitation //$NON-NLS-1$ // Examine the event and figure out what needs to be done - Set<IProject> refreshProjects = new HashSet<IProject>(5); - Set<Executable> executablesChanged = new HashSet<Executable>(5); - Set<Executable> executablesRemoved = new HashSet<Executable>(5); + Set<IProject> refreshProjects = new HashSet<>(5); + Set<Executable> executablesChanged = new HashSet<>(5); + Set<Executable> executablesRemoved = new HashSet<>(5); processDeltas(event.getDelta().getAddedChildren(), null, refreshProjects, executablesRemoved, executablesChanged); processDeltas(event.getDelta().getChangedChildren(), null, refreshProjects, executablesRemoved, diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/StandardExecutableProvider.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/StandardExecutableProvider.java index 19455417697..721e581173a 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/StandardExecutableProvider.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/StandardExecutableProvider.java @@ -43,7 +43,7 @@ import org.eclipse.debug.core.DebugPlugin; */ public class StandardExecutableProvider implements IProjectExecutablesProvider { - List<String> supportedNatureIds = new ArrayList<String>(); + List<String> supportedNatureIds = new ArrayList<>(); public StandardExecutableProvider() { supportedNatureIds.add(CProjectNature.C_NATURE_ID); @@ -57,7 +57,7 @@ public class StandardExecutableProvider implements IProjectExecutablesProvider { @Override public List<Executable> getExecutables(IProject project, IProgressMonitor monitor) { - List<Executable> executables = new ArrayList<Executable>(); + List<Executable> executables = new ArrayList<>(); ICProject cproject = CModelManager.getDefault().create(project); try { @@ -78,7 +78,7 @@ public class StandardExecutableProvider implements IProjectExecutablesProvider { if (projDesc != null) { ICConfigurationDescription cfg = projDesc.getActiveConfiguration(); if (cfg != null) { - binaries = new ArrayList<IBinary>(allBinaries.length); + binaries = new ArrayList<>(allBinaries.length); ICOutputEntry[] cfgOutDirs = cfg.getBuildSetting().getOutputDirectories(); for (IBinary allBinary : allBinaries) { for (ICOutputEntry outdir : cfgOutDirs) { @@ -108,7 +108,7 @@ public class StandardExecutableProvider implements IProjectExecutablesProvider { IPath exePath = binary.getResource().getLocation(); if (exePath == null) exePath = binary.getPath(); - List<ISourceFileRemapping> srcRemappers = new ArrayList<ISourceFileRemapping>(2); + List<ISourceFileRemapping> srcRemappers = new ArrayList<>(2); ISourceFileRemappingFactory[] factories = ExecutablesManager.getExecutablesManager() .getSourceFileRemappingFactories(); for (ISourceFileRemappingFactory factory : factories) { diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/CProjectSourceContainer.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/CProjectSourceContainer.java index a767873f698..eaf4feadf79 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/CProjectSourceContainer.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/CProjectSourceContainer.java @@ -118,7 +118,7 @@ public class CProjectSourceContainer extends CompositeSourceContainer { if (fProject == null) return EMPTY; - ArrayList<Object> sources = new ArrayList<Object>(); + ArrayList<Object> sources = new ArrayList<>(); // An IllegalArgumentException is thrown from the "getFile" method // if the path created by appending the file name to the container @@ -216,7 +216,7 @@ public class CProjectSourceContainer extends CompositeSourceContainer { if (isSearchReferencedProjects()) { IProject[] projects = SourceUtils.getAllReferencedProjects(fProject); ISourceContainer[] folders = createFolderSourceContainers(fProject); - List<ISourceContainer> containers = new ArrayList<ISourceContainer>(folders.length + projects.length); + List<ISourceContainer> containers = new ArrayList<>(folders.length + projects.length); for (ISourceContainer folder : folders) { containers.add(folder); } @@ -236,7 +236,7 @@ public class CProjectSourceContainer extends CompositeSourceContainer { private ISourceContainer[] createFolderSourceContainers(IProject project) throws CoreException { IResource[] resources = project.members(); - List<FolderSourceContainer> list = new ArrayList<FolderSourceContainer>(resources.length); + List<FolderSourceContainer> list = new ArrayList<>(resources.length); for (IResource resource : resources) { if (resource.getType() == IResource.FOLDER) { list.add(new FolderSourceContainer((IFolder) resource, true)); diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/MappingSourceContainer.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/MappingSourceContainer.java index 4970a011730..da66bfbc77b 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/MappingSourceContainer.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/MappingSourceContainer.java @@ -50,7 +50,7 @@ public class MappingSourceContainer extends AbstractSourceContainer implements I */ public MappingSourceContainer(String name) { fName = name; - fContainers = new ArrayList<MapEntrySourceContainer>(); + fContainers = new ArrayList<>(); } /* (non-Javadoc) @@ -90,7 +90,7 @@ public class MappingSourceContainer extends AbstractSourceContainer implements I CoreException single = null; MultiStatus multiStatus = null; if (isFindDuplicates()) { - results = new ArrayList<Object>(); + results = new ArrayList<>(); } for (int i = 0; i < containers.length; i++) { ISourceContainer container = containers[i]; diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/RegisterGroupsPersistance.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/RegisterGroupsPersistance.java index 95e68ea958d..2d2e32e78f8 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/RegisterGroupsPersistance.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/RegisterGroupsPersistance.java @@ -101,7 +101,7 @@ public class RegisterGroupsPersistance { Node node = DebugPlugin.parseDocument(fMemento); Element element = (Element) node; - List<IRegisterDescriptor> list = new ArrayList<IRegisterDescriptor>(); + List<IRegisterDescriptor> list = new ArrayList<>(); Node childNode = element.getFirstChild(); while (childNode != null) { if (childNode.getNodeType() == Node.ELEMENT_NODE) { @@ -167,7 +167,7 @@ public class RegisterGroupsPersistance { * whose container id matches given containerId */ public IRegisterGroupDescriptor[] parseGroups(String containerId) throws CoreException { - List<IRegisterGroupDescriptor> groups = new ArrayList<IRegisterGroupDescriptor>(); + List<IRegisterGroupDescriptor> groups = new ArrayList<>(); String memento; memento = fLaunchConfig.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_REGISTER_GROUPS, diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/StringSubstitutionEngine.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/StringSubstitutionEngine.java index c925fa2ee40..2a979e0651b 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/StringSubstitutionEngine.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/StringSubstitutionEngine.java @@ -87,7 +87,7 @@ public class StringSubstitutionEngine { public String performStringSubstitution(String expression, boolean reportUndefinedVariables, boolean resolveVariables, IStringVariableManager manager) throws CoreException { substitute(expression, reportUndefinedVariables, resolveVariables, manager); - List<HashSet<String>> resolvedVariableSets = new ArrayList<HashSet<String>>(); + List<HashSet<String>> resolvedVariableSets = new ArrayList<>(); while (fSubs) { HashSet<String> resolved = substitute(fResult.toString(), reportUndefinedVariables, true, manager); @@ -95,7 +95,7 @@ public class StringSubstitutionEngine { HashSet<String> prevSet = resolvedVariableSets.get(i); if (prevSet.equals(resolved)) { - HashSet<String> conflictingSet = new HashSet<String>(); + HashSet<String> conflictingSet = new HashSet<>(); for (HashSet<String> set : resolvedVariableSets) { conflictingSet.addAll(set); } @@ -146,10 +146,10 @@ public class StringSubstitutionEngine { private HashSet<String> substitute(String expression, boolean reportUndefinedVariables, boolean resolveVariables, IStringVariableManager manager) throws CoreException { fResult = new StringBuilder(expression.length()); - fStack = new Stack<VariableReference>(); + fStack = new Stack<>(); fSubs = false; - HashSet<String> resolvedVariables = new HashSet<String>(); + HashSet<String> resolvedVariables = new HashSet<>(); int pos = 0; int state = SCAN_FOR_START; diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/Trace.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/Trace.java index c0e63372f10..6626d88cf29 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/Trace.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/Trace.java @@ -127,7 +127,7 @@ public class Trace { if (bundle != null) { BundleContext context = bundle.getBundleContext(); if (context != null) { - ServiceTracker<DebugOptions, DebugOptions> tracker = new ServiceTracker<DebugOptions, DebugOptions>( + ServiceTracker<DebugOptions, DebugOptions> tracker = new ServiceTracker<>( context, DebugOptions.class.getName(), null); try { tracker.open(); diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java index ed3fcd902dc..1a1af9adb0e 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java @@ -59,7 +59,7 @@ public abstract class CBreakpoint extends Breakpoint * This map is sorted to allow consistent iteration order so that extension * message does not unexpectedly change order */ - private SortedMap<String, ICBreakpointExtension[]> fExtensions = new TreeMap<String, ICBreakpointExtension[]>(); + private SortedMap<String, ICBreakpointExtension[]> fExtensions = new TreeMap<>(); /** * The number of debug targets the breakpoint is installed in. We don't use @@ -303,7 +303,7 @@ public abstract class CBreakpoint extends Breakpoint IMarker marker = ensureMarker(); // Read the extension registry and create applicable extensions. - List<ICBreakpointExtension> extensions = new ArrayList<ICBreakpointExtension>(4); + List<ICBreakpointExtension> extensions = new ArrayList<>(4); IExtensionPoint ep = Platform.getExtensionRegistry().getExtensionPoint( CDebugCorePlugin.getUniqueIdentifier(), CDebugCorePlugin.BREAKPOINT_EXTENSION_EXTENSION_POINT_ID); diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/disassembly/DisassemblyContextService.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/disassembly/DisassemblyContextService.java index 2ffa1bde74a..b2942a82ae3 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/disassembly/DisassemblyContextService.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/disassembly/DisassemblyContextService.java @@ -27,7 +27,7 @@ public class DisassemblyContextService implements IDisassemblyContextService { private Set<Object> fContexts; public DisassemblyContextService() { - fContexts = new CopyOnWriteArraySet<Object>(); + fContexts = new CopyOnWriteArraySet<>(); fListeners = new ListenerList<>(); } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/executables/StandardExecutableImporter.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/executables/StandardExecutableImporter.java index 4e7452b38a8..5f6c36fd72d 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/executables/StandardExecutableImporter.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/executables/StandardExecutableImporter.java @@ -230,7 +230,7 @@ public class StandardExecutableImporter implements IExecutableImporter { CCorePlugin.BINARY_PARSER_SIMPLE_ID); if (point != null) { IExtension[] exts = point.getExtensions(); - ArrayList<IExtension> extensionsInUse = new ArrayList<IExtension>(); + ArrayList<IExtension> extensionsInUse = new ArrayList<>(); for (int i = 0; i < exts.length; i++) { if (isExtensionVisible(exts[i])) { extensionsInUse.add(exts[i]); diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CDirectorySourceLocation.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CDirectorySourceLocation.java index 8a7327a6087..ec41579706a 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CDirectorySourceLocation.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CDirectorySourceLocation.java @@ -161,7 +161,7 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation { return null; File[] folders = getFolders(); if (folders != null) { - LinkedList<Object> list = new LinkedList<Object>(); + LinkedList<Object> list = new LinkedList<>(); for (int i = 0; i < folders.length; ++i) { Object result = findFileByAbsolutePath(folders[i], name); if (result instanceof List) { @@ -202,7 +202,7 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation { // Try for a file in another workspace project IFile[] wsFiles = ResourceLookup.findFilesForLocation(filePath); - LinkedList<IFile> list = new LinkedList<IFile>(); + LinkedList<IFile> list = new LinkedList<>(); for (int j = 0; j < wsFiles.length; ++j) if (wsFiles[j].exists()) { if (!searchForDuplicateFiles()) @@ -223,7 +223,7 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation { private Object findFileByRelativePath(String fileName) { File[] folders = getFolders(); if (folders != null) { - LinkedList<Object> list = new LinkedList<Object>(); + LinkedList<Object> list = new LinkedList<>(); for (int i = 0; i < folders.length; ++i) { Object result = findFileByRelativePath(folders[i], fileName); if (result instanceof List) { @@ -253,7 +253,7 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation { if (file.exists() && file.isFile()) { path = new Path(file.getAbsolutePath()); IFile[] wsFiles = ResourceLookup.findFilesForLocation(path); - LinkedList<IFile> list = new LinkedList<IFile>(); + LinkedList<IFile> list = new LinkedList<>(); for (int j = 0; j < wsFiles.length; ++j) if (wsFiles[j].exists()) { if (!searchForDuplicateFiles()) @@ -430,7 +430,7 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation { private void initializeFolders() { if (getDirectory() != null) { - ArrayList<File> list = new ArrayList<File>(); + ArrayList<File> list = new ArrayList<>(); File root = getDirectory().toFile(); list.add(root); if (searchSubfolders()) @@ -440,7 +440,7 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation { } private List<File> getFileFolders(File file) { - ArrayList<File> list = new ArrayList<File>(); + ArrayList<File> list = new ArrayList<>(); File[] folders = file.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CProjectSourceLocation.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CProjectSourceLocation.java index 81d5b8d4d32..b312529bfd2 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CProjectSourceLocation.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CProjectSourceLocation.java @@ -62,8 +62,8 @@ public class CProjectSourceLocation implements IProjectSourceLocation { */ private IProject fProject; private IResource[] fFolders; - private HashMap<String, Object> fCache = new HashMap<String, Object>(20); - private HashSet<String> fNotFoundCache = new HashSet<String>(20); + private HashMap<String, Object> fCache = new HashMap<>(20); + private HashSet<String> fNotFoundCache = new HashSet<>(20); private boolean fGenerated = true; private boolean fSearchForDuplicateFiles = false; @@ -138,7 +138,7 @@ public class CProjectSourceLocation implements IProjectSourceLocation { } private Object findFileByAbsolutePath(File file) { - LinkedList<IFile> list = new LinkedList<IFile>(); + LinkedList<IFile> list = new LinkedList<>(); if (file.exists()) { IPath path = new Path(file.getAbsolutePath()); IFile[] wsFiles = ResourceLookup.findFilesForLocation(path); @@ -155,7 +155,7 @@ public class CProjectSourceLocation implements IProjectSourceLocation { private Object findFileByRelativePath(String fileName) { IResource[] folders = getFolders(); - LinkedList<IFile> list = new LinkedList<IFile>(); + LinkedList<IFile> list = new LinkedList<>(); for (int i = 0; i < folders.length; ++i) { if (list.size() > 0 && !searchForDuplicateFiles()) break; @@ -297,7 +297,7 @@ public class CProjectSourceLocation implements IProjectSourceLocation { } private void initializeFolders() { - final LinkedList<IResource> list = new LinkedList<IResource>(); + final LinkedList<IResource> list = new LinkedList<>(); if (getProject() != null && getProject().exists()) { list.add(getProject()); try { diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java index 0f5b7a5f4b4..c868386ea41 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java @@ -84,7 +84,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato /** * The array of projects referenced by main project. */ - private List<IProject> fReferencedProjects = new ArrayList<IProject>(10); + private List<IProject> fReferencedProjects = new ArrayList<>(10); /** * The flag specifies whether to search for all source elements, or just the first match. @@ -123,7 +123,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato protected Object getInput(IStackFrame f) { if (f instanceof ICStackFrame) { ICStackFrame frame = (ICStackFrame) f; - LinkedList<Object> list = new LinkedList<Object>(); + LinkedList<Object> list = new LinkedList<>(); Object result = null; String fileName = frame.getFile(); if (fileName != null && fileName.length() > 0) { @@ -207,7 +207,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato * @exception CoreException */ public static ICSourceLocation[] getDefaultSourceLocations(IProject project) { - ArrayList<IProjectSourceLocation> list = new ArrayList<IProjectSourceLocation>(); + ArrayList<IProjectSourceLocation> list = new ArrayList<>(); if (project != null && project.exists()) { list.add(SourceLookupFactory.createProjectSourceLocation(project)); addReferencedSourceLocations(list, project); @@ -321,7 +321,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato if (!root.getNodeName().equalsIgnoreCase(SOURCE_LOCATOR_NAME)) { abort(InternalSourceLookupMessages.CSourceLocator_1, null); } - List<ICSourceLocation> sourceLocations = new ArrayList<ICSourceLocation>(); + List<ICSourceLocation> sourceLocations = new ArrayList<>(); // Add locations based on referenced projects IProject project = getProject(); if (project != null && project.exists() && project.isOpen()) @@ -346,7 +346,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato private void removeDisabledLocations(Element root, List<ICSourceLocation> sourceLocations) { NodeList list = root.getChildNodes(); int length = list.getLength(); - HashSet<String> disabledProjects = new HashSet<String>(length); + HashSet<String> disabledProjects = new HashSet<>(length); for (int i = 0; i < length; ++i) { Node node = list.item(i); short type = node.getNodeType(); @@ -483,7 +483,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato if (event.getSource() instanceof IWorkspace && event.getDelta() != null) { IResourceDelta[] deltas = event.getDelta().getAffectedChildren(); if (deltas != null) { - ArrayList<IResource> list = new ArrayList<IResource>(deltas.length); + ArrayList<IResource> list = new ArrayList<>(deltas.length); for (int i = 0; i < deltas.length; ++i) if (deltas[i].getResource() instanceof IProject) list.add(deltas[i].getResource()); @@ -496,7 +496,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato IProject project = getProject(); if (project != null && project.exists() && project.isOpen()) { List<IProject> list = CDebugUtils.getReferencedProjects(project); - HashSet<String> names = new HashSet<String>(list.size() + 1); + HashSet<String> names = new HashSet<>(list.size() + 1); names.add(project.getName()); for (IProject proj : list) { names.add(proj.getName()); @@ -560,7 +560,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato } protected ICSourceLocation[] getDefaultSourceLocations() { - ArrayList<IProjectSourceLocation> list = new ArrayList<IProjectSourceLocation>(fReferencedProjects.size()); + ArrayList<IProjectSourceLocation> list = new ArrayList<>(fReferencedProjects.size()); if (getProject() != null && getProject().exists() && getProject().isOpen()) list.add(SourceLookupFactory.createProjectSourceLocation(getProject())); for (IProject project : fReferencedProjects) { @@ -583,7 +583,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato private void removeGenericSourceLocations() { fReferencedProjects.clear(); ICSourceLocation[] locations = getSourceLocations(); - ArrayList<ICSourceLocation> newLocations = new ArrayList<ICSourceLocation>(locations.length); + ArrayList<ICSourceLocation> newLocations = new ArrayList<>(locations.length); for (int i = 0; i < locations.length; ++i) { if (!(locations[i] instanceof IProjectSourceLocation) || !((IProjectSourceLocation) locations[i]).isGeneric()) @@ -595,7 +595,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato private void updateGenericSourceLocations(List<IResource> affectedProjects) { List<IProject> newRefs = CDebugUtils.getReferencedProjects(getProject()); ICSourceLocation[] locations = getSourceLocations(); - ArrayList<ICSourceLocation> newLocations = new ArrayList<ICSourceLocation>(locations.length); + ArrayList<ICSourceLocation> newLocations = new ArrayList<>(locations.length); for (int i = 0; i < locations.length; ++i) { if (!(locations[i] instanceof IProjectSourceLocation) || !((IProjectSourceLocation) locations[i]).isGeneric()) { diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLookupDirector.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLookupDirector.java index dfe42e48254..e44005a3b77 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLookupDirector.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLookupDirector.java @@ -91,7 +91,7 @@ public class CSourceLookupDirector extends AbstractSourceLookupDirector { private void readSupportedContainerTypes() { synchronized (fSupportedTypesLock) { if (fSupportedTypes == null) { - fSupportedTypes = new HashSet<String>(); + fSupportedTypes = new HashSet<>(); String name = CDebugCorePlugin.PLUGIN_ID + ".supportedSourceContainerTypes"; //$NON-NLS-1$; IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(name); if (extensionPoint != null) { diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/MapEntrySourceContainer.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/MapEntrySourceContainer.java index 3a73fbf0983..1fa73a87f51 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/MapEntrySourceContainer.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/MapEntrySourceContainer.java @@ -154,7 +154,7 @@ public class MapEntrySourceContainer extends AbstractSourceContainer { if (path != null) { IFile[] wsFiles = ResourceLookup.findFilesForLocation(path); - ArrayList<IFile> list = new ArrayList<IFile>(); + ArrayList<IFile> list = new ArrayList<>(); for (int j = 0; j < wsFiles.length; ++j) { if (wsFiles[j].exists()) { list.add(wsFiles[j]); diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/MappingSourceContainerType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/MappingSourceContainerType.java index ecb102accb6..a818b01cd8f 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/MappingSourceContainerType.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/MappingSourceContainerType.java @@ -52,7 +52,7 @@ public class MappingSourceContainerType extends AbstractSourceContainerTypeDeleg // When upgrading source locator (See Bug 472765), // do not enable backend path substitution boolean enabled = Boolean.parseBoolean(backendEnabled); - List<MapEntrySourceContainer> entries = new ArrayList<MapEntrySourceContainer>(); + List<MapEntrySourceContainer> entries = new ArrayList<>(); Node childNode = element.getFirstChild(); while (childNode != null) { if (childNode.getNodeType() == Node.ELEMENT_NODE) { diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/SourceFoldersRelativePathSourceContainer.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/SourceFoldersRelativePathSourceContainer.java index 1e83b69506c..4abe4b12a65 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/SourceFoldersRelativePathSourceContainer.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/SourceFoldersRelativePathSourceContainer.java @@ -149,7 +149,7 @@ public class SourceFoldersRelativePathSourceContainer extends CompositeSourceCon if (isSearchReferencedProjects()) { IProject[] projects = SourceUtils.getAllReferencedProjects(fProject); ISourceContainer[] folders = createCompilationDirectoryContainers(fProject); - List<ISourceContainer> containers = new ArrayList<ISourceContainer>(folders.length + projects.length); + List<ISourceContainer> containers = new ArrayList<>(folders.length + projects.length); for (ISourceContainer folder : folders) { containers.add(folder); } @@ -171,7 +171,7 @@ public class SourceFoldersRelativePathSourceContainer extends CompositeSourceCon private ISourceContainer[] createCompilationDirectoryContainers(IProject project) throws CoreException { ICProject cProject = CModelManager.getDefault().create(project); ISourceRoot[] roots = cProject.getAllSourceRoots(); - List<ISourceContainer> list = new ArrayList<ISourceContainer>(roots.length); + List<ISourceContainer> list = new ArrayList<>(roots.length); for (ISourceRoot root : roots) { IContainer folder = root.getResource(); ISourceContainer container = new CompilationDirectorySourceContainer(folder.getLocation(), false); diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/SourceUtils.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/SourceUtils.java index b8b81e632c9..83690389960 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/SourceUtils.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/SourceUtils.java @@ -130,7 +130,7 @@ public class SourceUtils { } public static ICSourceLocation[] initializeSourceLocations(Element root) { - List<ICSourceLocation> sourceLocations = new LinkedList<ICSourceLocation>(); + List<ICSourceLocation> sourceLocations = new LinkedList<>(); NodeList list = root.getChildNodes(); int length = list.getLength(); for (int i = 0; i < length; ++i) { @@ -181,7 +181,7 @@ public class SourceUtils { } static public ISourceContainer[] convertSourceLocations(ICSourceLocation[] locations) { - ArrayList<ISourceContainer> containers = new ArrayList<ISourceContainer>(locations.length); + ArrayList<ISourceContainer> containers = new ArrayList<>(locations.length); int mappingCount = 0; for (ICSourceLocation location : locations) { if (location instanceof IProjectSourceLocation) { @@ -220,7 +220,7 @@ public class SourceUtils { } public static IProject[] getAllReferencedProjects(IProject project) throws CoreException { - Set<IProject> all = new HashSet<IProject>(); + Set<IProject> all = new HashSet<>(); getAllReferencedProjects(all, project); return all.toArray(new IProject[all.size()]); } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImageDescriptorRegistry.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImageDescriptorRegistry.java index 566e5da6037..793554198f4 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImageDescriptorRegistry.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImageDescriptorRegistry.java @@ -25,7 +25,7 @@ import org.eclipse.swt.widgets.Display; * A registry that maps <code>ImageDescriptors</code> to <code>Image</code>. */ public class CDebugImageDescriptorRegistry { - private HashMap<ImageDescriptor, Image> fRegistry = new HashMap<ImageDescriptor, Image>(10); + private HashMap<ImageDescriptor, Image> fRegistry = new HashMap<>(10); private Display fDisplay; /** diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java index 3c59d2ec333..5777b4fa77e 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java @@ -108,7 +108,7 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode private static final String DUMMY_STACKFRAME_LABEL = "..."; //$NON-NLS-1$ - protected HashMap<String, Object> fAttributes = new HashMap<String, Object>(3); + protected HashMap<String, Object> fAttributes = new HashMap<>(3); protected CDebugImageDescriptorRegistry fDebugImageRegistry = CDebugUIPlugin.getImageDescriptorRegistry(); diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ColorManager.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ColorManager.java index 0ff06bddf52..05a98f734f8 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ColorManager.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ColorManager.java @@ -39,7 +39,7 @@ public class ColorManager { return gfColorManager; } - protected Map<RGB, Color> fColorTable = new HashMap<RGB, Color>(10); + protected Map<RGB, Color> fColorTable = new HashMap<>(10); public Color getColor(RGB rgb) { Color color = fColorTable.get(rgb); diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/OverlayImageCache.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/OverlayImageCache.java index 1f1ccf3c457..7bb1f2bfb39 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/OverlayImageCache.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/OverlayImageCache.java @@ -24,7 +24,7 @@ import org.eclipse.swt.graphics.Image; * @since May 30, 2003 */ public class OverlayImageCache { - private Map<OverlayImageDescriptor, Image> fCache = new HashMap<OverlayImageDescriptor, Image>(); + private Map<OverlayImageDescriptor, Image> fCache = new HashMap<>(); /** * Returns and caches an image corresponding to the specified image diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToArrayActionHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToArrayActionHandler.java index 513ea86bc58..22808ca2eb7 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToArrayActionHandler.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToArrayActionHandler.java @@ -282,7 +282,7 @@ public class CastToArrayActionHandler extends AbstractHandler { } private ICastToArray[] getCastToArray(Object evaluationContext) { - List<ICastToArray> castableItems = new ArrayList<ICastToArray>(); + List<ICastToArray> castableItems = new ArrayList<>(); if (evaluationContext instanceof IEvaluationContext) { Object s = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_MENU_SELECTION_NAME); if (s instanceof IStructuredSelection) { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToTypeActionHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToTypeActionHandler.java index 58d73a9f46a..5e2a531e08f 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToTypeActionHandler.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToTypeActionHandler.java @@ -131,7 +131,7 @@ public class CastToTypeActionHandler extends AbstractHandler { } private ICastToType[] getCastToType(Object evaluationContext) { - List<ICastToType> castableItems = new ArrayList<ICastToType>(); + List<ICastToType> castableItems = new ArrayList<>(); if (evaluationContext instanceof IEvaluationContext) { Object s = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_MENU_SELECTION_NAME); if (s instanceof IStructuredSelection) { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/PinDebugContextActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/PinDebugContextActionDelegate.java index 2e8f6c72d61..8aa03763f3d 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/PinDebugContextActionDelegate.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/PinDebugContextActionDelegate.java @@ -209,7 +209,7 @@ public class PinDebugContextActionDelegate implements IViewActionDelegate, IActi String description = ""; //$NON-NLS-1$ if (provider != null) { - Set<String> labels = new HashSet<String>(); + Set<String> labels = new HashSet<>(); for (IPinElementHandle handle : provider.getPinHandles()) { String tmp = getLabel(handle); if (tmp != null && tmp.trim().length() != 0) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestoreDefaultTypeActionHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestoreDefaultTypeActionHandler.java index bd8d30be00d..782d0566a7f 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestoreDefaultTypeActionHandler.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestoreDefaultTypeActionHandler.java @@ -87,7 +87,7 @@ public class RestoreDefaultTypeActionHandler extends AbstractHandler { } private ICastToType[] getCastToType(Object evaluationContext) { - List<ICastToType> castableItems = new ArrayList<ICastToType>(); + List<ICastToType> castableItems = new ArrayList<>(); if (evaluationContext instanceof IEvaluationContext) { Object s = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_MENU_SELECTION_NAME); if (s instanceof IStructuredSelection) { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleBreakpointAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleBreakpointAdapter.java index 69d37bfd66f..0b56ebd3de7 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleBreakpointAdapter.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleBreakpointAdapter.java @@ -49,7 +49,7 @@ public class ToggleBreakpointAdapter extends AbstractToggleBreakpointAdapter { IResource resource, int lineNumber) throws CoreException { if (interactive) { ICLineBreakpoint lineBp = CDIDebugModel.createBlankLineBreakpoint(); - Map<String, Object> attributes = new HashMap<String, Object>(); + Map<String, Object> attributes = new HashMap<>(); CDIDebugModel.setLineBreakpointAttributes(attributes, sourceHandle, getBreakpointType(), lineNumber, true, 0, ""); //$NON-NLS-1$ openBreakpointPropertiesDialog(lineBp, part, resource, attributes); @@ -70,7 +70,7 @@ public class ToggleBreakpointAdapter extends AbstractToggleBreakpointAdapter { IResource resource, String functionName, int charStart, int charEnd, int lineNumber) throws CoreException { if (interactive) { ICFunctionBreakpoint bp = CDIDebugModel.createBlankFunctionBreakpoint(); - Map<String, Object> attributes = new HashMap<String, Object>(); + Map<String, Object> attributes = new HashMap<>(); CDIDebugModel.setFunctionBreakpointAttributes(attributes, sourceHandle, getBreakpointType(), functionName, charStart, charEnd, lineNumber, true, 0, ""); //$NON-NLS-1$ openBreakpointPropertiesDialog(bp, part, resource, attributes); @@ -91,7 +91,7 @@ public class ToggleBreakpointAdapter extends AbstractToggleBreakpointAdapter { int charStart, int charEnd, int lineNumber, String expression, String memorySpace, String range) throws CoreException { ICWatchpoint bp = CDIDebugModel.createBlankWatchpoint(); - Map<String, Object> attributes = new HashMap<String, Object>(); + Map<String, Object> attributes = new HashMap<>(); CDIDebugModel.setWatchPointAttributes(attributes, sourceHandle, resource, true, false, expression, memorySpace, new BigInteger(range), true, 0, ""); //$NON-NLS-1$ openBreakpointPropertiesDialog(bp, part, resource, attributes); @@ -101,7 +101,7 @@ public class ToggleBreakpointAdapter extends AbstractToggleBreakpointAdapter { protected void createEventBreakpoint(boolean interactive, IWorkbenchPart part, IResource resource, String type, String arg) throws CoreException { ICEventBreakpoint bp = CDIDebugModel.createBlankEventBreakpoint(); - Map<String, Object> attributes = new HashMap<String, Object>(); + Map<String, Object> attributes = new HashMap<>(); CDIDebugModel.setEventBreakpointAttributes(attributes, type, arg); openBreakpointPropertiesDialog(bp, part, resource, attributes); } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleCBreakpointsTargetFactory.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleCBreakpointsTargetFactory.java index 60031da3b28..532cd900b06 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleCBreakpointsTargetFactory.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleCBreakpointsTargetFactory.java @@ -39,7 +39,7 @@ public class ToggleCBreakpointsTargetFactory implements IToggleBreakpointsTarget public static String TOGGLE_C_BREAKPOINT_TARGET_ID = CDebugUIPlugin.getUniqueIdentifier() + ".toggleCBreakpointTarget"; //$NON-NLS-1$ - private static Set<String> TOGGLE_TARGET_IDS = new HashSet<String>(1); + private static Set<String> TOGGLE_TARGET_IDS = new HashSet<>(1); static { TOGGLE_TARGET_IDS.add(TOGGLE_C_BREAKPOINT_TARGET_ID); } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleCDynamicPrintfTargetFactory.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleCDynamicPrintfTargetFactory.java index a16c6ea334d..1c58844ba23 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleCDynamicPrintfTargetFactory.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleCDynamicPrintfTargetFactory.java @@ -33,7 +33,7 @@ public class ToggleCDynamicPrintfTargetFactory implements IToggleBreakpointsTarg public static String TOGGLE_C_DYNAMICPRINTF_TARGET_ID = CDebugUIPlugin.getUniqueIdentifier() + ".toggleCDynamicPrintfTarget"; //$NON-NLS-1$ - private static Set<String> TOGGLE_TARGET_IDS = new HashSet<String>(1); + private static Set<String> TOGGLE_TARGET_IDS = new HashSet<>(1); static { TOGGLE_TARGET_IDS.add(TOGGLE_C_DYNAMICPRINTF_TARGET_ID); } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleCTracepointsTargetFactory.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleCTracepointsTargetFactory.java index 23a99cf5d2c..5dc9b29a32f 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleCTracepointsTargetFactory.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleCTracepointsTargetFactory.java @@ -34,7 +34,7 @@ public class ToggleCTracepointsTargetFactory implements IToggleBreakpointsTarget public static String TOGGLE_C_TRACEPOINT_TARGET_ID = CDebugUIPlugin.getUniqueIdentifier() + ".toggleCTracepointTarget"; //$NON-NLS-1$ - private static Set<String> TOGGLE_TARGET_IDS = new HashSet<String>(1); + private static Set<String> TOGGLE_TARGET_IDS = new HashSet<>(1); static { TOGGLE_TARGET_IDS.add(TOGGLE_C_TRACEPOINT_TARGET_ID); } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleDynamicPrintfAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleDynamicPrintfAdapter.java index 5e330dc74ce..091d41b57d5 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleDynamicPrintfAdapter.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleDynamicPrintfAdapter.java @@ -48,7 +48,7 @@ public class ToggleDynamicPrintfAdapter extends AbstractToggleBreakpointAdapter IResource resource, int lineNumber) throws CoreException { if (interactive) { ICDynamicPrintf dprintf = (ICDynamicPrintf) CDIDebugModel.createBlankLineDynamicPrintf(); - Map<String, Object> attributes = new HashMap<String, Object>(); + Map<String, Object> attributes = new HashMap<>(); CDIDebugModel.setLineBreakpointAttributes(attributes, sourceHandle, getBreakpointType(), lineNumber, true, 0, ""); //$NON-NLS-1$ @@ -79,7 +79,7 @@ public class ToggleDynamicPrintfAdapter extends AbstractToggleBreakpointAdapter IResource resource, String functionName, int charStart, int charEnd, int lineNumber) throws CoreException { if (interactive) { ICDynamicPrintf dprintf = (ICDynamicPrintf) CDIDebugModel.createBlankFunctionDynamicPrintf(); - Map<String, Object> attributes = new HashMap<String, Object>(); + Map<String, Object> attributes = new HashMap<>(); CDIDebugModel.setFunctionBreakpointAttributes(attributes, sourceHandle, getBreakpointType(), functionName, charStart, charEnd, lineNumber, true, 0, ""); //$NON-NLS-1$ diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleTracepointAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleTracepointAdapter.java index afa715c2f8b..a6a615e5abf 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleTracepointAdapter.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleTracepointAdapter.java @@ -43,7 +43,7 @@ public class ToggleTracepointAdapter extends AbstractToggleBreakpointAdapter { IResource resource, int lineNumber) throws CoreException { if (interactive) { ICLineBreakpoint lineBp = CDIDebugModel.createBlankLineTracepoint(); - Map<String, Object> attributes = new HashMap<String, Object>(); + Map<String, Object> attributes = new HashMap<>(); CDIDebugModel.setLineBreakpointAttributes(attributes, sourceHandle, getBreakpointType(), lineNumber, true, 0, ""); //$NON-NLS-1$ openBreakpointPropertiesDialog(lineBp, part, resource, attributes); @@ -64,7 +64,7 @@ public class ToggleTracepointAdapter extends AbstractToggleBreakpointAdapter { IResource resource, String functionName, int charStart, int charEnd, int lineNumber) throws CoreException { if (interactive) { ICFunctionBreakpoint bp = CDIDebugModel.createBlankFunctionTracepoint(); - Map<String, Object> attributes = new HashMap<String, Object>(); + Map<String, Object> attributes = new HashMap<>(); CDIDebugModel.setFunctionBreakpointAttributes(attributes, sourceHandle, getBreakpointType(), functionName, charStart, charEnd, lineNumber, true, 0, ""); //$NON-NLS-1$ openBreakpointPropertiesDialog(bp, part, resource, attributes); diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPreferenceStore.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPreferenceStore.java index cf6e3541f5d..476e4bc0b39 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPreferenceStore.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPreferenceStore.java @@ -57,12 +57,12 @@ import org.eclipse.jface.util.PropertyChangeEvent; public class CBreakpointPreferenceStore implements IPersistentPreferenceStore { // This map is the current properties/values being maintained/manipulated - private HashMap<String, Object> fProperties = new HashMap<String, Object>(); + private HashMap<String, Object> fProperties = new HashMap<>(); // Original set of values. So we can see what has really changed on the save and // perform appropriate change operations. We only really want to operate on changed // values, to avoid generating churn. - private HashMap<String, Object> fOriginalValues = new HashMap<String, Object>(); + private HashMap<String, Object> fOriginalValues = new HashMap<>(); private boolean fIsDirty = false; private boolean fIsCanceled = false; private ListenerList<IPropertyChangeListener> fListeners; @@ -167,7 +167,7 @@ public class CBreakpointPreferenceStore implements IPersistentPreferenceStore { } private void saveToExistingMarker(final ICBreakpoint breakpoint, final IMarker marker) throws IOException { - final List<String> changedProperties = new ArrayList<String>(5); + final List<String> changedProperties = new ArrayList<>(5); Set<String> valueNames = fProperties.keySet(); for (String name : valueNames) { if (fProperties.containsKey(name)) { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPropertyPage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPropertyPage.java index 8597628aecc..7a4591690db 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPropertyPage.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPropertyPage.java @@ -1085,8 +1085,8 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement private void setupEventTypeFieldEditor(ICBreakpointsUIContribution[] cons, ICBreakpoint breakpoint, String conMainElement, Composite parent) { String id = null; - ArrayList<String> eventTypeValueList = new ArrayList<String>(); - ArrayList<String> eventTypeLabelList = new ArrayList<String>(); + ArrayList<String> eventTypeValueList = new ArrayList<>(); + ArrayList<String> eventTypeLabelList = new ArrayList<>(); // The filter of the debugModelIds should already be done. for (ICBreakpointsUIContribution con : cons) { @@ -1114,7 +1114,7 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement void addEditorToComposite(FieldEditor fieldEditor) { if (fEventArgsFEs == null) { - fEventArgsFEs = new ArrayList<FieldEditor>(); + fEventArgsFEs = new ArrayList<>(); } fEventArgsFEs.add(fieldEditor); } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogs/AddEventBreakpointDialog.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogs/AddEventBreakpointDialog.java index f500d1980a2..4244f9c6e34 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogs/AddEventBreakpointDialog.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogs/AddEventBreakpointDialog.java @@ -52,7 +52,7 @@ public class AddEventBreakpointDialog extends Dialog implements ModifyListener, private String fEventType; private String fEventArgument; private Composite fEventArgumentControl; - private HashMap<String, String> fIdLabelMap = new LinkedHashMap<String, String>(); + private HashMap<String, String> fIdLabelMap = new LinkedHashMap<>(); private FieldEditorPreferencePage page; private CBreakpointUIContributionFactory factory; private String debugModelId; @@ -77,7 +77,7 @@ public class AddEventBreakpointDialog extends Dialog implements ModifyListener, protected void createFieldEditors() { Composite parent = getFieldEditorParent(); try { - Map<String, Object> map = new HashMap<String, Object>(); + Map<String, Object> map = new HashMap<>(); map.put(ICEventBreakpoint.EVENT_TYPE_ID, eventType); ICBreakpointsUIContribution cons[] = CBreakpointUIContributionFactory.getInstance() .getBreakpointUIContributions(modelId, ICEventBreakpoint.C_EVENT_BREAKPOINT_MARKER, map); diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/editor/DisassemblyEditorManager.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/editor/DisassemblyEditorManager.java index 3d95bb39fa7..b9f81e2200a 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/editor/DisassemblyEditorManager.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/editor/DisassemblyEditorManager.java @@ -56,9 +56,9 @@ public class DisassemblyEditorManager implements IWindowListener, IDisassemblyCo public DisassemblyEditorManager() { fDocumentProvider = new DisassemblyDocumentProvider(); - fEditorParts = new HashMap<Object, IEditorPart>(); - fOpenDisassemblyPolicy = new HashMap<Object, String>(); - fSteppingModePolicy = new HashMap<Object, ISteppingModeTarget>(); + fEditorParts = new HashMap<>(); + fOpenDisassemblyPolicy = new HashMap<>(); + fSteppingModePolicy = new HashMap<>(); CDebugUIPlugin.getDefault().getWorkbench().addWindowListener(this); IWorkbenchWindow window = CDebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow(); if (window != null) { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/DisassemblyDocumentProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/DisassemblyDocumentProvider.java index d8cab82a395..727785eedfe 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/DisassemblyDocumentProvider.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/DisassemblyDocumentProvider.java @@ -70,7 +70,7 @@ public class DisassemblyDocumentProvider implements IDocumentProvider { private Map<Object, DocumentInfo> fDocumentInfos; public DisassemblyDocumentProvider() { - fDocumentInfos = new HashMap<Object, DocumentInfo>(); + fDocumentInfos = new HashMap<>(); } /* (non-Javadoc) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/DisassemblyPane.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/DisassemblyPane.java index 97fbfb70832..3a974b4270f 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/DisassemblyPane.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/DisassemblyPane.java @@ -90,7 +90,7 @@ public class DisassemblyPane implements IPropertyChangeListener { private IMenuListener fMenuListener; private MouseListener fMouseListener; - private Map<String, IAction> fActions = new HashMap<String, IAction>(10); + private Map<String, IAction> fActions = new HashMap<>(10); public DisassemblyPane(String contextMenuId, String rulerMenuId) { fAnnotationPreferences = new MarkerAnnotationPreferences(); diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/DocumentAnnotationUpdate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/DocumentAnnotationUpdate.java index 650deb25530..ef5f69860a4 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/DocumentAnnotationUpdate.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/DocumentAnnotationUpdate.java @@ -35,7 +35,7 @@ public class DocumentAnnotationUpdate extends DocumentUpdate implements IDocumen super(presentationContext, root, base, element); fAnnotationProvider = annotationProvider; fIndex = index; - fAnnotations = new ArrayList<Annotation>(); + fAnnotations = new ArrayList<>(); } /* (non-Javadoc) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/DocumentContentProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/DocumentContentProvider.java index 52c274873af..2861a6da8a7 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/DocumentContentProvider.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/DocumentContentProvider.java @@ -49,8 +49,8 @@ public class DocumentContentProvider implements IModelChangedListener { private IModelProxy fRootProxy; private IModelProxy fBaseProxy; - private List<IModelProxy> fLineProxies = new ArrayList<IModelProxy>(50); - private Map<Object, Integer> fLineElements = new HashMap<Object, Integer>(20); + private List<IModelProxy> fLineProxies = new ArrayList<>(50); + private Map<Object, Integer> fLineElements = new HashMap<>(20); private DocumentUpdate fUpdateInProgress; diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/VirtualDocument.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/VirtualDocument.java index 1c01e6cd301..9332a6db348 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/VirtualDocument.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/viewer/VirtualDocument.java @@ -201,7 +201,7 @@ public class VirtualDocument extends Document { Position[] positions = getPositions(CATEGORY_LINE); if (lineNumber < positions.length) { Iterator it = annotationModel.getAnnotationIterator(); - ArrayList<Annotation> oldAnnotations = new ArrayList<Annotation>(3); + ArrayList<Annotation> oldAnnotations = new ArrayList<>(3); while (it.hasNext()) { Annotation ann = (Annotation) it.next(); if (positions[lineNumber].equals(annotationModel.getPosition(ann))) { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/launch/CApplicationLaunchShortcut.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/launch/CApplicationLaunchShortcut.java index c6e1b6445a1..46ec455d919 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/launch/CApplicationLaunchShortcut.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/launch/CApplicationLaunchShortcut.java @@ -97,7 +97,7 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut2 { List<ILaunchConfiguration> candidateConfigs = Collections.emptyList(); try { ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(); - candidateConfigs = new ArrayList<ILaunchConfiguration>(configs.length); + candidateConfigs = new ArrayList<>(configs.length); for (int i = 0; i < configs.length; i++) { ILaunchConfiguration config = configs[i]; IPath programPath = CDebugUtils.getProgramPath(config); @@ -297,7 +297,7 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut2 { if (elements.length == 1 && elements[0] instanceof IBinary) { bin = (IBinary) elements[0]; } else { - final List<IBinary> results = new ArrayList<IBinary>(); + final List<IBinary> results = new ArrayList<>(); ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell()); IRunnableWithProgress runnable = new IRunnableWithProgress() { @Override @@ -412,7 +412,7 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut2 { * @return a list of projects - may be empty */ public static List<IProject> getProjectsFromSelection(ISelection selection) { - List<IProject> projects = new ArrayList<IProject>(); + List<IProject> projects = new ArrayList<>(); if (selection != null && !selection.isEmpty()) { if (selection instanceof ITextSelection) { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/launch/InvalidLaunchableAdapterFactory.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/launch/InvalidLaunchableAdapterFactory.java index ca7951149eb..b4b4ceca8ee 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/launch/InvalidLaunchableAdapterFactory.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/launch/InvalidLaunchableAdapterFactory.java @@ -28,7 +28,7 @@ import org.eclipse.debug.ui.actions.ILaunchable; */ public class InvalidLaunchableAdapterFactory implements IAdapterFactory { private static final Class<?>[] TYPES = { ILaunchable.class }; - private static ArrayList<String> currentTraces = new ArrayList<String>(); + private static ArrayList<String> currentTraces = new ArrayList<>(); @Override public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/DebugContextPinProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/DebugContextPinProvider.java index 90e1daf0692..241dab57d48 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/DebugContextPinProvider.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/DebugContextPinProvider.java @@ -53,7 +53,7 @@ public class DebugContextPinProvider extends AbstractDebugContextProvider implem public DebugContextPinProvider(IWorkbenchPart part, ISelection activeContext) { super(part); fWorkbenchPart = part; - fPinProvider = new HashMap<IPinElementHandle, IPinProvider>(); + fPinProvider = new HashMap<>(); fActiveContext = activeContext; fPinHandles = pin(part, activeContext, new IPinModelListener() { @@ -120,7 +120,7 @@ public class DebugContextPinProvider extends AbstractDebugContextProvider implem * @param listener pin model listener * @return a set of pinned handle */ - Set<IPinElementHandle> handles = new HashSet<IPinElementHandle>(); + Set<IPinElementHandle> handles = new HashSet<>(); private Set<IPinElementHandle> pin(IWorkbenchPart part, ISelection selection, IPinModelListener listener) { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/DebugEventFilterService.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/DebugEventFilterService.java index b8150346fa3..80025463f35 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/DebugEventFilterService.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/DebugEventFilterService.java @@ -52,7 +52,7 @@ public class DebugEventFilterService { public void debugContextChanged(DebugContextEvent event) { ISelection eventContext = event.getContext(); if (eventContext instanceof IStructuredSelection) { - List<Object> filteredContextList = new ArrayList<Object>(); + List<Object> filteredContextList = new ArrayList<>(); List<?> eventContextList = ((IStructuredSelection) eventContext).toList(); for (Object o : eventContextList) { if (fProvider.isPinnedTo(o)) { @@ -74,7 +74,7 @@ public class DebugEventFilterService { } private static DebugEventFilterService INSTANCE; - private Map<IWorkbenchPart, DebugEventFilter> fFilterMap = new HashMap<IWorkbenchPart, DebugEventFilter>(); + private Map<IWorkbenchPart, DebugEventFilter> fFilterMap = new HashMap<>(); private DebugEventFilterService() { } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/ViewIDCounterManager.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/ViewIDCounterManager.java index 7fc14d9697e..153e37b5f6d 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/ViewIDCounterManager.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/ViewIDCounterManager.java @@ -90,7 +90,7 @@ public final class ViewIDCounterManager { String secondaryId = viewRef.getSecondaryId(); Set<Integer> secondaryIdSet = viewIdToNextCounterMap.get(id); if (secondaryIdSet == null) { - secondaryIdSet = new HashSet<Integer>(); + secondaryIdSet = new HashSet<>(); viewIdToNextCounterMap.put(id, secondaryIdSet); } secondaryId = PinCloneUtils.decodeClonedPartSecondaryId(secondaryId); @@ -221,7 +221,7 @@ public final class ViewIDCounterManager { public Integer getNextCounter(String viewId) { Set<Integer> secondaryIdSet = viewIdToNextCounterMap.get(viewId); if (secondaryIdSet == null) { - secondaryIdSet = new HashSet<Integer>(); + secondaryIdSet = new HashSet<>(); viewIdToNextCounterMap.put(viewId, secondaryIdSet); } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/SourcePreferencePage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/SourcePreferencePage.java index 550fe657f69..518c82d36c5 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/SourcePreferencePage.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/SourcePreferencePage.java @@ -48,7 +48,7 @@ import org.eclipse.ui.IWorkbenchPreferencePage; */ public class SourcePreferencePage extends PreferencePage implements IWorkbenchPreferencePage { private SourceContainerViewer fPathViewer; - private List<SourceContainerAction> fActions = new ArrayList<SourceContainerAction>(6); + private List<SourceContainerAction> fActions = new ArrayList<>(6); private IWorkbench fWorkbench; private AddContainerAction fAddAction; private EditContainerAction fEditAction; diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/StringSetSerializer.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/StringSetSerializer.java index 28d46c789eb..fdf605f86dd 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/StringSetSerializer.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/StringSetSerializer.java @@ -39,7 +39,7 @@ public final class StringSetSerializer { public static Set<String> deserialize(String serialized) { Assert.isLegal(serialized != null); - Set<String> marked = new HashSet<String>(); + Set<String> marked = new HashSet<>(); StringTokenizer tok = new StringTokenizer(serialized, DELIM); while (tok.hasMoreTokens()) marked.add(tok.nextToken()); @@ -49,7 +49,7 @@ public final class StringSetSerializer { public static String[] getDifference(String oldValue, String newValue) { Set<String> oldSet = deserialize(oldValue); Set<String> newSet = deserialize(newValue); - Set<String> intersection = new HashSet<String>(oldSet); + Set<String> intersection = new HashSet<>(oldSet); intersection.retainAll(newSet); oldSet.removeAll(intersection); newSet.removeAll(intersection); diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java index 8d91acf5d39..dc97bb758ec 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java @@ -129,7 +129,7 @@ public class AddSourceContainerDialog extends TitleAreaDialog { * @return the list of source container types that have browsers */ private ISourceContainerType[] filterTypes(ISourceContainerType[] types) { - ArrayList<ISourceContainerType> validTypes = new ArrayList<ISourceContainerType>(); + ArrayList<ISourceContainerType> validTypes = new ArrayList<>(); for (int i = 0; i < types.length; i++) { ISourceContainerType type = types[i]; if (fDirector.supportsSourceContainerType(type)) { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CProjectSourceContainerBrowser.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CProjectSourceContainerBrowser.java index ef2ab7b4034..337d19c75a9 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CProjectSourceContainerBrowser.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CProjectSourceContainerBrowser.java @@ -51,7 +51,7 @@ public class CProjectSourceContainerBrowser extends AbstractSourceContainerBrows ProjectSourceContainerDialog dialog = new ProjectSourceContainerDialog(shell, input, contentProvider, labelProvider, SourceLookupUIMessages.projectSelection_chooseLabel); if (dialog.open() == Window.OK) { - ArrayList<ISourceContainer> res = new ArrayList<ISourceContainer>(); + ArrayList<ISourceContainer> res = new ArrayList<>(); for (Object element : dialog.getResult()) { if (!(element instanceof IProject)) continue; diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditor.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditor.java index 2831032b218..17b5f678337 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditor.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditor.java @@ -313,7 +313,7 @@ public class CSourceNotFoundEditor extends CommonSourceNotFoundEditor { private void addSourceMappingToDirector(String missingPath, IPath newSourcePath, AbstractSourceLookupDirector director) throws CoreException { - ArrayList<ISourceContainer> containerList = new ArrayList<ISourceContainer>( + ArrayList<ISourceContainer> containerList = new ArrayList<>( Arrays.asList(director.getSourceContainers())); MappingSourceContainer foundMappings = null; for (ISourceContainer container : containerList) { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/MappingSourceContainerDialog.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/MappingSourceContainerDialog.java index f159ffaf904..fbfbc067ead 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/MappingSourceContainerDialog.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/MappingSourceContainerDialog.java @@ -587,7 +587,7 @@ public class MappingSourceContainerDialog extends TitleAreaDialog { MapEntrySourceContainer entry = selEntries[0]; try { ISourceContainer[] containers = fContainer.getSourceContainers(); - List<MapEntrySourceContainer> list = new ArrayList<MapEntrySourceContainer>(containers.length); + List<MapEntrySourceContainer> list = new ArrayList<>(containers.length); for (ISourceContainer container : containers) { list.add(((MapEntrySourceContainer) container).copy()); } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/SourceContainerAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/SourceContainerAction.java index 9bd3e26e5e4..9df132d0f3c 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/SourceContainerAction.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/SourceContainerAction.java @@ -77,7 +77,7 @@ public abstract class SourceContainerAction extends SelectionListenerAction { * @return targets for an action */ protected List<ISourceContainer> getOrderedSelection() { - List<ISourceContainer> targets = new ArrayList<ISourceContainer>(); + List<ISourceContainer> targets = new ArrayList<>(); List<?> selection = ((IStructuredSelection) getViewer().getSelection()).toList(); ISourceContainer[] entries = getViewer().getEntries(); for (int i = 0; i < entries.length; i++) { @@ -94,7 +94,7 @@ public abstract class SourceContainerAction extends SelectionListenerAction { */ protected List<ISourceContainer> getEntriesAsList() { ISourceContainer[] entries = getViewer().getEntries(); - List<ISourceContainer> list = new ArrayList<ISourceContainer>(entries.length); + List<ISourceContainer> list = new ArrayList<>(entries.length); for (int i = 0; i < entries.length; i++) { list.add(entries[i]); } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/SourceContainerViewer.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/SourceContainerViewer.java index 606589bf69c..fa18d4a6086 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/SourceContainerViewer.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/SourceContainerViewer.java @@ -39,7 +39,7 @@ public class SourceContainerViewer extends TreeViewer { /** * The source container entries displayed in this viewer */ - protected List<ISourceContainer> fEntries = new ArrayList<ISourceContainer>(); + protected List<ISourceContainer> fEntries = new ArrayList<>(); class ContentProvider implements ITreeContentProvider { /** diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/SourceFoldersRelativePathSourceContainerBrowser.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/SourceFoldersRelativePathSourceContainerBrowser.java index 74df270f32d..4ee769e688b 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/SourceFoldersRelativePathSourceContainerBrowser.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/SourceFoldersRelativePathSourceContainerBrowser.java @@ -52,7 +52,7 @@ public class SourceFoldersRelativePathSourceContainerBrowser extends AbstractSou ProjectSourceContainerDialog dialog = new ProjectSourceContainerDialog(shell, input, contentProvider, labelProvider, SourceLookupUIMessages.projectSelection_chooseLabel); if (dialog.open() == Window.OK) { - ArrayList<ISourceContainer> res = new ArrayList<ISourceContainer>(); + ArrayList<ISourceContainer> res = new ArrayList<>(); for (Object element : dialog.getResult()) { if (!(element instanceof IProject)) continue; diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/ExecutablesView.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/ExecutablesView.java index 89ff4a8bd94..a73ced5e56c 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/ExecutablesView.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/ExecutablesView.java @@ -209,7 +209,7 @@ public class ExecutablesView extends ViewPart { new ColumnLabelProvider(), Messages.ExecutablesView_SelectColumns); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, CONFIGURE_COLUMNS_DIALOG); String[] visibleColumns = getVisibleColumns(); - List<String> initialSelection = new ArrayList<String>(visibleColumns.length); + List<String> initialSelection = new ArrayList<>(visibleColumns.length); for (int i = 0; i < visibleColumns.length; i++) { initialSelection.add(visibleColumns[i]); } @@ -390,7 +390,7 @@ public class ExecutablesView extends ViewPart { } private String[] getVisibleColumns() { - ArrayList<String> visibleNames = new ArrayList<String>(); + ArrayList<String> visibleNames = new ArrayList<>(); for (int i = 0; i < columnNames.length; i++) { if (allColumns[i].getWidth() > 0) @@ -440,7 +440,7 @@ public class ExecutablesView extends ViewPart { ISelection selection = getExecutablesViewer().getSelection(); if (selection instanceof IStructuredSelection) { Object[] selectedObjects = ((IStructuredSelection) selection).toArray(); - ArrayList<Executable> selectedExes = new ArrayList<Executable>(); + ArrayList<Executable> selectedExes = new ArrayList<>(); for (Object object : selectedObjects) { if (object instanceof Executable) selectedExes.add((Executable) object); diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/SourceFilesContentProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/SourceFilesContentProvider.java index 9f705186f90..177664017bb 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/SourceFilesContentProvider.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/SourceFilesContentProvider.java @@ -81,7 +81,7 @@ public class SourceFilesContentProvider extends CElementContentProvider implemen * * <p> This collection must be accessed only from the UI thread */ - private Map<IPath, QuickParseJob> pathToJobMap = new HashMap<IPath, SourceFilesContentProvider.QuickParseJob>(); + private Map<IPath, QuickParseJob> pathToJobMap = new HashMap<>(); /** those executables for which we asked the question and got a result. * NOTE: this contains a duplicate of into in Executable, because we can't @@ -108,7 +108,7 @@ public class SourceFilesContentProvider extends CElementContentProvider implemen /** * The cached file info. Key is the path of the executable. This collection must be accessed only on the UI thread. */ - private Map<IPath, TUData> fetchedExecutables = new HashMap<IPath, TUData>(); + private Map<IPath, TUData> fetchedExecutables = new HashMap<>(); private final SourceFilesViewer viewer; diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/SourceFilesViewer.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/SourceFilesViewer.java index 1282953c88a..1d52a2e3178 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/SourceFilesViewer.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/SourceFilesViewer.java @@ -77,7 +77,7 @@ public class SourceFilesViewer extends BaseViewer { /** Tradeoff expensiveness of checking filesystem against likelihood * that files will be added/removed/changed in the given time period */ static final long FILE_CHECK_DELTA = 30 * 1000; - private static LRUCache<Object, TranslationUnitInfo> translationUnitInfoCache = new LRUCache<Object, TranslationUnitInfo>( + private static LRUCache<Object, TranslationUnitInfo> translationUnitInfoCache = new LRUCache<>( 1024); public SourceFilesViewer(ExecutablesView view, Composite parent, int style) { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/AddMemoryBlockDialog.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/AddMemoryBlockDialog.java index ef9b1eaed00..8851ab466b0 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/AddMemoryBlockDialog.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/AddMemoryBlockDialog.java @@ -68,8 +68,8 @@ public class AddMemoryBlockDialog extends TrayDialog implements ModifyListener, */ private static String fPreviousMemorySpaceSelection; - private static List<String> sAddressHistory = new ArrayList<String>(); - private static List<String> sExpressionHistory = new ArrayList<String>(); + private static List<String> sAddressHistory = new ArrayList<>(); + private static List<String> sExpressionHistory = new ArrayList<>(); private static boolean sDefaultToExpression = true; diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/AddMemoryBlocks.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/AddMemoryBlocks.java index 23b105cfc63..da317b6ef36 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/AddMemoryBlocks.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/AddMemoryBlocks.java @@ -189,7 +189,7 @@ public class AddMemoryBlocks implements IAddMemoryBlocksTarget { String input = dialog.enteredExpression() ? dialog.getExpression() : dialog.getAddress(); - List<String> list = new ArrayList<String>(); + List<String> list = new ArrayList<>(); if (input.length() == 0) list.add(""); //$NON-NLS-1$ diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java index bba7b4c9c8c..84913dc98b6 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java @@ -183,7 +183,7 @@ public class CDebugUIPlugin extends AbstractUIPlugin { } protected void initializeDebuggerPageMap() { - fDebuggerPageMap = new HashMap<String, IConfigurationElement>(10); + fDebuggerPageMap = new HashMap<>(10); IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(PLUGIN_ID, CDEBUGGER_PAGE_EXTENSION_POINT_ID); IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpointactions/SoundActionComposite.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpointactions/SoundActionComposite.java index 5d4a7388de4..49c555bd715 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpointactions/SoundActionComposite.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpointactions/SoundActionComposite.java @@ -153,7 +153,7 @@ public class SoundActionComposite extends Composite { private void rebuildRecentSoundsCombo() { combo_1.removeAll(); - ArrayList<File> sortedSounds = new ArrayList<File>(soundActionPage.getRecentSounds()); + ArrayList<File> sortedSounds = new ArrayList<>(soundActionPage.getRecentSounds()); Collections.sort(sortedSounds); for (Iterator<File> iter = sortedSounds.iterator(); iter.hasNext();) { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpointactions/SoundActionPage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpointactions/SoundActionPage.java index bab3288c50c..1abe58efa37 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpointactions/SoundActionPage.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpointactions/SoundActionPage.java @@ -56,7 +56,7 @@ public class SoundActionPage extends PlatformObject implements IBreakpointAction private SoundActionComposite editor = null; private String mediaPath = ""; //$NON-NLS-1$ - private ArrayList<File> recentSounds = new ArrayList<File>(); + private ArrayList<File> recentSounds = new ArrayList<>(); private SoundAction soundAction; @@ -156,7 +156,7 @@ public class SoundActionPage extends PlatformObject implements IBreakpointAction return; } - recentSounds = new ArrayList<File>(); + recentSounds = new ArrayList<>(); Element root = null; DocumentBuilder parser; diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/CBreakpointUIContributionFactory.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/CBreakpointUIContributionFactory.java index 0f831d1be19..bf383ebff58 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/CBreakpointUIContributionFactory.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/CBreakpointUIContributionFactory.java @@ -41,7 +41,7 @@ public class CBreakpointUIContributionFactory { protected ArrayList<ICBreakpointsUIContribution> contributions; private CBreakpointUIContributionFactory() { - contributions = new ArrayList<ICBreakpointsUIContribution>(); + contributions = new ArrayList<>(); loadSubtypeContributions(); } @@ -129,7 +129,7 @@ public class CBreakpointUIContributionFactory { if (debugModelIds != null) { debugModelIdsList = Arrays.asList(debugModelIds); } - ArrayList<ICBreakpointsUIContribution> list = new ArrayList<ICBreakpointsUIContribution>(); + ArrayList<ICBreakpointsUIContribution> list = new ArrayList<>(); for (ICBreakpointsUIContribution con : contributions) { try { if (con.getDebugModelId() == null diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/DefaultCBreakpointUIContribution.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/DefaultCBreakpointUIContribution.java index e708998db19..10359e566a5 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/DefaultCBreakpointUIContribution.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/DefaultCBreakpointUIContribution.java @@ -40,8 +40,8 @@ class DefaultCBreakpointUIContribution implements ICBreakpointsUIContribution { private String markerType; private String modelId; private String attType; - private Map<String, String> valueLabels = new LinkedHashMap<String, String>(); - private Map<String, String> conditions = new HashMap<String, String>(); + private Map<String, String> valueLabels = new LinkedHashMap<>(); + private Map<String, String> conditions = new HashMap<>(); DefaultCBreakpointUIContribution(IConfigurationElement config) { fConfig = config; diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/disassembly/rulers/RulerColumnRegistry.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/disassembly/rulers/RulerColumnRegistry.java index d4410636ba5..a0868d93233 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/disassembly/rulers/RulerColumnRegistry.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/disassembly/rulers/RulerColumnRegistry.java @@ -146,11 +146,11 @@ public final class RulerColumnRegistry { */ public void reload() { IExtensionRegistry registry = Platform.getExtensionRegistry(); - List<IConfigurationElement> elements = new ArrayList<IConfigurationElement>( + List<IConfigurationElement> elements = new ArrayList<>( Arrays.asList(registry.getConfigurationElementsFor(CDebugUIPlugin.PLUGIN_ID, EXTENSION_POINT))); - List<RulerColumnDescriptor> descriptors = new ArrayList<RulerColumnDescriptor>(); - Map<String, RulerColumnDescriptor> descriptorMap = new HashMap<String, RulerColumnDescriptor>(); + List<RulerColumnDescriptor> descriptors = new ArrayList<>(); + Map<String, RulerColumnDescriptor> descriptorMap = new HashMap<>(); for (Iterator<IConfigurationElement> iter = elements.iterator(); iter.hasNext();) { IConfigurationElement element = iter.next(); @@ -207,7 +207,7 @@ public final class RulerColumnRegistry { descriptors.toArray(array); sorter.sort(array); - Map<String, RulerColumnDescriptor> descriptorsById = new HashMap<String, RulerColumnDescriptor>(); + Map<String, RulerColumnDescriptor> descriptorsById = new HashMap<>(); for (RulerColumnDescriptor desc : array) { descriptorsById.put(desc.getId(), desc); } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/editors/AbstractDebugTextHover.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/editors/AbstractDebugTextHover.java index ac56028de79..042e3568eec 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/editors/AbstractDebugTextHover.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/editors/AbstractDebugTextHover.java @@ -359,7 +359,7 @@ public abstract class AbstractDebugTextHover implements ICEditorTextHover, IText private boolean insideInactiveCode(IASTTranslationUnit ast, int offset) { int inactiveCodeStart = -1; boolean inInactiveCode = false; - Stack<Boolean> inactiveCodeStack = new Stack<Boolean>(); + Stack<Boolean> inactiveCodeStack = new Stack<>(); IASTPreprocessorStatement[] preprocStmts = ast.getAllPreprocessorStatements(); diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/importexecutable/ImportExecutablePageTwo.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/importexecutable/ImportExecutablePageTwo.java index a1d6ad5b514..9c9f6d06bbf 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/importexecutable/ImportExecutablePageTwo.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/importexecutable/ImportExecutablePageTwo.java @@ -428,7 +428,7 @@ public class ImportExecutablePageTwo extends WizardPage { // check if executables with same names already exist in the existing project String[] executables = wizard.getImportExecutablePage().getSelectedExecutables(); - List<String> existingNames = new ArrayList<String>(); + List<String> existingNames = new ArrayList<>(); for (String executable : executables) { IFile exeFile = getExecutableFile(project.getProject(), executable); if (exeFile.exists()) { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/DefaultSourceLocator.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/DefaultSourceLocator.java index e2082d13c64..b066f1cbd9e 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/DefaultSourceLocator.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/DefaultSourceLocator.java @@ -63,7 +63,7 @@ public class DefaultSourceLocator extends CSourceLookupDirector { // If so, DefaultSpourceContainer should be used. IProject project = csl.getProject(); List<IProject> list = CDebugUtils.getReferencedProjects(project); - HashSet<String> names = new HashSet<String>(list.size() + 1); + HashSet<String> names = new HashSet<>(list.size() + 1); names.add(project.getName()); for (IProject proj : list) { names.add(proj.getName()); @@ -79,7 +79,7 @@ public class DefaultSourceLocator extends CSourceLookupDirector { } // Generate an array of new source containers including DefaultSourceContainer - ArrayList<ICSourceLocation> locs = new ArrayList<ICSourceLocation>(locations.length); + ArrayList<ICSourceLocation> locs = new ArrayList<>(locations.length); for (int i = 0; i < locations.length; ++i) { if (!includesDefault || !(locations[i] instanceof IProjectSourceLocation && names.contains(((IProjectSourceLocation) locations[i]).getProject().getName()))) { @@ -89,7 +89,7 @@ public class DefaultSourceLocator extends CSourceLookupDirector { ISourceContainer[] containers = SourceUtils .convertSourceLocations(locs.toArray(new ICSourceLocation[locs.size()])); - ArrayList<ISourceContainer> cons = new ArrayList<ISourceContainer>(Arrays.asList(containers)); + ArrayList<ISourceContainer> cons = new ArrayList<>(Arrays.asList(containers)); if (includesDefault) { DefaultSourceContainer defaultContainer = new DefaultSourceContainer(); defaultContainer.init(this); diff --git a/debug/org.eclipse.cdt.gdb/src/org/eclipse/cdt/gdb/internal/eventbkpts/GdbCatchpoints.java b/debug/org.eclipse.cdt.gdb/src/org/eclipse/cdt/gdb/internal/eventbkpts/GdbCatchpoints.java index dd14732de58..491356b82ae 100644 --- a/debug/org.eclipse.cdt.gdb/src/org/eclipse/cdt/gdb/internal/eventbkpts/GdbCatchpoints.java +++ b/debug/org.eclipse.cdt.gdb/src/org/eclipse/cdt/gdb/internal/eventbkpts/GdbCatchpoints.java @@ -21,7 +21,7 @@ import org.eclipse.cdt.gdb.eventbkpts.IEventBreakpointConstants; public class GdbCatchpoints { /** Map which services {@link #eventToGdbCatchpointKeyword(String)} */ - private static final Map<String, String> sIdToKeyword = new HashMap<String, String>(); + private static final Map<String, String> sIdToKeyword = new HashMap<>(); static { // these Ids are also referenced in mi.ui plugin as contribution // to event breakpoints selector diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/model/VisualizerCPU.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/model/VisualizerCPU.java index 518868a6d43..f46ab084044 100755 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/model/VisualizerCPU.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/model/VisualizerCPU.java @@ -46,8 +46,8 @@ public class VisualizerCPU implements Comparable<VisualizerCPU>, IVisualizerMode /** Constructor */ public VisualizerCPU(int id) { m_id = id; - m_cores = new ArrayList<VisualizerCore>(); - m_coreMap = new Hashtable<Integer, VisualizerCore>(); + m_cores = new ArrayList<>(); + m_coreMap = new Hashtable<>(); } /** Dispose method */ diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/model/VisualizerModel.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/model/VisualizerModel.java index 9543be19a0e..4993789bb66 100755 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/model/VisualizerModel.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/model/VisualizerModel.java @@ -54,9 +54,9 @@ public class VisualizerModel { /** Constructor */ public VisualizerModel(String sessionId) { m_sessionId = sessionId; - m_cpus = new ArrayList<VisualizerCPU>(); - m_cpuMap = new Hashtable<Integer, VisualizerCPU>(); - m_threads = new ArrayList<VisualizerThread>(); + m_cpus = new ArrayList<>(); + m_cpuMap = new Hashtable<>(); + m_threads = new ArrayList<>(); } /** Dispose method */ @@ -189,7 +189,7 @@ public class VisualizerModel { for (VisualizerThread thread : m_threads) { if (thread.getPID() == processId) { if (result == null) - result = new ArrayList<VisualizerThread>(); + result = new ArrayList<>(); result.add(thread); } } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java index 9376dad9532..eaaa834912c 100755 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java @@ -286,7 +286,7 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer implements IPin @Override public void initializeVisualizer() { fEventListener = new MulticoreVisualizerEventListener(this); - m_cpuCoreContextsCache = new ArrayList<IDMContext>(); + m_cpuCoreContextsCache = new ArrayList<>(); m_visualizerInstanceId = getViewer().getView().getViewSite().getSecondaryId(); // The first visualizer view will have a null secondary id - override that @@ -514,7 +514,7 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer implements IPin // enable the load meter sub-menu m_enableLoadMetersAction.setEnabled(true); - m_setLoadMeterPeriodActions = new ArrayList<SetLoadMeterPeriodAction>(); + m_setLoadMeterPeriodActions = new ArrayList<>(); m_setLoadMeterPeriodActions.add(new SetLoadMeterPeriodAction( MulticoreVisualizerUIPlugin.getString("MulticoreVisualizer.actions.SetLoadMeterPeriod.fast.text"), //$NON-NLS-1$ LOAD_METER_TIMER_FAST)); @@ -965,7 +965,7 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer implements IPin VisualizerModel model = m_canvas.getModel(); if (model != null) { - Set<Object> selected = new HashSet<Object>(); + Set<Object> selected = new HashSet<>(); for (Object item : items) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCPU.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCPU.java index d90a5cd9be3..1df20214f3a 100755 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCPU.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCPU.java @@ -50,7 +50,7 @@ public class MulticoreVisualizerCPU extends MulticoreVisualizerGraphicObject { /** Constructor */ public MulticoreVisualizerCPU(int id) { m_id = id; - m_cores = new ArrayList<MulticoreVisualizerCore>(); + m_cores = new ArrayList<>(); // default load meter m_loadMeter = new MulticoreVisualizerLoadMeter(null, null); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java index 367d001c54d..1aa787b6b44 100755 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java @@ -166,16 +166,16 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas implements ISelecti setFont(m_textFont); // initialize cached state storage - m_cpus = new ArrayList<MulticoreVisualizerCPU>(); - m_cpuMap = new Hashtable<VisualizerCPU, MulticoreVisualizerCPU>(); + m_cpus = new ArrayList<>(); + m_cpuMap = new Hashtable<>(); - m_cores = new ArrayList<MulticoreVisualizerCore>(); - m_coreMap = new Hashtable<VisualizerCore, MulticoreVisualizerCore>(); + m_cores = new ArrayList<>(); + m_coreMap = new Hashtable<>(); - m_threads = new ArrayList<MulticoreVisualizerThread>(); - m_threadMap = new Hashtable<VisualizerThread, MulticoreVisualizerThread>(); + m_threads = new ArrayList<>(); + m_threadMap = new Hashtable<>(); - m_selectedPIDs = new HashSet<Integer>(); + m_selectedPIDs = new HashSet<>(); // mouse-drag monitor m_mouseMonitor = new MouseMonitor(this) { @@ -827,7 +827,7 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas implements ISelecti * Otherwise, selects item(s) and deselects other items. */ public void selectPoint(int x, int y, boolean addToSelection, boolean toggleSelection) { - List<MulticoreVisualizerGraphicObject> selectedObjects = new ArrayList<MulticoreVisualizerGraphicObject>(); + List<MulticoreVisualizerGraphicObject> selectedObjects = new ArrayList<>(); List<MulticoreVisualizerGraphicObject> selectableObjects = getSelectableObjects(); // the list of selectable objects is ordered to have contained objects @@ -938,7 +938,7 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas implements ISelecti /** Saves current canvas selection as list of model objects. */ protected void updateSelection(boolean raiseEvent) { // get model objects (if any) corresponding to canvas selection - HashSet<Object> selectedObjects = new HashSet<Object>(); + HashSet<Object> selectedObjects = new HashSet<>(); // threads if (m_threads != null) { @@ -1001,7 +1001,7 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas implements ISelecti * For instance, threads are before cores and cores before CPUs. */ protected List<MulticoreVisualizerGraphicObject> getSelectableObjects() { - List<MulticoreVisualizerGraphicObject> selectableObjects = new ArrayList<MulticoreVisualizerGraphicObject>(); + List<MulticoreVisualizerGraphicObject> selectableObjects = new ArrayList<>(); selectableObjects.addAll(m_threads); selectableObjects.addAll(m_cores); selectableObjects.addAll(m_cpus); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvasFilter.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvasFilter.java index 93283d006e2..eb3578413ae 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvasFilter.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvasFilter.java @@ -112,8 +112,8 @@ public class MulticoreVisualizerCanvasFilter { clearFilter(); } - m_filterList = new ArrayList<IVisualizerModelObject>(); - m_dynamicFilterList = new ArrayList<IVisualizerModelObject>(); + m_filterList = new ArrayList<>(); + m_dynamicFilterList = new ArrayList<>(); m_filterActive = true; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvasFilterManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvasFilterManager.java index 82ef92bf0d7..65b9be20dc4 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvasFilterManager.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvasFilterManager.java @@ -36,7 +36,7 @@ public class MulticoreVisualizerCanvasFilterManager implements SessionEndedListe /** Constructor */ public MulticoreVisualizerCanvasFilterManager(MulticoreVisualizerCanvas canvas) { - m_filterSessionMap = new Hashtable<String, MulticoreVisualizerCanvasFilter>(); + m_filterSessionMap = new Hashtable<>(); m_canvas = canvas; // add listener to be notified when a debug session ends DsfSession.addSessionEndedListener(this); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCore.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCore.java index 5f2ab47c33f..1a572621018 100755 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCore.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCore.java @@ -52,7 +52,7 @@ public class MulticoreVisualizerCore extends MulticoreVisualizerGraphicObject { if (m_cpu != null) m_cpu.addCore(this); m_id = id; - m_threads = new ArrayList<MulticoreVisualizerThread>(); + m_threads = new ArrayList<>(); // default load meter m_loadMeter = new MulticoreVisualizerLoadMeter(null, null); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerSelectionFinder.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerSelectionFinder.java index 591fda6cb2c..5d9761afb44 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerSelectionFinder.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerSelectionFinder.java @@ -68,7 +68,7 @@ public class MulticoreVisualizerSelectionFinder extends DebugViewTreeWalker { public ISelection findSelection(ISelection selection) { m_selection = SelectionUtils.getSelectedObjects(selection); - m_result = new HashSet<Object>(); + m_result = new HashSet<>(); walk(); ISelection found = SelectionUtils.toSelection(m_result); return found; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DSFSessionState.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DSFSessionState.java index cff6e9ddfbc..0d92af792c0 100755 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DSFSessionState.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DSFSessionState.java @@ -45,7 +45,7 @@ public class DSFSessionState { public DSFSessionState(String sessionId) { m_sessionId = sessionId; - m_sessionListeners = new ArrayList<Object>(); + m_sessionListeners = new ArrayList<>(); m_servicesTracker = new DsfServicesTracker(MulticoreVisualizerUIPlugin.getBundleContext(), m_sessionId); } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DebugViewTreeWalker.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DebugViewTreeWalker.java index 2e298f5e97c..e1773818d41 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DebugViewTreeWalker.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DebugViewTreeWalker.java @@ -112,7 +112,7 @@ public class DebugViewTreeWalker { * Note: each returned path is the root of a distinct debug session */ public TreePath[] getRootPaths() { - List<TreePath> paths = new ArrayList<TreePath>(); + List<TreePath> paths = new ArrayList<>(); if (m_viewer != null) { Tree tree = (Tree) m_viewer.getControl(); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/PersistentSettingsManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/PersistentSettingsManager.java index 878dfc4046a..5130ef29530 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/PersistentSettingsManager.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/PersistentSettingsManager.java @@ -431,7 +431,7 @@ public class PersistentSettingsManager { T defaultValue) { PersistentParameter<T> setting; // build the final store key with category, parameter label and specific instance, if applicable - setting = new PersistentParameter<T>(clazz, perInstance, getStorageKey(perInstance) + "." + label); //$NON-NLS-1$ + setting = new PersistentParameter<>(clazz, perInstance, getStorageKey(perInstance) + "." + label); //$NON-NLS-1$ // check that we're dealing with one of a few supported types if (setting.isTypeSupported(clazz)) { setting.setDefault(defaultValue); @@ -453,7 +453,7 @@ public class PersistentSettingsManager { List<T> defaultValue) { PersistentListParameter<T> setting; // build the final store key with category, parameter label and specific instance, if applicable - setting = new PersistentListParameter<T>(clazz, perInstance, getStorageKey(perInstance) + "." + label); //$NON-NLS-1$ + setting = new PersistentListParameter<>(clazz, perInstance, getStorageKey(perInstance) + "." + label); //$NON-NLS-1$ // check that we're dealing with one of a few supported types if (setting.isTypeSupported(clazz)) { setting.setDefault(defaultValue); @@ -475,7 +475,7 @@ public class PersistentSettingsManager { Map<String, T> defaultValue) { PersistentMapParameter<T> setting; // build the final store key with category, parameter label and specific instance, if applicable - setting = new PersistentMapParameter<T>(clazz, perInstance, getStorageKey(perInstance) + "." + label); //$NON-NLS-1$ + setting = new PersistentMapParameter<>(clazz, perInstance, getStorageKey(perInstance) + "." + label); //$NON-NLS-1$ // check that we're dealing with one of a few supported types if (setting.isTypeSupported(clazz)) { setting.setDefault(defaultValue); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/src/org/eclipse/cdt/dsf/mi/service/command/commands/TestMICommandConstructCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/src/org/eclipse/cdt/dsf/mi/service/command/commands/TestMICommandConstructCommand.java index 49ef3c2d2ad..36d23292870 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/src/org/eclipse/cdt/dsf/mi/service/command/commands/TestMICommandConstructCommand.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/src/org/eclipse/cdt/dsf/mi/service/command/commands/TestMICommandConstructCommand.java @@ -38,7 +38,7 @@ public class TestMICommandConstructCommand { @Test public void multipleParametersShouldHaveCorrectSeparators() { // Setup - MICommand<MIInfo> target = new MICommand<MIInfo>(new TestContext(), "-test-operation"); + MICommand<MIInfo> target = new MICommand<>(new TestContext(), "-test-operation"); target.setOptions(new String[] { "-a a_test\\with slashes", "-b \"hello\"", "-c c_test" }); target.setParameters(new String[] { "-param1 param", "param2", "-param3" }); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/DsfTerminateCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/DsfTerminateCommand.java index 8f83bac2471..840406179bd 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/DsfTerminateCommand.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/DsfTerminateCommand.java @@ -235,7 +235,7 @@ public class DsfTerminateCommand implements ITerminateHandler { } private IProcessDMContext[] getProcessDMContexts(Object[] elements) { - final Set<IProcessDMContext> procDmcs = new HashSet<IProcessDMContext>(); + final Set<IProcessDMContext> procDmcs = new HashSet<>(); for (Object obj : elements) { if (obj instanceof IDMVMContext) { IProcessDMContext procDmc = DMContexts.getAncestorOfType(((IDMVMContext) obj).getDMContext(), diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbDisconnectCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbDisconnectCommand.java index 1f8ced9e17f..6ebf4b46036 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbDisconnectCommand.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbDisconnectCommand.java @@ -184,7 +184,7 @@ public class GdbDisconnectCommand implements IDisconnectHandler { private void getContainerDMContexts(Object[] elements, final DataRequestMonitor<IContainerDMContext[]> rm) { GdbLaunch launch = null; - final Set<IContainerDMContext> contDmcs = new HashSet<IContainerDMContext>(); + final Set<IContainerDMContext> contDmcs = new HashSet<>(); for (Object obj : elements) { if (obj instanceof GdbLaunch) { launch = (GdbLaunch) obj; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/DisassemblyToggleDynamicPrintfTarget.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/DisassemblyToggleDynamicPrintfTarget.java index e42e3247f43..4db6fc84d29 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/DisassemblyToggleDynamicPrintfTarget.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/DisassemblyToggleDynamicPrintfTarget.java @@ -49,7 +49,7 @@ public class DisassemblyToggleDynamicPrintfTarget extends AbstractDisassemblyBre protected void createLineBreakpointInteractive(IWorkbenchPart part, String sourceHandle, IResource resource, int lineNumber) throws CoreException { ICDynamicPrintf dprintf = (ICDynamicPrintf) CDIDebugModel.createBlankLineDynamicPrintf(); - Map<String, Object> attributes = new HashMap<String, Object>(); + Map<String, Object> attributes = new HashMap<>(); CDIDebugModel.setLineBreakpointAttributes(attributes, sourceHandle, getBreakpointType(), lineNumber, true, 0, ""); //$NON-NLS-1$ @@ -89,7 +89,7 @@ public class DisassemblyToggleDynamicPrintfTarget extends AbstractDisassemblyBre protected void createAddressBreakpointInteractive(IWorkbenchPart part, IResource resource, IAddress address) throws CoreException { ICDynamicPrintf dprintf = (ICDynamicPrintf) CDIDebugModel.createBlankAddressDynamicPrintf(); - Map<String, Object> attributes = new HashMap<String, Object>(); + Map<String, Object> attributes = new HashMap<>(); CDIDebugModel.setAddressBreakpointAttributes(attributes, null, null, getBreakpointType(), -1, address, true, 0, ""); //$NON-NLS-1$ diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/DisassemblyToggleTracepointsTarget.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/DisassemblyToggleTracepointsTarget.java index f2d4d80f32e..70aafa7ded5 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/DisassemblyToggleTracepointsTarget.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/DisassemblyToggleTracepointsTarget.java @@ -44,7 +44,7 @@ public class DisassemblyToggleTracepointsTarget extends AbstractDisassemblyBreak protected void createLineBreakpointInteractive(IWorkbenchPart part, String sourceHandle, IResource resource, int lineNumber) throws CoreException { ICLineBreakpoint lineBp = CDIDebugModel.createBlankLineTracepoint(); - Map<String, Object> attributes = new HashMap<String, Object>(); + Map<String, Object> attributes = new HashMap<>(); CDIDebugModel.setLineBreakpointAttributes(attributes, sourceHandle, getBreakpointType(), lineNumber, true, 0, ""); //$NON-NLS-1$ openBreakpointPropertiesDialog(lineBp, part, resource, attributes); @@ -63,7 +63,7 @@ public class DisassemblyToggleTracepointsTarget extends AbstractDisassemblyBreak protected void createAddressBreakpointInteractive(IWorkbenchPart part, IResource resource, IAddress address) throws CoreException { ICLineBreakpoint lineBp = CDIDebugModel.createBlankAddressTracepoint(); - Map<String, Object> attributes = new HashMap<String, Object>(); + Map<String, Object> attributes = new HashMap<>(); CDIDebugModel.setAddressBreakpointAttributes(attributes, null, null, getBreakpointType(), -1, address, true, 0, ""); //$NON-NLS-1$ openBreakpointPropertiesDialog(lineBp, part, resource, attributes); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/GdbThreadFilterEditor.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/GdbThreadFilterEditor.java index 10e2e8663bd..fa7680944d2 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/GdbThreadFilterEditor.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/GdbThreadFilterEditor.java @@ -141,7 +141,7 @@ public class GdbThreadFilterEditor { } if (parent instanceof ILaunchManager) { - List<Object> children = new ArrayList<Object>(); + List<Object> children = new ArrayList<>(); ILaunch[] launches = ((ILaunchManager) parent).getLaunches(); IContainerDMContext[] targetArray; for (int i = 0; i < launches.length; i++) { @@ -276,7 +276,7 @@ public class GdbThreadFilterEditor { if (!(input instanceof ILaunchManager)) { return new IContainerDMContext[0]; } - List<Object> targets = new ArrayList<Object>(); + List<Object> targets = new ArrayList<>(); ILaunch[] launches = ((ILaunchManager) input).getLaunches(); IContainerDMContext[] targetArray; for (int i = 0; i < launches.length; i++) { @@ -343,7 +343,7 @@ public class GdbThreadFilterEditor { private IExecutionDMContext[] getTargetThreadFilters(IContainerDMContext target) { Object[] threads = ((ITreeContentProvider) getThreadViewer().getContentProvider()).getChildren(target); - ArrayList<Object> list = new ArrayList<Object>(threads.length); + ArrayList<Object> list = new ArrayList<>(threads.length); for (int i = 0; i < threads.length; ++i) { if (getThreadViewer().getChecked(threads[i])) list.add(threads[i]); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/ToggleDynamicPrintfTargetFactory.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/ToggleDynamicPrintfTargetFactory.java index 6a9f1193941..61ec294d7ab 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/ToggleDynamicPrintfTargetFactory.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/ToggleDynamicPrintfTargetFactory.java @@ -48,7 +48,7 @@ public class ToggleDynamicPrintfTargetFactory implements IToggleBreakpointsTarge public static final String TOGGLE_C_DYNAMICPRINTF_TARGET_ID = CDebugUIPlugin.PLUGIN_ID + ".toggleCDynamicPrintfTarget"; //$NON-NLS-1$ - private static final Set<String> TOGGLE_TARGET_IDS_ALL = new HashSet<String>(1); + private static final Set<String> TOGGLE_TARGET_IDS_ALL = new HashSet<>(1); static { TOGGLE_TARGET_IDS_ALL.add(TOGGLE_C_DYNAMICPRINTF_TARGET_ID); } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/ToggleTracepointsTargetFactory.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/ToggleTracepointsTargetFactory.java index 1a81de7abf5..e2af9cc455e 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/ToggleTracepointsTargetFactory.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/ToggleTracepointsTargetFactory.java @@ -46,7 +46,7 @@ public class ToggleTracepointsTargetFactory implements IToggleBreakpointsTargetF */ public static final String TOGGLE_C_TRACEPOINT_TARGET_ID = CDebugUIPlugin.PLUGIN_ID + ".toggleCTracepointTarget"; //$NON-NLS-1$ - private static final Set<String> TOGGLE_TARGET_IDS_ALL = new HashSet<String>(1); + private static final Set<String> TOGGLE_TARGET_IDS_ALL = new HashSet<>(1); static { TOGGLE_TARGET_IDS_ALL.add(TOGGLE_C_TRACEPOINT_TARGET_ID); } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java index f825dd5a1fa..b8bd0ed1830 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java @@ -90,7 +90,7 @@ public class GdbConnectCommand extends RefreshableDebugCommand implements IConne // reset it by using a new debug session. // This map is only needed for remote sessions, since we don't need to specify // the binary location for a local attach session. - private Map<String, String> fProcessNameToBinaryMap = new HashMap<String, String>(); + private Map<String, String> fProcessNameToBinaryMap = new HashMap<>(); public GdbConnectCommand(DsfSession session, ILaunch launch) { fLaunch = launch; @@ -408,7 +408,7 @@ public class GdbConnectCommand extends RefreshableDebugCommand implements IConne @Override protected void handleSuccess() { - final List<IProcessExtendedInfo> procInfoList = new ArrayList<IProcessExtendedInfo>(); + final List<IProcessExtendedInfo> procInfoList = new ArrayList<>(); final CountingRequestMonitor countingRm = new CountingRequestMonitor(fExecutor, rm) { @@ -555,7 +555,7 @@ public class GdbConnectCommand extends RefreshableDebugCommand implements IConne // Create a list of all our processes so we can attach to one at a time. // We need to create a new list so that we can remove elements from it. - final List<IProcessExtendedInfo> procList = new ArrayList<IProcessExtendedInfo>(Arrays.asList(processes)); + final List<IProcessExtendedInfo> procList = new ArrayList<>(Arrays.asList(processes)); // Create a one element array to remember what process we are trying to attach to, so that we can // use it in case of error. final IProcessExtendedInfo[] previousProcAttempt = new IProcessExtendedInfo[1]; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/NewExecutableInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/NewExecutableInfo.java index cc5ae917434..d2813555904 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/NewExecutableInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/NewExecutableInfo.java @@ -35,7 +35,7 @@ public class NewExecutableInfo { final private SessionType fSessionType; private String fHostPath = ""; //$NON-NLS-1$ - private Map<String, Object> fAttributes = new HashMap<String, Object>(); + private Map<String, Object> fAttributes = new HashMap<>(); public NewExecutableInfo(SessionType sessionType) { super(); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/SolibSearchPathBlock.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/SolibSearchPathBlock.java index 965e4f943d7..c526ae5a189 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/SolibSearchPathBlock.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/SolibSearchPathBlock.java @@ -316,7 +316,7 @@ public class SolibSearchPathBlock extends Observable implements IMILaunchConfigu @SuppressWarnings("unchecked") List<String> values = configuration.getAttribute( IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, Collections.EMPTY_LIST); - ArrayList<Path> paths = new ArrayList<Path>(values.size()); + ArrayList<Path> paths = new ArrayList<>(values.size()); Iterator<String> it = values.iterator(); while (it.hasNext()) { paths.add(new Path(it.next())); @@ -337,7 +337,7 @@ public class SolibSearchPathBlock extends Observable implements IMILaunchConfigu List<String> autoSolibs = configuration .getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB_LIST, Collections.EMPTY_LIST); - List<File> list = new ArrayList<File>(autoSolibs.size()); + List<File> list = new ArrayList<>(autoSolibs.size()); Iterator<String> it = autoSolibs.iterator(); while (it.hasNext()) { list.add(new File(it.next())); @@ -363,14 +363,14 @@ public class SolibSearchPathBlock extends Observable implements IMILaunchConfigu @SuppressWarnings("unchecked") List<IPath> elements = fDirList.getElements(); - ArrayList<String> values = new ArrayList<String>(elements.size()); + ArrayList<String> values = new ArrayList<>(elements.size()); Iterator<IPath> it = elements.iterator(); while (it.hasNext()) { values.add((it.next()).toOSString()); } configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, values); } - ArrayList<String> autoLibs = new ArrayList<String>(fAutoSolibs.length); + ArrayList<String> autoLibs = new ArrayList<>(fAutoSolibs.length); for (int i = 0; i < fAutoSolibs.length; ++i) autoLibs.add(fAutoSolibs[i].getPath()); configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB_LIST, autoLibs); @@ -467,7 +467,7 @@ public class SolibSearchPathBlock extends Observable implements IMILaunchConfigu @SuppressWarnings("unchecked") List<IPath> dirList = fDirList.getSelectedElements(); - final HashSet<IPath> libs = new HashSet<IPath>(10); + final HashSet<IPath> libs = new HashSet<>(10); if (generateLibraryList(dirList.toArray(new IPath[dirList.size()]), libs)) { ITreeContentProvider cp = new ITreeContentProvider() { @Override diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/AttachProcessHandler.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/AttachProcessHandler.java index 1849e4c3ba6..e180d301939 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/AttachProcessHandler.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/AttachProcessHandler.java @@ -147,7 +147,7 @@ public class AttachProcessHandler extends AbstractHandler implements IHandler { // Use a set of process. It is possible to have multiple entries // with the same pid, e.g. threads with same process id - Set<String> process_ids = new LinkedHashSet<String>(); + Set<String> process_ids = new LinkedHashSet<>(); for (Object sel : ((IStructuredSelection) selection).toList()) { IResourcesInformation ri = (IResourcesInformation) sel; if (pidColumn >= 0) { @@ -163,7 +163,7 @@ public class AttachProcessHandler extends AbstractHandler implements IHandler { } final ICommandControlDMContext context = ((OSResourcesView) part).getSessionContext(); - final List<Sequence.Step> attach_steps = new ArrayList<Sequence.Step>(process_ids.size()); + final List<Sequence.Step> attach_steps = new ArrayList<>(process_ids.size()); for (final String p : process_ids) { attach_steps.add(new Sequence.Step() { @Override diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/ColumnLayout.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/ColumnLayout.java index 097c760b3ac..b2b1dd24977 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/ColumnLayout.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/ColumnLayout.java @@ -25,8 +25,8 @@ import org.eclipse.jface.dialogs.IDialogSettings; */ class ColumnLayout { private String fResourceClass; - private Map<String, Boolean> fVisible = new HashMap<String, Boolean>(); - private Map<String, Integer> fWidth = new HashMap<String, Integer>(); + private Map<String, Boolean> fVisible = new HashMap<>(); + private Map<String, Integer> fWidth = new HashMap<>(); private Integer fSortColumn = null; private Integer fSortDirection = null; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/OSData.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/OSData.java index 4ab8142f4b6..84c6cd78904 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/OSData.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/OSData.java @@ -38,7 +38,7 @@ class OSData extends LabelProvider implements ITableLabelProvider, IStructuredCo this.data = data; determineColumnTypes(); - remap = new ArrayList<Integer>(data.getColumnNames().length); + remap = new ArrayList<>(data.getColumnNames().length); for (int i = 0; i < data.getColumnNames().length; ++i) remap.add(i); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/OSResourcesView.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/OSResourcesView.java index a6d7a98415c..622a992a63e 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/OSResourcesView.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/OSResourcesView.java @@ -91,7 +91,7 @@ public class OSResourcesView extends ViewPart implements DsfSession.SessionEnded // The data model for the selected session, or null if no session is // selected. private SessionOSData fSessionData; - private Map<String, SessionOSData> fSessionDataCache = new HashMap<String, SessionOSData>(); + private Map<String, SessionOSData> fSessionDataCache = new HashMap<>(); // The data presently shown by table viewer. private OSData fTableShownData = null; // The data which was used to populate column selector menu @@ -112,7 +112,7 @@ public class OSResourcesView extends ViewPart implements DsfSession.SessionEnded private Action fRefreshAction; // Map from resource class name to table column layout. - private Map<String, ColumnLayout> fColumnLayouts = new HashMap<String, ColumnLayout>(); + private Map<String, ColumnLayout> fColumnLayouts = new HashMap<>(); private ColumnLayout fColumnLayout = null; @@ -553,7 +553,7 @@ public class OSResourcesView extends ViewPart implements DsfSession.SessionEnded fViewer.getTable().setEnabled(true); if (fViewer.getContentProvider() == null) { - ContentLabelProviderWrapper<OSData> wrapper = new ContentLabelProviderWrapper<OSData>(data); + ContentLabelProviderWrapper<OSData> wrapper = new ContentLabelProviderWrapper<>(data); fViewer.setContentProvider(wrapper); fViewer.setLabelProvider(wrapper); } else { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/SessionOSData.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/SessionOSData.java index fcb235617c0..7227c39c6a6 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/SessionOSData.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/SessionOSData.java @@ -55,8 +55,8 @@ public class SessionOSData { private ICommandControlDMContext fContext; private IResourceClass[] fResourceClasses = new IResourceClass[0]; - private Map<String, OSData> fExistingData = new HashMap<String, OSData>(); - private Map<String, Date> fTimestamp = new HashMap<String, Date>(); + private Map<String, OSData> fExistingData = new HashMap<>(); + private Map<String, Date> fTimestamp = new HashMap<>(); private Listener fUIListener; private Control fUIControl; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbDebugPreferencePage.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbDebugPreferencePage.java index 6298aac88fd..1c7e36d23a1 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbDebugPreferencePage.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbDebugPreferencePage.java @@ -228,7 +228,7 @@ public class GdbDebugPreferencePage extends FieldEditorPreferencePage implements AdvancedTimeoutSettingsDialog(Shell parentShell, Set<Map.Entry<String, Integer>> entries) { super(parentShell); setShellStyle(getShellStyle() | SWT.RESIZE); - fEntries = new LinkedList<CommandTimeoutEntry>(); + fEntries = new LinkedList<>(); for (Map.Entry<String, Integer> entry : entries) { fEntries.add(new CommandTimeoutEntry(entry.getKey(), entry.getValue())); } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepointactions/TracepointActionDialog.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepointactions/TracepointActionDialog.java index 09ec33f5b62..22e1510d2f2 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepointactions/TracepointActionDialog.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepointactions/TracepointActionDialog.java @@ -157,7 +157,7 @@ public class TracepointActionDialog extends Dialog { }); combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); - tracepointActions = new Vector<ITracepointAction>(TRACEPOINT_ACTIONS_COUNT); + tracepointActions = new Vector<>(TRACEPOINT_ACTIONS_COUNT); tracepointActions.add(new CollectAction()); tracepointActions.add(new EvaluateAction()); // Sub actions of whileStepping cannot be whileStepping diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/AbstractImageRegistry.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/AbstractImageRegistry.java index 2b506899f72..599e0e20d87 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/AbstractImageRegistry.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/AbstractImageRegistry.java @@ -35,8 +35,8 @@ import org.osgi.framework.Bundle; * @since 2.1 */ public abstract class AbstractImageRegistry extends ImageRegistry { - private HashMap<String, String> fPlugins = new HashMap<String, String>(); - private HashMap<String, String[]> fLocations = new HashMap<String, String[]>(); + private HashMap<String, String> fPlugins = new HashMap<>(); + private HashMap<String, String[]> fLocations = new HashMap<>(); private URL fBaseUrl; protected AbstractImageRegistry(Plugin plugin) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TracepointImageRegistry.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TracepointImageRegistry.java index e90abca9111..a9d5dbc255e 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TracepointImageRegistry.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TracepointImageRegistry.java @@ -26,7 +26,7 @@ import org.eclipse.jface.resource.ImageDescriptor; * @since 2.1 */ public class TracepointImageRegistry extends AbstractImageRegistry { - private static List<Object[]> fStore = new ArrayList<Object[]>(); + private static List<Object[]> fStore = new ArrayList<>(); private static String add(String plugin, String[] dirs, String name) { String key = plugin + '/' + dirs[0] + '/' + name; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/GdbVariableVMNode.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/GdbVariableVMNode.java index 1fe6d290a0f..31b2871d205 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/GdbVariableVMNode.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/GdbVariableVMNode.java @@ -294,7 +294,7 @@ public class GdbVariableVMNode extends VariableVMNode { /** * Maps expressions to their current limit on the maximum number of children. */ - private Map<IExpressionDMContext, Integer> childCountLimits = new HashMap<IExpressionDMContext, Integer>(); + private Map<IExpressionDMContext, Integer> childCountLimits = new HashMap<>(); /** * Utility method to create an IStatus object for an internal error @@ -418,7 +418,7 @@ public class GdbVariableVMNode extends VariableVMNode { @Override public void update(IPropertiesUpdate[] updates) { - List<IPropertiesUpdate> realExpressions = new ArrayList<IPropertiesUpdate>(); + List<IPropertiesUpdate> realExpressions = new ArrayList<>(); for (IPropertiesUpdate update : updates) { if (update.getElement() instanceof IncompleteChildrenVMC) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/breakpoints/GdbBreakpointVMProvider.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/breakpoints/GdbBreakpointVMProvider.java index 0994819ade3..f2d31424529 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/breakpoints/GdbBreakpointVMProvider.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/breakpoints/GdbBreakpointVMProvider.java @@ -122,7 +122,7 @@ public class GdbBreakpointVMProvider extends BreakpointVMProvider { ISelection debugContext = getDebugContext(); if (debugContext instanceof IStructuredSelection) { // Use a set to avoid duplicates - final Set<IBreakpoint> bps = new HashSet<IBreakpoint>(); + final Set<IBreakpoint> bps = new HashSet<>(); int count = 0; final ImmediateCountingRequestMonitor crm = new ImmediateCountingRequestMonitor(rm) { @@ -167,7 +167,7 @@ public class GdbBreakpointVMProvider extends BreakpointVMProvider { } else { // Original behavior of bp filtering. Return all bp of type ICBreakpoint IBreakpoint[] allBreakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(); - List<IBreakpoint> filteredBPs = new ArrayList<IBreakpoint>(allBreakpoints.length); + List<IBreakpoint> filteredBPs = new ArrayList<>(allBreakpoints.length); for (IBreakpoint bp : allBreakpoints) { if (bp instanceof ICBreakpoint && bp.getModelIdentifier().equals(CDebugCorePlugin.PLUGIN_ID)) { filteredBPs.add(bp); @@ -293,7 +293,7 @@ public class GdbBreakpointVMProvider extends BreakpointVMProvider { } if (getData().length > 0) { - final Set<IBreakpoint> bps = new HashSet<IBreakpoint>(getData().length); + final Set<IBreakpoint> bps = new HashSet<>(getData().length); final CountingRequestMonitor crm = new CountingRequestMonitor( ImmediateExecutor.getInstance(), rm) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/ThreadVMNode.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/ThreadVMNode.java index 5d904de1fb3..cf58fccda4b 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/ThreadVMNode.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/ThreadVMNode.java @@ -280,7 +280,7 @@ public class ThreadVMNode extends AbstractThreadVMNode implements IElementLabelP return; } - List<IExecutionDMContext> execDmcsNotRunning = new ArrayList<IExecutionDMContext>(); + List<IExecutionDMContext> execDmcsNotRunning = new ArrayList<>(); for (IExecutionDMContext execDmc : execDmcs) { // Keep suspended or stepping threads if (runControl.isSuspended(execDmc) || runControl.isStepping(execDmc)) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/breakpoints/CBreakpointGdbThreadsFilterExtension.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/breakpoints/CBreakpointGdbThreadsFilterExtension.java index fe1c79de813..7018137333c 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/breakpoints/CBreakpointGdbThreadsFilterExtension.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/breakpoints/CBreakpointGdbThreadsFilterExtension.java @@ -104,7 +104,7 @@ public class CBreakpointGdbThreadsFilterExtension implements IDsfBreakpointExten public void setThreadFilters(IExecutionDMContext[] threads) throws CoreException { if (threads != null && threads.length > 0) { IContainerDMContext target = DMContexts.getAncestorOfType(threads[0], IContainerDMContext.class); - fFilteredThreadsByTarget.put(target, new HashSet<IExecutionDMContext>(Arrays.asList(threads))); + fFilteredThreadsByTarget.put(target, new HashSet<>(Arrays.asList(threads))); } } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/CoreList.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/CoreList.java index 35bd9a7dbaf..0b091fd9ea8 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/CoreList.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/CoreList.java @@ -79,7 +79,7 @@ public class CoreList { private void getCoreListFromFile() { File cpuInfo = new File(fCoreFileName); - Vector<ICoreInfo> coreInfo = new Vector<ICoreInfo>(); + Vector<ICoreInfo> coreInfo = new Vector<>(); BufferedReader reader = null; try { String processorId = null; @@ -134,7 +134,7 @@ public class CoreList { } private void getCoreListFromResourceInfo() { - Vector<ICoreInfo> coreInfo = new Vector<ICoreInfo>(); + Vector<ICoreInfo> coreInfo = new Vector<>(); int processorIdIndex = -1; int physicalIdIndex = -1; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/GdbDebugOptions.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/GdbDebugOptions.java index 05ec17c3be8..3e2c646cb82 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/GdbDebugOptions.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/GdbDebugOptions.java @@ -51,7 +51,7 @@ public class GdbDebugOptions implements DebugOptionsListener { * Constructor */ public GdbDebugOptions(BundleContext context) { - Hashtable<String, String> props = new Hashtable<String, String>(2); + Hashtable<String, String> props = new Hashtable<>(2); props.put(org.eclipse.osgi.service.debug.DebugOptions.LISTENER_SYMBOLICNAME, GdbPlugin.getUniqueIdentifier()); context.registerService(DebugOptionsListener.class.getName(), this, props); } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/ProcStatCoreLoads.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/ProcStatCoreLoads.java index 9315a3ffe78..fcabd048633 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/ProcStatCoreLoads.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/ProcStatCoreLoads.java @@ -25,7 +25,7 @@ public class ProcStatCoreLoads { private Map<String, Float> m_coreLoads; public ProcStatCoreLoads() { - m_coreLoads = new HashMap<String, Float>(); + m_coreLoads = new HashMap<>(); } public void put(String coreId, Float load) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/ProcStatCounters.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/ProcStatCounters.java index c6266e8f674..4a47d1acfe7 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/ProcStatCounters.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/ProcStatCounters.java @@ -22,7 +22,7 @@ import java.util.Map; * TODO: extend to more than the tick counters. */ public class ProcStatCounters { - private Map<String, OneCoreTickCounters> fTickCounters = new HashMap<String, OneCoreTickCounters>(); + private Map<String, OneCoreTickCounters> fTickCounters = new HashMap<>(); /** * An object of this class holds one set of core/CPU tick counter values, for a single CPU core @@ -70,7 +70,7 @@ public class ProcStatCounters { * */ public ProcStatCounters() { - fTickCounters = new HashMap<String, OneCoreTickCounters>(); + fTickCounters = new HashMap<>(); } /** diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/ProcStatParser.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/ProcStatParser.java index beedd9c562f..f54af2e537a 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/ProcStatParser.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/ProcStatParser.java @@ -67,7 +67,7 @@ public class ProcStatParser { // catch "cpu" lines from /proc/stat Matcher matcherCpu = patternCpu.matcher(line); if (matcherCpu.find()) { - Vector<Integer> ticks = new Vector<Integer>(); + Vector<Integer> ticks = new Vector<>(); coreId = matcherCpu.group(1); // extract the counters for current cpu line for (String tick : matcherCpu.group(2).trim().split("\\s+")) { //$NON-NLS-1$ diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryAddressInfoRegistersRetrieval.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryAddressInfoRegistersRetrieval.java index 6baf5cbaf47..ed8aeed455e 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryAddressInfoRegistersRetrieval.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryAddressInfoRegistersRetrieval.java @@ -118,7 +118,7 @@ public class GdbMemoryAddressInfoRegistersRetrieval implements IGdbMemoryAddress // memSpaceId = ((IMemorySpaceAwareMemoryBlock) memBlock).getMemorySpaceID(); // } - List<IMemoryBlockAddressInfoItem> items = new ArrayList<IMemoryBlockAddressInfoItem>(); + List<IMemoryBlockAddressInfoItem> items = new ArrayList<>(); // Remove all items with value zero for (IMemoryBlockAddressInfoItem item : regDataContainers) { if (item.getAddress().intValue() != 0) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryAddressInfoVariablesRetrieval.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryAddressInfoVariablesRetrieval.java index 9b5274e8e0c..94a890453cb 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryAddressInfoVariablesRetrieval.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryAddressInfoVariablesRetrieval.java @@ -136,7 +136,7 @@ public class GdbMemoryAddressInfoVariablesRetrieval implements IGdbMemoryAddress // Create a List in which we store the DM data objects for the local variables. This is // necessary because there is no MultiDataRequestMonitor. :) - final List<IVariableDMData> localsDMData = new ArrayList<IVariableDMData>(); + final List<IVariableDMData> localsDMData = new ArrayList<>(); // Create the MultiRequestMonitor to handle completion of the set of getModelData() calls. @@ -262,7 +262,7 @@ public class GdbMemoryAddressInfoVariablesRetrieval implements IGdbMemoryAddress String ctxDefaultMemSpaceId) { int length = contentsBins.length; - final List<IMemoryBlockAddressInfoItem> infoItems = new ArrayList<IMemoryBlockAddressInfoItem>(); + final List<IMemoryBlockAddressInfoItem> infoItems = new ArrayList<>(); // Resolve the memory space id of the memory block String memBlockMemSpaceId = EMPTY_STRING; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryBlockRetrieval.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryBlockRetrieval.java index 087efd478c0..c0f8e14f2e7 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryBlockRetrieval.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryBlockRetrieval.java @@ -466,7 +466,7 @@ public class GdbMemoryBlockRetrieval extends DsfMemoryBlockRetrieval implements // Process the block list specific to this memory context // FIXME: (Bug228573) We only process the first entry... if (root.getAttribute(ATTR_EXPRESSION_LIST_CONTEXT).equals(CONTEXT_RESERVED)) { - List<IMemoryBlock> blocks = new ArrayList<IMemoryBlock>(); + List<IMemoryBlock> blocks = new ArrayList<>(); NodeList expressionList = root.getChildNodes(); int length = expressionList.getLength(); for (int i = 0; i < length; ++i) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/tracepointactions/TracepointActionManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/tracepointactions/TracepointActionManager.java index 0fa2c688af3..02de3bb747c 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/tracepointactions/TracepointActionManager.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/tracepointactions/TracepointActionManager.java @@ -74,7 +74,7 @@ public class TracepointActionManager { public ArrayList<ITracepointAction> getActions() { if (tracepointActions == null) { - tracepointActions = new ArrayList<ITracepointAction>(); + tracepointActions = new ArrayList<>(); loadActionData(); } return tracepointActions; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence_7_0.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence_7_0.java index f4d2d140116..0a0a83e62a4 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence_7_0.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence_7_0.java @@ -57,7 +57,7 @@ public class FinalLaunchSequence_7_0 extends FinalLaunchSequence { if (GROUP_TOP_LEVEL.equals(group)) { // Initialize the list with the base class' steps // We need to create a list that we can modify, which is why we create our own ArrayList. - List<String> orderList = new ArrayList<String>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); + List<String> orderList = new ArrayList<>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); // Now insert our steps right after the initialization of the base class. orderList.add(orderList.indexOf("stepInitializeFinalLaunchSequence") + 1, //$NON-NLS-1$ diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence_7_12.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence_7_12.java index a3932deb844..3cd02b138e2 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence_7_12.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence_7_12.java @@ -52,7 +52,7 @@ public class FinalLaunchSequence_7_12 extends FinalLaunchSequence_7_7 { if (GROUP_TOP_LEVEL.equals(group)) { // Initialize the list with the base class' steps // We need to create a list that we can modify, which is why we create our own ArrayList. - List<String> orderList = new ArrayList<String>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); + List<String> orderList = new ArrayList<>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); // Now insert our steps right after the initialization of the base class. orderList.add(orderList.indexOf("stepInitializeFinalLaunchSequence_7_7") + 1, //$NON-NLS-1$ diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence_7_2.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence_7_2.java index 41763985f82..96276634c92 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence_7_2.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence_7_2.java @@ -52,7 +52,7 @@ public class FinalLaunchSequence_7_2 extends FinalLaunchSequence_7_0 { if (GROUP_TOP_LEVEL.equals(group)) { // Initialize the list with the base class' steps // We need to create a list that we can modify, which is why we create our own ArrayList. - List<String> orderList = new ArrayList<String>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); + List<String> orderList = new ArrayList<>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); // Now insert our steps right after the initialization of the base class. orderList.add(orderList.indexOf("stepInitializeFinalLaunchSequence_7_0") + 1, //$NON-NLS-1$ diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence_7_7.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence_7_7.java index 98bc35f9a78..3a42f5782c8 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence_7_7.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence_7_7.java @@ -49,7 +49,7 @@ public class FinalLaunchSequence_7_7 extends FinalLaunchSequence_7_2 { if (GROUP_TOP_LEVEL.equals(group)) { // Initialize the list with the base class' steps // We need to create a list that we can modify, which is why we create our own ArrayList. - List<String> orderList = new ArrayList<String>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); + List<String> orderList = new ArrayList<>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); // Now insert our steps right after the initialization of the base class. orderList.add(orderList.indexOf("stepInitializeFinalLaunchSequence_7_2") + 1, //$NON-NLS-1$ diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java index 9b7af989956..9208008cc9d 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java @@ -223,7 +223,7 @@ public class GdbLaunch extends DsfLaunch implements ITerminate, IDisconnect, ITr // the overrideable process factory to allow others to override. // First set attribute to specify we want to create the gdb process. // Bug 210366 - Map<String, String> attributes = new HashMap<String, String>(); + Map<String, String> attributes = new HashMap<>(); attributes.put(IGdbDebugConstants.PROCESS_TYPE_CREATION_ATTR, IGdbDebugConstants.GDB_PROCESS_CREATION_VALUE); DebugPlugin.newProcess(this, gdbProc, label, attributes); @@ -633,7 +633,7 @@ public class GdbLaunch extends DsfLaunch implements ITerminate, IDisconnect, ITr public String[] getLaunchEnvironment() throws CoreException { IProject project = getProject(); - HashMap<String, String> envMap = new HashMap<String, String>(); + HashMap<String, String> envMap = new HashMap<>(); ICProjectDescription projDesc = CoreModel.getDefault().getProjectDescription(project, false); if (projDesc != null) { String buildConfigID = getLaunchConfiguration() @@ -675,7 +675,7 @@ public class GdbLaunch extends DsfLaunch implements ITerminate, IDisconnect, ITr } // Turn it into an envp format - List<String> strings = new ArrayList<String>(envMap.size()); + List<String> strings = new ArrayList<>(envMap.size()); for (Entry<String, String> entry : envMap.entrySet()) { StringBuilder buffer = new StringBuilder(entry.getKey()); buffer.append('=').append(entry.getValue()); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchUtils.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchUtils.java index 9b777cb2bd9..b67cc2665b0 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchUtils.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchUtils.java @@ -529,7 +529,7 @@ public class LaunchUtils { } // Environment variables and inherited vars - HashMap<String, String> envMap = new HashMap<String, String>(); + HashMap<String, String> envMap = new HashMap<>(); IEnvironmentVariable[] vars = CCorePlugin.getDefault().getBuildEnvironmentManager().getVariables(cfg, true); for (IEnvironmentVariable var : vars) { envMap.put(var.getName(), var.getValue()); @@ -551,7 +551,7 @@ public class LaunchUtils { } // Turn it into an envp format - List<String> strings = new ArrayList<String>(envMap.size()); + List<String> strings = new ArrayList<>(envMap.size()); for (Entry<String, String> entry : envMap.entrySet()) { StringBuilder buffer = new StringBuilder(entry.getKey()); buffer.append('=').append(entry.getValue()); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/ShutdownSequence.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/ShutdownSequence.java index 3833bdff77e..ce8729b5cbb 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/ShutdownSequence.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/ShutdownSequence.java @@ -90,7 +90,7 @@ public class ShutdownSequence extends Sequence { String.format("(%s=%s)", IDsfService.PROP_SESSION_ID, fSessionId).intern()); //$NON-NLS-1$ if (serviceRefs != null) { - List<IDsfService> services = new ArrayList<IDsfService>(serviceRefs.length); + List<IDsfService> services = new ArrayList<>(serviceRefs.length); for (ServiceReference<?> ref : serviceRefs) { Object serviceObj = GdbPlugin.getBundleContext().getService(ref); if (serviceObj instanceof IDsfService) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/DebugNewProcessSequence_7_2.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/DebugNewProcessSequence_7_2.java index c2918cbda48..ea63c59f8d5 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/DebugNewProcessSequence_7_2.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/DebugNewProcessSequence_7_2.java @@ -66,7 +66,7 @@ public class DebugNewProcessSequence_7_2 extends DebugNewProcessSequence { if (GROUP_TOP_LEVEL.equals(group)) { // Initialize the list with the base class' steps // We need to create a list that we can modify, which is why we create our own ArrayList. - List<String> orderList = new ArrayList<String>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); + List<String> orderList = new ArrayList<>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); // Now insert our steps right after the initialization of the base class. orderList.add(orderList.indexOf("stepInitializeBaseSequence") + 1, "stepInitializeSequence_7_2"); //$NON-NLS-1$ //$NON-NLS-2$ diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBreakpoints_7_0.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBreakpoints_7_0.java index 2b52817c0fe..0b7ed1dd454 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBreakpoints_7_0.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBreakpoints_7_0.java @@ -288,7 +288,7 @@ public class GDBBreakpoints_7_0 extends MIBreakpoints { // Also, tracepoints are created with no passcount. // We have to set the passcount manually now. // Same for commands. - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(MIBreakpoints.IS_ENABLED, getProperty(attributes, MIBreakpoints.IS_ENABLED, true)); delta.put(MIBreakpoints.PASS_COUNT, @@ -393,7 +393,7 @@ public class GDBBreakpoints_7_0 extends MIBreakpoints { return; } - ArrayList<String> actionStrings = new ArrayList<String>(); + ArrayList<String> actionStrings = new ArrayList<>(); for (ITracepointAction action : actions) { if (action != null) { actionStrings.add(action.getSummary()); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBreakpoints_7_2.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBreakpoints_7_2.java index 5e0491fc403..c3006c344a7 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBreakpoints_7_2.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBreakpoints_7_2.java @@ -256,7 +256,7 @@ public class GDBBreakpoints_7_2 extends GDBBreakpoints_7_0 { // the same thing as ignore-count, which is not supported by // tracepoints). We have to set the passcount manually now. // Same for commands. - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(MIBreakpoints.PASS_COUNT, getProperty(attributes, MIBreakpoints.PASS_COUNT, 0)); delta.put(MIBreakpoints.COMMANDS, getProperty(attributes, MIBreakpoints.COMMANDS, "")); //$NON-NLS-1$ modifyBreakpoint(dmc, delta, drm, false); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBHardwareAndOS.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBHardwareAndOS.java index 20012763ca3..7b7f2c5422a 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBHardwareAndOS.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBHardwareAndOS.java @@ -289,7 +289,7 @@ public class GDBHardwareAndOS extends AbstractDsfService implements IGDBHardware // handle getting the required cpu info fFetchCPUInfoCache = new CommandCache(getSession(), new CPUInfoManager()); fFetchCPUInfoCache.setContextAvailable(fCommandControl.getContext(), true); - fLoadInfoRequestCache = new HashMap<IDMContext, DataRequestMonitor<ILoadInfo>>(); + fLoadInfoRequestCache = new HashMap<>(); getSession().addServiceEventListener(this, null); @@ -400,7 +400,7 @@ public class GDBHardwareAndOS extends AbstractDsfService implements IGDBHardware * Parse the CoreInfo and create the CPU Contexts for the hardwareTarget context. */ ICPUDMContext[] parseCoresInfoForCPUs(IHardwareTargetDMContext dmc, ICoreInfo[] coresInfo) { - Set<String> cpuIds = new HashSet<String>(); + Set<String> cpuIds = new HashSet<>(); ICPUDMContext[] CPUs; for (ICoreInfo core : coresInfo) { @@ -420,7 +420,7 @@ public class GDBHardwareAndOS extends AbstractDsfService implements IGDBHardware */ ICoreDMContext[] parseCoresInfoForCores(ICPUDMContext cpuDmc, ICoreInfo[] coresInfo) { - Vector<ICoreDMContext> coreDmcs = new Vector<ICoreDMContext>(); + Vector<ICoreDMContext> coreDmcs = new Vector<>(); for (ICoreInfo core : coresInfo) { if (core.getPhysicalId().equals(cpuDmc.getId())) { // This core belongs to the right CPU @@ -476,7 +476,7 @@ public class GDBHardwareAndOS extends AbstractDsfService implements IGDBHardware * information we need. */ private class CPUInfoManager implements ICommandControl { - private final List<ICommandListener> fCommandProcessors = new ArrayList<ICommandListener>(); + private final List<ICommandListener> fCommandProcessors = new ArrayList<>(); @Override public <V extends ICommandResult> ICommandToken queueCommand(final ICommand<V> command, @@ -533,7 +533,7 @@ public class GDBHardwareAndOS extends AbstractDsfService implements IGDBHardware @Override protected void handleSuccess() { // First extract the string id for every core GDB reports - Set<String> coreIds = new HashSet<String>(); + Set<String> coreIds = new HashSet<>(); IThreadGroupInfo[] groups = getData().getGroupList(); for (IThreadGroupInfo group : groups) { coreIds.addAll(Arrays.asList(group.getCores())); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBMemory.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBMemory.java index 7576a4ff969..449385045fd 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBMemory.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBMemory.java @@ -60,12 +60,12 @@ public class GDBMemory extends MIMemory implements IGDBMemory2 { /** * Cache of the address sizes for each memory context. */ - private Map<IMemoryDMContext, Integer> fAddressSizes = new HashMap<IMemoryDMContext, Integer>(); + private Map<IMemoryDMContext, Integer> fAddressSizes = new HashMap<>(); /** * Cache of the addressable sizes for each memory context. */ - private Map<IMemoryDMContext, Integer> fAddressableSizes = new HashMap<IMemoryDMContext, Integer>(); + private Map<IMemoryDMContext, Integer> fAddressableSizes = new HashMap<>(); /** * Cache of the endianness for each memory context. @@ -136,7 +136,7 @@ public class GDBMemory extends MIMemory implements IGDBMemory2 { private Step[] steps = null; private void determineSteps() { - ArrayList<Step> stepsList = new ArrayList<Step>(); + ArrayList<Step> stepsList = new ArrayList<>(); if (fAddressSizes.get(memContext) == null) { stepsList.add(new Step() { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBPatternMatchingExpressions.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBPatternMatchingExpressions.java index 79a778f04e2..283436182db 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBPatternMatchingExpressions.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBPatternMatchingExpressions.java @@ -197,7 +197,7 @@ public class GDBPatternMatchingExpressions extends AbstractDsfService implements @Override public Map<String, Integer> getEnumerations() { - return new HashMap<String, Integer>(); + return new HashMap<>(); } @Override @@ -618,7 +618,7 @@ public class GDBPatternMatchingExpressions extends AbstractDsfService implements // Remove any extra whitespace from each resulting expression, // and ignore any empty expressions. - List<String> expressions = new ArrayList<String>(splitExpressions.length); + List<String> expressions = new ArrayList<>(splitExpressions.length); for (String expr : splitExpressions) { expr = expr.trim(); if (!expr.isEmpty()) { @@ -643,10 +643,10 @@ public class GDBPatternMatchingExpressions extends AbstractDsfService implements final DataRequestMonitor<IExpressionDMContext[]> rm) { // First separate the group into different expressions. // We need to create a new list, as we will modify it during our processing. - final List<String> exprList = new ArrayList<String>(splitExpressionsInGroup(exprGroupDmc)); + final List<String> exprList = new ArrayList<>(splitExpressionsInGroup(exprGroupDmc)); // List to store the final result, which is all the sub-expressions of this group - final ArrayList<IExpressionDMContext> subExprList = new ArrayList<IExpressionDMContext>(); + final ArrayList<IExpressionDMContext> subExprList = new ArrayList<>(); final int startIndex1 = (startIndex < 0) ? 0 : startIndex; final int length1 = (length < 0) ? Integer.MAX_VALUE : length; @@ -662,7 +662,7 @@ public class GDBPatternMatchingExpressions extends AbstractDsfService implements // Not only does selecting the element jump back and forth between the duplicates, // but children of duplicated elements are not always right. Because of this, we // remove all duplicates here. - LinkedHashSet<IExpressionDMContext> uniqueSubExprSet = new LinkedHashSet<IExpressionDMContext>( + LinkedHashSet<IExpressionDMContext> uniqueSubExprSet = new LinkedHashSet<>( subExprList); subExprList.clear(); subExprList.addAll(uniqueSubExprSet); @@ -777,7 +777,7 @@ public class GDBPatternMatchingExpressions extends AbstractDsfService implements @Override protected void handleSuccess() { final List<IExpressionDMContext> exprList = getData() != null ? getData() - : new ArrayList<IExpressions.IExpressionDMContext>(); + : new ArrayList<>(); matchLocals(exprDmc, new ImmediateDataRequestMonitor<List<IExpressionDMContext>>(rm) { @Override protected void handleSuccess() { @@ -815,7 +815,7 @@ public class GDBPatternMatchingExpressions extends AbstractDsfService implements @Override protected void handleSuccess() { assert getData() instanceof MIRegisterDMC[]; - ArrayList<IExpressionDMContext> matches = new ArrayList<IExpressionDMContext>(); + ArrayList<IExpressionDMContext> matches = new ArrayList<>(); String fullExpr = globDmc.getExpression().trim(); if (fullExpr.startsWith(GLOB_EXPRESSION_PREFIX)) { @@ -865,7 +865,7 @@ public class GDBPatternMatchingExpressions extends AbstractDsfService implements final CountingRequestMonitor varNameCRM = new CountingRequestMonitor(getExecutor(), rm) { @Override public void handleSuccess() { - ArrayList<IExpressionDMContext> matches = new ArrayList<IExpressionDMContext>( + ArrayList<IExpressionDMContext> matches = new ArrayList<>( localsDMData.length); String fullExpr = globDmc.getExpression().trim(); @@ -954,7 +954,7 @@ public class GDBPatternMatchingExpressions extends AbstractDsfService implements final CountingRequestMonitor varNameCRM = new CountingRequestMonitor(getExecutor(), rm) { @Override public void handleSuccess() { - final ArrayList<IExpressionDMContext> matches = new ArrayList<IExpressionDMContext>(); + final ArrayList<IExpressionDMContext> matches = new ArrayList<>(); final CountingRequestMonitor elementMatchesCRM = new CountingRequestMonitor(getExecutor(), rm) { @Override public void handleSuccess() { @@ -1025,7 +1025,7 @@ public class GDBPatternMatchingExpressions extends AbstractDsfService implements protected void handleCompleted() { boolean isArray = isSuccess() && getData().getBasicType().equals(IExpressionDMData.BasicType.array); - final ArrayList<IExpressionDMContext> elements = new ArrayList<IExpressionDMContext>(); + final ArrayList<IExpressionDMContext> elements = new ArrayList<>(); if (isArray) { // we must now create the elements based on the indices @@ -1053,7 +1053,7 @@ public class GDBPatternMatchingExpressions extends AbstractDsfService implements * could be a valid expression (i.e., the index 3-2=1 in this case) */ protected List<IExpressionDMContext> createArrayIndicesExpression(IExpressionDMContext arrayDmc, String indexSpec) { - ArrayList<IExpressionDMContext> expressionDMCs = new ArrayList<IExpressionDMContext>(); + ArrayList<IExpressionDMContext> expressionDMCs = new ArrayList<>(); String arrayName = arrayDmc.getExpression(); IDMContext parentDmc = arrayDmc.getParents()[0]; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java index fc70fe604b7..daf39b69c06 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java @@ -91,7 +91,7 @@ public class GDBProcesses extends MIProcesses implements IGDBProcesses { // A map of pid to names. It is filled when we get all the // processes that are running - private Map<Integer, String> fProcessNames = new HashMap<Integer, String>(); + private Map<Integer, String> fProcessNames = new HashMap<>(); // Id of our process. Currently, we only know it for an attach session. private String fProcId; @@ -573,7 +573,7 @@ public class GDBProcesses extends MIProcesses implements IGDBProcesses { // the overrideable process factory to allow others to override. // First set attribute to specify we want to create an inferior process. // Bug 210366 - Map<String, String> attributes = new HashMap<String, String>(); + Map<String, String> attributes = new HashMap<>(); attributes.put(IGdbDebugConstants.PROCESS_TYPE_CREATION_ATTR, IGdbDebugConstants.INFERIOR_PROCESS_CREATION_VALUE); IProcess runtimeInferior = DebugPlugin.newProcess(launch, inferior, label, attributes); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java index 82288507b27..c277dadd323 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java @@ -611,11 +611,11 @@ public class GDBProcesses_7_0 extends AbstractDsfService implements IGDBProcesse /** * A map of thread id to thread group id. We use this to find out to which threadGroup a thread belongs. */ - private Map<String, String> fThreadToGroupMap = new HashMap<String, String>(); + private Map<String, String> fThreadToGroupMap = new HashMap<>(); /** * A map of thread group id to process id. We use this to find out to which pid a group refers. */ - private Map<String, String> fGroupToPidMap = new HashMap<String, String>(); + private Map<String, String> fGroupToPidMap = new HashMap<>(); private IGDBControl fCommandControl; private IGDBBackend fBackend; @@ -969,7 +969,7 @@ public class GDBProcesses_7_0 extends AbstractDsfService implements IGDBProcesse } String groupId = containerDmc.getGroupId(); - List<IMIExecutionDMContext> execDmcList = new ArrayList<IMIExecutionDMContext>(); + List<IMIExecutionDMContext> execDmcList = new ArrayList<>(); Iterator<Map.Entry<String, String>> iterator = getThreadToGroupMap().entrySet().iterator(); while (iterator.hasNext()) { Map.Entry<String, String> entry = iterator.next(); @@ -1553,7 +1553,7 @@ public class GDBProcesses_7_0 extends AbstractDsfService implements IGDBProcesse // -list-thread-groups // ^done,groups=[{id="i1",type="process"}] // Just ignore that entry - List<IMIContainerDMContext> containerDmcs = new ArrayList<IMIContainerDMContext>(groups.length); + List<IMIContainerDMContext> containerDmcs = new ArrayList<>(groups.length); for (IThreadGroupInfo group : groups) { if (group.getPid() == null || group.getPid().isEmpty() || group.getPid().equals("0")) { //$NON-NLS-1$ continue; @@ -1855,7 +1855,7 @@ public class GDBProcesses_7_0 extends AbstractDsfService implements IGDBProcesse // First set attribute to specify we want to create an inferior process. // Bug 210366 ILaunch launch = (ILaunch) getSession().getModelAdapter(ILaunch.class); - Map<String, String> attributes = new HashMap<String, String>(); + Map<String, String> attributes = new HashMap<>(); attributes.put(IGdbDebugConstants.PROCESS_TYPE_CREATION_ATTR, IGdbDebugConstants.INFERIOR_PROCESS_CREATION_VALUE); IProcess runtimeInferior = DebugPlugin.newProcess(launch, inferior, label != null ? label : "", //$NON-NLS-1$ diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java index 0fb2509259b..9269d384465 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java @@ -186,7 +186,7 @@ public class GDBProcesses_7_2 extends GDBProcesses_7_1 implements IMultiTerminat * We use this set for such things as not removing breakpoints * because we know the process will be restarted. */ - private Set<IContainerDMContext> fProcRestarting = new HashSet<IContainerDMContext>(); + private Set<IContainerDMContext> fProcRestarting = new HashSet<>(); /** * Indicates that we are currently visualizing trace data. @@ -810,7 +810,7 @@ public class GDBProcesses_7_2 extends GDBProcesses_7_1 implements IMultiTerminat * @since 4.6 */ protected void canDetachFromProcesses(IDMContext[] dmcs, boolean all, DataRequestMonitor<Boolean> rm) { - Set<IMIContainerDMContext> contDmcs = new HashSet<IMIContainerDMContext>(); + Set<IMIContainerDMContext> contDmcs = new HashSet<>(); for (IDMContext c : dmcs) { IMIContainerDMContext contDmc = DMContexts.getAncestorOfType(c, IMIContainerDMContext.class); if (contDmc != null) { @@ -832,7 +832,7 @@ public class GDBProcesses_7_2 extends GDBProcesses_7_1 implements IMultiTerminat */ @Override public void detachDebuggerFromProcesses(IDMContext[] dmcs, final RequestMonitor rm) { - Set<IMIContainerDMContext> contDmcs = new HashSet<IMIContainerDMContext>(); + Set<IMIContainerDMContext> contDmcs = new HashSet<>(); for (IDMContext c : dmcs) { IMIContainerDMContext contDmc = DMContexts.getAncestorOfType(c, IMIContainerDMContext.class); if (contDmc != null) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRegisters.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRegisters.java index 05e2f1f9536..118749443f9 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRegisters.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRegisters.java @@ -72,20 +72,20 @@ public class GDBRegisters extends MIRegisters implements IRegisters2 { * References to all groups related to a given context. Different programs may use different sets of registers e.g. * 32/64 bits */ - private final ContextToGroupsMap<IContainerDMContext, MIRegisterGroupDMC[]> fContextToGroupsMap = new ContextToGroupsMap<IContainerDMContext, MIRegisterGroupDMC[]>(); + private final ContextToGroupsMap<IContainerDMContext, MIRegisterGroupDMC[]> fContextToGroupsMap = new ContextToGroupsMap<>(); /** * Used to save base list of Registers associated to a group, these registers can not be used as is for * "getRegisters" since the execution context may change e.g. The current selection points to a process or a running * thread or a different frame, all information besides the execution context is valid. */ - private final GroupRegistersMap<MIRegisterGroupDMC, MIRegisterDMC[]> fGroupToRegistersMap = new GroupRegistersMap<MIRegisterGroupDMC, MIRegisterDMC[]>(); + private final GroupRegistersMap<MIRegisterGroupDMC, MIRegisterDMC[]> fGroupToRegistersMap = new GroupRegistersMap<>(); /** * Saves the Group number to RegisterGroupDescriptor created from the serialized memento, The group number is used across contexts as the * key:Integer uses a booking number incremented across container contexts */ - private final Map<Integer, IRegisterGroupDescriptor> fGroupMementoDescriptorIndex = new HashMap<Integer, IRegisterGroupDescriptor>(); + private final Map<Integer, IRegisterGroupDescriptor> fGroupMementoDescriptorIndex = new HashMap<>(); public GDBRegisters(DsfSession session) { super(session); @@ -93,7 +93,7 @@ public class GDBRegisters extends MIRegisters implements IRegisters2 { private class ContextToGroupsMap<K, V> extends HashMap<IContainerDMContext, MIRegisterGroupDMC[]> { private static final long serialVersionUID = 1L; - private final Map<IContainerDMContext, Map<String, MIRegisterGroupDMC>> fNameToGroupMap = new HashMap<IContainerDMContext, Map<String, MIRegisterGroupDMC>>(); + private final Map<IContainerDMContext, Map<String, MIRegisterGroupDMC>> fNameToGroupMap = new HashMap<>(); @Override public MIRegisterGroupDMC[] put(IContainerDMContext key, MIRegisterGroupDMC[] value) { @@ -131,7 +131,7 @@ public class GDBRegisters extends MIRegisters implements IRegisters2 { Map<String, MIRegisterGroupDMC> nameMap = fNameToGroupMap.get(key); if (nameMap == null) { // cache not resolved, rebuild - nameMap = new HashMap<String, MIRegisterGroupDMC>(); + nameMap = new HashMap<>(); MIRegisterGroupDMC[] groupsArr = super.get(key); // If the container context exist, build the name map if (groupsArr != null) { @@ -175,7 +175,7 @@ public class GDBRegisters extends MIRegisters implements IRegisters2 { */ private class GroupRegistersMap<K, V> extends HashMap<MIRegisterGroupDMC, MIRegisterDMC[]> { private static final long serialVersionUID = 1L; - private final Map<MIRegisterGroupDMC, Map<String, MIRegisterDMC>> fNameToRegisterMap = new HashMap<MIRegisterGroupDMC, Map<String, MIRegisterDMC>>(); + private final Map<MIRegisterGroupDMC, Map<String, MIRegisterDMC>> fNameToRegisterMap = new HashMap<>(); @Override public MIRegisterDMC[] put(MIRegisterGroupDMC key, MIRegisterDMC[] value) { @@ -216,7 +216,7 @@ public class GDBRegisters extends MIRegisters implements IRegisters2 { return null; } - Map<String, MIRegisterDMC> registerNameMap = new HashMap<String, MIRegisterDMC>(); + Map<String, MIRegisterDMC> registerNameMap = new HashMap<>(); for (IRegisterDMContext register : registers) { assert (register instanceof MIRegisterDMC); MIRegisterDMC registerDmc = (MIRegisterDMC) register; @@ -761,7 +761,7 @@ public class GDBRegisters extends MIRegisters implements IRegisters2 { * Cast to MI and sort them ascending order by register index */ private MIRegisterDMC[] arrangeRegisters(IRegisterDMContext[] iRegisters) { - TreeMap<Integer, MIRegisterDMC> sortedRegisters = new TreeMap<Integer, MIRegisterDMC>(); + TreeMap<Integer, MIRegisterDMC> sortedRegisters = new TreeMap<>(); for (int i = 0; i < iRegisters.length; i++) { assert (iRegisters[i] instanceof MIRegisterDMC); MIRegisterDMC register = (MIRegisterDMC) iRegisters[i]; @@ -781,7 +781,7 @@ public class GDBRegisters extends MIRegisters implements IRegisters2 { private void removeRegisterGroups(IRegisterGroupDMContext[] groups, boolean removeRoot, RequestMonitor rm) { if (groups != null) { // Save a list of updated containers to only send an update event for each of them - final Set<IContainerDMContext> updatedContainers = new HashSet<IContainerDMContext>(); + final Set<IContainerDMContext> updatedContainers = new HashSet<>(); for (IRegisterGroupDMContext group : groups) { if (!removeRoot) { @@ -808,7 +808,7 @@ public class GDBRegisters extends MIRegisters implements IRegisters2 { assert (groupsCtx != null); if (groupsCtx != null) { - List<MIRegisterGroupDMC> groupsList = new ArrayList<MIRegisterGroupDMC>(Arrays.asList(groupsCtx)); + List<MIRegisterGroupDMC> groupsList = new ArrayList<>(Arrays.asList(groupsCtx)); // Removing a single group groupsList.remove(group); @@ -875,7 +875,7 @@ public class GDBRegisters extends MIRegisters implements IRegisters2 { IRegisterGroupDescriptor[] buildDescriptors() { // use a tree map to sort the entries by group number - TreeMap<Integer, MIRegisterGroupDMC> sortedGroups = new TreeMap<Integer, MIRegisterGroupDMC>(); + TreeMap<Integer, MIRegisterGroupDMC> sortedGroups = new TreeMap<>(); for (MIRegisterGroupDMC group : fGroupToRegistersMap.keySet()) { sortedGroups.put(Integer.valueOf(group.getGroupNo()), group); @@ -923,7 +923,7 @@ public class GDBRegisters extends MIRegisters implements IRegisters2 { return new MIRegisterGroupDMC[0]; } - List<MIRegisterGroupDMC> groups = new ArrayList<MIRegisterGroupDMC>(); + List<MIRegisterGroupDMC> groups = new ArrayList<>(); for (IRegisterGroupDescriptor group : groupDescriptions) { fGroupMementoDescriptorIndex.put(fGroupBookingCount, group); groups.add(new MIRegisterGroupDMC(this, contDmc, fGroupBookingCount, group.getName())); @@ -1001,7 +1001,7 @@ public class GDBRegisters extends MIRegisters implements IRegisters2 { */ private MIRegisterDMC[] resolveRegisters(IRegisterGroupDescriptor grpDescriptor, IDMContext ctx) throws CoreException { - final List<MIRegisterDMC> registerContexts = new ArrayList<MIRegisterDMC>(); + final List<MIRegisterDMC> registerContexts = new ArrayList<>(); final IContainerDMContext containerDmc = DMContexts.getAncestorOfType(ctx, IContainerDMContext.class); final MIRegisterGroupDMC groupDmc = DMContexts.getAncestorOfType(ctx, MIRegisterGroupDMC.class); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java index 51c5dede46e..592b80bb3f4 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java @@ -383,7 +383,7 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService private boolean fTerminated = false; // ThreadStates indexed by the execution context - protected Map<IMIExecutionDMContext, MIThreadRunState> fThreadRunStates = new HashMap<IMIExecutionDMContext, MIThreadRunState>(); + protected Map<IMIExecutionDMContext, MIThreadRunState> fThreadRunStates = new HashMap<>(); private RunToLineActiveOperation fRunToLineActiveOperation = null; @@ -402,15 +402,15 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService /** * Set of threads for which the next MIRunning event should be silenced. */ - private Set<IMIExecutionDMContext> fDisableNextRunningEventDmcSet = new HashSet<IMIExecutionDMContext>(); + private Set<IMIExecutionDMContext> fDisableNextRunningEventDmcSet = new HashSet<>(); /** * Set of threads for which the next MISignal (MIStopped) event should be silenced. */ - private Set<IMIExecutionDMContext> fDisableNextSignalEventDmcSet = new HashSet<IMIExecutionDMContext>(); + private Set<IMIExecutionDMContext> fDisableNextSignalEventDmcSet = new HashSet<>(); /** * Map that stores the silenced MIStopped event for the specified thread, in case we need to use it for a failure. */ - private Map<IMIExecutionDMContext, MIStoppedEvent> fSilencedSignalEventMap = new HashMap<IMIExecutionDMContext, MIStoppedEvent>(); + private Map<IMIExecutionDMContext, MIStoppedEvent> fSilencedSignalEventMap = new HashMap<>(); /** * This variable allows us to know if run control operation @@ -1266,7 +1266,7 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService }; // The set of threads that we will actually be suspended to make the containers suspended. - private Set<IMIExecutionDMContext> fExecutionDmcToSuspendSet = new HashSet<IMIExecutionDMContext>(); + private Set<IMIExecutionDMContext> fExecutionDmcToSuspendSet = new HashSet<>(); // Do we currently have an executeWithTargetAvailable() operation ongoing? private boolean fOngoingOperation; @@ -1288,7 +1288,7 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService // and we can complete the operation. private int fNumStepsStillExecuting; // Queue of executeWithTargetAvailable() operations that need to be processed. - private LinkedList<TargetAvailableOperationInfo> fOperationsPending = new LinkedList<TargetAvailableOperationInfo>(); + private LinkedList<TargetAvailableOperationInfo> fOperationsPending = new LinkedList<>(); /** * Returns whether there is currently an ExecuteWithTargetAvailable() operation ongoing. @@ -2211,7 +2211,7 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService resumeAtLocation(context, location, rm); } else { // Create the breakpoint attributes - Map<String, Object> attr = new HashMap<String, Object>(); + Map<String, Object> attr = new HashMap<>(); attr.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.BREAKPOINT); attr.put(MIBreakpoints.FILE_NAME, debuggerPath); attr.put(MIBreakpoints.LINE_NUMBER, lineNumber); @@ -2255,7 +2255,7 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService resumeAtLocation(context, location, rm); else { // Create the breakpoint attributes - Map<String, Object> attr = new HashMap<String, Object>(); + Map<String, Object> attr = new HashMap<>(); attr.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.BREAKPOINT); attr.put(MIBreakpoints.ADDRESS, "0x" + address.toString(16)); //$NON-NLS-1$ attr.put(MIBreakpointDMData.IS_TEMPORARY, true); @@ -2592,10 +2592,10 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService */ private List<IExecutionDMContext> extractContextsForOperation(IExecutionDMContext[] contexts) { // Remove duplicate contexts by using a set - Set<IExecutionDMContext> specifiedExedDmcSet = new HashSet<IExecutionDMContext>(Arrays.asList(contexts)); + Set<IExecutionDMContext> specifiedExedDmcSet = new HashSet<>(Arrays.asList(contexts)); // A list that ignores threads for which the process is also present - List<IExecutionDMContext> execDmcForOperationList = new ArrayList<IExecutionDMContext>( + List<IExecutionDMContext> execDmcForOperationList = new ArrayList<>( specifiedExedDmcSet.size()); // Check for the case of a process selected along with some of its threads diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/StartOrRestartProcessSequence_7_0.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/StartOrRestartProcessSequence_7_0.java index 2fe91716e45..ac18ef3e340 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/StartOrRestartProcessSequence_7_0.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/StartOrRestartProcessSequence_7_0.java @@ -132,7 +132,7 @@ public class StartOrRestartProcessSequence_7_0 extends ReflectionSequence { assert containerDmc != null; if (attributes == null) { // If no attributes are specified, simply use an empty map. - attributes = new HashMap<String, Object>(); + attributes = new HashMap<>(); } fContainerDmc = containerDmc; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/StartOrRestartProcessSequence_7_10.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/StartOrRestartProcessSequence_7_10.java index 9e8a4a1ae3c..22bd18b83ba 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/StartOrRestartProcessSequence_7_10.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/StartOrRestartProcessSequence_7_10.java @@ -57,7 +57,7 @@ public class StartOrRestartProcessSequence_7_10 extends StartOrRestartProcessSeq if (GROUP_TOP_LEVEL.equals(group)) { // Initialize the list with the base class' steps // We need to create a list that we can modify, which is why we create our own ArrayList. - List<String> orderList = new ArrayList<String>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); + List<String> orderList = new ArrayList<>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); // Insert the new stepSetReverseMode after stepSetReverseOff orderList.add(orderList.indexOf("stepSetReverseOff") + 1, "stepSetReverseMode"); //$NON-NLS-1$ //$NON-NLS-2$ diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/StartOrRestartProcessSequence_7_12.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/StartOrRestartProcessSequence_7_12.java index a1288c0385d..d8918a0e575 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/StartOrRestartProcessSequence_7_12.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/StartOrRestartProcessSequence_7_12.java @@ -59,7 +59,7 @@ public class StartOrRestartProcessSequence_7_12 extends StartOrRestartProcessSeq if (GROUP_TOP_LEVEL.equals(group)) { // Initialize the list with the base class' steps // We need to create a list that we can modify, which is why we create our own ArrayList. - List<String> orderList = new ArrayList<String>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); + List<String> orderList = new ArrayList<>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); // Need to insert reverse mode off before ordering the reverse start at a specified location orderList.add(orderList.indexOf("stepCreateConsole") + 1, "stepSetReverseOff2"); //$NON-NLS-1$ //$NON-NLS-2$ diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java index 11cbc0d9c2b..ca54d11a493 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java @@ -207,7 +207,7 @@ public class GDBControl extends AbstractMIControl implements IGDBControl { * is available in 6.8, it does not report anything we care about, so * return empty list. */ - private final List<String> fFeatures = new ArrayList<String>(); + private final List<String> fFeatures = new ArrayList<>(); private Sequence fInitializationSequence; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GdbCommandTimeoutManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GdbCommandTimeoutManager.java index 7e38a27d6be..087f4d4bc9c 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GdbCommandTimeoutManager.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GdbCommandTimeoutManager.java @@ -222,7 +222,7 @@ public class GdbCommandTimeoutManager implements ICommandListener, IPreferenceCh private boolean fTimeoutEnabled = false; private int fTimeout = 0; private TimerThread fTimerThread; - private BlockingQueue<QueueEntry> fCommandQueue = new LinkedBlockingQueue<QueueEntry>(); + private BlockingQueue<QueueEntry> fCommandQueue = new LinkedBlockingQueue<>(); private CustomTimeoutsMap fCustomTimeouts = new CustomTimeoutsMap(); private ListenerList fListeners; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/CSourceLookup.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/CSourceLookup.java index 169e5de5e14..25638044357 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/CSourceLookup.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/CSourceLookup.java @@ -52,7 +52,7 @@ import org.osgi.framework.BundleContext; * ISourceLookup service implementation based on the CDT CSourceLookupDirector. */ public class CSourceLookup extends AbstractDsfService implements ISourceLookup { - private Map<ISourceLookupDMContext, CSourceLookupDirector> fDirectors = new HashMap<ISourceLookupDMContext, CSourceLookupDirector>(); + private Map<ISourceLookupDMContext, CSourceLookupDirector> fDirectors = new HashMap<>(); ICommandControl fConnection; private CommandFactory fCommandFactory; @@ -79,7 +79,7 @@ public class CSourceLookup extends AbstractDsfService implements ISourceLookup { } private List<String> getSourceLookupPath(ISourceContainer[] containers) { - ArrayList<String> list = new ArrayList<String>(containers.length); + ArrayList<String> list = new ArrayList<>(containers.length); for (ISourceContainer container : containers) { if (container instanceof CProjectSourceContainer) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointDMData.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointDMData.java index a00c3cd5685..76c884b68cf 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointDMData.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointDMData.java @@ -71,7 +71,7 @@ public class MIBreakpointDMData implements IBreakpointDMData { public MIBreakpointDMData(MIBreakpointDMData other) { fBreakpoint = new MIBreakpoint(other.fBreakpoint); - fProperties = new HashMap<String, Object>(other.fProperties); + fProperties = new HashMap<>(other.fProperties); } /** @@ -81,7 +81,7 @@ public class MIBreakpointDMData implements IBreakpointDMData { * @since 5.3 */ public MIBreakpointDMData copy() { - return new MIBreakpointDMData(new MIBreakpoint(fBreakpoint), new HashMap<String, Object>(fProperties)); + return new MIBreakpointDMData(new MIBreakpoint(fBreakpoint), new HashMap<>(fProperties)); } /** @@ -98,7 +98,7 @@ public class MIBreakpointDMData implements IBreakpointDMData { if (properties != null) { fProperties = properties; } else { - fProperties = new HashMap<String, Object>(); + fProperties = new HashMap<>(); if (dsfMIBreakpoint.isTracepoint()) { // Generic breakpoint attributes diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpoints.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpoints.java index ee834d1a4c9..13aa31b9c37 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpoints.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpoints.java @@ -595,7 +595,7 @@ public class MIBreakpoints extends AbstractDsfService public void getExecutionContextBreakpoints(IExecutionDMContext ctx, DataRequestMonitor<IBreakpointDMContext[]> rm) { IBreakpointDMContext[] bps = fBreakpointHitMap.get(ctx); if (bps == null && ctx instanceof IContainerDMContext) { - List<IBreakpointDMContext> bpsList = new ArrayList<IBreakpointDMContext>(1); + List<IBreakpointDMContext> bpsList = new ArrayList<>(1); for (Map.Entry<IExecutionDMContext, IBreakpointDMContext[]> entry : fBreakpointHitMap.entrySet()) { if (DMContexts.isAncestorOf(entry.getKey(), ctx)) { @@ -748,7 +748,7 @@ public class MIBreakpoints extends AbstractDsfService // By default the breakpoint is enabled at creation // If it wasn't supposed to be, then disable it right away - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(IS_ENABLED, getProperty(attributes, IS_ENABLED, true)); modifyBreakpoint(dmc, delta, rm, false); } @@ -844,7 +844,7 @@ public class MIBreakpoints extends AbstractDsfService // Condition, ignore count and state can not be specified at watchpoint creation time. // Therefore, we have to update the watchpoint if any of these is present - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(CONDITION, getProperty(attributes, CONDITION, NULL_STRING)); delta.put(IGNORE_COUNT, getProperty(attributes, IGNORE_COUNT, 0)); delta.put(IS_ENABLED, getProperty(attributes, IS_ENABLED, true)); @@ -941,7 +941,7 @@ public class MIBreakpoints extends AbstractDsfService // Condition, ignore count and state cannot be specified at creation time. // Therefore, we have to update the catchpoint if any of these is present - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(CONDITION, getProperty(attributes, CONDITION, NULL_STRING)); delta.put(IGNORE_COUNT, getProperty(attributes, IGNORE_COUNT, 0)); delta.put(IS_ENABLED, getProperty(attributes, IS_ENABLED, true)); @@ -1109,7 +1109,7 @@ public class MIBreakpoints extends AbstractDsfService protected void modifyBreakpoint(final IBreakpointDMContext dmc, Map<String, Object> attributes, final RequestMonitor rm, final boolean generateUpdateEvent) { // Use a working copy of the attributes since we are going to tamper happily with them - Map<String, Object> properties = new HashMap<String, Object>(attributes); + Map<String, Object> properties = new HashMap<>(attributes); // Retrieve the breakpoint parameters // At this point, we know their are OK so there is no need to re-validate diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java index 2e613488674..e66a5adb7ae 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java @@ -1958,7 +1958,7 @@ public class MIBreakpointsManager extends AbstractDsfService */ protected Map<String, Object> convertToPlatformAttributes(Map<String, Object> cdtAttributes) { - Map<String, Object> result = new HashMap<String, Object>(); + Map<String, Object> result = new HashMap<>(); // IBreakpoint attributes if (cdtAttributes.containsKey(ATTR_DEBUGGER_PATH)) { @@ -2311,8 +2311,8 @@ public class MIBreakpointsManager extends AbstractDsfService } private String[] compareAttributes(Map<String, Object> oldAttr, Map<String, Object> newAttr, String[] exclude) { - List<String> list = new ArrayList<String>(); - Set<String> names = new HashSet<String>(oldAttr.keySet()); + List<String> list = new ArrayList<>(); + Set<String> names = new HashSet<>(oldAttr.keySet()); names.addAll(newAttr.keySet()); for (String n : names) { if (exclude != null && Arrays.asList(exclude).contains(n)) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsSynchronizer.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsSynchronizer.java index 9a5d7e7269e..53a2b470ce9 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsSynchronizer.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsSynchronizer.java @@ -186,10 +186,10 @@ public class MIBreakpointsSynchronizer extends AbstractDsfService public MIBreakpointsSynchronizer(DsfSession session) { super(session); - fTrackedTargets = new HashSet<IBreakpointsTargetDMContext>(); - fCreatedTargetBreakpoints = new HashMap<IBreakpointsTargetDMContext, Map<String, MIBreakpoint>>(); - fDeletedTargetBreakpoints = new HashMap<IBreakpointsTargetDMContext, Set<String>>(); - fPendingModifications = new HashMap<IBreakpointsTargetDMContext, Map<String, MIBreakpoint>>(); + fTrackedTargets = new HashSet<>(); + fCreatedTargetBreakpoints = new HashMap<>(); + fDeletedTargetBreakpoints = new HashMap<>(); + fPendingModifications = new HashMap<>(); } @Override @@ -451,7 +451,7 @@ public class MIBreakpointsSynchronizer extends AbstractDsfService // when addBreakpoint() is called. Map<String, MIBreakpoint> targetMap = fCreatedTargetBreakpoints.get(bpTargetDMC); if (targetMap == null) { - targetMap = new HashMap<String, MIBreakpoint>(); + targetMap = new HashMap<>(); fCreatedTargetBreakpoints.put(bpTargetDMC, targetMap); } targetMap.put(miBpt.getNumber(), miBpt); @@ -594,7 +594,7 @@ public class MIBreakpointsSynchronizer extends AbstractDsfService if (plBpt instanceof ICBreakpoint) { Set<String> set = fDeletedTargetBreakpoints.get(bpTargetDMC); if (set == null) { - set = new HashSet<String>(); + set = new HashSet<>(); fDeletedTargetBreakpoints.put(bpTargetDMC, set); } set.add(id); @@ -619,7 +619,7 @@ public class MIBreakpointsSynchronizer extends AbstractDsfService } IExecutionDMContext[] execDMCs = bpExtension.getThreadFilters(contDMC); - List<IExecutionDMContext> list = new ArrayList<IExecutionDMContext>(execDMCs.length); + List<IExecutionDMContext> list = new ArrayList<>(execDMCs.length); for (IExecutionDMContext c : execDMCs) { if (c instanceof IMIExecutionDMContext && !((IMIExecutionDMContext) c).getThreadId().equals(threadId)) { @@ -724,7 +724,7 @@ public class MIBreakpointsSynchronizer extends AbstractDsfService // modification data, it will be picked up later. Map<String, MIBreakpoint> map = fPendingModifications.get(bpTargetDMC); if (map == null) { - map = new HashMap<String, MIBreakpoint>(); + map = new HashMap<>(); fPendingModifications.put(bpTargetDMC, map); } map.put(miBpt.getNumber(), miBpt); @@ -1437,7 +1437,7 @@ public class MIBreakpointsSynchronizer extends AbstractDsfService * @param commands list of gdb tracepoint commands separated by TracepointActionManager.TRACEPOINT_ACTION_DELIMITER */ private ITracepointAction[] getActionsFromCommands(String[] commands) { - List<ITracepointAction> list = new ArrayList<ITracepointAction>(); + List<ITracepointAction> list = new ArrayList<>(); TracepointActionManager tam = TracepointActionManager.getInstance(); WhileSteppingAction whileStepping = null; List<ITracepointAction> subActions = null; @@ -1465,7 +1465,7 @@ public class MIBreakpointsSynchronizer extends AbstractDsfService } else if (command.startsWith(TC_WHILE_STEPPING)) { whileStepping = createWhileSteppingAction(command.substring(TC_WHILE_STEPPING.length())); if (whileStepping != null) { - subActions = new ArrayList<ITracepointAction>(); + subActions = new ArrayList<>(); } } else if (command.equals(TC_END)) { if (whileStepping == null || subActions == null) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIExpressions.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIExpressions.java index 1a636b2ae70..ec715092b54 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIExpressions.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIExpressions.java @@ -741,7 +741,7 @@ public class MIExpressions extends AbstractDsfService implements IMIExpressions, @Override public Map<String, Integer> getEnumerations() { - return new HashMap<String, Integer>(); + return new HashMap<>(); } @Override @@ -859,20 +859,20 @@ public class MIExpressions extends AbstractDsfService implements IMIExpressions, * storing the return value, e.g., $1 -> "foo() returned" * This map allows to quickly find the alias to be used for return value variables. */ - private Map<String, String> fExpressionAliasesMap = new HashMap<String, String>(); + private Map<String, String> fExpressionAliasesMap = new HashMap<>(); /** * Map of thread to aliases expression list. This map allows to know which aliases are related * to a thread of execution. This is important to allow us to delete aliases when a * thread exits. Note that we need a list because we keep all previous aliases until * the thread exits. */ - private Map<IMIExecutionDMContext, List<String>> fThreadToAliasedExpressionsMap = new HashMap<IMIExecutionDMContext, List<String>>(); + private Map<IMIExecutionDMContext, List<String>> fThreadToAliasedExpressionsMap = new HashMap<>(); /** * Map of thread to the name of the method the thread last stopped in. * This allows us to create the alias based on the method the thread was in * before it returned out of the method. */ - private Map<IMIExecutionDMContext, String> fThreadToTopMethodName = new HashMap<IMIExecutionDMContext, String>(); + private Map<IMIExecutionDMContext, String> fThreadToTopMethodName = new HashMap<>(); /** * Create an alias for expr with respect to threadDmc. @@ -889,7 +889,7 @@ public class MIExpressions extends AbstractDsfService implements IMIExpressions, List<String> aliasedExprList = fThreadToAliasedExpressionsMap.get(threadDmc); if (aliasedExprList == null) { - aliasedExprList = new ArrayList<String>(); + aliasedExprList = new ArrayList<>(); fThreadToAliasedExpressionsMap.put(threadDmc, aliasedExprList); } aliasedExprList.add(expr); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIMemory.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIMemory.java index 52f90903777..a6b615577f3 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIMemory.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIMemory.java @@ -157,7 +157,7 @@ public class MIMemory extends AbstractDsfService implements IMemory, ICachingSer register(new String[] { MIMemory.class.getName(), IMemory.class.getName() }, new Hashtable<String, String>()); - fMemoryCaches = new HashMap<IMemoryDMContext, MIMemoryCache>(); + fMemoryCaches = new HashMap<>(); getSession().addServiceEventListener(this, null); @@ -722,7 +722,7 @@ public class MIMemory extends AbstractDsfService implements IMemory, ICachingSer private List<MemoryBlock> getListOfMissingBlocks(IAddress reqBlockStart, int wordCount, int wordSize) { int octetCount = wordCount * wordSize; - LinkedList<MemoryBlock> list = new LinkedList<MemoryBlock>(); + LinkedList<MemoryBlock> list = new LinkedList<>(); ListIterator<MemoryBlock> it = fMemoryBlockList.listIterator(); // Look for holes in the list of memory blocks diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRegisters.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRegisters.java index ea906867ac7..1ff3a3851a5 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRegisters.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRegisters.java @@ -251,7 +251,7 @@ public class MIRegisters extends AbstractDsfService implements IRegisters, ICach private CommandFactory fCommandFactory; //One Group per container process - private final Map<IContainerDMContext, MIRegisterGroupDMC> fContainerToGroupMap = new HashMap<IContainerDMContext, MIRegisterGroupDMC>(); + private final Map<IContainerDMContext, MIRegisterGroupDMC> fContainerToGroupMap = new HashMap<>(); private CommandCache fRegisterNameCache; // Cache for holding the Register Names in the single Group private CommandCache fRegisterValueCache; // Cache for holding the Register Values @@ -559,7 +559,7 @@ public class MIRegisters extends AbstractDsfService implements IRegisters, ICach // Wraps a list of registers in DMContexts. private MIRegisterDMC[] makeRegisterDMCs(MIRegisterGroupDMC groupDmc, IFrameDMContext frameDmc, String[] regNames) { - List<MIRegisterDMC> regDmcList = new ArrayList<MIRegisters.MIRegisterDMC>(regNames.length); + List<MIRegisterDMC> regDmcList = new ArrayList<>(regNames.length); int regNo = 0; for (String regName : regNames) { if (regName != null && !regName.isEmpty()) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRunControl.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRunControl.java index 00b89388e19..b76cb26d717 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRunControl.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRunControl.java @@ -1075,7 +1075,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I // and we can complete the operation. private int fNumStepsStillExecuting; // Queue of executeWithTargetAvailable() operations that need to be processed. - private LinkedList<TargetAvailableOperationInfo> fOperationsPending = new LinkedList<TargetAvailableOperationInfo>(); + private LinkedList<TargetAvailableOperationInfo> fOperationsPending = new LinkedList<>(); /** * Returns whether the target is available to perform operations @@ -1587,7 +1587,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I resumeAtLocation(context, location, rm); } else { // Create the breakpoint attributes - Map<String, Object> attr = new HashMap<String, Object>(); + Map<String, Object> attr = new HashMap<>(); attr.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.BREAKPOINT); attr.put(MIBreakpoints.FILE_NAME, debuggerPath); attr.put(MIBreakpoints.LINE_NUMBER, lineNumber); @@ -1633,7 +1633,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I resumeAtLocation(context, location, rm); else { // Create the breakpoint attributes - Map<String, Object> attr = new HashMap<String, Object>(); + Map<String, Object> attr = new HashMap<>(); attr.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.BREAKPOINT); attr.put(MIBreakpoints.ADDRESS, "0x" + address.toString(16)); //$NON-NLS-1$ attr.put(MIBreakpointDMData.IS_TEMPORARY, true); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIStack.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIStack.java index e27079fe6af..e57157c0d8b 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIStack.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIStack.java @@ -195,7 +195,7 @@ public class MIStack extends AbstractDsfService implements IStack, ICachingServi private boolean limited = true; // The actual depth we received private int stackDepth = -1; - private final List<FrameData> frames = new ArrayList<FrameData>(); + private final List<FrameData> frames = new ArrayList<>(); /** * Return currently cached stack depth if cache value if valid, otherwise return -1. @@ -349,7 +349,7 @@ public class MIStack extends AbstractDsfService implements IStack, ICachingServi * A return value is stored when the user performs a step-return, * and it cleared as soon as that thread executes again. */ - private Map<IMIExecutionDMContext, VariableData> fThreadToReturnVariable = new HashMap<IMIExecutionDMContext, VariableData>(); + private Map<IMIExecutionDMContext, VariableData> fThreadToReturnVariable = new HashMap<>(); public MIStack(DsfSession session) { super(session); @@ -949,7 +949,7 @@ public class MIStack extends AbstractDsfService implements IStack, ICachingServi // We don't currently support variables with the same name in the same frame, // so we only keep the first one. // Bug 327621 and 328573 - Map<String, MIVariableDMC> variableNames = new LinkedHashMap<String, MIVariableDMC>(); + Map<String, MIVariableDMC> variableNames = new LinkedHashMap<>(); for (int i = 0; i < miArgs.length; i++) { String name = miArgs[i].getName(); @@ -984,7 +984,7 @@ public class MIStack extends AbstractDsfService implements IStack, ICachingServi @Override public void getLocals(final IFrameDMContext frameDmc, final DataRequestMonitor<IVariableDMContext[]> rm) { - final List<IVariableDMContext> localsList = new ArrayList<IVariableDMContext>(); + final List<IVariableDMContext> localsList = new ArrayList<>(); final CountingRequestMonitor countingRm = new CountingRequestMonitor(getExecutor(), rm) { @Override diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java index cc5f756b122..2f481d962cc 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java @@ -2179,7 +2179,7 @@ public class MIVariableManager implements ICommandControl { public MIRootVariableObject(VariableObjectId id) { super(id, null); currentState = STATE_NOT_CREATED; - modifiableDescendants = new HashMap<String, MIVariableObject>(); + modifiableDescendants = new HashMap<>(); } public ICommandControlDMContext getControlDMContext() { @@ -2634,13 +2634,13 @@ public class MIVariableManager implements ICommandControl { private IExpressions fExpressionService; // Typically, there will only be one listener, since only the ExpressionService will use this class - private final List<ICommandListener> fCommandProcessors = new ArrayList<ICommandListener>(); + private final List<ICommandListener> fCommandProcessors = new ArrayList<>(); /** Our least recently used cache */ private final LRUVariableCache lruVariableList; /** The list of root variable objects that have been updated */ - private final LinkedList<MIRootVariableObject> updatedRootList = new LinkedList<MIRootVariableObject>(); + private final LinkedList<MIRootVariableObject> updatedRootList = new LinkedList<>(); /** * MIVariableManager constructor diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractMIControl.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractMIControl.java index 2a40598826e..e8077abde6b 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractMIControl.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractMIControl.java @@ -104,7 +104,7 @@ public abstract class AbstractMIControl extends AbstractDsfService implements IM // Since GDB.7.1 private boolean fUseThreadGroupOption; - private final BlockingQueue<CommandHandle> fTxCommands = new LinkedBlockingQueue<CommandHandle>(); + private final BlockingQueue<CommandHandle> fTxCommands = new LinkedBlockingQueue<>(); private final Map<Integer, CommandHandle> fRxCommands = Collections .synchronizedMap(new HashMap<Integer, CommandHandle>()); @@ -119,14 +119,14 @@ public abstract class AbstractMIControl extends AbstractDsfService implements IM * what the control object is doing. */ - private final List<ICommandListener> fCommandProcessors = new ArrayList<ICommandListener>(); - private final List<IEventListener> fEventProcessors = new ArrayList<IEventListener>(); + private final List<ICommandListener> fCommandProcessors = new ArrayList<>(); + private final List<IEventListener> fEventProcessors = new ArrayList<>(); /** * Current command which have not been handed off to the backend yet. */ - private final List<CommandHandle> fCommandQueue = new ArrayList<CommandHandle>(); + private final List<CommandHandle> fCommandQueue = new ArrayList<>(); /** * Flag indicating that the command control has stopped processing commands. @@ -294,7 +294,7 @@ public abstract class AbstractMIControl extends AbstractDsfService implements IM /* * Now handle any requests which have not been transmitted, but weconsider them handed off. */ - List<CommandHandle> txCommands = new ArrayList<CommandHandle>(); + List<CommandHandle> txCommands = new ArrayList<>(); fTxCommands.drainTo(txCommands); for (CommandHandle commandHandle : txCommands) { if (commandHandle.getRequestMonitor() == null) @@ -748,7 +748,7 @@ public abstract class AbstractMIControl extends AbstractDsfService implements IM * List of out of band records since the last result record. Out of band * records are required for processing the results of CLI commands. */ - private final List<MIOOBRecord> fAccumulatedOOBRecords = new LinkedList<MIOOBRecord>(); + private final List<MIOOBRecord> fAccumulatedOOBRecords = new LinkedList<>(); /** * List of stream records since the last result record, not including @@ -756,7 +756,7 @@ public abstract class AbstractMIControl extends AbstractDsfService implements IM * a subset of {@link #fAccumulatedOOBRecords}, as a stream record is a * particular type of OOB record. */ - private final List<MIStreamRecord> fAccumulatedStreamRecords = new LinkedList<MIStreamRecord>(); + private final List<MIStreamRecord> fAccumulatedStreamRecords = new LinkedList<>(); public RxThread(InputStream inputStream) { super("MI RX Thread"); //$NON-NLS-1$ diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java index e700ff075ac..a1aef544584 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java @@ -500,21 +500,21 @@ public class CommandFactory { public ICommand<MIDataEvaluateExpressionInfo> createMIDataEvaluateExpression(ICommandControlDMContext ctx, String expr) { - return new MIDataEvaluateExpression<MIDataEvaluateExpressionInfo>(ctx, expr); + return new MIDataEvaluateExpression<>(ctx, expr); } public ICommand<MIDataEvaluateExpressionInfo> createMIDataEvaluateExpression(IMIExecutionDMContext execDmc, String expr) { - return new MIDataEvaluateExpression<MIDataEvaluateExpressionInfo>(execDmc, expr); + return new MIDataEvaluateExpression<>(execDmc, expr); } public ICommand<MIDataEvaluateExpressionInfo> createMIDataEvaluateExpression(IFrameDMContext frameDmc, String expr) { - return new MIDataEvaluateExpression<MIDataEvaluateExpressionInfo>(frameDmc, expr); + return new MIDataEvaluateExpression<>(frameDmc, expr); } public ICommand<MIDataEvaluateExpressionInfo> createMIDataEvaluateExpression(IExpressionDMContext exprDmc) { - return new MIDataEvaluateExpression<MIDataEvaluateExpressionInfo>(exprDmc); + return new MIDataEvaluateExpression<>(exprDmc); } public ICommand<MIDataListRegisterNamesInfo> createMIDataListRegisterNames(IContainerDMContext ctx) { @@ -931,11 +931,11 @@ public class CommandFactory { } public ICommand<MIInfo> createMIInterpreterExec(IDMContext ctx, String interpreter, String cmd) { - return new MIInterpreterExec<MIInfo>(ctx, interpreter, cmd); + return new MIInterpreterExec<>(ctx, interpreter, cmd); } public ICommand<MIInfo> createMIInterpreterExecConsole(IDMContext ctx, String cmd) { - return new MIInterpreterExecConsole<MIInfo>(ctx, cmd); + return new MIInterpreterExecConsole<>(ctx, cmd); } /** @since 4.0 */ diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIBackendCLIProcess.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIBackendCLIProcess.java index c9ed9f08796..b896dd5ce7e 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIBackendCLIProcess.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIBackendCLIProcess.java @@ -66,7 +66,7 @@ public class MIBackendCLIProcess extends AbstractCLIProcess { } public class BackedExitedEventListener { - private final List<RequestMonitor> fWaitForRMs = new ArrayList<RequestMonitor>(); + private final List<RequestMonitor> fWaitForRMs = new ArrayList<>(); @DsfServiceEventHandler public void eventDispatched(BackendStateChangedEvent event) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIRunControlEventProcessor.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIRunControlEventProcessor.java index a2ce531140e..8665bd15401 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIRunControlEventProcessor.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIRunControlEventProcessor.java @@ -121,7 +121,7 @@ public class MIRunControlEventProcessor implements IEventProcessor { @Override public void eventReceived(Object output) { for (MIOOBRecord oobr : ((MIOutput) output).getMIOOBRecords()) { - List<MIEvent<?>> events = new LinkedList<MIEvent<?>>(); + List<MIEvent<?>> events = new LinkedList<>(); if (oobr instanceof MIExecAsyncOutput) { MIExecAsyncOutput exec = (MIExecAsyncOutput) oobr; // Change of state. diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIRunControlEventProcessor_7_0.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIRunControlEventProcessor_7_0.java index 3726a94c4d2..5c598ca948e 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIRunControlEventProcessor_7_0.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIRunControlEventProcessor_7_0.java @@ -123,7 +123,7 @@ public class MIRunControlEventProcessor_7_0 implements IEventProcessor { @Override public void eventReceived(Object output) { for (MIOOBRecord oobr : ((MIOutput) output).getMIOOBRecords()) { - List<MIEvent<?>> events = new LinkedList<MIEvent<?>>(); + List<MIEvent<?>> events = new LinkedList<>(); if (oobr instanceof MIExecAsyncOutput) { MIExecAsyncOutput exec = (MIExecAsyncOutput) oobr; // Change of state. diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIDPrintfInsert.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIDPrintfInsert.java index 78305277abc..1320c12f6ad 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIDPrintfInsert.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIDPrintfInsert.java @@ -131,7 +131,7 @@ public class MIDPrintfInsert extends MICommand<MIBreakInsertInfo> { } private Adjustable[] createParameters(String location, String printfStr) { - List<Adjustable> paramsList = new ArrayList<Adjustable>(); + List<Adjustable> paramsList = new ArrayList<>(); paramsList.add(new MIStandardParameterAdjustable(location)); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIGDBSetArgs.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIGDBSetArgs.java index 7c4497eb694..25d4b8192d0 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIGDBSetArgs.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIGDBSetArgs.java @@ -37,7 +37,7 @@ public class MIGDBSetArgs extends MIGDBSet { /** @since 4.0 */ public MIGDBSetArgs(IMIContainerDMContext dmc, String[] arguments) { super(dmc, null); - fParameters = new ArrayList<Adjustable>(); + fParameters = new ArrayList<>(); fParameters.add(new MIStandardParameterAdjustable("args")); //$NON-NLS-1$ /* * GDB-MI terminates the -gdb-set on the newline, so we have to encode diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIListThreadGroups.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIListThreadGroups.java index cb849383243..9275c0af2f9 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIListThreadGroups.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIListThreadGroups.java @@ -110,7 +110,7 @@ public class MIListThreadGroups extends MICommand<MIListThreadGroupsInfo> { assert !((groupId != null) && listAll); // see comment above - final ArrayList<String> arguments = new ArrayList<String>(); + final ArrayList<String> arguments = new ArrayList<>(); if (listAll) { arguments.add("--available"); //$NON-NLS-1$ } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoBreakInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoBreakInfo.java index 5ee62d2db72..6194a89e568 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoBreakInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoBreakInfo.java @@ -56,7 +56,7 @@ import java.util.Set; */ public class CLIInfoBreakInfo extends MIInfo { - private Map<String, String[]> fBreakpointToGroupMap = new HashMap<String, String[]>(); + private Map<String, String[]> fBreakpointToGroupMap = new HashMap<>(); public CLIInfoBreakInfo(MIOutput out) { super(out); @@ -86,7 +86,7 @@ public class CLIInfoBreakInfo extends MIInfo { String bpIdStr = line.split("[\\s\\.]", 2)[0]; //$NON-NLS-1$ String[] groups = fBreakpointToGroupMap.get(bpIdStr); - Set<String> groupIdList = new HashSet<String>(); + Set<String> groupIdList = new HashSet<>(); if (groups != null) { // Since we already know about this breakpoint id we must retain the list // we have been building diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoSharedLibraryInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoSharedLibraryInfo.java index dbdfd5abcd0..4cde03fe9ee 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoSharedLibraryInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoSharedLibraryInfo.java @@ -71,7 +71,7 @@ public class CLIInfoSharedLibraryInfo extends MIInfo { } void parse() { - List<DsfMISharedInfo> aList = new ArrayList<DsfMISharedInfo>(); + List<DsfMISharedInfo> aList = new ArrayList<>(); if (isDone()) { MIOutput out = getMIOutput(); MIOOBRecord[] oobs = out.getMIOOBRecords(); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoThreadsInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoThreadsInfo.java index 543ad3ca2b9..31db26571ad 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoThreadsInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoThreadsInfo.java @@ -104,7 +104,7 @@ public class CLIInfoThreadsInfo extends MIInfo { } protected void parse() { - info = new ArrayList<ThreadInfo>(); + info = new ArrayList<>(); if (isDone()) { MIOutput out = getMIOutput(); MIOOBRecord[] oobs = out.getMIOOBRecords(); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIArg.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIArg.java index 0899b1cd329..2daf16e88a6 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIArg.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIArg.java @@ -45,7 +45,7 @@ public class MIArg { * [{name="xxx"},{name="xxx"}] */ public static MIArg[] getMIArgs(MIList miList) { - List<MIArg> aList = new ArrayList<MIArg>(); + List<MIArg> aList = new ArrayList<>(); MIValue[] values = miList.getMIValues(); for (int i = 0; i < values.length; i++) { if (values[i] instanceof MITuple) { @@ -73,7 +73,7 @@ public class MIArg { * {{name="xxx"},{name="xxx"}} */ public static MIArg[] getMIArgs(MITuple miTuple) { - List<MIArg> aList = new ArrayList<MIArg>(); + List<MIArg> aList = new ArrayList<>(); MIValue[] values = miTuple.getMIValues(); for (int i = 0; i < values.length; i++) { if (values[i] instanceof MITuple) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIBreakInsertInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIBreakInsertInfo.java index 94bd7103a9b..3b26e72b5df 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIBreakInsertInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIBreakInsertInfo.java @@ -35,7 +35,7 @@ public class MIBreakInsertInfo extends MIInfo { public MIBreakInsertInfo(MIOutput record) { super(record); breakpoints = null; - List<MIBreakpoint> aList = new ArrayList<MIBreakpoint>(1); + List<MIBreakpoint> aList = new ArrayList<>(1); if (isDone()) { MIResultRecord rr = record.getMIResultRecord(); if (rr != null) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIBreakListInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIBreakListInfo.java index 6052cda1d15..ff02b7742a2 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIBreakListInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIBreakListInfo.java @@ -41,7 +41,7 @@ public class MIBreakListInfo extends MIInfo { } void parse() { - List<MIBreakpoint> aList = new ArrayList<MIBreakpoint>(1); + List<MIBreakpoint> aList = new ArrayList<>(1); if (isDone()) { MIOutput out = getMIOutput(); MIResultRecord rr = out.getMIResultRecord(); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIBreakpoint.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIBreakpoint.java index 17c10c95475..1b224b946b3 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIBreakpoint.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIBreakpoint.java @@ -657,7 +657,7 @@ public class MIBreakpoint { } private void parseGroups(MIList list) { - List<String> groups = new ArrayList<String>(); + List<String> groups = new ArrayList<>(); MIValue[] values = list.getMIValues(); for (int i = 0; i < values.length; i++) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIDataDisassembleInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIDataDisassembleInfo.java index 0aab7da1ea8..7a3a8b9f754 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIDataDisassembleInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIDataDisassembleInfo.java @@ -79,8 +79,8 @@ public class MIDataDisassembleInfo extends MIInfo { * parse its value. */ private void parse() { - List<MIInstruction> asmList = new ArrayList<MIInstruction>(); - List<MIMixedInstruction> srcList = new ArrayList<MIMixedInstruction>(); + List<MIInstruction> asmList = new ArrayList<>(); + List<MIMixedInstruction> srcList = new ArrayList<>(); if (isDone()) { MIOutput out = getMIOutput(); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIDataListRegisterNamesInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIDataListRegisterNamesInfo.java index 713a15ffe01..5efc567be15 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIDataListRegisterNamesInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIDataListRegisterNamesInfo.java @@ -29,7 +29,7 @@ public class MIDataListRegisterNamesInfo extends MIInfo { public MIDataListRegisterNamesInfo(MIOutput rr) { super(rr); names = null; - List<String> aList = new ArrayList<String>(); + List<String> aList = new ArrayList<>(); if (isDone()) { MIOutput out = getMIOutput(); MIResultRecord outr = out.getMIResultRecord(); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIDataListRegisterValuesInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIDataListRegisterValuesInfo.java index 1c25c653efb..ca99b8b0cd4 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIDataListRegisterValuesInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIDataListRegisterValuesInfo.java @@ -76,7 +76,7 @@ public class MIDataListRegisterValuesInfo extends MIInfo { public <V extends ICommandResult> V getSubsetResult(ICommand<V> cmd) { if (cmd instanceof MIDataListRegisterValues) { MIDataListRegisterValues command = (MIDataListRegisterValues) cmd; - List<MIRegisterValue> aList = new ArrayList<MIRegisterValue>(); + List<MIRegisterValue> aList = new ArrayList<>(); int[] wantedRegNos = command.getRegList(); /* diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIInfoOsInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIInfoOsInfo.java index a71ddde4f88..00903d184bb 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIInfoOsInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIInfoOsInfo.java @@ -101,7 +101,7 @@ public class MIInfoOsInfo extends MIInfo { } private void parseResourceClasses() { - List<IResourceClass> classes = new ArrayList<IResourceClass>(); + List<IResourceClass> classes = new ArrayList<>(); MITuple table = (MITuple) get(getMIOutput(), "OSDataTable"); //$NON-NLS-1$ diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIListFeaturesInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIListFeaturesInfo.java index 9bfcb387441..0205a621957 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIListFeaturesInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIListFeaturesInfo.java @@ -25,7 +25,7 @@ import java.util.List; */ public class MIListFeaturesInfo extends MIInfo { - private List<String> fFeatures = new ArrayList<String>(); + private List<String> fFeatures = new ArrayList<>(); public MIListFeaturesInfo(MIOutput out) { super(out); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIListThreadGroupsInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIListThreadGroupsInfo.java index 7309ec5f2cc..7e8bbf5759d 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIListThreadGroupsInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIListThreadGroupsInfo.java @@ -501,7 +501,7 @@ public class MIListThreadGroupsInfo extends MIInfo { /** @since 4.4 */ protected String[] parseCores(MIList list) { - List<String> cores = new ArrayList<String>(); + List<String> cores = new ArrayList<>(); MIValue[] values = list.getMIValues(); for (int i = 0; i < values.length; i++) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIMixedInstruction.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIMixedInstruction.java index 5f57239776c..883e38eb216 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIMixedInstruction.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIMixedInstruction.java @@ -62,7 +62,7 @@ public class MIMixedInstruction implements IMixedInstruction { * ] */ private void parse(MITuple tuple) { - List<MIInstruction> instructions = new ArrayList<MIInstruction>(); + List<MIInstruction> instructions = new ArrayList<>(); MIResult[] results = tuple.getMIResults(); for (int i = 0; i < results.length; i++) { String var = results[i].getVariable(); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIParser.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIParser.java index 7e0b3c5b48e..b4ba93be734 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIParser.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIParser.java @@ -266,7 +266,7 @@ public class MIParser { * Extract the MI Result comma seperated responses. */ private MIResult[] processMIResults(FSB buffer) { - List<MIResult> aList = new ArrayList<MIResult>(); + List<MIResult> aList = new ArrayList<>(); MIResult result = processMIResult(buffer); if (result != null) { aList.add(result); @@ -340,8 +340,8 @@ public class MIParser { */ private MIValue processMITuple(FSB buffer) { MITuple tuple = new MITuple(); - List<MIValue> valueList = new ArrayList<MIValue>(); - List<MIResult> resultList = new ArrayList<MIResult>(); + List<MIValue> valueList = new ArrayList<>(); + List<MIResult> resultList = new ArrayList<>(); // Catch closing '}' while (buffer.length() > 0 && buffer.charAt(0) != '}') { // Try for the DsfMIValue first @@ -374,8 +374,8 @@ public class MIParser { */ private MIValue processMIList(FSB buffer) { MIList list = new MIList(); - List<MIValue> valueList = new ArrayList<MIValue>(); - List<MIResult> resultList = new ArrayList<MIResult>(); + List<MIValue> valueList = new ArrayList<>(); + List<MIResult> resultList = new ArrayList<>(); // catch closing ']' while (buffer.length() > 0 && buffer.charAt(0) != ']') { // Try for the DsfMIValue first diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIRegisterValue.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIRegisterValue.java index f1ad6e91557..55a27d530db 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIRegisterValue.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIRegisterValue.java @@ -51,7 +51,7 @@ public class MIRegisterValue { * [{number="1",value="0xffff"},{number="xxx",value="yyy"},..] */ public static MIRegisterValue[] getMIRegisterValues(MIList miList) { - List<MIRegisterValue> aList = new ArrayList<MIRegisterValue>(); + List<MIRegisterValue> aList = new ArrayList<>(); MIValue[] values = miList.getMIValues(); for (int i = 0; i < values.length; i++) { if (values[i] instanceof MITuple) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIStackListArgumentsInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIStackListArgumentsInfo.java index 73f5766fc46..e0e852c4e40 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIStackListArgumentsInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIStackListArgumentsInfo.java @@ -28,7 +28,7 @@ public class MIStackListArgumentsInfo extends MIInfo { public MIStackListArgumentsInfo(MIOutput out) { super(out); frames = null; - List<MIFrame> aList = new ArrayList<MIFrame>(1); + List<MIFrame> aList = new ArrayList<>(1); if (isDone()) { MIResultRecord rr = out.getMIResultRecord(); if (rr != null) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIStackListFramesInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIStackListFramesInfo.java index 6b7e2858ab6..ff9b048a4f2 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIStackListFramesInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIStackListFramesInfo.java @@ -27,7 +27,7 @@ public class MIStackListFramesInfo extends MIInfo { public MIStackListFramesInfo(MIOutput out) { super(out); frames = null; - List<MIFrame> aList = new ArrayList<MIFrame>(1); + List<MIFrame> aList = new ArrayList<>(1); if (isDone()) { MIResultRecord rr = out.getMIResultRecord(); if (rr != null) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIStringHandler.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIStringHandler.java index af9f9aef5a6..d9f0f76a2b6 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIStringHandler.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIStringHandler.java @@ -35,7 +35,7 @@ public class MIStringHandler { * corresponding Unicode code point (i.e. character code). */ // Use a LinkedHashMap to preserve order, so as to get 'e' and not 'E' - private static Map<Character, Integer> fSpecialCharactersToCodePointMap = new LinkedHashMap<Character, Integer>(); + private static Map<Character, Integer> fSpecialCharactersToCodePointMap = new LinkedHashMap<>(); static { fSpecialCharactersToCodePointMap.put('a', 0x07); // Alert (bell) character fSpecialCharactersToCodePointMap.put('b', 0x08); // Backspace character diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MITraceListVariablesInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MITraceListVariablesInfo.java index 2362560b7ed..fc233a0c791 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MITraceListVariablesInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MITraceListVariablesInfo.java @@ -60,7 +60,7 @@ public class MITraceListVariablesInfo extends MIInfo { } private void parse() { - List<MITraceVariableInfo> aList = new ArrayList<MITraceVariableInfo>(1); + List<MITraceVariableInfo> aList = new ArrayList<>(1); if (isDone()) { MIOutput out = getMIOutput(); MIResultRecord rr = out.getMIResultRecord(); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MITuple.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MITuple.java index 148469c6cd7..33d926375ee 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MITuple.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MITuple.java @@ -50,7 +50,7 @@ public class MITuple extends MIValue { */ public MIValue getField(String name) { if (name2value == null) { - name2value = new HashMap<String, MIValue>(); + name2value = new HashMap<>(); for (MIResult r : results) { name2value.put(r.getVariable(), r.getMIValue()); } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIVarListChildrenInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIVarListChildrenInfo.java index f0417d5deca..2282001ca28 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIVarListChildrenInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIVarListChildrenInfo.java @@ -31,7 +31,7 @@ public class MIVarListChildrenInfo extends MIInfo { public MIVarListChildrenInfo(MIOutput record) { super(record); - List<MIVar> aList = new ArrayList<MIVar>(); + List<MIVar> aList = new ArrayList<>(); if (isDone()) { MIOutput out = getMIOutput(); MIResultRecord rr = out.getMIResultRecord(); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIVarUpdateInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIVarUpdateInfo.java index a24e25510c6..ef1d66834eb 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIVarUpdateInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIVarUpdateInfo.java @@ -29,7 +29,7 @@ public class MIVarUpdateInfo extends MIInfo { public MIVarUpdateInfo(MIOutput record) { super(record); - List<MIVarChange> aList = new ArrayList<MIVarChange>(); + List<MIVarChange> aList = new ArrayList<>(); if (isDone()) { MIOutput out = getMIOutput(); MIResultRecord rr = out.getMIResultRecord(); @@ -123,7 +123,7 @@ public class MIVarUpdateInfo extends MIInfo { } } else if (var.equals("new_children")) { //$NON-NLS-1$ if (change != null) { - List<MIVar> newChildren = new ArrayList<MIVar>(); + List<MIVar> newChildren = new ArrayList<>(); parseNewChildren(value, newChildren); change.setNewChildren(newChildren.toArray(new MIVar[newChildren.size()])); } diff --git a/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/launch/GdbExtendedFinalLaunchSequence.java b/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/launch/GdbExtendedFinalLaunchSequence.java index 53f47d0bc67..e2e41250ee0 100644 --- a/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/launch/GdbExtendedFinalLaunchSequence.java +++ b/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/launch/GdbExtendedFinalLaunchSequence.java @@ -47,7 +47,7 @@ public class GdbExtendedFinalLaunchSequence extends FinalLaunchSequence_7_12 { if (GROUP_TOP_LEVEL.equals(group)) { // Initialize the list with the base class' steps // We need to create a list that we can modify, which is why we create our own ArrayList. - List<String> orderList = new ArrayList<String>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); + List<String> orderList = new ArrayList<>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); // Now insert our init step right after the initialization of the base class. orderList.add(orderList.indexOf("stepInitializeFinalLaunchSequence_7_7") + 1, //$NON-NLS-1$ diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java index 2ecca984887..e4bdc6edcdd 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java @@ -127,7 +127,7 @@ public class BaseTestCase { // This allows a SuiteGdb to set an attribute // The suite is responsible for clearing those attributes // once it is finished - private static Map<String, Object> globalLaunchAttributes = new HashMap<String, Object>(); + private static Map<String, Object> globalLaunchAttributes = new HashMap<>(); private static Process gdbserverProc; @@ -362,7 +362,7 @@ public class BaseTestCase { protected void setLaunchAttributes() { // Clear all launch attributes before starting a new test - launchAttributes = new HashMap<String, Object>(); + launchAttributes = new HashMap<>(); launchAttributes.put(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EXEC_PATH + DEFAULT_EXEC_NAME); diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/OnceOnlySuite.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/OnceOnlySuite.java index ca2f1fd3fa1..bf63f193a12 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/OnceOnlySuite.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/OnceOnlySuite.java @@ -36,7 +36,7 @@ import org.junit.runners.model.RunnerBuilder; */ @SuppressWarnings("restriction") public class OnceOnlySuite extends Suite { - private static Set<Class<?>> alreadySeen = new HashSet<Class<?>>(); + private static Set<Class<?>> alreadySeen = new HashSet<>(); public OnceOnlySuite(Class<?> testClass, final RunnerBuilder builder) throws InitializationError { super(testClass, new RunnerBuilder() { diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/ServiceEventWaitor.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/ServiceEventWaitor.java index f1bfeef0c02..5528b8cddeb 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/ServiceEventWaitor.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/ServiceEventWaitor.java @@ -106,7 +106,7 @@ public class ServiceEventWaitor<V> { */ public synchronized List<V> waitForEvents(int period) { long startMs = System.currentTimeMillis(); - List<V> events = new ArrayList<V>(); + List<V> events = new ArrayList<>(); //Timeout exception will exit the loop and return the resulting list of events while (true) { diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java index 1c1c7338e01..74042b75e41 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java @@ -170,7 +170,7 @@ public class SyncUtil { public static MIStoppedEvent step(final IExecutionDMContext dmc, final StepType stepType, boolean reverse, int massagedTimeout) throws Throwable { - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>(fSession, + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>(fSession, MIStoppedEvent.class); if (!reverse) { @@ -280,7 +280,7 @@ public class SyncUtil { private static MIStoppedEvent resumeUntilStopped(final IExecutionDMContext dmc, int massagedTimeout) throws Throwable { - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>(fSession, + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>(fSession, MIStoppedEvent.class); fRunControl.getExecutor().submit(new Runnable() { @@ -308,7 +308,7 @@ public class SyncUtil { } public static MIRunningEvent resume(final IExecutionDMContext dmc, int massagedTimeout) throws Throwable { - final ServiceEventWaitor<MIRunningEvent> eventWaitor = new ServiceEventWaitor<MIRunningEvent>(fSession, + final ServiceEventWaitor<MIRunningEvent> eventWaitor = new ServiceEventWaitor<>(fSession, MIRunningEvent.class); fRunControl.getExecutor().submit(new Runnable() { @@ -378,7 +378,7 @@ public class SyncUtil { // if there is a sleep in the code between the resume and the time // it stops; this will give us plenty of time to call this method. public static MIStoppedEvent waitForStop(int timeout) throws Throwable { - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>(fSession, + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>(fSession, MIStoppedEvent.class); // Wait for the execution to suspend @@ -592,7 +592,7 @@ public class SyncUtil { * we allows 10 seconds, which is probably ample in most cases. Tests * can provide larger values as needed in specific SyncUtil calls. */ - private static Map<ETimeout, Integer> sTimeouts = new HashMap<ETimeout, Integer>(); + private static Map<ETimeout, Integer> sTimeouts = new HashMap<>(); static { sTimeouts.put(ETimeout.addBreakpoint, 1000); sTimeouts.put(ETimeout.deleteBreakpoint, 1000); @@ -778,7 +778,7 @@ public class SyncUtil { } // Now wait for the stopped event of the restart - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>(fSession, + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>(fSession, MIStoppedEvent.class); // Perform the restart @@ -815,7 +815,7 @@ public class SyncUtil { protected void handleCompleted() { if (isSuccess()) { IVariableDMContext[] varDmcs = getData(); - final List<IVariableDMData> localsDMData = new ArrayList<IVariableDMData>(); + final List<IVariableDMData> localsDMData = new ArrayList<>(); final CountingRequestMonitor crm = new CountingRequestMonitor( ImmediateExecutor.getInstance(), rm) { @Override @@ -876,7 +876,7 @@ public class SyncUtil { // Remove registers with empty names since the service also // remove them. I don't know why GDB returns such empty names. - List<String> registerNames = new LinkedList<String>(); + List<String> registerNames = new LinkedList<>(); for (String name : names) { if (!name.isEmpty()) { registerNames.add(name); diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/CommandTimeoutTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/CommandTimeoutTest.java index 63f7e196b64..7555b477977 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/CommandTimeoutTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/CommandTimeoutTest.java @@ -97,7 +97,7 @@ public class CommandTimeoutTest extends BaseParametrizedTestCase { doLaunch(); final DsfSession session = getGDBLaunch().getSession(); - ServiceEventWaitor<ICommandControlShutdownDMEvent> shutdownEventWaitor = new ServiceEventWaitor<ICommandControlShutdownDMEvent>( + ServiceEventWaitor<ICommandControlShutdownDMEvent> shutdownEventWaitor = new ServiceEventWaitor<>( session, ICommandControlShutdownDMEvent.class); // Send the command that will timeout diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBConsoleBreakpointsTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBConsoleBreakpointsTest.java index bdea8c196e0..1ad33dc43e7 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBConsoleBreakpointsTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBConsoleBreakpointsTest.java @@ -113,7 +113,7 @@ public class GDBConsoleBreakpointsTest extends BaseParametrizedTestCase { private IBreakpoints fBreakpointService; private MIBreakpointsSynchronizer fBreakpointsSynchronizer; - private List<IBreakpointsChangedEvent> fBreakpointEvents = new ArrayList<IBreakpointsChangedEvent>(); + private List<IBreakpointsChangedEvent> fBreakpointEvents = new ArrayList<>(); @Override @Before @@ -819,7 +819,7 @@ public class GDBConsoleBreakpointsTest extends BaseParametrizedTestCase { } private Map<String, Object> getLocationBreakpointAttributes(Class<? extends ICBreakpoint> type, boolean valid) { - Map<String, Object> map = new HashMap<String, Object>(); + Map<String, Object> map = new HashMap<>(); if (ICFunctionBreakpoint.class.equals(type)) { map.put(ATTR_FILE_NAME, (valid) ? SOURCE_NAME_VALID : SOURCE_NAME_INVALID); map.put(ATTR_FUNCTION, (valid) ? FUNCTION_VALID : FUNCTION_INVALID); @@ -837,7 +837,7 @@ public class GDBConsoleBreakpointsTest extends BaseParametrizedTestCase { public Map<String, Object> getWatchpointAttributes(Class<? extends ICWatchpoint> type, boolean read, boolean write) throws Throwable { Assert.assertTrue(read || write); - Map<String, Object> map = new HashMap<String, Object>(); + Map<String, Object> map = new HashMap<>(); map.put(ATTR_EXPRESSION, EXPRESSION_VALID); map.put(ATTR_READ, Boolean.valueOf(read)); map.put(ATTR_WRITE, Boolean.valueOf(write)); diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBConsoleSynchronizingTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBConsoleSynchronizingTest.java index e9d67881067..cb4ed53ace9 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBConsoleSynchronizingTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBConsoleSynchronizingTest.java @@ -75,7 +75,7 @@ public class GDBConsoleSynchronizingTest extends BaseParametrizedTestCase { private IExpressions fExprService; private IRunControl fRunControl; - private List<IDMEvent<? extends IDMContext>> fEventsReceived = new ArrayList<IDMEvent<? extends IDMContext>>(); + private List<IDMEvent<? extends IDMContext>> fEventsReceived = new ArrayList<>(); @Override protected void setLaunchAttributes() { diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBPatternMatchingExpressionsTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBPatternMatchingExpressionsTest.java index 1bd1b8242bf..3d359d35006 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBPatternMatchingExpressionsTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBPatternMatchingExpressionsTest.java @@ -1500,7 +1500,7 @@ public class GDBPatternMatchingExpressionsTest extends BaseParametrizedTestCase @Test public void testGroupGetSubExpressions() throws Throwable { final String exprString = "$eax;*"; - List<String> list = new LinkedList<String>(); + List<String> list = new LinkedList<>(); list.add("$eax"); list.addAll(Arrays.asList(fAllVariables)); final String[] children = list.toArray(new String[list.size()]); diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBRemoteTracepointsTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBRemoteTracepointsTest.java index 1c5aa1baa81..71dbd000b33 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBRemoteTracepointsTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBRemoteTracepointsTest.java @@ -659,7 +659,7 @@ public class GDBRemoteTracepointsTest extends BaseParametrizedTestCase { getLineForTag("4_BYTE"), getLineForTag("5_BYTE") }; for (int i = 0; i < lineNumbers.length; i++) { - attributes = new HashMap<String, Object>(); + attributes = new HashMap<>(); attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); attributes.put(MIBreakpoints.FILE_NAME, SOURCE_NAME); attributes.put(MIBreakpoints.LINE_NUMBER, lineNumbers[i]); @@ -739,7 +739,7 @@ public class GDBRemoteTracepointsTest extends BaseParametrizedTestCase { passed.add(byteCount); } } - assertEquals("Some byte length were not seen", new HashSet<Integer>(Arrays.asList(1, 2, 3, 4, 5)), passed); + assertEquals("Some byte length were not seen", new HashSet<>(Arrays.asList(1, 2, 3, 4, 5)), passed); } catch (AssertionError | Exception e) { throw new AssertionError( "Failed to verify instruction lengths. Output from GDB's disassemble:\n" + miInfo.toString(), e); @@ -785,7 +785,7 @@ public class GDBRemoteTracepointsTest extends BaseParametrizedTestCase { public void disableTracepoints() throws Throwable { createTracepoints(); - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(MIBreakpoints.IS_ENABLED, false); // Disable all tracepoints for (IBreakpointDMContext tp : fTracepoints) { @@ -804,7 +804,7 @@ public class GDBRemoteTracepointsTest extends BaseParametrizedTestCase { public void enableTracepoints() throws Throwable { disableTracepoints(); - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(MIBreakpoints.IS_ENABLED, true); // Enable all tracepoints for (IBreakpointDMContext tp : fTracepoints) { @@ -823,7 +823,7 @@ public class GDBRemoteTracepointsTest extends BaseParametrizedTestCase { public void tracepointPasscount() throws Throwable { createTracepoints(); - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); // Set passcount for all tracepoints for (int i = 0; i < fTracepoints.length; i++) { if (fTracepoints[i] == null) @@ -844,7 +844,7 @@ public class GDBRemoteTracepointsTest extends BaseParametrizedTestCase { public void tracepointCondition() throws Throwable { createTracepoints(); - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); // Set conditions for all tracepoints for (int i = 0; i < fTracepoints.length; i++) { if (fTracepoints[i] == null) @@ -865,7 +865,7 @@ public class GDBRemoteTracepointsTest extends BaseParametrizedTestCase { public void tracepointActions() throws Throwable { createTracepoints(); - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); // Set conditions for all tracepoints for (int i = 0; i < fTracepoints.length; i++) { if (fTracepoints[i] == null) @@ -949,7 +949,7 @@ public class GDBRemoteTracepointsTest extends BaseParametrizedTestCase { getLineForTag("4_BYTE"), getLineForTag("5_BYTE") }; for (int i = 0; i < lineNumbers.length; i++) { - attributes = new HashMap<String, Object>(); + attributes = new HashMap<>(); attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); attributes.put(MIBreakpoints.FILE_NAME, SOURCE_NAME); attributes.put(MIBreakpoints.LINE_NUMBER, lineNumbers[i]); @@ -1237,7 +1237,7 @@ public class GDBRemoteTracepointsTest extends BaseParametrizedTestCase { createTracepoints(); - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); // Set conditions for all tracepoints delta.put(MIBreakpoints.COMMANDS, action1.getName()); updateBreakpoint(fTracepoints[0], delta); diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/LaunchConfigurationAndRestartTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/LaunchConfigurationAndRestartTest.java index 1d35a5374a3..acf45f16b1d 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/LaunchConfigurationAndRestartTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/LaunchConfigurationAndRestartTest.java @@ -331,7 +331,7 @@ public class LaunchConfigurationAndRestartTest extends BaseParametrizedTestCase public void testSettingEnvironment() throws Throwable { setLaunchAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, true); - Map<String, String> map = new HashMap<String, String>(1); + Map<String, String> map = new HashMap<>(1); map.put("LAUNCHTEST", "IS SET"); setLaunchAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, map); doLaunch(); @@ -392,7 +392,7 @@ public class LaunchConfigurationAndRestartTest extends BaseParametrizedTestCase public void testClearingAndSettingEnvironment() throws Throwable { setLaunchAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, false); - Map<String, String> map = new HashMap<String, String>(1); + Map<String, String> map = new HashMap<>(1); map.put("LAUNCHTEST", "IS SET"); setLaunchAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, map); doLaunch(); @@ -596,7 +596,7 @@ public class LaunchConfigurationAndRestartTest extends BaseParametrizedTestCase assumeGdbVersionAtLeast(ITestConstants.SUFFIX_GDB_7_3); doLaunch(); - ServiceEventWaitor<ICommandControlShutdownDMEvent> shutdownEventWaitor = new ServiceEventWaitor<ICommandControlShutdownDMEvent>( + ServiceEventWaitor<ICommandControlShutdownDMEvent> shutdownEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), ICommandControlShutdownDMEvent.class); // The target is currently stopped. We resume to get it running @@ -714,7 +714,7 @@ public class LaunchConfigurationAndRestartTest extends BaseParametrizedTestCase // Now step backwards to make sure reverse was enabled - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>(fSession, + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>(fSession, MIStoppedEvent.class); final int REVERSE_NUM_STEPS = 2; @@ -780,7 +780,7 @@ public class LaunchConfigurationAndRestartTest extends BaseParametrizedTestCase frame.getFunction().equals("stopAtOther")); // Now step backwards all the way to the start to make sure reverse was enabled from the very start - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>(fSession, + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>(fSession, MIStoppedEvent.class); final int REVERSE_NUM_STEPS = 3; @@ -854,7 +854,7 @@ public class LaunchConfigurationAndRestartTest extends BaseParametrizedTestCase frame.getFunction().equals("main") && frame.getLine() == LAST_LINE_IN_MAIN); // Now step backwards all the way to the start to make sure reverse was enabled from the very start - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>(fSession, + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>(fSession, MIStoppedEvent.class); final int REVERSE_NUM_STEPS = 3; diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIBreakpointsTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIBreakpointsTest.java index b287e4d6073..18cce53ce65 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIBreakpointsTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIBreakpointsTest.java @@ -484,7 +484,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { private IBreakpointDMContext insertAndRunToLineBreakpoint(int lineNumber) throws Throwable { clearEventCounters(); // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, lineNumber); @@ -800,7 +800,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void insertBreakpoint_InvalidContext() throws Throwable { // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -820,7 +820,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { public void insertBreakpoint_InvalidFileName() throws Throwable { assumeGdbVersionLowerThen(ITestConstants.SUFFIX_GDB_6_8); // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME + "_bad"); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -840,7 +840,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { public void insertBreakpoint_InvalidLineNumber() throws Throwable { assumeGdbVersionLowerThen(ITestConstants.SUFFIX_GDB_7_4); // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, 0); @@ -860,7 +860,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { public void insertBreakpoint_InvalidFunctionName() throws Throwable { assumeGdbVersionLowerThen(ITestConstants.SUFFIX_GDB_6_8); // Create a function breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(FUNCTION_TAG, "invalid-function-name"); @@ -879,7 +879,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void insertBreakpoint_InvalidAddress() throws Throwable { // Create an address breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(ADDRESS_TAG, "0x0z"); @@ -899,7 +899,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void insertBreakpoint_Address() throws Throwable { // Create an address breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); final BigInteger ADDRESS = new BigInteger("00affe00", 16); breakpoint.put(ADDRESS_TAG, "0x" + ADDRESS.toString(16)); @@ -933,7 +933,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void insertBreakpoint_LineNumber() throws Throwable { // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -968,7 +968,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void insertBreakpoint_Disabled() throws Throwable { // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -1004,7 +1004,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void insertBreakpoint_FunctionName() throws Throwable { // Create a function breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(FUNCTION_TAG, FUNCTION); @@ -1039,7 +1039,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void insertBreakpoint_Condition() throws Throwable { // Create a conditional line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -1075,7 +1075,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void insertBreakpoint_IgnoreCnt() throws Throwable { // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -1111,7 +1111,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void insertBreakpoint_MultipleBreakpoints() throws Throwable { // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -1131,7 +1131,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { validateBreakpoint(breakpoint1, SOURCE_NAME, LINE_NUMBER_1, NO_CONDITION, 0, true, false); // Create a function breakpoint - breakpoint = new HashMap<String, Object>(); + breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(FUNCTION_TAG, FUNCTION); @@ -1177,7 +1177,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void insertBreakpoint_Duplicate() throws Throwable { // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -1247,7 +1247,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { return; } // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_5); @@ -1298,7 +1298,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { return; } // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, "Bad file name"); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_5); @@ -1343,7 +1343,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void insertWatchpoint_Write() throws Throwable { // Create a write watchpoint - Map<String, Object> watchpoint = new HashMap<String, Object>(); + Map<String, Object> watchpoint = new HashMap<>(); watchpoint.put(BREAKPOINT_TYPE_TAG, WATCHPOINT_TAG); watchpoint.put(EXPRESSION_TAG, EXPRESSION_1); watchpoint.put(WRITE_TAG, true); @@ -1378,7 +1378,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void insertWatchpoint_Read() throws Throwable { // Create a read watchpoint - Map<String, Object> watchpoint = new HashMap<String, Object>(); + Map<String, Object> watchpoint = new HashMap<>(); watchpoint.put(BREAKPOINT_TYPE_TAG, WATCHPOINT_TAG); watchpoint.put(EXPRESSION_TAG, EXPRESSION_1); watchpoint.put(READ_TAG, true); @@ -1413,7 +1413,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void insertWatchpoint_Access() throws Throwable { // Create an access watchpoint - Map<String, Object> watchpoint = new HashMap<String, Object>(); + Map<String, Object> watchpoint = new HashMap<>(); watchpoint.put(BREAKPOINT_TYPE_TAG, WATCHPOINT_TAG); watchpoint.put(EXPRESSION_TAG, EXPRESSION_1); watchpoint.put(READ_TAG, true); @@ -1458,7 +1458,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { return; } // Create a write watchpoint - Map<String, Object> watchpoint = new HashMap<String, Object>(); + Map<String, Object> watchpoint = new HashMap<>(); watchpoint.put(BREAKPOINT_TYPE_TAG, WATCHPOINT_TAG); watchpoint.put(EXPRESSION_TAG, EXPRESSION_3); watchpoint.put(WRITE_TAG, true); @@ -1506,7 +1506,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void removeBreakpoint_SimpleCase() throws Throwable { // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -1553,7 +1553,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { assertTrue("BreakpointEvent problem: expected " + 0 + " BREAKPOINT event(s), received " + fBreakpointEventCount, fBreakpointEventCount == 0); // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -1631,7 +1631,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { public void removeBreakpoint_MixedCase() throws Throwable { // Create a line breakpoint for (int i = 0; i < 4; i++) { - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1 + i); @@ -1695,7 +1695,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { return; } // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_5); @@ -1740,7 +1740,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { IBreakpointDMContext invalid_ref = new MIBreakpointDMContext((MIBreakpoints) fBreakpointService, new IDMContext[] { fBreakpointsDmc }, "0.0"); // Update the invalid breakpoint - Map<String, Object> properties = new HashMap<String, Object>(); + Map<String, Object> properties = new HashMap<>(); properties.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); properties.put(FILE_NAME_TAG, SOURCE_NAME); properties.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -1760,7 +1760,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void updateBreakpoint_AddCondition() throws Throwable { // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -1775,7 +1775,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { + getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); clearEventCounters(); // Modify the condition - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(CONDITION_TAG, CONDITION_1); updateBreakpoint(ref, delta); @@ -1800,7 +1800,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void updateBreakpoint_RemoveCondition() throws Throwable { // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -1816,7 +1816,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { + getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); clearEventCounters(); // Remove the condition - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(CONDITION_TAG, null); updateBreakpoint(ref, delta); @@ -1841,7 +1841,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void updateBreakpoint_ModifyCondition() throws Throwable { // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -1857,7 +1857,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { + getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); clearEventCounters(); // Update the condition - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(CONDITION_TAG, CONDITION_2); updateBreakpoint(ref, delta); @@ -1891,7 +1891,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { return; } // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_5); @@ -1907,7 +1907,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { + getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); clearEventCounters(); // Prepare to update the condition - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(CONDITION_TAG, CONDITION_5); // Run the program SyncUtil.resume(); @@ -1944,7 +1944,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { // Run to the point where the variable is initialized insertAndRunToLineBreakpoint(LINE_NUMBER_1); // Create a write watchpoint - Map<String, Object> watchpoint = new HashMap<String, Object>(); + Map<String, Object> watchpoint = new HashMap<>(); watchpoint.put(BREAKPOINT_TYPE_TAG, WATCHPOINT_TAG); watchpoint.put(EXPRESSION_TAG, EXPRESSION_1); watchpoint.put(WRITE_TAG, true); @@ -1959,7 +1959,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { + getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); clearEventCounters(); // Add the condition - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(CONDITION_TAG, CONDITION_1); updateBreakpoint(ref, delta); @@ -1986,7 +1986,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { // Run to the point where the variable is initialized insertAndRunToLineBreakpoint(LINE_NUMBER_1); // Create a write watchpoint - Map<String, Object> watchpoint = new HashMap<String, Object>(); + Map<String, Object> watchpoint = new HashMap<>(); watchpoint.put(BREAKPOINT_TYPE_TAG, WATCHPOINT_TAG); watchpoint.put(EXPRESSION_TAG, EXPRESSION_1); watchpoint.put(WRITE_TAG, true); @@ -2002,7 +2002,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { + getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); clearEventCounters(); // Remove the condition - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(CONDITION_TAG, null); updateBreakpoint(ref, delta); @@ -2029,7 +2029,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { // Run to the point where the variable is initialized insertAndRunToLineBreakpoint(LINE_NUMBER_1); // Create a write watchpoint - Map<String, Object> watchpoint = new HashMap<String, Object>(); + Map<String, Object> watchpoint = new HashMap<>(); watchpoint.put(BREAKPOINT_TYPE_TAG, WATCHPOINT_TAG); watchpoint.put(EXPRESSION_TAG, EXPRESSION_1); watchpoint.put(WRITE_TAG, true); @@ -2045,7 +2045,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { + getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); clearEventCounters(); // Update the condition - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(CONDITION_TAG, CONDITION_2); updateBreakpoint(ref, delta); @@ -2070,7 +2070,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void updateBreakpoint_AddCount() throws Throwable { // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -2085,7 +2085,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { + getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); clearEventCounters(); // Add a count - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(IGNORE_COUNT_TAG, IGNORE_COUNT_2); updateBreakpoint(ref, delta); @@ -2110,7 +2110,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void updateBreakpoint_RemoveCount() throws Throwable { // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -2126,7 +2126,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { + getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); clearEventCounters(); // Remove the count - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(IGNORE_COUNT_TAG, null); updateBreakpoint(ref, delta); @@ -2150,7 +2150,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void updateBreakpoint_ModifyCount() throws Throwable { // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -2166,7 +2166,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { + getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); clearEventCounters(); // Update the count - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(IGNORE_COUNT_TAG, IGNORE_COUNT_2); updateBreakpoint(ref, delta); @@ -2200,7 +2200,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { return; } // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_5); @@ -2216,7 +2216,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { + getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); clearEventCounters(); // Prepare to update the count - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(IGNORE_COUNT_TAG, 0); // Run the program SyncUtil.resume(); @@ -2250,7 +2250,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void updateBreakpoint_Disable() throws Throwable { // Create a first line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -2258,7 +2258,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { IBreakpointDMContext ref1 = insertBreakpoint(fBreakpointsDmc, breakpoint); // Create a second line breakpoint - breakpoint = new HashMap<String, Object>(); + breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_2); @@ -2278,7 +2278,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { assertTrue("BreakpointService problem: breakpoint state error", breakpoint1.isEnabled() && breakpoint2.isEnabled()); // Disable the first breakpoint - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(IS_ENABLED_TAG, false); updateBreakpoint(ref1, delta); @@ -2323,7 +2323,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { return; } // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_5); @@ -2342,7 +2342,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { + getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 2); clearEventCounters(); // Prepare to disable the breakpoint - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(IS_ENABLED_TAG, false); // Run the program SyncUtil.resume(); @@ -2371,7 +2371,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void updateBreakpoint_Enable() throws Throwable { // Create a first line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -2379,7 +2379,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { IBreakpointDMContext ref1 = insertBreakpoint(fBreakpointsDmc, breakpoint); // Create a second line breakpoint - breakpoint = new HashMap<String, Object>(); + breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_2); @@ -2399,7 +2399,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { assertTrue("BreakpointService problem: breakpoint state error", breakpoint1.isEnabled() && breakpoint2.isEnabled()); // Disable the first breakpoint - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(IS_ENABLED_TAG, false); updateBreakpoint(ref1, delta); @@ -2426,7 +2426,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { assertTrue("BreakpointService problem: breakpoint mismatch", fBreakpointRef.equals(breakpoint2.getNumber())); clearEventCounters(); // Enable the first breakpoint - delta = new HashMap<String, Object>(); + delta = new HashMap<>(); delta.put(IS_ENABLED_TAG, true); updateBreakpoint(ref1, delta); @@ -2471,7 +2471,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { return; } // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_5); @@ -2487,7 +2487,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { + getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); clearEventCounters(); // Prepare to enable the breakpoint - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(IS_ENABLED_TAG, true); // Run the program SyncUtil.resume(); @@ -2621,7 +2621,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void breakpointHit_LineNumber() throws Throwable { // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -2656,7 +2656,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void breakpointHit_Function() throws Throwable { // Create a function breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(FUNCTION_TAG, FUNCTION); @@ -2693,7 +2693,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void breakpointHit_Condition() throws Throwable { // Create a conditional line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -2735,7 +2735,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void breakpointHit_UpdatedCondition() throws Throwable { // Create a conditional line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -2750,7 +2750,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { + getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); clearEventCounters(); // Add the condition - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(CONDITION_TAG, CONDITION_1); updateBreakpoint(ref, delta); @@ -2788,7 +2788,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void breakpointHit_Count() throws Throwable { // Create a conditional line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -2830,7 +2830,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void breakpointHit_UpdatedCount() throws Throwable { // Create a conditional line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -2845,7 +2845,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { + getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); clearEventCounters(); // Add a count - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(IGNORE_COUNT_TAG, IGNORE_COUNT_2); updateBreakpoint(ref, delta); @@ -2882,7 +2882,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void breakpointHit_WriteWatchpoint() throws Throwable { // Create a write watchpoint - Map<String, Object> watchpoint = new HashMap<String, Object>(); + Map<String, Object> watchpoint = new HashMap<>(); watchpoint.put(BREAKPOINT_TYPE_TAG, WATCHPOINT_TAG); watchpoint.put(EXPRESSION_TAG, EXPRESSION_1); watchpoint.put(WRITE_TAG, true); @@ -2922,7 +2922,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void breakpointHit_ReadWatchpoint() throws Throwable { // Create a write watchpoint - Map<String, Object> watchpoint = new HashMap<String, Object>(); + Map<String, Object> watchpoint = new HashMap<>(); watchpoint.put(BREAKPOINT_TYPE_TAG, WATCHPOINT_TAG); watchpoint.put(EXPRESSION_TAG, EXPRESSION_1); watchpoint.put(READ_TAG, true); @@ -2962,7 +2962,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { @Test public void breakpointHit_AccessWatchpoint() throws Throwable { // Create an access watchpoint - Map<String, Object> watchpoint = new HashMap<String, Object>(); + Map<String, Object> watchpoint = new HashMap<>(); watchpoint.put(BREAKPOINT_TYPE_TAG, WATCHPOINT_TAG); watchpoint.put(EXPRESSION_TAG, EXPRESSION_1); watchpoint.put(READ_TAG, true); @@ -3005,7 +3005,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { // Run to the point where the variable is initialized insertAndRunToLineBreakpoint(LINE_NUMBER_4); // Create a write watchpoint - Map<String, Object> watchpoint = new HashMap<String, Object>(); + Map<String, Object> watchpoint = new HashMap<>(); watchpoint.put(BREAKPOINT_TYPE_TAG, WATCHPOINT_TAG); watchpoint.put(EXPRESSION_TAG, EXPRESSION_2); watchpoint.put(WRITE_TAG, true); @@ -3020,7 +3020,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { + getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); clearEventCounters(); // Add a count - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(IGNORE_COUNT_TAG, IGNORE_COUNT_2); updateBreakpoint(ref, delta); @@ -3063,7 +3063,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { // Run to the point where the variable is initialized insertAndRunToLineBreakpoint(LINE_NUMBER_4); // Create a write watchpoint - Map<String, Object> watchpoint = new HashMap<String, Object>(); + Map<String, Object> watchpoint = new HashMap<>(); watchpoint.put(BREAKPOINT_TYPE_TAG, WATCHPOINT_TAG); watchpoint.put(EXPRESSION_TAG, EXPRESSION_2); watchpoint.put(WRITE_TAG, true); @@ -3078,7 +3078,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { + getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); clearEventCounters(); // Add a condition - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); delta.put(CONDITION_TAG, CONDITION_3); updateBreakpoint(ref, delta); @@ -3118,7 +3118,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { // Run to the point where the variable is initialized insertAndRunToLineBreakpoint(LINE_NUMBER_4); // Create a write watchpoint - Map<String, Object> watchpoint = new HashMap<String, Object>(); + Map<String, Object> watchpoint = new HashMap<>(); watchpoint.put(BREAKPOINT_TYPE_TAG, WATCHPOINT_TAG); watchpoint.put(EXPRESSION_TAG, EXPRESSION_2); watchpoint.put(READ_TAG, true); @@ -3166,7 +3166,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { public void insertBreakpoint_InvalidLineNumberPending() throws Throwable { assumeGdbVersionAtLeast(ITestConstants.SUFFIX_GDB_7_4); // Create a line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, 0); @@ -3191,7 +3191,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { public void insertBreakpoint_InvalidFileNamePending() throws Throwable { assumeGdbVersionAtLeast(ITestConstants.SUFFIX_GDB_6_8); // Create an invalid line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME + "_bad"); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); @@ -3238,7 +3238,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { public void insertBreakpoint_InvalidFunctionNamePending() throws Throwable { assumeGdbVersionAtLeast(ITestConstants.SUFFIX_GDB_6_8); // Create an invalid function breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(FUNCTION_TAG, "invalid-function-name"); @@ -3293,7 +3293,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase { } // Create an invalid line breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); breakpoint.put(FILE_NAME_TAG, "Bad file name"); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_5); diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MICatchpointsTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MICatchpointsTest.java index 2ab9794c660..2eaac4b4c8d 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MICatchpointsTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MICatchpointsTest.java @@ -595,7 +595,7 @@ public class MICatchpointsTest extends BaseParametrizedTestCase { public void insertCatchpoint_InvalidContext() throws Throwable { // Attempt to create a catchpoint with an invalid execution context (should fail) - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.CATCHPOINT); breakpoint.put(MIBreakpoints.CATCHPOINT_TYPE, "throw"); insertBreakpoint(null, breakpoint); @@ -769,7 +769,7 @@ public class MICatchpointsTest extends BaseParametrizedTestCase { // Set a throw catchpoint; don't use the utility method since it assumes // the target is running - Map<String, Object> bkptsProps = new HashMap<String, Object>(); + Map<String, Object> bkptsProps = new HashMap<>(); bkptsProps.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.CATCHPOINT); bkptsProps.put(MIBreakpoints.CATCHPOINT_TYPE, "throw"); insertBreakpoint(fBreakpointsDmc, bkptsProps); @@ -1289,7 +1289,7 @@ public class MICatchpointsTest extends BaseParametrizedTestCase { IBreakpointDMContext[] bkptsBefore = getBreakpoints(fBreakpointsDmc); // Set the breakpoint - Map<String, Object> breakpoint = new HashMap<String, Object>(); + Map<String, Object> breakpoint = new HashMap<>(); breakpoint.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.BREAKPOINT); breakpoint.put(MIBreakpoints.FILE_NAME, SOURCE_NAME); breakpoint.put(MIBreakpoints.LINE_NUMBER, lineNumber); @@ -1302,7 +1302,7 @@ public class MICatchpointsTest extends BaseParametrizedTestCase { assertEquals("Unexpected number of breakpoint-added events", 1, getBreakpointEventCount(BP_ADDED)); // Ensure the breakpoint service sees what we expect - List<IBreakpointDMContext> bkptsAfter = new LinkedList<IBreakpointDMContext>( + List<IBreakpointDMContext> bkptsAfter = new LinkedList<>( Arrays.asList(getBreakpoints(fBreakpointsDmc))); assertEquals("Breakpoints service reports unexpected number of breakpoints", bkptsBefore.length + 1, bkptsAfter.size()); @@ -1341,7 +1341,7 @@ public class MICatchpointsTest extends BaseParametrizedTestCase { IBreakpointDMContext[] bkptsBefore = getBreakpoints(fBreakpointsDmc); // set the catchpoint - Map<String, Object> bkptsProps = new HashMap<String, Object>(); + Map<String, Object> bkptsProps = new HashMap<>(); bkptsProps.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.CATCHPOINT); bkptsProps.put(MIBreakpoints.CATCHPOINT_TYPE, event); if (condition != null) { @@ -1361,7 +1361,7 @@ public class MICatchpointsTest extends BaseParametrizedTestCase { // Ensure the breakpoint service sees what we expect. Ask the breakpoint // service for the list of breakpoint against and make sure it differs // only by the newly added one - List<IBreakpointDMContext> bkptsAfter = new LinkedList<IBreakpointDMContext>( + List<IBreakpointDMContext> bkptsAfter = new LinkedList<>( Arrays.asList(getBreakpoints(fBreakpointsDmc))); assertEquals("Breakpoints service reports unexpected number of breakpoints", bkptsBefore.length + 1, bkptsAfter.size()); @@ -1432,7 +1432,7 @@ public class MICatchpointsTest extends BaseParametrizedTestCase { private void modifyBkptProperty(IBreakpointDMContext bkptRef, String property, Object value) throws Throwable { // Modify the catchpoint to not have an ignore count clearEventCounters(); - Map<String, Object> bkptProps = new HashMap<String, Object>(); + Map<String, Object> bkptProps = new HashMap<>(); bkptProps.put(property, value); updateBreakpoint(bkptRef, bkptProps); assertTrue(fWait.getMessage(), fWait.isOK()); diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIExpressionsTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIExpressionsTest.java index c9151a40fdd..bfed2af26bb 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIExpressionsTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIExpressionsTest.java @@ -166,7 +166,7 @@ public class MIExpressionsTest extends BaseParametrizedTestCase { MIStoppedEvent stoppedEvent = SyncUtil.runToLocation("testLocals"); // Create a map of expressions and their expected values. - Map<String, String[]> tests = new HashMap<String, String[]>(); + Map<String, String[]> tests = new HashMap<>(); tests.put("0 + 0 - 0", new String[] { "0x0", "0", "0", "0", "0", "0" }); tests.put("3 + 4", new String[] { "0x7", "07", "111", "7", "7", "7" }); @@ -189,7 +189,7 @@ public class MIExpressionsTest extends BaseParametrizedTestCase { MIStoppedEvent stoppedEvent = SyncUtil.runToLocation("testLocals"); // Create a map of expressions and their expected values. - Map<String, String[]> tests = new HashMap<String, String[]>(); + Map<String, String[]> tests = new HashMap<>(); tests.put("3.14159 + 1.1111", new String[] { "0x4", "04", "100", "4", "4.2526", "4.2526" }); tests.put("100.0 / 3.0", new String[] { "0x21", "041", "100001", "33", "33.3333", "33.3333" }); @@ -215,7 +215,7 @@ public class MIExpressionsTest extends BaseParametrizedTestCase { MIStoppedEvent stoppedEvent = SyncUtil.step(16, StepType.STEP_OVER); // Create a map of expressions to expected values. - Map<String, String[]> tests1 = new HashMap<String, String[]>(); + Map<String, String[]> tests1 = new HashMap<>(); tests1.put("lIntVar", new String[] { "0x3039", "030071", "11000000111001", "12345", "12345", "12345" }); tests1.put("lDoubleVar", new String[] { "0x3039", "030071", "11000000111001", "12345", "12345.123449999999", @@ -251,7 +251,7 @@ public class MIExpressionsTest extends BaseParametrizedTestCase { stoppedEvent = SyncUtil.step(5, StepType.STEP_OVER); // Create a map of expressions to expected values. - Map<String, String[]> tests2 = new HashMap<String, String[]>(); + Map<String, String[]> tests2 = new HashMap<>(); tests2.put("lIntVar", new String[] { "0x1a85", "015205", "1101010000101", "6789", "6789", "6789" }); tests2.put("lDoubleArray[1]", new String[] { "0x1a85", "015205", "1101010000101", "6789", "6789.6788999999999", @@ -284,7 +284,7 @@ public class MIExpressionsTest extends BaseParametrizedTestCase { MIStoppedEvent stoppedEvent = SyncUtil.step(2, StepType.STEP_OVER); IFrameDMContext frameDmc = SyncUtil.getStackFrame(stoppedEvent.getDMContext(), 0); - Map<String, String[]> tests = new HashMap<String, String[]>(); + Map<String, String[]> tests = new HashMap<>(); tests.put("a", new String[] { "0x8", "010", "1000", "8", "8", "8" }); tests.put("b", new String[] { "0x1", "01", "1", "1", "1", "1" }); @@ -294,7 +294,7 @@ public class MIExpressionsTest extends BaseParametrizedTestCase { // Now enter a subblock with the same variable names SyncUtil.step(2, StepType.STEP_OVER); - tests = new HashMap<String, String[]>(); + tests = new HashMap<>(); tests.put("a", new String[] { "0xc", "014", "1100", "12", "12", "12" }); tests.put("b", new String[] { "0x1", "01", "1", "1", "1", "1" }); @@ -304,7 +304,7 @@ public class MIExpressionsTest extends BaseParametrizedTestCase { // Now step to change the b variable SyncUtil.step(1, StepType.STEP_OVER); - tests = new HashMap<String, String[]>(); + tests = new HashMap<>(); tests.put("a", new String[] { "0xc", "014", "1100", "12", "12", "12" }); tests.put("b", new String[] { "0xc", "014", "1100", "12", "12", "12" }); @@ -315,7 +315,7 @@ public class MIExpressionsTest extends BaseParametrizedTestCase { // same b SyncUtil.step(1, StepType.STEP_OVER); - tests = new HashMap<String, String[]>(); + tests = new HashMap<>(); tests.put("a", new String[] { "0x8", "010", "1000", "8", "8", "8" }); tests.put("b", new String[] { "0xc", "014", "1100", "12", "12", "12" }); @@ -1394,7 +1394,7 @@ public class MIExpressionsTest extends BaseParametrizedTestCase { MIStoppedEvent stoppedEvent = SyncUtil.runToLocation("locals2"); // Create a map of expressions to expected values. - Map<String, String[]> tests = new HashMap<String, String[]>(); + Map<String, String[]> tests = new HashMap<>(); // Global variables tests.put("gIntVar", new String[] { "0x21F", "01037", "1000011111", "543", "543", "543" }); @@ -1440,21 +1440,21 @@ public class MIExpressionsTest extends BaseParametrizedTestCase { MIStoppedEvent stoppedEvent = SyncUtil.step(1, StepType.STEP_OVER); IFrameDMContext frameDmc = SyncUtil.getStackFrame(stoppedEvent.getDMContext(), 0); - Map<String, String[]> tests = new HashMap<String, String[]>(); + Map<String, String[]> tests = new HashMap<>(); tests.put("a", new String[] { "0x1", "01", "1", "1", "1", "1" }); executeExpressionSubTests(tests, frameDmc); SyncUtil.runToLocation("testName2"); stoppedEvent = SyncUtil.step(1, StepType.STEP_INTO); frameDmc = SyncUtil.getStackFrame(stoppedEvent.getDMContext(), 0); - tests = new HashMap<String, String[]>(); + tests = new HashMap<>(); tests.put("a", new String[] { "0x2", "02", "10", "2", "2", "2" }); executeExpressionSubTests(tests, frameDmc); SyncUtil.runToLocation("testName1"); stoppedEvent = SyncUtil.step(1, StepType.STEP_INTO); frameDmc = SyncUtil.getStackFrame(stoppedEvent.getDMContext(), 0); - tests = new HashMap<String, String[]>(); + tests = new HashMap<>(); tests.put("a", new String[] { "0x3", "03", "11", "3", "3", "3" }); executeExpressionSubTests(tests, frameDmc); } @@ -1469,21 +1469,21 @@ public class MIExpressionsTest extends BaseParametrizedTestCase { MIStoppedEvent stoppedEvent = SyncUtil.step(2, StepType.STEP_INTO); IFrameDMContext frameDmc = SyncUtil.getStackFrame(stoppedEvent.getDMContext(), 0); - Map<String, String[]> tests = new HashMap<String, String[]>(); + Map<String, String[]> tests = new HashMap<>(); tests.put("a", new String[] { "0x1", "01", "1", "1", "1", "1" }); executeExpressionSubTests(tests, frameDmc); SyncUtil.step(StepType.STEP_RETURN); stoppedEvent = SyncUtil.step(2, StepType.STEP_INTO); frameDmc = SyncUtil.getStackFrame(stoppedEvent.getDMContext(), 0); - tests = new HashMap<String, String[]>(); + tests = new HashMap<>(); tests.put("a", new String[] { "0x2", "02", "10", "2", "2", "2" }); executeExpressionSubTests(tests, frameDmc); SyncUtil.step(StepType.STEP_RETURN); stoppedEvent = SyncUtil.step(2, StepType.STEP_INTO); frameDmc = SyncUtil.getStackFrame(stoppedEvent.getDMContext(), 0); - tests = new HashMap<String, String[]>(); + tests = new HashMap<>(); tests.put("a", new String[] { "0x3", "03", "11", "3", "3", "3" }); executeExpressionSubTests(tests, frameDmc); } @@ -1500,7 +1500,7 @@ public class MIExpressionsTest extends BaseParametrizedTestCase { MIStoppedEvent stoppedEvent = SyncUtil.step(StepType.STEP_OVER); // Create a map of expressions to expected values. - Map<String, String[]> tests = new HashMap<String, String[]>(); + Map<String, String[]> tests = new HashMap<>(); // First make sure we have a different value on the other stack frame and that we select // a frame that is not the top frame @@ -1508,7 +1508,7 @@ public class MIExpressionsTest extends BaseParametrizedTestCase { executeExpressionSubTests(tests, SyncUtil.getStackFrame(stoppedEvent.getDMContext(), 1)); // Now check that we get the same values as the top stack when selecting the thread only - tests = new HashMap<String, String[]>(); + tests = new HashMap<>(); tests.put("lIntVar", new String[] { "0x1a85", "015205", "1101010000101", "6789", "6789", "6789" }); executeExpressionSubTests(tests, stoppedEvent.getDMContext()); } diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIMemoryTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIMemoryTest.java index e73002eb40c..08d58fdbaab 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIMemoryTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIMemoryTest.java @@ -1164,7 +1164,7 @@ public class MIMemoryTest extends BaseParametrizedTestCase { } // Write asynchronously - ServiceEventWaitor<IMemoryChangedEvent> eventWaitor = new ServiceEventWaitor<IMemoryChangedEvent>(fSession, + ServiceEventWaitor<IMemoryChangedEvent> eventWaitor = new ServiceEventWaitor<>(fSession, IMemoryChangedEvent.class); MemoryWriteQuery writeQueries[] = new MemoryWriteQuery[BLOCK_SIZE]; for (int offset = 0; offset < BLOCK_SIZE; offset++) { diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIModifiedServicesTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIModifiedServicesTest.java index 87e81666074..10d47f175a5 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIModifiedServicesTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIModifiedServicesTest.java @@ -224,7 +224,7 @@ public class MIModifiedServicesTest extends BaseParametrizedTestCase { private void resumeContainerContextExe() throws InterruptedException, ExecutionException, TimeoutException { - final ServiceEventWaitor<IResumedDMEvent> resumedWaitor = new ServiceEventWaitor<IResumedDMEvent>( + final ServiceEventWaitor<IResumedDMEvent> resumedWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), IResumedDMEvent.class); Query<Void> query = new Query<Void>() { @@ -268,7 +268,7 @@ public class MIModifiedServicesTest extends BaseParametrizedTestCase { */ private void interruptRunningTargetExe() throws InterruptedException, Exception, ExecutionException, TimeoutException { - ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>( + ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), ISuspendedDMEvent.class); Query<MIInfo> requestSuspend = new Query<MIInfo>() { diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRegistersTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRegistersTest.java index 69f6bd79273..3118defa988 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRegistersTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRegistersTest.java @@ -413,7 +413,7 @@ public class MIRegistersTest extends BaseParametrizedTestCase { */ private List<IRegistersChangedDMEvent> writeRegisterWaitNotication(final IRegisterDMContext registerDmc, final String regValue, final String formatId) throws Throwable { - ServiceEventWaitor<IRegistersChangedDMEvent> eventWaitor = new ServiceEventWaitor<IRegistersChangedDMEvent>( + ServiceEventWaitor<IRegistersChangedDMEvent> eventWaitor = new ServiceEventWaitor<>( fSession, IRegistersChangedDMEvent.class); writeRegister(registerDmc, regValue, formatId); diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTargetAvailableTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTargetAvailableTest.java index 97504bc5132..50cb3ae547e 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTargetAvailableTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTargetAvailableTest.java @@ -129,7 +129,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase { // Now resume the target and check that we stop at the breakpoint. - ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>( + ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), ISuspendedDMEvent.class); SyncUtil.resume(); @@ -159,7 +159,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase { } }; // The target is currently stopped so we resume it - ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>( + ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), ISuspendedDMEvent.class); SyncUtil.resume(); @@ -236,7 +236,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase { // Now resume the target three times and check that we stop three times. for (int i = 0; i < steps.length; i++) { - ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>( + ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), ISuspendedDMEvent.class); SyncUtil.resume(); @@ -351,7 +351,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase { } }; // The target is currently stopped so we resume it - ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>( + ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), ISuspendedDMEvent.class); SyncUtil.resume(); @@ -372,7 +372,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase { // Wait up to 3 second for the target to suspend. Should happen within two seconds. suspendedEventWaitor.waitForEvent(TestsPlugin.massageTimeout(3000)); - suspendedEventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>(getGDBLaunch().getSession(), + suspendedEventWaitor = new ServiceEventWaitor<>(getGDBLaunch().getSession(), ISuspendedDMEvent.class); SyncUtil.resume(); @@ -425,7 +425,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase { } }; // The target is currently stopped so we resume it - ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>( + ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), ISuspendedDMEvent.class); SyncUtil.resume(); @@ -505,7 +505,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase { for (int i = 0; i < steps.length; i++) { // Now resume the target and check that we stop at all the breakpoints. - ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>( + ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), ISuspendedDMEvent.class); SyncUtil.resume(); @@ -542,7 +542,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase { } // The target is currently stopped so we resume it - ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>( + ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), ISuspendedDMEvent.class); SyncUtil.resume(); @@ -575,7 +575,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase { suspendedEventWaitor.waitForEvent(TestsPlugin.massageTimeout(3000)); // Now resume the target and check that we stop at all the breakpoints. - suspendedEventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>(getGDBLaunch().getSession(), + suspendedEventWaitor = new ServiceEventWaitor<>(getGDBLaunch().getSession(), ISuspendedDMEvent.class); SyncUtil.resume(); @@ -636,7 +636,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase { for (int i = 0; i < 2; i++) { // The target is currently stopped so we resume it - ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>( + ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), ISuspendedDMEvent.class); SyncUtil.resume(); @@ -686,7 +686,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase { } }; // The target is currently stopped so we resume it - ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>( + ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), ISuspendedDMEvent.class); SyncUtil.resume(); @@ -707,7 +707,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase { suspendedEventWaitor.waitForEvent(TestsPlugin.massageTimeout(3000)); // Now resume the target and check that we stop at all the breakpoints. - suspendedEventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>(getGDBLaunch().getSession(), + suspendedEventWaitor = new ServiceEventWaitor<>(getGDBLaunch().getSession(), ISuspendedDMEvent.class); SyncUtil.resume(); @@ -766,7 +766,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase { for (int i = 0; i < 2; i++) { // The target is currently stopped so we resume it - ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>( + ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), ISuspendedDMEvent.class); SyncUtil.resume(); @@ -814,7 +814,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase { } }; // The target is currently stopped so we resume it - ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>( + ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), ISuspendedDMEvent.class); SyncUtil.resume(); @@ -835,7 +835,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase { suspendedEventWaitor.waitForEvent(TestsPlugin.massageTimeout(3000)); // Now resume the target and check that we stop at all the breakpoints. - suspendedEventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>(getGDBLaunch().getSession(), + suspendedEventWaitor = new ServiceEventWaitor<>(getGDBLaunch().getSession(), ISuspendedDMEvent.class); SyncUtil.resume(); diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTest.java index f14babb9ccf..d19784ef8dc 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTest.java @@ -241,7 +241,7 @@ public class MIRunControlTest extends BaseParametrizedTestCase { ctxts.length); // The ordering of the contexts is not deterministic - LinkedList<Integer> ids = new LinkedList<Integer>(Arrays.asList(new Integer[] { 1 })); + LinkedList<Integer> ids = new LinkedList<>(Arrays.asList(new Integer[] { 1 })); if (sProgramIsCygwin) { ids.add(2); } @@ -277,7 +277,7 @@ public class MIRunControlTest extends BaseParametrizedTestCase { }; // Prepare a waiter to make sure we have received the thread started event - final ServiceEventWaitor<IStartedDMEvent> startedEventWaitor = new ServiceEventWaitor<IStartedDMEvent>( + final ServiceEventWaitor<IStartedDMEvent> startedEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), IStartedDMEvent.class); SyncUtil.runToLocation(SOURCE_NAME + ':' + getLineForTag("LINE_MAIN_AFTER_THREAD_START")); @@ -316,7 +316,7 @@ public class MIRunControlTest extends BaseParametrizedTestCase { Assert.assertEquals("Unexpected number of threads", sProgramIsCygwin ? 3 : 2, data.length); // The ordering of the contexts is not deterministic - LinkedList<Integer> ids = new LinkedList<Integer>(Arrays.asList(new Integer[] { 1, 2 })); + LinkedList<Integer> ids = new LinkedList<>(Arrays.asList(new Integer[] { 1, 2 })); if (sProgramIsCygwin) { ids.add(3); } @@ -580,7 +580,7 @@ public class MIRunControlTest extends BaseParametrizedTestCase { //TestsPlugin.debug("handleCompleted over"); } }; - final ServiceEventWaitor<IResumedDMEvent> eventWaitor = new ServiceEventWaitor<IResumedDMEvent>( + final ServiceEventWaitor<IResumedDMEvent> eventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), IResumedDMEvent.class); final IContainerDMContext containerDmc = SyncUtil.getContainerContext(); @@ -629,7 +629,7 @@ public class MIRunControlTest extends BaseParametrizedTestCase { } }; - final ServiceEventWaitor<IResumedDMEvent> eventWaitor = new ServiceEventWaitor<IResumedDMEvent>( + final ServiceEventWaitor<IResumedDMEvent> eventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), IResumedDMEvent.class); fRunCtrl.getExecutor().submit(new Runnable() { @@ -682,7 +682,7 @@ public class MIRunControlTest extends BaseParametrizedTestCase { public void runToLine() throws Throwable { final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); - ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>( + ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), ISuspendedDMEvent.class); fRunCtrl.getExecutor().submit(new Runnable() { @@ -726,7 +726,7 @@ public class MIRunControlTest extends BaseParametrizedTestCase { public void interruptRunningTarget() throws Throwable { final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); - ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>( + ServiceEventWaitor<ISuspendedDMEvent> suspendedEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), ISuspendedDMEvent.class); // Resume the target diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/OperationsWhileTargetIsRunningTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/OperationsWhileTargetIsRunningTest.java index 958324ee03f..2d5d7303c3f 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/OperationsWhileTargetIsRunningTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/OperationsWhileTargetIsRunningTest.java @@ -177,7 +177,7 @@ public class OperationsWhileTargetIsRunningTest extends BaseParametrizedTestCase // then we terminate, and confirm that we shutdown right away SyncUtil.resume(); - ServiceEventWaitor<ICommandControlShutdownDMEvent> shutdownEventWaitor = new ServiceEventWaitor<ICommandControlShutdownDMEvent>( + ServiceEventWaitor<ICommandControlShutdownDMEvent> shutdownEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), ICommandControlShutdownDMEvent.class); // Don't use a query here. The terminate, because it kills GDB, may not return right away @@ -215,7 +215,7 @@ public class OperationsWhileTargetIsRunningTest extends BaseParametrizedTestCase // then we terminate the process, and confirm that there are no more processes SyncUtil.resume(); - ServiceEventWaitor<IExitedDMEvent> exitedEventWaitor = new ServiceEventWaitor<IExitedDMEvent>( + ServiceEventWaitor<IExitedDMEvent> exitedEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), IExitedDMEvent.class); Query<Object> query = new Query<Object>() { @@ -260,7 +260,7 @@ public class OperationsWhileTargetIsRunningTest extends BaseParametrizedTestCase // then we detach the process, and confirm that we are shutdown SyncUtil.resume(); - ServiceEventWaitor<ICommandControlShutdownDMEvent> shutdownEventWaitor = new ServiceEventWaitor<ICommandControlShutdownDMEvent>( + ServiceEventWaitor<ICommandControlShutdownDMEvent> shutdownEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), ICommandControlShutdownDMEvent.class); // Don't use a query here. Because GDB will be killed, the call to detach may not return right away @@ -297,7 +297,7 @@ public class OperationsWhileTargetIsRunningTest extends BaseParametrizedTestCase // then we detach the process, and confirm that we are not longer running SyncUtil.resume(); - ServiceEventWaitor<IExitedDMEvent> exitedEventWaitor = new ServiceEventWaitor<IExitedDMEvent>( + ServiceEventWaitor<IExitedDMEvent> exitedEventWaitor = new ServiceEventWaitor<>( getGDBLaunch().getSession(), IExitedDMEvent.class); Query<Object> query = new Query<Object>() { diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/PostMortemCoreTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/PostMortemCoreTest.java index 4ad84e4fc14..2559a9104ef 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/PostMortemCoreTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/PostMortemCoreTest.java @@ -320,7 +320,7 @@ public class PostMortemCoreTest extends BaseParametrizedTestCase { doLaunch(); // Create a map of expressions and their expected values. - Map<String, String[]> tests = new HashMap<String, String[]>(); + Map<String, String[]> tests = new HashMap<>(); tests.put("0 + 0 - 0", new String[] { "0x0", "0", "0", "0", "0", "0" }); tests.put("3 + 4", new String[] { "0x7", "07", "111", "7", "7", "7" }); @@ -343,7 +343,7 @@ public class PostMortemCoreTest extends BaseParametrizedTestCase { doLaunch(); // Create a map of expressions and their expected values. - Map<String, String[]> tests = new HashMap<String, String[]>(); + Map<String, String[]> tests = new HashMap<>(); tests.put("3.14159 + 1.1111", new String[] { "0x4", "04", "100", "4", "4.2526", "4.2526" }); tests.put("100.0 / 3.0", new String[] { "0x21", "041", "100001", "33", "33.3333", "33.3333" }); @@ -367,7 +367,7 @@ public class PostMortemCoreTest extends BaseParametrizedTestCase { doLaunch(); // Create a map of expressions to expected values. - Map<String, String[]> tests1 = new HashMap<String, String[]>(); + Map<String, String[]> tests1 = new HashMap<>(); tests1.put("lIntVar", new String[] { "0x3039", "030071", "11000000111001", "12345", "12345", "12345" }); tests1.put("lDoubleVar", new String[] { "0x3039", "030071", "11000000111001", "12345", "12345.123449999999", diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/SourceLookupTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/SourceLookupTest.java index c47f654d26b..297b5f211b4 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/SourceLookupTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/SourceLookupTest.java @@ -353,7 +353,7 @@ public class SourceLookupTest extends BaseParametrizedTestCase { protected void addSourceContainer(AbstractSourceLookupDirector director, ISourceContainer container) throws CoreException { - ArrayList<ISourceContainer> containerList = new ArrayList<ISourceContainer>( + ArrayList<ISourceContainer> containerList = new ArrayList<>( Arrays.asList(director.getSourceContainers())); container.init(director); containerList.add(container); @@ -375,7 +375,7 @@ public class SourceLookupTest extends BaseParametrizedTestCase { } else { mapContainer.addMapEntry(fMapEntrySourceContainerN); } - ArrayList<ISourceContainer> containerList = new ArrayList<ISourceContainer>( + ArrayList<ISourceContainer> containerList = new ArrayList<>( Arrays.asList(commonSourceLookupDirector.getSourceContainers())); containerList.add(mapContainer); commonSourceLookupDirector diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/StepIntoSelectionTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/StepIntoSelectionTest.java index 00da7d80ce8..d7fe5dd96cc 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/StepIntoSelectionTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/StepIntoSelectionTest.java @@ -186,7 +186,7 @@ public class StepIntoSelectionTest extends BaseParametrizedTestCase { */ private ISuspendedDMEvent triggerStepIntoSelection(final IExecutionDMContext exeContext, final String sourceName, final int targetLine, final IFunctionDeclaration function, final boolean skipBreakPoints) throws Throwable { - ServiceEventWaitor<ISuspendedDMEvent> eventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>(fSession, + ServiceEventWaitor<ISuspendedDMEvent> eventWaitor = new ServiceEventWaitor<>(fSession, ISuspendedDMEvent.class); Query<Object> query = new Query<Object>() { @@ -207,7 +207,7 @@ public class StepIntoSelectionTest extends BaseParametrizedTestCase { */ private ISuspendedDMEvent triggerRunToLine(final IExecutionDMContext exeContext, final String sourceName, final int targetLine, final boolean skipBreakPoints) throws Throwable { - ServiceEventWaitor<ISuspendedDMEvent> eventWaitor = new ServiceEventWaitor<ISuspendedDMEvent>(fSession, + ServiceEventWaitor<ISuspendedDMEvent> eventWaitor = new ServiceEventWaitor<>(fSession, ISuspendedDMEvent.class); Query<Object> query = new Query<Object>() { diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/TraceFileTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/TraceFileTest.java index 4b17bfbe7ba..f05f698ac84 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/TraceFileTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/TraceFileTest.java @@ -418,7 +418,7 @@ public class TraceFileTest extends BaseParametrizedTestCase { } private MIBreakpointDMContext setBreakpointAtEndLine() throws Throwable { - Map<String, Object> attributes = new HashMap<String, Object>(); + Map<String, Object> attributes = new HashMap<>(); attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.BREAKPOINT); attributes.put(MIBreakpoints.FILE_NAME, SOURCE_NAME); attributes.put(MIBreakpoints.FUNCTION, END_FUNCTION); @@ -445,7 +445,7 @@ public class TraceFileTest extends BaseParametrizedTestCase { evalAction.setName(String.format("Evaluate %s", TEVAL_STRING)); tam.addAction(evalAction); - Map<String, Object> attributes = new HashMap<String, Object>(); + Map<String, Object> attributes = new HashMap<>(); attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); attributes.put(MIBreakpoints.FILE_NAME, SOURCE_NAME); attributes.put(MIBreakpoints.LINE_NUMBER, getLineForTag("IF_X_NE_A")); diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/nonstop/GDBMultiNonStopRunControlTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/nonstop/GDBMultiNonStopRunControlTest.java index 119923cacec..961cfa508d0 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/nonstop/GDBMultiNonStopRunControlTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/nonstop/GDBMultiNonStopRunControlTest.java @@ -353,7 +353,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -463,7 +463,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -577,7 +577,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -696,7 +696,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { final IMIExecutionDMContext[] threads = SyncUtil.getExecutionContexts(); assertTrue("Expected a single thread but got " + threads.length, threads.length == 1); - final ServiceEventWaitor<MIRunningEvent> eventWaitor = new ServiceEventWaitor<MIRunningEvent>( + final ServiceEventWaitor<MIRunningEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIRunningEvent.class); runAsyncCall(new AsyncRunnable<Object>() { @@ -767,7 +767,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -777,7 +777,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { final IMIExecutionDMContext[] threads = SyncUtil.getExecutionContexts(); assertTrue("Expected two threads but got " + threads.length, threads.length == 2); - final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<MIRunningEvent>( + final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<>( fMultiRun.getSession(), MIRunningEvent.class); runAsyncCall(new AsyncRunnable<Object>() { @@ -819,7 +819,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -829,7 +829,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { final IMIExecutionDMContext[] threads = SyncUtil.getExecutionContexts(); assertTrue("Expected two threads but got " + threads.length, threads.length == 2); - final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<MIRunningEvent>( + final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<>( fMultiRun.getSession(), MIRunningEvent.class); runAsyncCall(new AsyncRunnable<Object>() { @@ -862,7 +862,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -876,7 +876,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { final IMIExecutionDMContext[] threads = SyncUtil.getExecutionContexts(); assertTrue("Expected two threads but got " + threads.length, threads.length == 2); - final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<MIRunningEvent>( + final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<>( fMultiRun.getSession(), MIRunningEvent.class); // No error should be thrown, the call should ignore running threads @@ -910,7 +910,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -927,7 +927,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { final IMIExecutionDMContext[] threads = SyncUtil.getExecutionContexts(); assertTrue("Expected two threads but got " + threads.length, threads.length == 2); - final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<MIRunningEvent>( + final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<>( fMultiRun.getSession(), MIRunningEvent.class); // No error should be thrown, the call should ignore running threads @@ -1000,7 +1000,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { }); assertFalse("expected no threads to be suspended, but found some", result); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); runAsyncCall(new AsyncRunnable<Object>() { @@ -1031,7 +1031,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -1069,7 +1069,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -1113,7 +1113,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -1169,7 +1169,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -1444,7 +1444,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -1553,7 +1553,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -1666,7 +1666,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -1996,7 +1996,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -2109,7 +2109,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -2227,7 +2227,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -2345,7 +2345,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -2471,7 +2471,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -2585,7 +2585,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -2703,7 +2703,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -2824,7 +2824,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { public void testResumeProcessOneThreadStopped() throws Throwable { final IExecutionDMContext[] processes = new IExecutionDMContext[] { SyncUtil.getContainerContext() }; - final ServiceEventWaitor<MIRunningEvent> eventWaitor = new ServiceEventWaitor<MIRunningEvent>( + final ServiceEventWaitor<MIRunningEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIRunningEvent.class); runAsyncCall(new AsyncRunnable<Object>() { @@ -2894,7 +2894,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -2903,7 +2903,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { final IExecutionDMContext[] processes = new IExecutionDMContext[] { SyncUtil.getContainerContext() }; - final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<MIRunningEvent>( + final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<>( fMultiRun.getSession(), MIRunningEvent.class); runAsyncCall(new AsyncRunnable<Object>() { @@ -2936,7 +2936,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -2949,7 +2949,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { final IExecutionDMContext[] processes = new IExecutionDMContext[] { SyncUtil.getContainerContext() }; - final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<MIRunningEvent>( + final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<>( fMultiRun.getSession(), MIRunningEvent.class); // No error should be thrown, the call should ignore running threads @@ -2983,7 +2983,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -2999,7 +2999,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { final IExecutionDMContext[] processes = new IExecutionDMContext[] { SyncUtil.getContainerContext() }; - final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<MIRunningEvent>( + final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<>( fMultiRun.getSession(), MIRunningEvent.class); // No error should be thrown, the call should ignore running threads @@ -3082,7 +3082,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { }); assertFalse("expected no process to be suspended, but found some", result); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); runAsyncCall(new AsyncRunnable<Object>() { @@ -3113,7 +3113,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -3162,7 +3162,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -3217,7 +3217,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -3302,7 +3302,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { final IExecutionDMContext[] execDmcs = new IExecutionDMContext[] { SyncUtil.getContainerContext(), SyncUtil.getExecutionContext(0) }; - final ServiceEventWaitor<MIRunningEvent> eventWaitor = new ServiceEventWaitor<MIRunningEvent>( + final ServiceEventWaitor<MIRunningEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIRunningEvent.class); runAsyncCall(new AsyncRunnable<Object>() { @@ -3347,7 +3347,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { }); assertFalse("expected no contexts to be suspended, but found some", result); - final ServiceEventWaitor<MIRunningEvent> eventWaitor = new ServiceEventWaitor<MIRunningEvent>( + final ServiceEventWaitor<MIRunningEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIRunningEvent.class); // No error should be thrown, the call should ignore running processes @@ -3381,7 +3381,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -3391,7 +3391,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { final IExecutionDMContext[] execDmcs = new IExecutionDMContext[] { SyncUtil.getContainerContext(), SyncUtil.getExecutionContext(0) }; - final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<MIRunningEvent>( + final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<>( fMultiRun.getSession(), MIRunningEvent.class); runAsyncCall(new AsyncRunnable<Object>() { @@ -3427,7 +3427,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -3441,7 +3441,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { final IExecutionDMContext[] execDmcs = new IExecutionDMContext[] { SyncUtil.getContainerContext(), SyncUtil.getExecutionContext(0) }; - final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<MIRunningEvent>( + final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<>( fMultiRun.getSession(), MIRunningEvent.class); // No error should be thrown, the call should ignore running threads @@ -3477,7 +3477,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -3491,7 +3491,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { final IExecutionDMContext[] execDmcs = new IExecutionDMContext[] { SyncUtil.getContainerContext(), SyncUtil.getExecutionContext(1) }; - final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<MIRunningEvent>( + final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<>( fMultiRun.getSession(), MIRunningEvent.class); // No error should be thrown, the call should ignore running threads @@ -3526,7 +3526,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -3543,7 +3543,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { final IExecutionDMContext[] execDmcs = new IExecutionDMContext[] { SyncUtil.getContainerContext(), SyncUtil.getExecutionContext(0) }; - final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<MIRunningEvent>( + final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<>( fMultiRun.getSession(), MIRunningEvent.class); // No error should be thrown, the call should ignore running threads @@ -3650,7 +3650,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { }); assertFalse("expected no process to be suspended, but found some", result); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); runAsyncCall(new AsyncRunnable<Object>() { @@ -3682,7 +3682,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -3733,7 +3733,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -3790,7 +3790,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -3847,7 +3847,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -3937,7 +3937,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -3947,7 +3947,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { final IExecutionDMContext[] execDmcs = new IExecutionDMContext[] { SyncUtil.getContainerContext(), SyncUtil.getExecutionContext(0), SyncUtil.getExecutionContext(1) }; - final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<MIRunningEvent>( + final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<>( fMultiRun.getSession(), MIRunningEvent.class); runAsyncCall(new AsyncRunnable<Object>() { @@ -3983,7 +3983,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -3997,7 +3997,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { final IExecutionDMContext[] execDmcs = new IExecutionDMContext[] { SyncUtil.getContainerContext(), SyncUtil.getExecutionContext(0), SyncUtil.getExecutionContext(1) }; - final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<MIRunningEvent>( + final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<>( fMultiRun.getSession(), MIRunningEvent.class); // No error should be thrown, the call should ignore running threads @@ -4032,7 +4032,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -4049,7 +4049,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { final IExecutionDMContext[] execDmcs = new IExecutionDMContext[] { SyncUtil.getContainerContext(), SyncUtil.getExecutionContext(0), SyncUtil.getExecutionContext(1) }; - final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<MIRunningEvent>( + final ServiceEventWaitor<MIRunningEvent> eventWaitorRunning = new ServiceEventWaitor<>( fMultiRun.getSession(), MIRunningEvent.class); // No error should be thrown, the call should ignore running threads @@ -4086,7 +4086,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -4137,7 +4137,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitorStopped = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); @@ -4194,7 +4194,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase { // Run program until both threads are stopped SyncUtil.addBreakpoint("firstBreakpoint", false); - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + final ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRun.getSession(), MIStoppedEvent.class); SyncUtil.resumeAll(); diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/nonstop/ThreadStackFrameSyncTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/nonstop/ThreadStackFrameSyncTest.java index 4584f0fb3ed..5b197e94896 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/nonstop/ThreadStackFrameSyncTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/nonstop/ThreadStackFrameSyncTest.java @@ -68,7 +68,7 @@ public class ThreadStackFrameSyncTest extends BaseParametrizedTestCase { private IGDBControl fCommandControl; private IGDBFocusSynchronizer fGdbSync; private DsfSession fSession; - private List<IDMEvent<? extends IDMContext>> fEventsReceived = new ArrayList<IDMEvent<? extends IDMContext>>(); + private List<IDMEvent<? extends IDMContext>> fEventsReceived = new ArrayList<>(); // Breakpoint tags in MultiThread.cc public static final String[] LINE_TAGS = new String[] { "LINE_MAIN_BEFORE_THREAD_START", // Just before StartThread @@ -157,7 +157,7 @@ public class ThreadStackFrameSyncTest extends BaseParametrizedTestCase { */ @Test public void testChangingCurrentThreadCLINotification() throws Throwable { - ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRunControl.getSession(), MIStoppedEvent.class); // add a breakpoint in main @@ -193,7 +193,7 @@ public class ThreadStackFrameSyncTest extends BaseParametrizedTestCase { */ @Test public void testChangingCurrentFrameCLINotification() throws Throwable { - ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRunControl.getSession(), MIStoppedEvent.class); // add a breakpoint in main @@ -229,7 +229,7 @@ public class ThreadStackFrameSyncTest extends BaseParametrizedTestCase { */ @Test public void testGdbSyncServiceCanSwitchGDBThread() throws Throwable { - ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRunControl.getSession(), MIStoppedEvent.class); // add a breakpoint in main @@ -270,7 +270,7 @@ public class ThreadStackFrameSyncTest extends BaseParametrizedTestCase { */ @Test public void testGdbSyncServiceCanSwitchGDBStackFrame() throws Throwable { - ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>( + ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<>( fMultiRunControl.getSession(), MIStoppedEvent.class); // add a breakpoint in main diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/CSourceNotFoundDescriptionFactory.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/CSourceNotFoundDescriptionFactory.java index 75a4cc3cd42..c6a4a5f84ac 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/CSourceNotFoundDescriptionFactory.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/CSourceNotFoundDescriptionFactory.java @@ -92,7 +92,7 @@ public class CSourceNotFoundDescriptionFactory implements IAdapterFactory { private static ICSourceNotFoundDescription getFrameDescription(IStack.IFrameDMData frame) { String formatString = ""; //$NON-NLS-1$ String[] propertyNames = null; - HashMap<String, Object> properties = new HashMap<String, Object>(); + HashMap<String, Object> properties = new HashMap<>(); fillFrameDataProperties(properties, frame); Integer line = (Integer) properties.get(ILaunchVMConstants.PROP_FRAME_LINE); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/DisassemblyToggleBreakpointsTarget.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/DisassemblyToggleBreakpointsTarget.java index 0d54e8c153c..8c9059b74a8 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/DisassemblyToggleBreakpointsTarget.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/DisassemblyToggleBreakpointsTarget.java @@ -42,7 +42,7 @@ public class DisassemblyToggleBreakpointsTarget extends AbstractDisassemblyBreak protected void createLineBreakpointInteractive(IWorkbenchPart part, String sourceHandle, IResource resource, int lineNumber) throws CoreException { ICLineBreakpoint lineBp = CDIDebugModel.createBlankLineBreakpoint(); - Map<String, Object> attributes = new HashMap<String, Object>(); + Map<String, Object> attributes = new HashMap<>(); CDIDebugModel.setLineBreakpointAttributes(attributes, sourceHandle, getBreakpointType(), lineNumber, true, 0, ""); //$NON-NLS-1$ openBreakpointPropertiesDialog(lineBp, part, resource, attributes); @@ -60,7 +60,7 @@ public class DisassemblyToggleBreakpointsTarget extends AbstractDisassemblyBreak protected void createAddressBreakpointInteractive(IWorkbenchPart part, IResource resource, IAddress address) throws CoreException { ICLineBreakpoint lineBp = CDIDebugModel.createBlankAddressBreakpoint(); - Map<String, Object> attributes = new HashMap<String, Object>(); + Map<String, Object> attributes = new HashMap<>(); CDIDebugModel.setAddressBreakpointAttributes(attributes, null, null, getBreakpointType(), -1, address, true, 0, ""); //$NON-NLS-1$ openBreakpointPropertiesDialog(lineBp, part, resource, attributes); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ToggleBreakpointsTargetFactory.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ToggleBreakpointsTargetFactory.java index 7d8b2bfe4e4..f9f35990b08 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ToggleBreakpointsTargetFactory.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ToggleBreakpointsTargetFactory.java @@ -53,7 +53,7 @@ public class ToggleBreakpointsTargetFactory implements IToggleBreakpointsTargetF */ public static final String TOGGLE_C_BREAKPOINT_TARGET_ID = CDebugUIPlugin.PLUGIN_ID + ".toggleCBreakpointTarget"; //$NON-NLS-1$ - private static final Set<String> TOGGLE_TARGET_IDS = new HashSet<String>(1); + private static final Set<String> TOGGLE_TARGET_IDS = new HashSet<>(1); static { TOGGLE_TARGET_IDS.add(TOGGLE_C_BREAKPOINT_TARGET_ID); } diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/AbstractDsfRegisterGroupActions.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/AbstractDsfRegisterGroupActions.java index 4eeeadfa6c0..bf0386689bc 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/AbstractDsfRegisterGroupActions.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/AbstractDsfRegisterGroupActions.java @@ -769,7 +769,7 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler { private IRegisterGroupDMContext[] resolveSelectedGroups(IStructuredSelection selection) { IRegisterGroupDMContext[] selectedGroups = null; - List<IRegisterGroupDMContext> groupList = new ArrayList<IRegisterGroupDMContext>(); + List<IRegisterGroupDMContext> groupList = new ArrayList<>(); if (selection != null && !selection.isEmpty()) { for (Iterator<?> iterator = selection.iterator(); iterator.hasNext();) { Object element = iterator.next(); @@ -791,7 +791,7 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler { @ConfinedToDsfExecutor("selectionContext.fsession.getExecutor()") private IRegisterDMContext[] resolveSelectedRegisters(IStructuredSelection selection) { - List<IRegisterDMContext> selectedRegistersList = new ArrayList<IRegisterDMContext>(); + List<IRegisterDMContext> selectedRegistersList = new ArrayList<>(); for (Iterator<?> iterator = selection.iterator(); iterator.hasNext();) { Object element = iterator.next(); IDMVMContext regContext = null; @@ -869,11 +869,11 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler { IRegisterDMData[] registerData, IRegisterDMData[] checkedRegistersData) { assert (registers.length == registerData.length); - List<RegisterDescriptor> checkedDescriptorsList = new ArrayList<RegisterDescriptor>(); + List<RegisterDescriptor> checkedDescriptorsList = new ArrayList<>(); final RegisterDescriptor[] regDescriptors = new RegisterDescriptor[registers.length]; - Map<String, RegisterDescriptor> mapNameToRegDescriptor = new HashMap<String, RegisterDescriptor>(); + Map<String, RegisterDescriptor> mapNameToRegDescriptor = new HashMap<>(); for (int i = 0; i < registers.length; i++) { regDescriptors[i] = new RegisterDescriptor(groupName, registers[i], registerData[i].getName()); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AbstractImageRegistry.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AbstractImageRegistry.java index 186733f8d8a..8a9c4b431fd 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AbstractImageRegistry.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AbstractImageRegistry.java @@ -32,8 +32,8 @@ import org.osgi.framework.Bundle; * Abstract image registry that allows for defining fallback paths for images. */ public abstract class AbstractImageRegistry { - private HashMap<String, String> fPlugins = new HashMap<String, String>(); - private HashMap<String, String[]> fLocations = new HashMap<String, String[]>(); + private HashMap<String, String> fPlugins = new HashMap<>(); + private HashMap<String, String[]> fLocations = new HashMap<>(); private URL fBaseUrl; private final ImageRegistry fRegistry; diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyColumnSupport.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyColumnSupport.java index 1de8ce769f5..ebe9233d677 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyColumnSupport.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyColumnSupport.java @@ -51,7 +51,7 @@ class DisassemblyColumnSupport implements IColumnSupport { Assert.isLegal(registry != null); fDisassembly = disassembly; fRegistry = registry; - fColumns = new ArrayList<IContributedRulerColumn>(); + fColumns = new ArrayList<>(); } /* @@ -202,7 +202,7 @@ class DisassemblyColumnSupport implements IColumnSupport { */ @Override public void dispose() { - for (Iterator<IContributedRulerColumn> iter = new ArrayList<IContributedRulerColumn>(fColumns).iterator(); iter + for (Iterator<IContributedRulerColumn> iter = new ArrayList<>(fColumns).iterator(); iter .hasNext();) removeColumn(getRuler(), iter.next()); fColumns.clear(); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyImageRegistry.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyImageRegistry.java index 04bd4c92cbb..9489b91245e 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyImageRegistry.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyImageRegistry.java @@ -26,7 +26,7 @@ import org.eclipse.jface.resource.ImageDescriptor; * DisassemblyImageRegistry */ public class DisassemblyImageRegistry extends AbstractImageRegistry { - private static List<Object[]> fStore = new ArrayList<Object[]>(); + private static List<Object[]> fStore = new ArrayList<>(); private static String add(String plugin, String[] dirs, String name) { String key = plugin + '/' + dirs[0] + '/' + name; diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java index 2d112f14d3d..f855d49a4a4 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java @@ -290,19 +290,19 @@ public abstract class DisassemblyPart extends WorkbenchPart private DisassemblyIPAnnotation fPCAnnotation; private DisassemblyIPAnnotation fSecondaryPCAnnotation; private boolean fPCAnnotationUpdatePending; - private ArrayList<BigInteger> fPendingPCUpdates = new ArrayList<BigInteger>(5); + private ArrayList<BigInteger> fPendingPCUpdates = new ArrayList<>(5); private Position fScrollPos; private int fScrollLine; private Position fFocusPos; private BigInteger fFrameAddress = PC_UNKNOWN; - protected Map<String, Action> fGlobalActions = new HashMap<String, Action>(); - private List<Action> fSelectionActions = new ArrayList<Action>(); - private List<AbstractDisassemblyAction> fStateDependentActions = new ArrayList<AbstractDisassemblyAction>(); + protected Map<String, Action> fGlobalActions = new HashMap<>(); + private List<Action> fSelectionActions = new ArrayList<>(); + private List<AbstractDisassemblyAction> fStateDependentActions = new ArrayList<>(); private boolean fShowSource; private boolean fShowSymbols; - private Map<String, Object> fFile2Storage = new HashMap<String, Object>(); + private Map<String, Object> fFile2Storage = new HashMap<>(); private boolean fShowDisassembly = true; - private LinkedList<AddressRangePosition> fPCHistory = new LinkedList<AddressRangePosition>(); + private LinkedList<AddressRangePosition> fPCHistory = new LinkedList<>(); private int fPCHistorySizeMax = 4; private boolean fGotoFramePending; @@ -316,7 +316,7 @@ public abstract class DisassemblyPart extends WorkbenchPart private String fPCAnnotationColorKey; - private ArrayList<Runnable> fRunnableQueue = new ArrayList<Runnable>(); + private ArrayList<Runnable> fRunnableQueue = new ArrayList<>(); protected IPartListener2 fPartListener = new IPartListener2() { @Override @@ -1397,7 +1397,7 @@ public abstract class DisassemblyPart extends WorkbenchPart */ private void registerWithHandlerService(IAction action) { if (fHandlerActivations == null) { - fHandlerActivations = new ArrayList<IHandlerActivation>(5); + fHandlerActivations = new ArrayList<>(5); } IHandlerService handlerService = getSite().getService(IHandlerService.class); fHandlerActivations @@ -1839,7 +1839,7 @@ public abstract class DisassemblyPart extends WorkbenchPart fAddressSize = addressSize; if (addressSize < oldAddressSize) { fDocument.deleteDisassemblyRange(fEndAddress, oldEndAddress, true, true); - List<AddressRangePosition> toRemove = new ArrayList<AddressRangePosition>(); + List<AddressRangePosition> toRemove = new ArrayList<>(); for (AddressRangePosition position : fDocument.getInvalidAddressRanges()) { if (position.fAddressOffset.compareTo(fEndAddress) >= 0) { try { @@ -2248,7 +2248,7 @@ public abstract class DisassemblyPart extends WorkbenchPart int offset = lineRegion.getOffset(); int length = lineRegion.getLength(); Iterator<Annotation> it = bpModel.getAnnotationIterator(offset, length, true, true); - List<IBreakpoint> bpList = new ArrayList<IBreakpoint>(5); + List<IBreakpoint> bpList = new ArrayList<>(5); final IBreakpointManager bpMgr = DebugPlugin.getDefault().getBreakpointManager(); while (it.hasNext()) { final SimpleMarkerAnnotation annotation = (SimpleMarkerAnnotation) it.next(); @@ -2673,7 +2673,7 @@ public abstract class DisassemblyPart extends WorkbenchPart fUpdatePending = true; lockScroller(); try { - ArrayList<Runnable> copy = new ArrayList<Runnable>(fRunnableQueue); + ArrayList<Runnable> copy = new ArrayList<>(fRunnableQueue); fRunnableQueue.clear(); for (Iterator<Runnable> iter = copy.iterator(); iter.hasNext();) { if (updateCount != fUpdateCount) { @@ -2923,7 +2923,7 @@ public abstract class DisassemblyPart extends WorkbenchPart } catch (BadLocationException e) { return; } - ArrayList<StyleRange> styleRanges = new ArrayList<StyleRange>(); + ArrayList<StyleRange> styleRanges = new ArrayList<>(); while (it.hasNext()) { AddressRangePosition pos = (AddressRangePosition) it.next(); if (pos.offset >= endOffset) { diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java index ce851ee11c9..08bd832e0ab 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java @@ -61,16 +61,16 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu * Use the add/remove methods. Note that we're not the only ones that * manipulate the list. This list should be accessed only from the GUI thread */ - private final List<AddressRangePosition> fInvalidAddressRanges = new ArrayList<AddressRangePosition>(); + private final List<AddressRangePosition> fInvalidAddressRanges = new ArrayList<>(); /** * For ease of troubleshooting, don't add or remove from this list directly. * Use the add/remove methods. Note that we're not the only ones that * manipulate the list. This list should be accessed only from the GUI thread */ - private final List<SourcePosition> fInvalidSource = new ArrayList<SourcePosition>(); + private final List<SourcePosition> fInvalidSource = new ArrayList<>(); - private final Map<IStorage, SourceFileInfo> fFileInfoMap = new HashMap<IStorage, SourceFileInfo>(); + private final Map<IStorage, SourceFileInfo> fFileInfoMap = new HashMap<>(); private int fMaxFunctionLength = 0; private BigInteger fMaxOpcodeLength = null; @@ -1326,7 +1326,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu String replacement = invalidate ? "...\n" : null; //$NON-NLS-1$ int replaceLen = replacement != null ? replacement.length() : 0; AddressRangePosition lastPos = null; - ArrayList<AddressRangePosition> toRemove = new ArrayList<AddressRangePosition>(); + ArrayList<AddressRangePosition> toRemove = new ArrayList<>(); Iterator<Position> it = getModelPositionIterator(startAddress); while (it.hasNext()) { AddressRangePosition pos = (AddressRangePosition) it.next(); @@ -1471,7 +1471,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu } BigInteger startAddress = BigInteger.ZERO; BigInteger addressLength = BigInteger.ZERO; - ArrayList<AddressRangePosition> toRemove = new ArrayList<AddressRangePosition>(); + ArrayList<AddressRangePosition> toRemove = new ArrayList<>(); try { Iterator<Position> it = getPositionIterator(DisassemblyDocument.CATEGORY_MODEL, startAddress); while (it.hasNext()) { diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/preferences/DisassemblyPreferencePage.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/preferences/DisassemblyPreferencePage.java index 6d1e33c689c..f8e509309be 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/preferences/DisassemblyPreferencePage.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/preferences/DisassemblyPreferencePage.java @@ -43,9 +43,9 @@ import org.eclipse.ui.PlatformUI; */ public class DisassemblyPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { - private List<Button> fCheckBoxes = new ArrayList<Button>(); - private List<Combo> fComboBoxes = new ArrayList<Combo>(); - private ArrayList<Text> fNumberFields = new ArrayList<Text>(); + private List<Button> fCheckBoxes = new ArrayList<>(); + private List<Combo> fComboBoxes = new ArrayList<>(); + private ArrayList<Text> fNumberFields = new ArrayList<>(); private ModifyListener fNumberFieldListener = new ModifyListener() { @Override public void modifyText(ModifyEvent e) { diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/SourceTagDamagerRepairer.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/SourceTagDamagerRepairer.java index 03b7116b9d6..d4a154fa0fc 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/SourceTagDamagerRepairer.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/SourceTagDamagerRepairer.java @@ -45,11 +45,11 @@ import org.eclipse.swt.graphics.RGB; public class SourceTagDamagerRepairer extends DefaultDamagerRepairer implements ISourceTagListener { private ISourceTagProvider fSourceTagProvider; - private Map<String, ITokenScanner> fScannerMap = new HashMap<String, ITokenScanner>(); - private List<ISourceTag> fSourceTags = new ArrayList<ISourceTag>(); + private Map<String, ITokenScanner> fScannerMap = new HashMap<>(); + private List<ISourceTag> fSourceTags = new ArrayList<>(); private IColorManager fColorManager; private IPreferenceStore fPreferenceStore; - private Map<String, TextAttribute> fAttributeMap = new HashMap<String, TextAttribute>(); + private Map<String, TextAttribute> fAttributeMap = new HashMap<>(); private final static String[] KEYS = { SemanticHighlightings.CLASS, SemanticHighlightings.METHOD_DECLARATION, SemanticHighlightings.FUNCTION_DECLARATION, SemanticHighlightings.FIELD, diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/DsfCastToTypeSupport.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/DsfCastToTypeSupport.java index cd902c16d78..301da2ddb9e 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/DsfCastToTypeSupport.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/DsfCastToTypeSupport.java @@ -56,7 +56,7 @@ public class DsfCastToTypeSupport { private final SyncVariableDataAccess fSyncVariableDataAccess; /** expression memento to casting context (TODO: persist these; bug 228301)*/ - private Map<String, CastInfo> fCastedExpressionStorage = new HashMap<String, CastInfo>(); + private Map<String, CastInfo> fCastedExpressionStorage = new HashMap<>(); public class CastImplementation extends PlatformObject implements ICastToArray { private final IExpressionDMContext exprDMC; diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/DsfViewMemoryHandler.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/DsfViewMemoryHandler.java index 30f5a81eb8c..538ed1f41ea 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/DsfViewMemoryHandler.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/DsfViewMemoryHandler.java @@ -101,7 +101,7 @@ public class DsfViewMemoryHandler extends AbstractHandler { } private VariableExpressionVMC[] getMemoryViewables(Object evaluationContext) { - List<VariableExpressionVMC> viewableMemoryItems = new ArrayList<VariableExpressionVMC>(); + List<VariableExpressionVMC> viewableMemoryItems = new ArrayList<>(); if (evaluationContext instanceof IEvaluationContext) { Object s = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_MENU_SELECTION_NAME); if (s instanceof IStructuredSelection) { diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/UpdatePoliciesContribution.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/UpdatePoliciesContribution.java index 6aef69cc9c7..cc984887a12 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/UpdatePoliciesContribution.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/UpdatePoliciesContribution.java @@ -87,7 +87,7 @@ public class UpdatePoliciesContribution extends CompoundContributionItem impleme IVMUpdatePolicy[] policies = cachingProvider.getAvailableUpdatePolicies(); IVMUpdatePolicy activePolicy = cachingProvider.getActiveUpdatePolicy(); - List<Action> actions = new ArrayList<Action>(policies.length); + List<Action> actions = new ArrayList<>(policies.length); for (IVMUpdatePolicy policy : policies) { Action action = new SelectUpdatePolicyAction(cachingProvider, policy); if (policy.getID().equals(activePolicy.getID())) { diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/numberformat/detail/NumberFormatDetailPane.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/numberformat/detail/NumberFormatDetailPane.java index 7cb4cec91c2..9f51bf47198 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/numberformat/detail/NumberFormatDetailPane.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/numberformat/detail/NumberFormatDetailPane.java @@ -111,12 +111,12 @@ public class NumberFormatDetailPane implements IDetailPane2, IAdaptable, IProper * Map of actions. Keys are strings, values * are <code>IAction</code>. */ - private Map<String, IAction> fActionMap = new HashMap<String, IAction>(); + private Map<String, IAction> fActionMap = new HashMap<>(); /** * Collection to track actions that should be updated when selection occurs. */ - private List<String> fSelectionActions = new ArrayList<String>(); + private List<String> fSelectionActions = new ArrayList<>(); /* (non-Javadoc) * @see org.eclipse.debug.ui.IDetailPane#init(org.eclipse.ui.IWorkbenchPartSite) @@ -310,7 +310,7 @@ public class NumberFormatDetailPane implements IDetailPane2, IAdaptable, IProper display = PlatformUI.getWorkbench().getDisplay(); } final Executor executor = SimpleDisplayExecutor.getSimpleDisplayExecutor(display); - Set<String> properties = new HashSet<String>(1); + Set<String> properties = new HashSet<>(1); properties.add(IDebugVMConstants.PROP_FORMATTED_VALUE_AVAILABLE_FORMATS); propertiesProvider .update(new IPropertiesUpdate[] { new VMPropertiesUpdate(properties, path, fViewerInput, @@ -322,7 +322,7 @@ public class NumberFormatDetailPane implements IDetailPane2, IAdaptable, IProper if (fMonitor.isCanceled()) return; - Set<String> properties = new HashSet<String>(1); + Set<String> properties = new HashSet<>(1); properties.add(IElementPropertiesProvider.PROP_NAME); final String[] formats = (String[]) getData() .get(IDebugVMConstants.PROP_FORMATTED_VALUE_AVAILABLE_FORMATS); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/numberformat/detail/NumberFormatDetailPaneFactory.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/numberformat/detail/NumberFormatDetailPaneFactory.java index 98160946ba0..f58a2f4c88d 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/numberformat/detail/NumberFormatDetailPaneFactory.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/numberformat/detail/NumberFormatDetailPaneFactory.java @@ -41,7 +41,7 @@ public class NumberFormatDetailPaneFactory implements IDetailPaneFactory { @SuppressWarnings("rawtypes") @Override public Set getDetailPaneTypes(IStructuredSelection selection) { - Set<String> possibleIDs = new HashSet<String>(1); + Set<String> possibleIDs = new HashSet<>(1); possibleIDs.add(NumberFormatDetailPane.ID); return possibleIDs; } diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/AbstractDisassemblyBreakpointsTarget.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/AbstractDisassemblyBreakpointsTarget.java index 24b770cd773..6e8926e5991 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/AbstractDisassemblyBreakpointsTarget.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/AbstractDisassemblyBreakpointsTarget.java @@ -286,7 +286,7 @@ public abstract class AbstractDisassemblyBreakpointsTarget } private IBreakpoint[] getBreakpointsAtLine(IDisassemblyPart part, int line) { - List<IBreakpoint> breakpoints = new ArrayList<IBreakpoint>(); + List<IBreakpoint> breakpoints = new ArrayList<>(); IAnnotationModel annotationModel = part.getTextViewer().getAnnotationModel(); IDocument document = part.getTextViewer().getDocument(); if (annotationModel != null) { diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/DsfCommandRunnable.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/DsfCommandRunnable.java index 1f8b6689585..d22cc4138f7 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/DsfCommandRunnable.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/DsfCommandRunnable.java @@ -86,7 +86,7 @@ public abstract class DsfCommandRunnable extends DsfRunnable { // Extract all selected execution contexts, using a set to avoid duplicates. Duplicates will // happen if multiple stack frames of the same thread are selected. - Set<IExecutionDMContext> execDmcSet = new HashSet<IExecutionDMContext>(request.getElements().length); + Set<IExecutionDMContext> execDmcSet = new HashSet<>(request.getElements().length); for (Object element : request.getElements()) { if (element instanceof IDMVMContext) { IDMVMContext vmc = (IDMVMContext) element; diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java index b6b52421ac4..8fa41bd7832 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java @@ -671,7 +671,7 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl private DisplayJob fRunningDisplayJob; private DisplayJob fPendingDisplayJob; private ClearingJob fRunningClearingJob; - private Set<IRunControl.IExecutionDMContext> fPendingExecDmcsToClear = new HashSet<IRunControl.IExecutionDMContext>(); + private Set<IRunControl.IExecutionDMContext> fPendingExecDmcsToClear = new HashSet<>(); private SteppingController fController; /** @@ -932,7 +932,7 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl // There are annotations to be cleared, run the job first fRunningClearingJob = new ClearingJob(fPendingExecDmcsToClear); fRunningClearingJob.schedule(); - fPendingExecDmcsToClear = new HashSet<IRunControl.IExecutionDMContext>(); + fPendingExecDmcsToClear = new HashSet<>(); } else if (fPendingDisplayJob != null) { fRunningDisplayJob = fPendingDisplayJob; fRunningDisplayJob.schedule(); @@ -966,7 +966,7 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl if (fRunningClearingJob == null && fRunningDisplayJob == null) { fRunningClearingJob = new ClearingJob(fPendingExecDmcsToClear); fRunningClearingJob.schedule(); - fPendingExecDmcsToClear = new HashSet<IRunControl.IExecutionDMContext>(); + fPendingExecDmcsToClear = new HashSet<>(); } } diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/InstructionPointerManager.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/InstructionPointerManager.java index 266584742ec..9150031487b 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/InstructionPointerManager.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/InstructionPointerManager.java @@ -209,7 +209,7 @@ class InstructionPointerManager { */ public InstructionPointerManager(IInstructionPointerPresentation presentation) { fPresentation = presentation; - fAnnotationWrappers = new LinkedList<AnnotationWrapper>(); + fAnnotationWrappers = new LinkedList<>(); } /** diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/SimpleMapPersistable.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/SimpleMapPersistable.java index 4e7258b1f04..2b10e2bdcaf 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/SimpleMapPersistable.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/SimpleMapPersistable.java @@ -39,7 +39,7 @@ public class SimpleMapPersistable<V> implements IPersistableElement, IAdaptable private static final String KEY_VALUE = "value"; //$NON-NLS-1$ private Class<V> fType; - private Map<String, V> fValues = new TreeMap<String, V>(); + private Map<String, V> fValues = new TreeMap<>(); @SuppressWarnings("unchecked") public SimpleMapPersistable(IMemento memento) throws CoreException { @@ -57,7 +57,7 @@ public class SimpleMapPersistable<V> implements IPersistableElement, IAdaptable } IMemento[] list = memento.getChildren(KEY_NAME); - Map<String, V> values = new TreeMap<String, V>(); + Map<String, V> values = new TreeMap<>(); for (IMemento elem : list) { values.put(elem.getID(), getValue(elem)); } @@ -79,7 +79,7 @@ public class SimpleMapPersistable<V> implements IPersistableElement, IAdaptable public void saveState(IMemento memento) { Map<String, V> values = null; synchronized (fValues) { - values = new TreeMap<String, V>(fValues); + values = new TreeMap<>(fValues); } IMemento type = memento.createChild(KEY_TYPE); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/SteppingController.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/SteppingController.java index a559961ddac..e3c3881840a 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/SteppingController.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/SteppingController.java @@ -153,14 +153,14 @@ public final class SteppingController { private IRunControl fRunControl; private int fQueueDepth = STEP_QUEUE_DEPTH; - private final Map<IExecutionDMContext, List<StepRequest>> fStepQueues = new HashMap<IExecutionDMContext, List<StepRequest>>(); - private final Map<IExecutionDMContext, Boolean> fTimedOutFlags = new HashMap<IExecutionDMContext, Boolean>(); - private final Map<IExecutionDMContext, ScheduledFuture<?>> fTimedOutFutures = new HashMap<IExecutionDMContext, ScheduledFuture<?>>(); + private final Map<IExecutionDMContext, List<StepRequest>> fStepQueues = new HashMap<>(); + private final Map<IExecutionDMContext, Boolean> fTimedOutFlags = new HashMap<>(); + private final Map<IExecutionDMContext, ScheduledFuture<?>> fTimedOutFutures = new HashMap<>(); /** * Records the time of the last step for an execution context. */ - private final Map<IExecutionDMContext, Long> fLastStepTimes = new HashMap<IExecutionDMContext, Long>(); + private final Map<IExecutionDMContext, Long> fLastStepTimes = new HashMap<>(); /** * Minimum step interval in milliseconds. @@ -175,7 +175,7 @@ public final class SteppingController { /** * Map of execution contexts for which a step is in progress. */ - private final Map<IExecutionDMContext, List<ISteppingControlParticipant>> fStepInProgress = new HashMap<IExecutionDMContext, List<ISteppingControlParticipant>>(); + private final Map<IExecutionDMContext, List<ISteppingControlParticipant>> fStepInProgress = new HashMap<>(); /** * List of registered stepping control participants. @@ -486,7 +486,7 @@ public final class SteppingController { private void doEnqueueStep(final IExecutionDMContext execCtx, final StepType stepType) { List<StepRequest> stepQueue = fStepQueues.get(execCtx); if (stepQueue == null) { - stepQueue = new LinkedList<StepRequest>(); + stepQueue = new LinkedList<>(); fStepQueues.put(execCtx, stepQueue); } if (stepQueue.size() < fQueueDepth) { @@ -571,7 +571,7 @@ public final class SteppingController { */ private void disableStepping(IExecutionDMContext execCtx) { if (!fParticipants.isEmpty()) { - fStepInProgress.put(execCtx, new ArrayList<ISteppingControlParticipant>(fParticipants)); + fStepInProgress.put(execCtx, new ArrayList<>(fParticipants)); } } diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/BreakpointVMNode.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/BreakpointVMNode.java index a68f06667d5..b6e9bae3b7f 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/BreakpointVMNode.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/BreakpointVMNode.java @@ -55,7 +55,7 @@ public class BreakpointVMNode extends AbstractBreakpointVMNode @Override public void update(ILabelUpdate[] updates) { - Map<IElementLabelProvider, List<ILabelUpdate>> delegatesMap = new HashMap<IElementLabelProvider, List<ILabelUpdate>>( + Map<IElementLabelProvider, List<ILabelUpdate>> delegatesMap = new HashMap<>( 1, 1); for (final ILabelUpdate update : updates) { @@ -68,7 +68,7 @@ public class BreakpointVMNode extends AbstractBreakpointVMNode List<ILabelUpdate> delegatesList = delegatesMap.get(provider); if (delegatesList == null) { - delegatesList = new ArrayList<ILabelUpdate>(updates.length); + delegatesList = new ArrayList<>(updates.length); delegatesMap.put(provider, delegatesList); } delegatesList.add(new ICheckUpdate() { @@ -164,7 +164,7 @@ public class BreakpointVMNode extends AbstractBreakpointVMNode @Override public void encodeElements(IElementMementoRequest[] updates) { - Map<IElementMementoProvider, List<IElementMementoRequest>> delegatesMap = new HashMap<IElementMementoProvider, List<IElementMementoRequest>>( + Map<IElementMementoProvider, List<IElementMementoRequest>> delegatesMap = new HashMap<>( 1, 1); for (final IElementMementoRequest update : updates) { @@ -177,7 +177,7 @@ public class BreakpointVMNode extends AbstractBreakpointVMNode List<IElementMementoRequest> delegatesList = delegatesMap.get(provider); if (delegatesList == null) { - delegatesList = new ArrayList<IElementMementoRequest>(updates.length); + delegatesList = new ArrayList<>(updates.length); delegatesMap.put(provider, delegatesList); } delegatesList.add(new IElementMementoRequest() { @@ -241,7 +241,7 @@ public class BreakpointVMNode extends AbstractBreakpointVMNode @Override public void compareElements(IElementCompareRequest[] updates) { - Map<IElementMementoProvider, List<IElementCompareRequest>> delegatesMap = new HashMap<IElementMementoProvider, List<IElementCompareRequest>>( + Map<IElementMementoProvider, List<IElementCompareRequest>> delegatesMap = new HashMap<>( 1, 1); for (final IElementCompareRequest update : updates) { @@ -254,7 +254,7 @@ public class BreakpointVMNode extends AbstractBreakpointVMNode List<IElementCompareRequest> delegatesList = delegatesMap.get(provider); if (delegatesList == null) { - delegatesList = new ArrayList<IElementCompareRequest>(updates.length); + delegatesList = new ArrayList<>(updates.length); delegatesMap.put(provider, delegatesList); } delegatesList.add(new IElementCompareRequest() { diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/BreakpointVMProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/BreakpointVMProvider.java index eca21d6b625..c9cd14274d2 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/BreakpointVMProvider.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/BreakpointVMProvider.java @@ -115,7 +115,7 @@ public class BreakpointVMProvider extends AbstractVMProvider { @SuppressWarnings({ "cast", "unchecked" }) @Override protected void handleSuccess() { - Map<IAdaptable, List<IBreakpoint>> bpsLists = new HashMap<IAdaptable, List<IBreakpoint>>(); + Map<IAdaptable, List<IBreakpoint>> bpsLists = new HashMap<>(); for (IBreakpoint bp : getData()) { IAdaptable[] bpCategories = fOrganizerVMNode.getOrganizer().getCategories(bp); if (bpCategories == null || bpCategories.length == 0) { @@ -125,7 +125,7 @@ public class BreakpointVMProvider extends AbstractVMProvider { for (IAdaptable category : bpCategories) { List<IBreakpoint> categoryBPs = bpsLists.get(category); if (categoryBPs == null) { - categoryBPs = new ArrayList<IBreakpoint>(); + categoryBPs = new ArrayList<>(); bpsLists.put(category, categoryBPs); } categoryBPs.add(bp); @@ -144,7 +144,7 @@ public class BreakpointVMProvider extends AbstractVMProvider { } } - List<BreakpointOrganizerVMContext> vmcs = new ArrayList<BreakpointOrganizerVMContext>( + List<BreakpointOrganizerVMContext> vmcs = new ArrayList<>( bpsLists.size()); for (Map.Entry<IAdaptable, List<IBreakpoint>> entry : bpsLists.entrySet()) { List<IBreakpoint> bpsList = entry.getValue(); @@ -165,7 +165,7 @@ public class BreakpointVMProvider extends AbstractVMProvider { } }; - private final Map<TreePath, ContainerBreakpointsCache> fContainerBreakpointsCacheMap = new HashMap<TreePath, ContainerBreakpointsCache>(); + private final Map<TreePath, ContainerBreakpointsCache> fContainerBreakpointsCacheMap = new HashMap<>(); private DataCache<IBreakpoint[]> fFilteredBreakpointsCache = new DataCache<IBreakpoint[]>(getExecutor()) { @Override diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/DataCache.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/DataCache.java index 9bee9d8381a..aa199baa743 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/DataCache.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/DataCache.java @@ -52,7 +52,7 @@ abstract class DataCache<V> { private V fData; private IStatus fStatus; - private List<DataRequestMonitor<V>> fWaitingList = new LinkedList<DataRequestMonitor<V>>(); + private List<DataRequestMonitor<V>> fWaitingList = new LinkedList<>(); public DataCache(Executor executor) { fExecutor = executor; @@ -133,7 +133,7 @@ abstract class DataCache<V> { fData = data; fStatus = status; List<DataRequestMonitor<V>> waitingList = fWaitingList; - fWaitingList = new LinkedList<DataRequestMonitor<V>>(); + fWaitingList = new LinkedList<>(); for (DataRequestMonitor<V> rm : waitingList) { rm.setData(data); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionManagerVMNode.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionManagerVMNode.java index 750cca28713..e156634b461 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionManagerVMNode.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionManagerVMNode.java @@ -334,7 +334,7 @@ public class ExpressionManagerVMNode extends AbstractVMNode implements IElementL } private TreePath getTreePathFromDelta(IModelDelta delta) { - List<Object> elementList = new LinkedList<Object>(); + List<Object> elementList = new LinkedList<>(); IModelDelta listDelta = delta; elementList.add(0, listDelta.getElement()); while (listDelta.getParentDelta() != null) { diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionVMProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionVMProvider.java index 3ce6f9265e1..39d61c5aa75 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionVMProvider.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionVMProvider.java @@ -386,7 +386,7 @@ public class ExpressionVMProvider extends AbstractElementVMProvider implements I } private void expressionsListChanged(ExpressionsChangedEvent.Type type, IExpression[] expressions, int index) { - Set<Object> rootElements = new HashSet<Object>(); + Set<Object> rootElements = new HashSet<>(); for (IVMModelProxy proxy : getActiveModelProxies()) { rootElements.add(proxy.getRootElement()); } diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/SingleExpressionVMNode.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/SingleExpressionVMNode.java index dfef8f40583..0af115c765f 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/SingleExpressionVMNode.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/SingleExpressionVMNode.java @@ -310,7 +310,7 @@ public class SingleExpressionVMNode extends AbstractVMNode implements IElementLa } private TreePath getTreePathFromDelta(IModelDelta delta) { - List<Object> elementList = new LinkedList<Object>(); + List<Object> elementList = new LinkedList<>(); IModelDelta listDelta = delta; elementList.add(0, listDelta.getElement()); while (listDelta.getParentDelta() != null) { diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractLaunchVMProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractLaunchVMProvider.java index 215496a40f5..2e327446f0c 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractLaunchVMProvider.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractLaunchVMProvider.java @@ -68,7 +68,7 @@ public class AbstractLaunchVMProvider extends AbstractDMVMProvider */ private static final int FRAME_UPDATE_DELAY = 200; - private final Map<IExecutionDMContext, ScheduledFuture<?>> fRefreshStackFramesFutures = new HashMap<IExecutionDMContext, ScheduledFuture<?>>(); + private final Map<IExecutionDMContext, ScheduledFuture<?>> fRefreshStackFramesFutures = new HashMap<>(); private IPropertyChangeListener fPreferencesListener; diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StackFramesVMNode.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StackFramesVMNode.java index 819f36ee75a..096c68ce6a9 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StackFramesVMNode.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StackFramesVMNode.java @@ -118,7 +118,7 @@ public class StackFramesVMNode extends AbstractDMVMNode /** * Temporary stack frame limit to allow incremental stack updates. */ - private Map<IExecutionDMContext, Integer> fTemporaryLimits = new HashMap<IExecutionDMContext, Integer>(); + private Map<IExecutionDMContext, Integer> fTemporaryLimits = new HashMap<>(); /** * The label provider delegate. This VM node will delegate label updates to this provider diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/detail/ModuleDetailPaneFactory.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/detail/ModuleDetailPaneFactory.java index 7e119eb80a3..2330e493ffd 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/detail/ModuleDetailPaneFactory.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/detail/ModuleDetailPaneFactory.java @@ -51,7 +51,7 @@ public class ModuleDetailPaneFactory implements IDetailPaneFactory { @Override public Set getDetailPaneTypes(IStructuredSelection selection) { - Set<String> possibleIDs = new HashSet<String>(1); + Set<String> possibleIDs = new HashSet<>(1); possibleIDs.add(ModuleDetailPane.ID); return possibleIDs; } diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/detail/ModulesAbstractDetailPane.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/detail/ModulesAbstractDetailPane.java index 79ac995dad9..85b6d299f04 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/detail/ModulesAbstractDetailPane.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/detail/ModulesAbstractDetailPane.java @@ -41,12 +41,12 @@ public abstract class ModulesAbstractDetailPane implements IDetailPane { * Map of actions. Keys are strings, values * are <code>IAction</code>. */ - private Map<String, IAction> fActionMap = new HashMap<String, IAction>(); + private Map<String, IAction> fActionMap = new HashMap<>(); /** * Collection to track actions that should be updated when selection occurs. */ - private List<String> fSelectionActions = new ArrayList<String>(); + private List<String> fSelectionActions = new ArrayList<>(); /* (non-Javadoc) * @see org.eclipse.debug.ui.IDetailPane#init(org.eclipse.ui.IWorkbenchPartSite) diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/ElementNumberFormatsContribution.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/ElementNumberFormatsContribution.java index 42a81e2ec53..a4d33d69f9b 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/ElementNumberFormatsContribution.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/ElementNumberFormatsContribution.java @@ -118,7 +118,7 @@ public class ElementNumberFormatsContribution extends NumberFormatsContribution } IVMNode[] nodes = new IVMNode[elementPaths.length]; - final List<SelectFormatAction> actions = new ArrayList<SelectFormatAction>(availableFormats.size()); + final List<SelectFormatAction> actions = new ArrayList<>(availableFormats.size()); for (String formatId : availableFormats) { actions.add(new SelectFormatAction((IElementFormatProvider) provider, context, nodes, viewerInput, elementPaths, formatId)); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/FormattedValueRetriever.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/FormattedValueRetriever.java index 7e65f654caa..d146a85daf5 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/FormattedValueRetriever.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/FormattedValueRetriever.java @@ -242,12 +242,12 @@ public class FormattedValueRetriever { } if (active != null) { if (cachedMap == null) { - cachedMap = new HashMap<IPropertiesUpdate, String>(updates.length * 4 / 3); + cachedMap = new HashMap<>(updates.length * 4 / 3); } cachedMap.put(update, active); } else { if (outstanding == null) { - outstanding = new HashSet<IPropertiesUpdate>(updates.length * 4 / 3); + outstanding = new HashSet<>(updates.length * 4 / 3); } outstanding.add(update); } @@ -258,7 +258,7 @@ public class FormattedValueRetriever { return; } if (cachedMap == null) { - cachedMap = new HashMap<IPropertiesUpdate, String>(updates.length * 4 / 3); + cachedMap = new HashMap<>(updates.length * 4 / 3); } final Map<IPropertiesUpdate, String> elementFormatMap = Collections.synchronizedMap(cachedMap); rm.setData(elementFormatMap); @@ -303,7 +303,7 @@ public class FormattedValueRetriever { // of whether we need to call the service for data. if (availableFormats != null || !isAvailableFormatsPropertyNeeded(update)) { if (cachedAvailableFormatsMap == null) { - cachedAvailableFormatsMap = new HashMap<IPropertiesUpdate, String[]>(updates.length * 4 / 3); + cachedAvailableFormatsMap = new HashMap<>(updates.length * 4 / 3); } cachedAvailableFormatsMap.put(update, availableFormats); continue; @@ -322,7 +322,7 @@ public class FormattedValueRetriever { private List<IPropertiesUpdate> calcOutstandingAvailableFormatsUpdates(IPropertiesUpdate[] updates, Map<IPropertiesUpdate, String[]> cachedAvailableFormatsMap) { if (cachedAvailableFormatsMap != null) { - List<IPropertiesUpdate> outstandingUpdates = new ArrayList<IPropertiesUpdate>( + List<IPropertiesUpdate> outstandingUpdates = new ArrayList<>( updates.length - cachedAvailableFormatsMap.size()); for (IPropertiesUpdate update : updates) { if (!cachedAvailableFormatsMap.containsKey(update)) { @@ -423,10 +423,10 @@ public class FormattedValueRetriever { private void doUpdateWithAvailableFormats(IPropertiesUpdate updates[], final Map<IPropertiesUpdate, String[]> availableFormatsMap, final Map<IPropertiesUpdate, String> elementFormatMap, final RequestMonitor rm) { - final List<IPropertiesUpdate> outstandingUpdates = new ArrayList<IPropertiesUpdate>(updates.length); - final Map<IPropertiesUpdate, List<String>> requestedFormatsMap = new HashMap<IPropertiesUpdate, List<String>>( + final List<IPropertiesUpdate> outstandingUpdates = new ArrayList<>(updates.length); + final Map<IPropertiesUpdate, List<String>> requestedFormatsMap = new HashMap<>( updates.length * 4 / 3); - final Map<IPropertiesUpdate, String> activeFormatsMap = new HashMap<IPropertiesUpdate, String>( + final Map<IPropertiesUpdate, String> activeFormatsMap = new HashMap<>( updates.length * 4 / 3); for (final IPropertiesUpdate update : updates) { @@ -608,7 +608,7 @@ public class FormattedValueRetriever { */ private List<String> calcRequestedFormats(IPropertiesUpdate update, String activeFormat, String[] availableFormats) { - List<String> requestedFormats = new ArrayList<String>(10); + List<String> requestedFormats = new ArrayList<>(10); boolean activeFormatValueHandled = false; // have we come across a specific format request that is the active format? diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/FormattedValueVMUtil.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/FormattedValueVMUtil.java index 5b4c5cf3596..1f73d0b61d6 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/FormattedValueVMUtil.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/FormattedValueVMUtil.java @@ -60,7 +60,7 @@ public class FormattedValueVMUtil { /** * Common map of user-readable labels for format IDs. */ - private static Map<String, String> fFormatLabels = new HashMap<String, String>(8); + private static Map<String, String> fFormatLabels = new HashMap<>(8); static { setFormatLabel(IFormattedValues.NATURAL_FORMAT, @@ -142,7 +142,7 @@ public class FormattedValueVMUtil { synchronized (fFormatProperties) { Map<String, String> prefixMap = fFormatProperties.get(prefix); if (prefixMap == null) { - prefixMap = new TreeMap<String, String>(); + prefixMap = new TreeMap<>(); fFormatProperties.put(prefix, prefixMap); } return prefixMap; diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/NumberFormatsContribution.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/NumberFormatsContribution.java index fb195473b5b..0f1859708ca 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/NumberFormatsContribution.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/NumberFormatsContribution.java @@ -42,7 +42,7 @@ import org.eclipse.ui.services.IServiceLocator; */ public class NumberFormatsContribution extends CompoundContributionItem implements IWorkbenchContribution { - protected static final List<String> FORMATS = new LinkedList<String>(); + protected static final List<String> FORMATS = new LinkedList<>(); static { FORMATS.add(IFormattedValues.NATURAL_FORMAT); FORMATS.add(IFormattedValues.HEX_FORMAT); @@ -101,7 +101,7 @@ public class NumberFormatsContribution extends CompoundContributionItem implemen activeId = IFormattedValues.NATURAL_FORMAT; } - List<Action> actions = new ArrayList<Action>(FORMATS.size()); + List<Action> actions = new ArrayList<>(FORMATS.size()); for (String formatId : FORMATS) { Action action = new SelectNumberFormatAction(context, formatId); if (formatId.equals(activeId)) { diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/NumberFormatsPropertyTester.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/NumberFormatsPropertyTester.java index e557429c05a..d821dc95729 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/NumberFormatsPropertyTester.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/NumberFormatsPropertyTester.java @@ -54,7 +54,7 @@ public class NumberFormatsPropertyTester extends PropertyTester { private static final String AVAILABLE = "isNumberFormatAvailable"; //$NON-NLS-1$ private static final String ACTIVE = "isNumberFormatActive"; //$NON-NLS-1$ - private static final List<String> AVAILABLE_FORMATS = new ArrayList<String>(); + private static final List<String> AVAILABLE_FORMATS = new ArrayList<>(); static { AVAILABLE_FORMATS.add(IFormattedValues.NATURAL_FORMAT); AVAILABLE_FORMATS.add(IFormattedValues.HEX_FORMAT); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/update/DebugManualUpdatePolicy.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/update/DebugManualUpdatePolicy.java index 0bfd5ee0832..b122731e8b4 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/update/DebugManualUpdatePolicy.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/update/DebugManualUpdatePolicy.java @@ -66,8 +66,8 @@ public class DebugManualUpdatePolicy extends ManualUpdatePolicy implements IVMUp fActiveNumberFormatPropertiesWithPrefixes = ACTIVE_NUMBER_FORMAT_PROPERTIES; fElementFormatPropertiesWithPrefixes = ELEMENT_FORMAT_PROPERTIES; } else { - fActiveNumberFormatPropertiesWithPrefixes = new TreeSet<String>(ACTIVE_NUMBER_FORMAT_PROPERTIES); - fElementFormatPropertiesWithPrefixes = new TreeSet<String>(ELEMENT_FORMAT_PROPERTIES); + fActiveNumberFormatPropertiesWithPrefixes = new TreeSet<>(ACTIVE_NUMBER_FORMAT_PROPERTIES); + fElementFormatPropertiesWithPrefixes = new TreeSet<>(ELEMENT_FORMAT_PROPERTIES); for (String prefix : prefixes) { fActiveNumberFormatPropertiesWithPrefixes .add((prefix + IDebugVMConstants.PROP_FORMATTED_VALUE_ACTIVE_FORMAT).intern()); @@ -82,14 +82,14 @@ public class DebugManualUpdatePolicy extends ManualUpdatePolicy implements IVMUp } - private static final Set<String> ACTIVE_NUMBER_FORMAT_PROPERTIES = new TreeSet<String>(); + private static final Set<String> ACTIVE_NUMBER_FORMAT_PROPERTIES = new TreeSet<>(); static { ACTIVE_NUMBER_FORMAT_PROPERTIES.add(IDebugVMConstants.PROP_FORMATTED_VALUE_ACTIVE_FORMAT); ACTIVE_NUMBER_FORMAT_PROPERTIES.add(IDebugVMConstants.PROP_FORMATTED_VALUE_ACTIVE_FORMAT_VALUE); ACTIVE_NUMBER_FORMAT_PROPERTIES.add(IDebugVMConstants.PROP_FORMATTED_VALUE_FORMAT_PREFERENCE); } - private static final Set<String> ELEMENT_FORMAT_PROPERTIES = new TreeSet<String>(); + private static final Set<String> ELEMENT_FORMAT_PROPERTIES = new TreeSet<>(); static { ELEMENT_FORMAT_PROPERTIES.add(IDebugVMConstants.PROP_FORMATTED_VALUE_ACTIVE_FORMAT); ELEMENT_FORMAT_PROPERTIES.add(IDebugVMConstants.PROP_FORMATTED_VALUE_ACTIVE_FORMAT_VALUE); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableVMNode.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableVMNode.java index 26f3935bbbc..f7d3c1b0221 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableVMNode.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableVMNode.java @@ -1120,7 +1120,7 @@ public class VariableVMNode extends AbstractExpressionVMNode // Create a List in which we store the DM data objects for the local variables. This is // necessary because there is no MultiDataRequestMonitor. :) - final List<IVariableDMData> localsDMData = new ArrayList<IVariableDMData>(); + final List<IVariableDMData> localsDMData = new ArrayList<>(); // Create the MultiRequestMonitor to handle completion of the set of getModelData() calls. diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/SimpleDisplayExecutor.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/SimpleDisplayExecutor.java index 22e85fe8f92..b8ff68cd692 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/SimpleDisplayExecutor.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/SimpleDisplayExecutor.java @@ -97,7 +97,7 @@ public class SimpleDisplayExecutor implements Executor { private synchronized boolean enqueue(final Runnable runnable) { boolean needsPosting = false; if (runnables == null) { - runnables = new LinkedList<Runnable>(); + runnables = new LinkedList<>(); needsPosting = true; } runnables.offer(runnable); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMAdapter.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMAdapter.java index ddf8a90d190..3ce16d55693 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMAdapter.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMAdapter.java @@ -227,7 +227,7 @@ abstract public class AbstractVMAdapter implements IVMAdapter { * @since 1.1 */ protected final void handleEvent(final Object event) { - final List<IVMEventListener> eventListeners = new ArrayList<IVMEventListener>(); + final List<IVMEventListener> eventListeners = new ArrayList<>(); aboutToHandleEvent(event); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMProvider.java index 5ff02ffa5a9..fe6ec9decb3 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMProvider.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMProvider.java @@ -118,7 +118,7 @@ abstract public class AbstractVMProvider implements IVMProvider, IVMEventListene * at the same time, each of these sub-trees will have it's own model * proxy. */ - private List<IVMModelProxy> fActiveModelProxies = new LinkedList<IVMModelProxy>(); + private List<IVMModelProxy> fActiveModelProxies = new LinkedList<>(); /** * Convenience constant. @@ -128,7 +128,7 @@ abstract public class AbstractVMProvider implements IVMProvider, IVMEventListene /** * The mapping of parent to child nodes. */ - private Map<IVMNode, IVMNode[]> fChildNodesMap = new HashMap<IVMNode, IVMNode[]>(); + private Map<IVMNode, IVMNode[]> fChildNodesMap = new HashMap<>(); /** * Cached array of all the configured view model nodes. It is generated @@ -170,10 +170,10 @@ abstract public class AbstractVMProvider implements IVMProvider, IVMEventListene RequestMonitor fCurrentRm; /** The queue */ - List<EventInfo> fEventQueue = new LinkedList<EventInfo>(); + List<EventInfo> fEventQueue = new LinkedList<>(); } - private Map<IVMModelProxy, ModelProxyEventQueue> fProxyEventQueues = new HashMap<IVMModelProxy, ModelProxyEventQueue>(); + private Map<IVMModelProxy, ModelProxyEventQueue> fProxyEventQueues = new HashMap<>(); /** * Constructs the view model provider for given DSF session. The @@ -265,7 +265,7 @@ abstract public class AbstractVMProvider implements IVMProvider, IVMEventListene } CountingRequestMonitor crm = new CountingRequestMonitor(getExecutor(), rm); - final List<IVMModelProxy> activeModelProxies = new ArrayList<IVMModelProxy>(getActiveModelProxies()); + final List<IVMModelProxy> activeModelProxies = new ArrayList<>(getActiveModelProxies()); crm.setDoneCount(activeModelProxies.size()); for (final IVMModelProxy proxyStrategy : activeModelProxies) { @@ -444,7 +444,7 @@ abstract public class AbstractVMProvider implements IVMProvider, IVMEventListene if (fNodesListCache != null) { return fNodesListCache; } - List<IVMNode> list = new ArrayList<IVMNode>(); + List<IVMNode> list = new ArrayList<>(); for (IVMNode node : fChildNodesMap.keySet()) { if (node != null) { list.add(node); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/DefaultVMContentProviderStrategy.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/DefaultVMContentProviderStrategy.java index a7d41e0846d..df0b8a9a40b 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/DefaultVMContentProviderStrategy.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/DefaultVMContentProviderStrategy.java @@ -83,7 +83,7 @@ public class DefaultVMContentProviderStrategy implements IElementContentProvider updateNodeChildren(firstNode, updates); } else { // Sort the updates by the node. - Map<IVMNode, List<IHasChildrenUpdate>> nodeUpdatesMap = new HashMap<IVMNode, List<IHasChildrenUpdate>>(); + Map<IVMNode, List<IHasChildrenUpdate>> nodeUpdatesMap = new HashMap<>(); for (IHasChildrenUpdate update : updates) { // Get the VM Context for last element in path. IVMNode node = getNodeForElement(update.getElement()); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/DefaultVMModelProxyStrategy.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/DefaultVMModelProxyStrategy.java index 5fe9191845d..88afb76d461 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/DefaultVMModelProxyStrategy.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/DefaultVMModelProxyStrategy.java @@ -776,7 +776,7 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy { final CountingRequestMonitor crm = new CountingRequestMonitor(getVMProvider().getExecutor(), rm) { @Override protected void handleSuccess() { - Map<IVMNode, Integer> data = new HashMap<IVMNode, Integer>(); + Map<IVMNode, Integer> data = new HashMap<>(); int offset = 0; for (int i = 0; i < childNodes.length; i++) { data.put(childNodes[i], offset); @@ -805,7 +805,7 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy { } crm.setDoneCount(countRM); } else { - Map<IVMNode, Integer> data = new HashMap<IVMNode, Integer>(); + Map<IVMNode, Integer> data = new HashMap<>(); for (int i = 0; i < childNodes.length; i++) { data.put(childNodes[i], -1); } @@ -821,7 +821,7 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy { * IModelDelta.NO_CHANGE are omitted. */ protected Map<IVMNode, Integer> getChildNodesWithDeltaFlags(IVMNode node, ModelDelta parentDelta, Object e) { - Map<IVMNode, Integer> nodes = new HashMap<IVMNode, Integer>(); + Map<IVMNode, Integer> nodes = new HashMap<>(); for (final IVMNode childNode : getVMProvider().getChildVMNodes(node)) { if (!childNode.equals(node) || allowRecursiveVMNodes()) { int delta = getDeltaFlags(childNode, parentDelta, e); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMChildrenUpdate.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMChildrenUpdate.java index 570ab37e747..6066daf25c4 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMChildrenUpdate.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMChildrenUpdate.java @@ -44,7 +44,7 @@ public class VMChildrenUpdate extends VMViewerUpdate implements IChildrenUpdate super(clientUpdate, requestMonitor); fOffset = offset; fLength = length; - fElements = length > 0 ? new ArrayList<Object>(length) : new ArrayList<Object>(); + fElements = length > 0 ? new ArrayList<>(length) : new ArrayList<>(); } public VMChildrenUpdate(IModelDelta delta, IPresentationContext presentationContext, int offset, int length, @@ -52,7 +52,7 @@ public class VMChildrenUpdate extends VMViewerUpdate implements IChildrenUpdate super(delta, presentationContext, rm); fOffset = offset; fLength = length; - fElements = length > 0 ? new ArrayList<Object>(length) : new ArrayList<Object>(); + fElements = length > 0 ? new ArrayList<>(length) : new ArrayList<>(); } public VMChildrenUpdate(TreePath elementPath, Object viewerInput, IPresentationContext presentationContext, @@ -60,7 +60,7 @@ public class VMChildrenUpdate extends VMViewerUpdate implements IChildrenUpdate super(elementPath, viewerInput, presentationContext, rm); fOffset = offset; fLength = length; - fElements = length > 0 ? new ArrayList<Object>(length) : new ArrayList<Object>(); + fElements = length > 0 ? new ArrayList<>(length) : new ArrayList<>(); } @Override diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMViewerUpdate.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMViewerUpdate.java index 0a5165a02ec..e889f4bc61b 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMViewerUpdate.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMViewerUpdate.java @@ -158,7 +158,7 @@ public class VMViewerUpdate extends DsfExecutable implements IViewerUpdate { * @param requestMonitor Call-back invoked when this update completes. */ public VMViewerUpdate(IModelDelta delta, IPresentationContext presentationContext, RequestMonitor requestMonitor) { - List<Object> elementList = new LinkedList<Object>(); + List<Object> elementList = new LinkedList<>(); IModelDelta listDelta = delta; elementList.add(0, listDelta.getElement()); while (listDelta.getParentDelta() != null) { diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/datamodel/CompositeDMVMContext.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/datamodel/CompositeDMVMContext.java index dd8123d4fb6..693995a1060 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/datamodel/CompositeDMVMContext.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/datamodel/CompositeDMVMContext.java @@ -54,7 +54,7 @@ public class CompositeDMVMContext extends CompositeDMContext { */ public CompositeDMVMContext(Object viewerInputObject, TreePath treePath) { super(EMPTY_CONTEXTS_ARRAY); - List<IDMContext> parentsList = new ArrayList<IDMContext>(treePath.getSegmentCount() + 1); + List<IDMContext> parentsList = new ArrayList<>(treePath.getSegmentCount() + 1); for (int i = treePath.getSegmentCount() - 1; i >= 0; i--) { if (treePath.getSegment(i) instanceof IDMVMContext) { parentsList.add(((IDMVMContext) treePath.getSegment(i)).getDMContext()); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/LabelColumnInfo.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/LabelColumnInfo.java index e17ee6343be..f4e016562d8 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/LabelColumnInfo.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/LabelColumnInfo.java @@ -54,7 +54,7 @@ public class LabelColumnInfo { public LabelColumnInfo(LabelAttribute[] attributes) { fLabelAttributes = attributes; - List<String> names = new LinkedList<String>(); + List<String> names = new LinkedList<>(); for (LabelAttribute attr : attributes) { for (String name : attr.getPropertyNames()) { names.add(name); @@ -87,7 +87,7 @@ public class LabelColumnInfo { protected void setLabelAttributes(LabelAttribute[] attributes) { fLabelAttributes = attributes; - List<String> names = new LinkedList<String>(); + List<String> names = new LinkedList<>(); for (LabelAttribute attr : attributes) { for (String name : attr.getPropertyNames()) { names.add(name); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/PropertiesBasedLabelProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/PropertiesBasedLabelProvider.java index fa5cb57a35d..96260238b14 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/PropertiesBasedLabelProvider.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/PropertiesBasedLabelProvider.java @@ -197,7 +197,7 @@ public class PropertiesBasedLabelProvider implements IElementLabelProvider { * @return Array of property names. */ private Set<String> calcPropertyNamesForColumns(String[] columnIds) { - Set<String> propertyNames = new HashSet<String>(); + Set<String> propertyNames = new HashSet<>(); if (columnIds == null) { LabelColumnInfo columnInfo = getColumnInfo(ID_COLUMN_NO_COLUMNS); if (columnInfo != null) { diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/PropertiesUpdateStatus.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/PropertiesUpdateStatus.java index f316b24b420..26df13d87f0 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/PropertiesUpdateStatus.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/PropertiesUpdateStatus.java @@ -44,7 +44,7 @@ import org.eclipse.core.runtime.IStatus; */ public class PropertiesUpdateStatus extends DsfMultiStatus { - final private Map<String, IStatus> fPropertiesStatus = new HashMap<String, IStatus>(1); + final private Map<String, IStatus> fPropertiesStatus = new HashMap<>(1); private boolean fFirstStatusSet; public PropertiesUpdateStatus() { @@ -132,7 +132,7 @@ public class PropertiesUpdateStatus extends DsfMultiStatus { // Children of merged status should contain all statuses that are found in the fPropertiesStatus map, but // without duplicates. - Set<IStatus> children = new HashSet<IStatus>( + Set<IStatus> children = new HashSet<>( (baseStatus.getChildren().length + newStatus.getChildren().length) * 4 / 3); children.addAll(mergedStatus.fPropertiesStatus.values()); for (IStatus child : children) { diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/VMPropertiesUpdate.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/VMPropertiesUpdate.java index 3c47a02028c..930035664d2 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/VMPropertiesUpdate.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/VMPropertiesUpdate.java @@ -91,7 +91,7 @@ public class VMPropertiesUpdate extends VMViewerUpdate implements IPropertiesUpd if (!fCreatedOwnMap) { fCreatedOwnMap = true; Map<String, Object> curValues = fValues; - fValues = new HashMap<String, Object>(fProperties.size() * 4 / 3, 0.75f); + fValues = new HashMap<>(fProperties.size() * 4 / 3, 0.75f); if (curValues != null) { fValues.putAll(curValues); } diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java index baa658445b3..083e0c1e8ce 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java @@ -243,7 +243,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider Integer childrenCount = fChildrenCount; childrenCount = childrenCount != null ? childrenCount : 0; int capacity = Math.max((childrenCount.intValue() * 4) / 3, 32); - fChildren = new HashMap<Integer, Object>(capacity); + fChildren = new HashMap<>(capacity); } } @@ -396,7 +396,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider private IVMUpdatePolicy[] fAvailableUpdatePolicies; - public Map<Object, RootElementMarkerKey> fRootMarkers = new HashMap<Object, RootElementMarkerKey>(); + public Map<Object, RootElementMarkerKey> fRootMarkers = new HashMap<>(); /** * Hash map holding cache data. To store the cache information, the cache uses a @@ -490,7 +490,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider @Override public void updateNode(final IVMNode node, IHasChildrenUpdate[] updates) { - LinkedList<IHasChildrenUpdate> missUpdates = new LinkedList<IHasChildrenUpdate>(); + LinkedList<IHasChildrenUpdate> missUpdates = new LinkedList<>(); for (final IHasChildrenUpdate update : updates) { // Find or create the cache entry for the element of this update. ElementDataKey key = makeEntryKey(node, update); @@ -670,7 +670,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider // Update for a partial list of children was requested. // Iterate through the known children and make a list of missing // indexes. - List<Integer> childrenMissingFromCache = new LinkedList<Integer>(); + List<Integer> childrenMissingFromCache = new LinkedList<>(); for (int i = update.getOffset(); i < update.getOffset() + update.getLength(); i++) { childrenMissingFromCache.add(i); } @@ -701,7 +701,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider // Some children were not found in the cache, create separate // proxy updates for the continuous ranges of missing children. - List<IChildrenUpdate> partialUpdates = new ArrayList<IChildrenUpdate>(2); + List<IChildrenUpdate> partialUpdates = new ArrayList<>(2); final CountingRequestMonitor multiRm = new ViewerCountingRequestMonitor(getExecutor(), update); while (!childrenMissingFromCache.isEmpty()) { final int offset = childrenMissingFromCache.get(0); @@ -1100,7 +1100,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider if (rootElementChildren != null) { entry.fHasChildren = rootElementChildren.length > 0; entry.fChildrenCount = rootElementChildren.length; - entry.fChildren = new HashMap<Integer, Object>(entry.fChildrenCount * 4 / 3); + entry.fChildren = new HashMap<>(entry.fChildrenCount * 4 / 3); for (int i = 0; i < rootElementChildren.length; i++) { entry.fChildren.put(i, rootElementChildren[i]); } @@ -1112,7 +1112,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider .getInitialRootElementProperties(rootElement); if (rootElementProperties != null) { - entry.fProperties = new HashMap<String, Object>((rootElementProperties.size() + 1) * 4 / 3); + entry.fProperties = new HashMap<>((rootElementProperties.size() + 1) * 4 / 3); entry.fProperties.putAll(rootElementProperties); entry.fProperties.put(PROP_CACHE_ENTRY_DIRTY, true); entry.fDirty = true; @@ -1164,7 +1164,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider } } else { // Sort the updates by the node. - Map<IVMNode, List<IPropertiesUpdate>> nodeUpdatesMap = new HashMap<IVMNode, List<IPropertiesUpdate>>(); + Map<IVMNode, List<IPropertiesUpdate>> nodeUpdatesMap = new HashMap<>(); for (IPropertiesUpdate update : updates) { // Get the VM Context for last element in path. IVMNode node = getNodeForElement(update.getElement()); @@ -1206,7 +1206,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider } protected void updateNode(final IVMNode node, IPropertiesUpdate[] updates) { - LinkedList<IPropertiesUpdate> missUpdates = new LinkedList<IPropertiesUpdate>(); + LinkedList<IPropertiesUpdate> missUpdates = new LinkedList<>(); for (final IPropertiesUpdate update : updates) { // Find or create the cache entry for the element of this update. ElementDataKey key = makeEntryKey(node, update); @@ -1232,7 +1232,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider // Cache miss! Check if already cached properties can be re-used. Set<String> missingProperties = null; if (entry.fProperties != null) { - missingProperties = new HashSet<String>(update.getProperties().size() * 4 / 3); + missingProperties = new HashSet<>(update.getProperties().size() * 4 / 3); missingProperties.addAll(update.getProperties()); missingProperties.removeAll(entry.fProperties.keySet()); @@ -1285,7 +1285,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider // We are caching the result of this update. Copy the properties from the update // to the cached properties map. if (entry.fProperties == null) { - entry.fProperties = new HashMap<String, Object>((getData().size() + 3) * 4 / 3); + entry.fProperties = new HashMap<>((getData().size() + 3) * 4 / 3); if (update.getProperties().contains(PROP_CACHE_ENTRY_DIRTY)) { entry.fProperties.put(PROP_CACHE_ENTRY_DIRTY, entry.fDirty); } @@ -1319,14 +1319,14 @@ public class AbstractCachingVMProvider extends AbstractVMProvider // Create a temporary cached properties map and add existing cache and node update // properties to it. if (entry.fProperties != null) { - cachedProperties = new HashMap<String, Object>( + cachedProperties = new HashMap<>( (entry.fProperties.size() + getData().size() + 3) * 4 / 3); cachedProperties.putAll(entry.fProperties); cachedStatus = PropertiesUpdateStatus.mergePropertiesStatus( (PropertiesUpdateStatus) cachedProperties.get(PROP_UPDATE_STATUS), missUpdateStatus, _missingProperties); } else { - cachedProperties = new HashMap<String, Object>((getData().size() + 3) * 4 / 3); + cachedProperties = new HashMap<>((getData().size() + 3) * 4 / 3); cachedStatus = missUpdateStatus; } cachedProperties.putAll(getData()); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/UserEditEvent.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/UserEditEvent.java index db5238b452d..93224a7e053 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/UserEditEvent.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/UserEditEvent.java @@ -28,7 +28,7 @@ public class UserEditEvent { private final Set<Object> fElements; public UserEditEvent(Object element) { - fElements = new HashSet<Object>(); + fElements = new HashSet<>(); fElements.add(element); } diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/AbstractCache.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/AbstractCache.java index 615bc312c9c..a8cc47eddaa 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/AbstractCache.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/AbstractCache.java @@ -246,7 +246,7 @@ public abstract class AbstractCache<V> implements ICache<V> { synchronized (this) { if (fWaitingList instanceof RequestMonitor) { if (((RequestMonitor) fWaitingList).isCanceled()) { - canceledRms = new ArrayList<RequestMonitor>(1); + canceledRms = new ArrayList<>(1); canceledRms.add((RequestMonitor) fWaitingList); canceled = true; } else { @@ -259,7 +259,7 @@ public abstract class AbstractCache<V> implements ICache<V> { if (waitingList[i] != null) { if (waitingList[i].isCanceled()) { if (canceledRms == null) { - canceledRms = new ArrayList<RequestMonitor>(1); + canceledRms = new ArrayList<>(1); } canceledRms.add(waitingList[i]); } else { diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DefaultDsfExecutor.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DefaultDsfExecutor.java index 389b67fd4a2..74782ff5822 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DefaultDsfExecutor.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DefaultDsfExecutor.java @@ -147,7 +147,7 @@ public class DefaultDsfExecutor extends ScheduledThreadPoolExecutor implements D * an executable object was created. * <br>Note: Only used when tracing. */ - static Map<Thread, DefaultDsfExecutor> fThreadToExecutorMap = new HashMap<Thread, DefaultDsfExecutor>(); + static Map<Thread, DefaultDsfExecutor> fThreadToExecutorMap = new HashMap<>(); /** * Currently executing runnable/callable. @@ -434,7 +434,7 @@ public class DefaultDsfExecutor extends ScheduledThreadPoolExecutor implements D public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) { if (DEBUG_EXECUTOR || ASSERTIONS_ENABLED) { if (!(callable instanceof TracingWrapper)) { - callable = new TracingWrapperCallable<V>(callable); + callable = new TracingWrapperCallable<>(callable); } } return super.schedule(callable, delay, unit); @@ -485,7 +485,7 @@ public class DefaultDsfExecutor extends ScheduledThreadPoolExecutor implements D @Override public <T> Future<T> submit(Callable<T> callable) { if (DEBUG_EXECUTOR || ASSERTIONS_ENABLED) { - callable = new TracingWrapperCallable<T>(callable); + callable = new TracingWrapperCallable<>(callable); } return super.submit(callable); } diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DsfExecutable.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DsfExecutable.java index e2c6510d122..59fa2a736b1 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DsfExecutable.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DsfExecutable.java @@ -127,7 +127,7 @@ public class DsfExecutable { // constructor of this object. StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); Class<?> thisClass = getClass(); - Set<String> classNamesSet = new HashSet<String>(); + Set<String> classNamesSet = new HashSet<>(); while (thisClass != null) { classNamesSet.add(thisClass.getName()); thisClass = thisClass.getSuperclass(); diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/MultiRequestMonitor.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/MultiRequestMonitor.java index 4c88031e73f..541ee217d85 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/MultiRequestMonitor.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/MultiRequestMonitor.java @@ -129,7 +129,7 @@ public class MultiRequestMonitor<V extends RequestMonitor> extends RequestMonito */ public List<V> getRequestMonitors() { synchronized (fRequestMonitorList) { // needed while copying, even when list is a synchronized collection - return new LinkedList<V>(fRequestMonitorList); + return new LinkedList<>(fRequestMonitorList); } } diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RangeCache.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RangeCache.java index 298b4bc86dc..13bb598ff50 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RangeCache.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RangeCache.java @@ -135,7 +135,7 @@ abstract public class RangeCache<V> { * non-overlapping ranges of elements. */ - private SortedSet<Request> fRequests = new TreeSet<Request>(); + private SortedSet<Request> fRequests = new TreeSet<>(); public RangeCache(ImmediateInDsfExecutor executor) { fExecutor = executor; @@ -237,7 +237,7 @@ abstract public class RangeCache<V> { } private List<Request> getRequests(long fOffset, int fCount) { - List<Request> requests = new ArrayList<Request>(1); + List<Request> requests = new ArrayList<>(1); // Create a new request for the data to retrieve. Request current = new Request(fOffset, fCount); @@ -282,7 +282,7 @@ abstract public class RangeCache<V> { */ private Request adjustRequestTail(Request current, List<Request> transactionRequests, long offset, int count) { // Create a duplicate of the tailSet, in order to avoid a concurrent modification exception. - List<Request> tailSet = new ArrayList<Request>(fRequests.tailSet(current)); + List<Request> tailSet = new ArrayList<>(fRequests.tailSet(current)); // Iterate through the matching requests and add them to the requests list. for (Request tailRequest : tailSet) { @@ -318,7 +318,7 @@ abstract public class RangeCache<V> { } private List<V> makeElementsListFromRequests(List<Request> requests, long offset, int count) { - List<V> retVal = new ArrayList<V>(count); + List<V> retVal = new ArrayList<>(count); long index = offset; long end = offset + count; int requestIdx = 0; diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ReflectionSequence.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ReflectionSequence.java index ace6092de20..a1a8321fbcf 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ReflectionSequence.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ReflectionSequence.java @@ -224,7 +224,7 @@ abstract public class ReflectionSequence extends Sequence { private List<Step> getGroupSteps(String groupId, Map<String, Method> executeMethods, Map<String, Method> rollBackMethods) { - List<Step> steps = new ArrayList<Step>(executeMethods.size()); + List<Step> steps = new ArrayList<>(executeMethods.size()); String[] order = getExecutionOrder(groupId); if (order == null) { @@ -244,7 +244,7 @@ abstract public class ReflectionSequence extends Sequence { } private Map<String, Method> getAnnotatedMethods(Class<? extends Annotation> annotationType) { - Map<String, Method> retVal = new HashMap<String, Method>(); + Map<String, Method> retVal = new HashMap<>(); try { Method[] methods = getClass().getMethods(); for (Method method : methods) { diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RequestMonitor.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RequestMonitor.java index 16bc0c31854..7721adc7d75 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RequestMonitor.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RequestMonitor.java @@ -257,7 +257,7 @@ public class RequestMonitor extends DsfExecutable { */ public synchronized void addCancelListener(ICanceledListener listener) { if (fCancelListeners == null) { - fCancelListeners = new ArrayList<ICanceledListener>(1); + fCancelListeners = new ArrayList<>(1); } fCancelListeners.add(listener); } diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/DMContexts.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/DMContexts.java index b5dc17f266f..6701903e0e2 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/DMContexts.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/DMContexts.java @@ -59,11 +59,11 @@ public class DMContexts { } // Use a LinkedHashSet to avoid duplicates and preserver insertion-order - Set<IDMContext> nodes = new LinkedHashSet<IDMContext>(); + Set<IDMContext> nodes = new LinkedHashSet<>(); nodes.addAll(Arrays.asList(ctx.getParents())); while (nodes.isEmpty() == false) { Set<IDMContext> parents = nodes; - nodes = new LinkedHashSet<IDMContext>(); + nodes = new LinkedHashSet<>(); for (IDMContext parent : parents) { if (ancestorType.isAssignableFrom(parent.getClass())) { return (V) parent; @@ -149,12 +149,12 @@ public class DMContexts { return null; // Use a LinkedHashSet to avoid duplicates and preserver insertion-order - Set<V> requestedAncestors = new LinkedHashSet<V>(); - Set<IDMContext> nodes = new LinkedHashSet<IDMContext>(); + Set<V> requestedAncestors = new LinkedHashSet<>(); + Set<IDMContext> nodes = new LinkedHashSet<>(); nodes.add(ctx); while (nodes.isEmpty() == false) { Set<IDMContext> parents = nodes; - nodes = new LinkedHashSet<IDMContext>(); + nodes = new LinkedHashSet<>(); for (IDMContext parent : parents) { if (ancestorType.isAssignableFrom(parent.getClass())) { requestedAncestors.add((V) parent); @@ -209,7 +209,7 @@ public class DMContexts { * This method is implemented recursively, which is not necessarily * the most efficient way to do this. */ - List<IDMContext> list = new ArrayList<IDMContext>(); + List<IDMContext> list = new ArrayList<>(); list.add(dmc); for (IDMContext parentDmc : dmc.getParents()) { diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/internal/provisional/model/MemoryBlockRetrievalManager.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/internal/provisional/model/MemoryBlockRetrievalManager.java index 4d547c4b9f7..84775b9c9d5 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/internal/provisional/model/MemoryBlockRetrievalManager.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/internal/provisional/model/MemoryBlockRetrievalManager.java @@ -45,7 +45,7 @@ public class MemoryBlockRetrievalManager implements IMemoryBlockRetrievalManager private final String fModelId; private final DsfSession fSession; private final ILaunchConfiguration fLaunchConfig; - private final Map<IMemoryDMContext, IMemoryBlockRetrieval> fMapMemDMCToBlockRetrieval = new HashMap<IMemoryDMContext, IMemoryBlockRetrieval>(); + private final Map<IMemoryDMContext, IMemoryBlockRetrieval> fMapMemDMCToBlockRetrieval = new HashMap<>(); /** * Constructor diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlock.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlock.java index 50969a54027..527fe198a90 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlock.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlock.java @@ -76,7 +76,7 @@ public class DsfMemoryBlock extends PlatformObject implements IMemoryBlockExtens private String fUpdatePolicy = UPDATE_POLICY_AUTOMATIC; - private ArrayList<Object> fConnections = new ArrayList<Object>(); + private ArrayList<Object> fConnections = new ArrayList<>(); @SuppressWarnings("unused") private boolean isEnabled; diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlockRetrieval.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlockRetrieval.java index 410facbad34..2e8b9489b03 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlockRetrieval.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlockRetrieval.java @@ -253,7 +253,7 @@ public class DsfMemoryBlockRetrieval extends PlatformObject implements IMemoryBl // Process the block list specific to this memory context // FIXME: (Bug228573) We only process the first entry... if (root.getAttribute(ATTR_EXPRESSION_LIST_CONTEXT).equals(fContextString)) { - List<IMemoryBlock> blocks = new ArrayList<IMemoryBlock>(); + List<IMemoryBlock> blocks = new ArrayList<>(); NodeList expressionList = root.getChildNodes(); int length = expressionList.getLength(); for (int i = 0; i < length; ++i) { diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator.java index b687727e93b..380e167384d 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator.java @@ -99,7 +99,7 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi * - Modified on breakpointChanged() * - Diminished on breakpointRemoved() */ - private Map<IBreakpointsTargetDMContext, Map<IBreakpoint, List<Map<String, Object>>>> fPlatformBPs = new HashMap<IBreakpointsTargetDMContext, Map<IBreakpoint, List<Map<String, Object>>>>(); + private Map<IBreakpointsTargetDMContext, Map<IBreakpoint, List<Map<String, Object>>>> fPlatformBPs = new HashMap<>(); /** * Holds the mapping from platform breakpoint to the corresponding target @@ -111,19 +111,19 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi * - A platform breakpoint is added/removed * - A thread filter is applied/removed */ - private Map<IBreakpointsTargetDMContext, Map<IBreakpoint, List<IBreakpointDMContext>>> fBreakpointDMContexts = new HashMap<IBreakpointsTargetDMContext, Map<IBreakpoint, List<IBreakpointDMContext>>>(); + private Map<IBreakpointsTargetDMContext, Map<IBreakpoint, List<IBreakpointDMContext>>> fBreakpointDMContexts = new HashMap<>(); /** * Due to the very asynchronous nature of DSF, a new breakpoint request can * pop up at any time before an ongoing one is completed. The following set * is used to store requests until the ongoing operation completes. */ - private Set<IBreakpoint> fPendingRequests = new HashSet<IBreakpoint>(); + private Set<IBreakpoint> fPendingRequests = new HashSet<>(); /** * @see fPendingRequests */ - private Set<IBreakpoint> fPendingBreakpoints = new HashSet<IBreakpoint>(); + private Set<IBreakpoint> fPendingBreakpoints = new HashSet<>(); /////////////////////////////////////////////////////////////////////////// // AbstractDsfService @@ -203,7 +203,7 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi // We have to make a copy of the fPlatformBPs keys because uninstallBreakpoints() // modifies the map as it walks through it. - List<IBreakpointsTargetDMContext> platformBPKeysCopy = new ArrayList<IBreakpointsTargetDMContext>( + List<IBreakpointsTargetDMContext> platformBPKeysCopy = new ArrayList<>( fPlatformBPs.size()); platformBPKeysCopy.addAll(0, fPlatformBPs.keySet()); for (IBreakpointsTargetDMContext dmc : platformBPKeysCopy) { @@ -274,7 +274,7 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi // Read initial breakpoints from platform. Copy the breakpoint attributes into a local map. // Note that we cannot write data into fPlatformBPs table here directly because we are not // executing on the dispatch thread. - final Map<IBreakpoint, List<Map<String, Object>>> initialPlatformBPs = new HashMap<IBreakpoint, List<Map<String, Object>>>(); + final Map<IBreakpoint, List<Map<String, Object>>> initialPlatformBPs = new HashMap<>(); try { // Get the stored breakpoint list from the platform BreakpointManager IBreakpoint[] bps = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(); @@ -441,7 +441,7 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi protected void handleCompleted() { List<IBreakpointDMContext> list = breakpointIDs.get(breakpoint); if (list == null) { - list = new LinkedList<IBreakpointDMContext>(); + list = new LinkedList<>(); breakpointIDs.put(breakpoint, list); } @@ -567,19 +567,19 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi } // Get the list of corresponding back-end breakpoints - final List<IBreakpointDMContext> oldBpContexts = new ArrayList<IBreakpointDMContext>( + final List<IBreakpointDMContext> oldBpContexts = new ArrayList<>( breakpointIDs.get(breakpoint)); // Calculate the list of attributes maps that have not changed. // Immediately add these to the list of new breakpoint contexts, // and remove them from further breakpoint attribute comparisons. final List<Map<String, Object>> commonAttrsList = getCommonAttributeMaps(newAttrsList0, oldAttrsList0); - final List<IBreakpointDMContext> newBpContexts = new ArrayList<IBreakpointDMContext>(commonAttrsList.size()); + final List<IBreakpointDMContext> newBpContexts = new ArrayList<>(commonAttrsList.size()); - final List<Map<String, Object>> newAttrsList = new ArrayList<Map<String, Object>>(newAttrsList0); + final List<Map<String, Object>> newAttrsList = new ArrayList<>(newAttrsList0); newAttrsList.removeAll(commonAttrsList); - List<Map<String, Object>> oldAttrsList = new ArrayList<Map<String, Object>>(oldAttrsList0); + List<Map<String, Object>> oldAttrsList = new ArrayList<>(oldAttrsList0); for (int i = 0; i < oldAttrsList.size(); i++) { if (commonAttrsList.contains(oldAttrsList.get(i))) { if (oldBpContexts.size() > i) { @@ -685,8 +685,8 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi private List<Map<String, Object>> getCommonAttributeMaps(List<Map<String, Object>> array1, List<Map<String, Object>> array2) { - List<Map<String, Object>> intersection = new LinkedList<Map<String, Object>>(); - List<Map<String, Object>> list2 = new ArrayList<Map<String, Object>>(array2); + List<Map<String, Object>> intersection = new LinkedList<>(); + List<Map<String, Object>> list2 = new ArrayList<>(array2); for (Map<String, Object> array1Map : array1) { if (list2.remove(array1Map)) { intersection.add(array1Map); @@ -704,7 +704,7 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi */ private List<Map<String, Object>> getAttributesDeltas(List<Map<String, Object>> oldAttributesList, List<Map<String, Object>> newAttributesList) { - List<Map<String, Object>> deltas = new ArrayList<Map<String, Object>>(oldAttributesList.size()); + List<Map<String, Object>> deltas = new ArrayList<>(oldAttributesList.size()); // Go through the bp attributes common to the old and the new lists and calculate // their deltas. @@ -712,16 +712,16 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi Map<String, Object> oldAttributes = oldAttributesList.get(i); Map<String, Object> newAttributes = newAttributesList.get(i); - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); Set<String> oldKeySet = oldAttributes.keySet(); Set<String> newKeySet = newAttributes.keySet(); - Set<String> commonKeys = new HashSet<String>(newKeySet); + Set<String> commonKeys = new HashSet<>(newKeySet); commonKeys.retainAll(oldKeySet); - Set<String> addedKeys = new HashSet<String>(newKeySet); + Set<String> addedKeys = new HashSet<>(newKeySet); addedKeys.removeAll(oldKeySet); - Set<String> removedKeys = new HashSet<String>(oldKeySet); + Set<String> removedKeys = new HashSet<>(oldKeySet); removedKeys.removeAll(newKeySet); // Add the modified attributes diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator2.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator2.java index 3cc49fe4c85..dac53b96c55 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator2.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator2.java @@ -186,13 +186,13 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo * - Modified on breakpointChanged() * - Diminished on breakpointRemoved() */ - private Map<IBreakpointsTargetDMContext, Map<IBreakpoint, List<ITargetBreakpointInfo>>> fPlatformBPs = new HashMap<IBreakpointsTargetDMContext, Map<IBreakpoint, List<ITargetBreakpointInfo>>>(); + private Map<IBreakpointsTargetDMContext, Map<IBreakpoint, List<ITargetBreakpointInfo>>> fPlatformBPs = new HashMap<>(); /** * BreakpointsTargetDMContext's that are being removed from {@link #fPlatformBPs}. * See where this is used for more. */ - private List<IBreakpointsTargetDMContext> fBPTargetDMCsBeingRemoved = new ArrayList<IBreakpoints.IBreakpointsTargetDMContext>(); + private List<IBreakpointsTargetDMContext> fBPTargetDMCsBeingRemoved = new ArrayList<>(); /** * Mapping of platform breakpoints to all their attributes (standard ones and @@ -202,7 +202,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo * 2. updated in breakpointsChanged(); <br> * 3. diminished in breakpointsRemoved(); */ - private Map<IBreakpoint, Map<String, Object>> fBreakpointAttributes = new HashMap<IBreakpoint, Map<String, Object>>(); + private Map<IBreakpoint, Map<String, Object>> fBreakpointAttributes = new HashMap<>(); /** * Hold info about a breakpoint events (added, removed, changed) for later @@ -239,9 +239,9 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo * pop up at any time before an ongoing one is completed. The following set * is used to store requests until the ongoing operation completes. */ - private Set<IBreakpoint> fRunningEvents = new HashSet<IBreakpoint>(); + private Set<IBreakpoint> fRunningEvents = new HashSet<>(); - private Map<IBreakpoint, LinkedList<PendingEventInfo>> fPendingEvents = new HashMap<IBreakpoint, LinkedList<PendingEventInfo>>(); + private Map<IBreakpoint, LinkedList<PendingEventInfo>> fPendingEvents = new HashMap<>(); /////////////////////////////////////////////////////////////////////////// // AbstractDsfService @@ -319,7 +319,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo // We have to make a copy of the fPlatformBPs keys because uninstallBreakpoints() // modifies the map as it walks through it. - List<IBreakpointsTargetDMContext> platformBPKeysCopy = new ArrayList<IBreakpointsTargetDMContext>( + List<IBreakpointsTargetDMContext> platformBPKeysCopy = new ArrayList<>( fPlatformBPs.size()); platformBPKeysCopy.addAll(0, fPlatformBPs.keySet()); for (IBreakpointsTargetDMContext dmc : platformBPKeysCopy) { @@ -522,12 +522,12 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo // Ensure the breakpoint is not already installed assert !platformBPs.containsKey(breakpoint); - final ArrayList<TargetBP> targetBPsAttempted = new ArrayList<TargetBP>(attrsList.size()); + final ArrayList<TargetBP> targetBPsAttempted = new ArrayList<>(attrsList.size()); for (int i = 0; i < attrsList.size(); i++) { targetBPsAttempted.add(new TargetBP(attrsList.get(i))); } - final ArrayList<ITargetBreakpointInfo> targetBPsInstalled = new ArrayList<ITargetBreakpointInfo>( + final ArrayList<ITargetBreakpointInfo> targetBPsInstalled = new ArrayList<>( attrsList.size()); // Update the breakpoint status when all back-end breakpoints have been installed @@ -663,7 +663,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo getExecutor().execute(new DsfRunnable() { @Override public void run() { - Collection<IBreakpointsTargetDMContext> dmcs = new ArrayList<IBreakpointsTargetDMContext>(); + Collection<IBreakpointsTargetDMContext> dmcs = new ArrayList<>(); if (bpsTargetDmc == null) dmcs.addAll(fPlatformBPs.keySet()); else @@ -690,7 +690,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo * @return */ private PlatformBreakpointInfo[] collectBreakpointsInfo(IBreakpoint[] bps) { - List<PlatformBreakpointInfo> bpsInfo = new ArrayList<PlatformBreakpointInfo>(bps.length); + List<PlatformBreakpointInfo> bpsInfo = new ArrayList<>(bps.length); for (IBreakpoint bp : bps) { if (bp.getMarker() == null) @@ -713,7 +713,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo private void doBreakpointsAddedInExecutor(PlatformBreakpointInfo[] bpsInfo, Collection<IBreakpointsTargetDMContext> bpTargetDMCs, final RequestMonitor rm) { - final Map<IBreakpoint, Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]>> eventBPs = new HashMap<IBreakpoint, Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]>>( + final Map<IBreakpoint, Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]>> eventBPs = new HashMap<>( bpsInfo.length, 1); CountingRequestMonitor processPendingCountingRm = new CountingRequestMonitor(getExecutor(), rm) { @@ -738,7 +738,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo int processPendingCountingRmCount = 0; for (final PlatformBreakpointInfo bpinfo : bpsInfo) { - final Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]> targetBPs = new HashMap<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]>( + final Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]> targetBPs = new HashMap<>( fPlatformBPs.size(), 1); eventBPs.put(bpinfo.breakpoint, targetBPs); @@ -780,7 +780,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo // disabled breakpoint. If not, just bail out. // if (!bpinfo.enabled) { - Map<String, Object> attr = new HashMap<String, Object>(1); + Map<String, Object> attr = new HashMap<>(1); attr.put(IBreakpoint.ENABLED, Boolean.FALSE); Map<String, Object> targetEnablementAttr = fAttributeTranslator2.convertAttributes(attr); if (!fAttributeTranslator2.canUpdateAttributes(bpinfo.breakpoint, dmc, targetEnablementAttr)) { @@ -834,7 +834,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo getExecutor().execute(new DsfRunnable() { @Override public void run() { - Map<String, Object> tmp = new HashMap<String, Object>(1); + Map<String, Object> tmp = new HashMap<>(1); tmp.put(IBreakpoint.ENABLED, true); final String targetEnablementKey = fAttributeTranslator2.convertAttributes(tmp).keySet().iterator() .next(); @@ -859,9 +859,9 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo if (attrDelta.size() == 0) continue; - final List<IBreakpointsTargetDMContext> reinstallContexts = new ArrayList<IBreakpointsTargetDMContext>(); + final List<IBreakpointsTargetDMContext> reinstallContexts = new ArrayList<>(); - List<IBreakpointsTargetDMContext> updateContexts = new ArrayList<IBreakpointsTargetDMContext>(); + List<IBreakpointsTargetDMContext> updateContexts = new ArrayList<>(); // Now change the breakpoint for each known context. // @@ -987,7 +987,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo private void doBreakpointsRemoved(final IBreakpoint[] bps, final IBreakpointsTargetDMContext bpsTargetDmc, final RequestMonitor rm) { - final List<IBreakpoint> bpCandidates = new ArrayList<IBreakpoint>(); + final List<IBreakpoint> bpCandidates = new ArrayList<>(); for (int i = 0; i < bps.length; i++) { IBreakpoint bp = bps[i]; @@ -1007,7 +1007,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo getExecutor().execute(new DsfRunnable() { @Override public void run() { - Collection<IBreakpointsTargetDMContext> contexts = new ArrayList<IBreakpointsTargetDMContext>(); + Collection<IBreakpointsTargetDMContext> contexts = new ArrayList<>(); if (bpsTargetDmc == null) contexts.addAll(fPlatformBPs.keySet()); else @@ -1032,7 +1032,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo private void doBreakpointsRemovedInExecutor(IBreakpoint[] bpCandidates, Collection<IBreakpointsTargetDMContext> targetContexts, final RequestMonitor rm) { - final Map<IBreakpoint, Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]>> eventBPs = new HashMap<IBreakpoint, Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]>>( + final Map<IBreakpoint, Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]>> eventBPs = new HashMap<>( bpCandidates.length, 1); CountingRequestMonitor processPendingCountingRm = new CountingRequestMonitor(getExecutor(), rm) { @@ -1068,7 +1068,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo processPendingCountingRmCount++; - final Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]> targetBPs = new HashMap<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]>( + final Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]> targetBPs = new HashMap<>( fPlatformBPs.size(), 1); eventBPs.put(breakpoint, targetBPs); @@ -1116,7 +1116,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo private void updatePendingRequest(IBreakpoint breakpoint, PendingEventInfo pendingEvent) { LinkedList<PendingEventInfo> pendingEventsList = fPendingEvents.get(breakpoint); if (pendingEventsList == null) { - pendingEventsList = new LinkedList<PendingEventInfo>(); + pendingEventsList = new LinkedList<>(); fPendingEvents.put(breakpoint, pendingEventsList); } if (!pendingEventsList.isEmpty() && pendingEventsList.getLast().fEventType == BreakpointEventType.MODIFIED) { @@ -1136,7 +1136,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo // Make a copy to avoid ConcurrentModificationException // as we are deleting element in the loop. - Set<IBreakpoint> bpsInPendingEvents = new HashSet<IBreakpoint>(fPendingEvents.keySet()); + Set<IBreakpoint> bpsInPendingEvents = new HashSet<>(fPendingEvents.keySet()); for (IBreakpoint bp : bpsInPendingEvents) { if (!fRunningEvents.contains(bp)) { LinkedList<PendingEventInfo> eventInfoList = fPendingEvents.get(bp); @@ -1192,16 +1192,16 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo private Map<String, Object> getAttributesDelta(Map<String, Object> oldAttributes, Map<String, Object> newAttributes) { - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); Set<String> oldKeySet = oldAttributes.keySet(); Set<String> newKeySet = newAttributes.keySet(); - Set<String> commonKeys = new HashSet<String>(newKeySet); + Set<String> commonKeys = new HashSet<>(newKeySet); commonKeys.retainAll(oldKeySet); - Set<String> addedKeys = new HashSet<String>(newKeySet); + Set<String> addedKeys = new HashSet<>(newKeySet); addedKeys.removeAll(oldKeySet); - Set<String> removedKeys = new HashSet<String>(oldKeySet); + Set<String> removedKeys = new HashSet<>(oldKeySet); removedKeys.removeAll(newKeySet); // Add the modified attributes diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/BufferedCommandControl.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/BufferedCommandControl.java index b270e02c6ca..c4c34521cd7 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/BufferedCommandControl.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/BufferedCommandControl.java @@ -84,8 +84,8 @@ public class BufferedCommandControl implements ICommandControl { } }; - private final List<ICommandListener> fCommandProcessors = new ArrayList<ICommandListener>(); - private final List<IEventListener> fEventProcessors = new ArrayList<IEventListener>(); + private final List<ICommandListener> fCommandProcessors = new ArrayList<>(); + private final List<IEventListener> fEventProcessors = new ArrayList<>(); public BufferedCommandControl(ICommandControl controlDelegate, DsfExecutor executor, int depth) { fControlDelegate = controlDelegate; diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/CommandCache.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/CommandCache.java index 024006f48c6..b400275a6a8 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/CommandCache.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/CommandCache.java @@ -84,7 +84,7 @@ public class CommandCache implements ICommandListener { public CommandInfo(CommandStyle cmdstyle, ICommand<ICommandResult> cmd, DataRequestMonitor<ICommandResult> rm) { fCmdStyle = cmdstyle; fCommand = cmd; - fCurrentRequestMonitors = new LinkedList<DataRequestMonitor<ICommandResult>>(); + fCurrentRequestMonitors = new LinkedList<>(); fCurrentRequestMonitors.add(rm); fCoalescedCmd = null; } @@ -186,15 +186,15 @@ public class CommandCache implements ICommandListener { * created. When the coalesced commands completes the results will be decomposed * when back into individual results from this command. */ - private Set<IDMContext> fAvailableContexts = new HashSet<IDMContext>(); + private Set<IDMContext> fAvailableContexts = new HashSet<>(); - private Map<IDMContext, HashMap<CommandInfo, CommandResultInfo>> fCachedContexts = new HashMap<IDMContext, HashMap<CommandInfo, CommandResultInfo>>(); + private Map<IDMContext, HashMap<CommandInfo, CommandResultInfo>> fCachedContexts = new HashMap<>(); - private ArrayList<CommandInfo> fPendingQCommandsSent = new ArrayList<CommandInfo>(); + private ArrayList<CommandInfo> fPendingQCommandsSent = new ArrayList<>(); - private ArrayList<CommandInfo> fPendingQCommandsNotYetSent = new ArrayList<CommandInfo>(); + private ArrayList<CommandInfo> fPendingQCommandsNotYetSent = new ArrayList<>(); - private ArrayList<CommandInfo> fPendingQWaitingForCoalescedCompletion = new ArrayList<CommandInfo>(); + private ArrayList<CommandInfo> fPendingQWaitingForCoalescedCompletion = new ArrayList<>(); private static boolean DEBUG = false; private static final String CACHE_TRACE_IDENTIFIER = " [CHE]"; //$NON-NLS-1$ @@ -261,7 +261,7 @@ public class CommandCache implements ICommandListener { */ private CommandInfo getCoalescedCommand(CommandInfo cmd) { - for (CommandInfo currentUnsentEntry : new ArrayList<CommandInfo>(fPendingQCommandsNotYetSent)) { + for (CommandInfo currentUnsentEntry : new ArrayList<>(fPendingQCommandsNotYetSent)) { /* * Get the current unsent entry to determine if we can coalesced with it. */ @@ -287,7 +287,7 @@ public class CommandCache implements ICommandListener { * them to point to the new super command. */ - for (CommandInfo waitingEntry : new ArrayList<CommandInfo>( + for (CommandInfo waitingEntry : new ArrayList<>( fPendingQWaitingForCoalescedCompletion)) { if (waitingEntry.getCoalescedCmd() == currentUnsentEntry) { @@ -469,7 +469,7 @@ public class CommandCache implements ICommandListener { * we create a new result from the coalesced command for it. */ - for (CommandInfo waitingEntry : new ArrayList<CommandInfo>( + for (CommandInfo waitingEntry : new ArrayList<>( fPendingQWaitingForCoalescedCompletion)) { if (waitingEntry.getCoalescedCmd() == finalCachedCmd) { @@ -487,7 +487,7 @@ public class CommandCache implements ICommandListener { if (fCachedContexts.get(context) != null) { fCachedContexts.get(context).put(waitingEntry, subResultInfo); } else { - HashMap<CommandInfo, CommandResultInfo> map = new HashMap<CommandInfo, CommandResultInfo>(); + HashMap<CommandInfo, CommandResultInfo> map = new HashMap<>(); map.put(waitingEntry, subResultInfo); fCachedContexts.put(context, map); } @@ -529,7 +529,7 @@ public class CommandCache implements ICommandListener { if (fCachedContexts.get(context) != null) { fCachedContexts.get(context).put(finalCachedCmd, resultInfo); } else { - HashMap<CommandInfo, CommandResultInfo> map = new HashMap<CommandInfo, CommandResultInfo>(); + HashMap<CommandInfo, CommandResultInfo> map = new HashMap<>(); map.put(finalCachedCmd, resultInfo); fCachedContexts.put(context, map); } @@ -649,7 +649,7 @@ public class CommandCache implements ICommandListener { // instead of only using 'cachedCmd'. This is because although cachedCmd can be considered // equal to unqueuedCommand, it is not identical and we need the full content of unqueuedCommand. // For instance, cachedCmd does not have the list of requestMonitors that unqueuedCommand has. - for (CommandInfo unqueuedCommand : new ArrayList<CommandInfo>(fPendingQCommandsNotYetSent)) { + for (CommandInfo unqueuedCommand : new ArrayList<>(fPendingQCommandsNotYetSent)) { if (unqueuedCommand.equals(cachedCmd)) { fPendingQCommandsNotYetSent.remove(unqueuedCommand); fPendingQCommandsSent.add(unqueuedCommand); diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/sourcelookup/DsfSourceLookupParticipant.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/sourcelookup/DsfSourceLookupParticipant.java index 79494a842dd..e078b8d3bdd 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/sourcelookup/DsfSourceLookupParticipant.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/sourcelookup/DsfSourceLookupParticipant.java @@ -86,7 +86,7 @@ public class DsfSourceLookupParticipant extends AbstractSourceLookupParticipant if (results != null) { return results.toArray(); } else { - results = new ArrayList<Object>(); + results = new ArrayList<>(); } ISourceContainer[] containers = getSourceContainers(); // if there is no containers, we can default to absolute path, since we should be able resolve file by absolute path diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java index 01bcd626a56..c31f32014e6 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java @@ -169,7 +169,7 @@ abstract public class AbstractDsfService implements IDsfService, IDsfStatusConst String[] previousClasses = (String[]) fRegistration.getReference().getProperty(Constants.OBJECTCLASS); // Use a HashSet to avoid duplicates - Set<String> newClasses = new HashSet<String>(); + Set<String> newClasses = new HashSet<>(); newClasses.addAll(Arrays.asList(previousClasses)); newClasses.addAll(Arrays.asList(classes)); classes = newClasses.toArray(new String[0]); diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/DsfSession.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/DsfSession.java index 3e4624a6e63..13d3c831bfc 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/DsfSession.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/DsfSession.java @@ -287,7 +287,7 @@ public class DsfSession { private int fServiceInstanceCounter; /** Map of registered event listeners. */ - private Map<ListenerEntry, Method[]> fListeners = new HashMap<ListenerEntry, Method[]>(); + private Map<ListenerEntry, Method[]> fListeners = new HashMap<>(); /** * Map of registered adapters, for implementing the <code>IDMContext.getAdapter()</code> @@ -485,7 +485,7 @@ public class DsfSession { Dictionary<String, ?> serviceProperties = (Dictionary<String, ?>) _serviceProperties; // Build a list of listeners; - SortedMap<ListenerEntry, List<Method>> listeners = new TreeMap<ListenerEntry, List<Method>>( + SortedMap<ListenerEntry, List<Method>> listeners = new TreeMap<>( new Comparator<ListenerEntry>() { @Override public int compare(ListenerEntry o1, ListenerEntry o2) { @@ -517,7 +517,7 @@ public class DsfSession { continue; } Method[] allMethods = entry.getValue(); - List<Method> matchingMethods = new ArrayList<Method>(); + List<Method> matchingMethods = new ArrayList<>(); for (Method method : allMethods) { assert method.getParameterTypes().length > 0 : eventClass.getName() + "." + method.getName() //$NON-NLS-1$ + " signature contains zero parameters"; //$NON-NLS-1$ @@ -570,7 +570,7 @@ public class DsfSession { * @return the collection of handler methods */ private Method[] getEventHandlerMethods(Object listener) { - List<Method> retVal = new ArrayList<Method>(); + List<Method> retVal = new ArrayList<>(); try { Method[] methods = listener.getClass().getMethods(); for (Method method : methods) { diff --git a/dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/PDAUIPlugin.java b/dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/PDAUIPlugin.java index 5bc21b14b4c..0587e5d684e 100644 --- a/dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/PDAUIPlugin.java +++ b/dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/PDAUIPlugin.java @@ -64,7 +64,7 @@ public class PDAUIPlugin extends AbstractUIPlugin implements ILaunchesListener2 /** * Managed colors */ - private Map<RGB, Color> fColors = new HashMap<RGB, Color>(); + private Map<RGB, Color> fColors = new HashMap<>(); /** * Active adapter sets. They are accessed using the DSF session ID @@ -85,7 +85,7 @@ public class PDAUIPlugin extends AbstractUIPlugin implements ILaunchesListener2 * instance. * </p> */ - private Map<ILaunch, Object> fDisposedSessionAdapterSets = new WeakHashMap<ILaunch, Object>(); + private Map<ILaunch, Object> fDisposedSessionAdapterSets = new WeakHashMap<>(); private void disposeAdapterSet(PDALaunch launch) { String sessionId = launch.getSession().getId(); diff --git a/dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/editor/PDAContentAssistProcessor.java b/dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/editor/PDAContentAssistProcessor.java index 668e9174f1d..6ccdf38a59c 100644 --- a/dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/editor/PDAContentAssistProcessor.java +++ b/dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/editor/PDAContentAssistProcessor.java @@ -46,7 +46,7 @@ public class PDAContentAssistProcessor implements IContentAssistProcessor { } } - List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(); + List<ICompletionProposal> proposals = new ArrayList<>(); String[] keywords = PDAScanner.fgKeywords; if (prefix.length() > 0) { String word = prefix.toString(); diff --git a/dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/viewmodel/PDAExpressionVMProvider.java b/dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/viewmodel/PDAExpressionVMProvider.java index cf09d97bf7d..4c750ffccf2 100644 --- a/dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/viewmodel/PDAExpressionVMProvider.java +++ b/dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/viewmodel/PDAExpressionVMProvider.java @@ -92,10 +92,10 @@ public class PDAExpressionVMProvider extends ExpressionVMProvider implements IEl if (p instanceof SimpleMapPersistable) { persistable = (SimpleMapPersistable<String>) p; } else { - persistable = new SimpleMapPersistable<String>(String.class); + persistable = new SimpleMapPersistable<>(String.class); context.setProperty(myPersistId, persistable); } - ArrayList<IDMVMContext> changed = new ArrayList<IDMVMContext>(elementPath.length); + ArrayList<IDMVMContext> changed = new ArrayList<>(elementPath.length); for (int i = 0; i < elementPath.length; i++) { Object x = elementPath[i].getLastSegment(); if (x instanceof VariableVMNode.VariableExpressionVMC) { diff --git a/dsf/org.eclipse.cdt.examples.dsf.pda/pdavm/src/org/eclipse/cdt/examples/pdavm/PDAVirtualMachine.java b/dsf/org.eclipse.cdt.examples.dsf.pda/pdavm/src/org/eclipse/cdt/examples/pdavm/PDAVirtualMachine.java index f2896d0918f..bcc5a30c6bb 100644 --- a/dsf/org.eclipse.cdt.examples.dsf.pda/pdavm/src/org/eclipse/cdt/examples/pdavm/PDAVirtualMachine.java +++ b/dsf/org.eclipse.cdt.examples.dsf.pda/pdavm/src/org/eclipse/cdt/examples/pdavm/PDAVirtualMachine.java @@ -59,7 +59,7 @@ public class PDAVirtualMachine { String fName; String fGroup = "<no_group>"; boolean fIsWriteable = true; - Map<String, BitField> fBitFields = new LinkedHashMap<String, BitField>(0); + Map<String, BitField> fBitFields = new LinkedHashMap<>(0); int fValue; } @@ -71,10 +71,10 @@ public class PDAVirtualMachine { String fName; int fBitOffset; int fBitCount; - Map<String, Integer> fMnemonics = new LinkedHashMap<String, Integer>(0); + Map<String, Integer> fMnemonics = new LinkedHashMap<>(0); } - Map<String, Register> fRegisters = new LinkedHashMap<String, Register>(0); + Map<String, Register> fRegisters = new LinkedHashMap<>(0); class Args { final String[] fArgs; @@ -141,7 +141,7 @@ public class PDAVirtualMachine { Map<String, Integer> fThreadLabels; /** The stack of stack frames (the control stack) */ - final List<Frame> fFrames = new LinkedList<Frame>(); + final List<Frame> fFrames = new LinkedList<>(); /** Current stack frame (not includced in fFrames) */ Frame fCurrentFrame; @@ -170,7 +170,7 @@ public class PDAVirtualMachine { } } - final Map<Integer, PDAThread> fThreads = new LinkedHashMap<Integer, PDAThread>(); + final Map<Integer, PDAThread> fThreads = new LinkedHashMap<>(); int fNextThreadId = 1; @@ -186,7 +186,7 @@ public class PDAVirtualMachine { /** Each stack frame is a mapping of variable names to values. */ class Frame { - final Map<String, Object> fLocalVariables = new LinkedHashMap<String, Object>(); + final Map<String, Object> fLocalVariables = new LinkedHashMap<>(); /** * The name of the function in this frame @@ -327,7 +327,7 @@ public class PDAVirtualMachine { * Breakpoints are stored per each each line of code. The boolean indicates * whether the whole VM should suspend or just the triggering thread. */ - final Map<Integer, Boolean> fBreakpoints = new HashMap<Integer, Boolean>(); + final Map<Integer, Boolean> fBreakpoints = new HashMap<>(); /** * The suspend flag is true if the VM should suspend running the program and @@ -373,7 +373,7 @@ public class PDAVirtualMachine { OutputStream fEventStream; /** The eventstops table holds which events cause suspends and which do not. */ - final Map<String, Boolean> fEventStops = new HashMap<String, Boolean>(); + final Map<String, Boolean> fEventStops = new HashMap<>(); { fEventStops.put("unimpinstr", false); fEventStops.put("nosuchlabel", false); @@ -389,7 +389,7 @@ public class PDAVirtualMachine { * <li>N = 2 is write watch</li> * <li>N = 3 is both, etc.</li> */ - final Map<String, Integer> fWatchpoints = new HashMap<String, Integer>(); + final Map<String, Integer> fWatchpoints = new HashMap<>(); public static void main(String[] args) { String programFile = args.length >= 1 ? args[0] : null; @@ -438,7 +438,7 @@ public class PDAVirtualMachine { // Load all the code into memory try (FileReader fileReader = new FileReader(inputFile)) { StringWriter stringWriter = new StringWriter(); - List<String> code = new LinkedList<String>(); + List<String> code = new LinkedList<>(); int c = fileReader.read(); while (c != -1) { if (c == '\n') { @@ -464,7 +464,7 @@ public class PDAVirtualMachine { * Initializes the labels map */ Map<String, Integer> mapLabels(String[] code) { - Map<String, Integer> labels = new HashMap<String, Integer>(); + Map<String, Integer> labels = new HashMap<>(); for (int i = 0; i < code.length; i++) { if (code[i].length() != 0 && code[i].charAt(0) == ':') { labels.put(code[i].substring(1), i); @@ -597,7 +597,7 @@ public class PDAVirtualMachine { void doOneInstruction(PDAThread thread, String instr) { StringTokenizer tokenizer = new StringTokenizer(instr); String op = tokenizer.nextToken(); - List<String> tokens = new LinkedList<String>(); + List<String> tokens = new LinkedList<>(); while (tokenizer.hasMoreTokens()) { tokens.add(tokenizer.nextToken()); } @@ -749,7 +749,7 @@ public class PDAVirtualMachine { } String command = tokenizer.nextToken(); - List<String> tokens = new LinkedList<String>(); + List<String> tokens = new LinkedList<>(); while (tokenizer.hasMoreTokens()) { tokens.add(tokenizer.nextToken()); } @@ -827,7 +827,7 @@ public class PDAVirtualMachine { Frame frame = sfnumber >= thread.fFrames.size() ? thread.fCurrentFrame : thread.fFrames.get(sfnumber); String varDot = var + "."; - List<String> children = new ArrayList<String>(); + List<String> children = new ArrayList<>(); for (String localVar : frame.fLocalVariables.keySet()) { if (localVar.startsWith(varDot) && localVar.indexOf('.', varDot.length() + 1) == -1) { children.add(localVar); @@ -985,7 +985,7 @@ public class PDAVirtualMachine { } void debugGroups(Args args) { - TreeSet<String> groups = new TreeSet<String>(); + TreeSet<String> groups = new TreeSet<>(); for (Register reg : fRegisters.values()) { groups.add(reg.fGroup); } diff --git a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDABackend.java b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDABackend.java index bb702a0d524..b9426f7698f 100644 --- a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDABackend.java +++ b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDABackend.java @@ -224,7 +224,7 @@ public class PDABackend extends AbstractDsfService { private Process launchPDABackendDebugger() throws CoreException { - List<String> commandList = new ArrayList<String>(); + List<String> commandList = new ArrayList<>(); // Get Java VM path String javaVMHome = System.getProperty("java.home"); diff --git a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDABreakpointAttributeTranslator.java b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDABreakpointAttributeTranslator.java index c1d577bd1ce..0a8bc97152a 100644 --- a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDABreakpointAttributeTranslator.java +++ b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDABreakpointAttributeTranslator.java @@ -80,7 +80,7 @@ public class PDABreakpointAttributeTranslator implements IBreakpointAttributeTra private List<Map<String, Object>> getCBreakpointAttributes(ICLineBreakpoint bp, boolean bpManagerEnabled) throws CoreException { - Map<String, Object> attrs = new HashMap<String, Object>(); + Map<String, Object> attrs = new HashMap<>(); // Check that the marker exists and retrieve its attributes. // Due to accepted race conditions, the breakpiont marker may become null @@ -108,14 +108,14 @@ public class PDABreakpointAttributeTranslator implements IBreakpointAttributeTra // The breakpoint mediator allows for multiple target-side breakpoints // to be created for each IDE breakpoint. Although in case of PDA this // feature is never used, we still have to return a list of attributes. - List<Map<String, Object>> retVal = new ArrayList<Map<String, Object>>(1); + List<Map<String, Object>> retVal = new ArrayList<>(1); retVal.add(attrs); return retVal; } private List<Map<String, Object>> getCWatchpointAttributes(ICWatchpoint bp, boolean bpManagerEnabled) throws CoreException { - Map<String, Object> attrs = new HashMap<String, Object>(); + Map<String, Object> attrs = new HashMap<>(); // Check that the marker exists and retrieve its attributes. // Due to accepted race conditions, the breakpiont marker may become null @@ -146,14 +146,14 @@ public class PDABreakpointAttributeTranslator implements IBreakpointAttributeTra // The breakpoint mediator allows for multiple target-side breakpoints // to be created for each IDE breakpoint. Although in case of PDA this // feature is never used, we still have to return a list of attributes. - List<Map<String, Object>> retVal = new ArrayList<Map<String, Object>>(1); + List<Map<String, Object>> retVal = new ArrayList<>(1); retVal.add(attrs); return retVal; } private List<Map<String, Object>> getPDABreakpointAttributes(IBreakpoint bp, boolean bpManagerEnabled) throws CoreException { - Map<String, Object> attrs = new HashMap<String, Object>(); + Map<String, Object> attrs = new HashMap<>(); // Check that the marker exists and retrieve its attributes. // Due to accepted race conditions, the breakpiont marker may become null @@ -187,7 +187,7 @@ public class PDABreakpointAttributeTranslator implements IBreakpointAttributeTra // The breakpoint mediator allows for multiple target-side breakpoints // to be created for each IDE breakpoint. Although in case of PDA this // feature is never used, we still have to return a list of attributes. - List<Map<String, Object>> retVal = new ArrayList<Map<String, Object>>(1); + List<Map<String, Object>> retVal = new ArrayList<>(1); retVal.add(attrs); return retVal; } @@ -206,7 +206,7 @@ public class PDABreakpointAttributeTranslator implements IBreakpointAttributeTra // PDA debugger only allows updating of the action property of the watchpoint. // All other breakpoint updates will require a re-installation. if (bp instanceof PDAWatchpoint) { - Map<String, Object> deltaCopy = new HashMap<String, Object>(attributes); + Map<String, Object> deltaCopy = new HashMap<>(attributes); deltaCopy.remove(PDAWatchpoint.ACCESS); deltaCopy.remove(PDAWatchpoint.MODIFICATION); return !deltaCopy.isEmpty(); diff --git a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDABreakpoints.java b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDABreakpoints.java index 2b46a0efbe1..dd1a4454d85 100644 --- a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDABreakpoints.java +++ b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDABreakpoints.java @@ -120,7 +120,7 @@ public class PDABreakpoints extends AbstractDsfService implements IBreakpoints { private PDACommandControl fCommandControl; // Breakpoints currently installed - private Set<IBreakpointDMContext> fBreakpoints = new HashSet<IBreakpointDMContext>(); + private Set<IBreakpointDMContext> fBreakpoints = new HashSet<>(); /** * The service constructor diff --git a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDACommandControl.java b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDACommandControl.java index 8b758f5084b..18d4fff4ed5 100644 --- a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDACommandControl.java +++ b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDACommandControl.java @@ -73,13 +73,13 @@ public class PDACommandControl extends AbstractDsfService implements ICommandCon // Queue of commands waiting to be sent to the debugger. As long as commands // are in this queue, they can still be removed by clients. - private final List<CommandHandle> fCommandQueue = new LinkedList<CommandHandle>(); + private final List<CommandHandle> fCommandQueue = new LinkedList<>(); // Queue of commands that are being sent to the debugger. This queue is read // by the send job, so as soon as commands are inserted into this queue, they can // be considered as sent. @ThreadSafe - private final BlockingQueue<CommandHandle> fTxCommands = new LinkedBlockingQueue<CommandHandle>(); + private final BlockingQueue<CommandHandle> fTxCommands = new LinkedBlockingQueue<>(); // Flag indicating that the PDA debugger started private boolean fStarted = false; @@ -92,8 +92,8 @@ public class PDACommandControl extends AbstractDsfService implements ICommandCon private PDAVirtualMachineDMContext fDMContext; // Synchronous listeners for commands and events. - private final List<ICommandListener> fCommandListeners = new ArrayList<ICommandListener>(); - private final List<IEventListener> fEventListeners = new ArrayList<IEventListener>(); + private final List<ICommandListener> fCommandListeners = new ArrayList<>(); + private final List<IEventListener> fEventListeners = new ArrayList<>(); // Sockets for communicating with PDA debugger @ThreadSafe diff --git a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDARunControl.java b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDARunControl.java index 3dcc55c5c66..4e0649f9c5a 100644 --- a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDARunControl.java +++ b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDARunControl.java @@ -227,7 +227,7 @@ public class PDARunControl extends AbstractDsfService implements IRunControl, IE } } - private Map<Integer, ThreadInfo> fThreads = new LinkedHashMap<Integer, ThreadInfo>(); + private Map<Integer, ThreadInfo> fThreads = new LinkedHashMap<>(); public PDARunControl(DsfSession session) { super(session); diff --git a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDABitField.java b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDABitField.java index 242a4b6f394..41c78719794 100644 --- a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDABitField.java +++ b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDABitField.java @@ -39,7 +39,7 @@ public class PDABitField { fOffset = Integer.parseInt(st.nextToken()); fCount = Integer.parseInt(st.nextToken()); - fMnemonics = new LinkedHashMap<String, String>(0); + fMnemonics = new LinkedHashMap<>(0); while (st.hasMoreTokens()) { fMnemonics.put(st.nextToken(), st.nextToken()); } diff --git a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAFrame.java b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAFrame.java index 8d4883748dc..47b4ed7cd4e 100644 --- a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAFrame.java +++ b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAFrame.java @@ -41,7 +41,7 @@ public class PDAFrame { fLine = Integer.parseInt(st.nextToken()); fFunction = st.nextToken(); - List<String> variablesList = new ArrayList<String>(); + List<String> variablesList = new ArrayList<>(); while (st.hasMoreTokens()) { variablesList.add(st.nextToken()); } diff --git a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAListResult.java b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAListResult.java index 93c8051d148..7b95becc63b 100644 --- a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAListResult.java +++ b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAListResult.java @@ -30,7 +30,7 @@ public class PDAListResult extends PDACommandResult { PDAListResult(String response) { super(response); StringTokenizer st = new StringTokenizer(response, "|"); - List<String> valuesList = new ArrayList<String>(); + List<String> valuesList = new ArrayList<>(); while (st.hasMoreTokens()) { String token = st.nextToken(); diff --git a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDARegister.java b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDARegister.java index e2bf1eb26b1..ae8dba6cc77 100644 --- a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDARegister.java +++ b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDARegister.java @@ -39,7 +39,7 @@ public class PDARegister { fName = regSt.nextToken(); fWritable = Boolean.parseBoolean(regSt.nextToken()); - List<PDABitField> bitFieldsList = new ArrayList<PDABitField>(); + List<PDABitField> bitFieldsList = new ArrayList<>(); while (st.hasMoreTokens()) { bitFieldsList.add(new PDABitField(st.nextToken())); } diff --git a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDARegistersCommandResult.java b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDARegistersCommandResult.java index 2314c0ebee2..a80208ec814 100644 --- a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDARegistersCommandResult.java +++ b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDARegistersCommandResult.java @@ -33,7 +33,7 @@ public class PDARegistersCommandResult extends PDACommandResult { PDARegistersCommandResult(String response) { super(response); StringTokenizer st = new StringTokenizer(response, "#"); - List<PDARegister> regList = new ArrayList<PDARegister>(); + List<PDARegister> regList = new ArrayList<>(); while (st.hasMoreTokens()) { regList.add(new PDARegister(st.nextToken())); diff --git a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAStackCommandResult.java b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAStackCommandResult.java index 6149f7fba96..433406ac064 100644 --- a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAStackCommandResult.java +++ b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAStackCommandResult.java @@ -34,7 +34,7 @@ public class PDAStackCommandResult extends PDACommandResult { PDAStackCommandResult(String response) { super(response); StringTokenizer st = new StringTokenizer(response, "#"); - List<PDAFrame> framesList = new ArrayList<PDAFrame>(); + List<PDAFrame> framesList = new ArrayList<>(); while (st.hasMoreTokens()) { framesList.add(new PDAFrame(st.nextToken())); diff --git a/dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/filebrowser/FileVMNode.java b/dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/filebrowser/FileVMNode.java index a91b26989b7..623a0c54163 100644 --- a/dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/filebrowser/FileVMNode.java +++ b/dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/filebrowser/FileVMNode.java @@ -258,7 +258,7 @@ class FileVMNode implements IElementLabelProvider, IVMNode { // it in the tree. if (eventFile.exists() && parentFile != null) { // Create a list containing all files in path - List<File> filePath = new LinkedList<File>(); + List<File> filePath = new LinkedList<>(); for (File file = eventFile; file != null && !file.equals(parentFile); file = file.getParentFile()) { filePath.add(0, file); @@ -304,7 +304,7 @@ class FileVMNode implements IElementLabelProvider, IVMNode { * nodes which are not us. */ protected Map<IVMNode, Integer> getChildNodesWithDeltas(Object e) { - Map<IVMNode, Integer> nodes = new HashMap<IVMNode, Integer>(); + Map<IVMNode, Integer> nodes = new HashMap<>(); for (final IVMNode childNode : getChildNodes()) { int delta = childNode.getDeltaFlags(e); if (delta != IModelDelta.NO_CHANGE) { diff --git a/dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/filebrowser/FilesystemRootsVMNode.java b/dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/filebrowser/FilesystemRootsVMNode.java index ee256f619fd..4c5c8e8d7b6 100644 --- a/dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/filebrowser/FilesystemRootsVMNode.java +++ b/dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/filebrowser/FilesystemRootsVMNode.java @@ -163,7 +163,7 @@ class FilesystemRootsVMNode extends AbstractVMNode implements IElementLabelProvi if (eventFile.exists()) { // Create a list containing all files in path of the file from the event - List<File> filePath = new LinkedList<File>(); + List<File> filePath = new LinkedList<>(); for (File file = eventFile; file != null; file = file.getParentFile()) { filePath.add(0, file); } diff --git a/dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/AlarmService.java b/dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/AlarmService.java index ed669a60439..06a3e5c3a57 100644 --- a/dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/AlarmService.java +++ b/dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/AlarmService.java @@ -118,7 +118,7 @@ public class AlarmService extends AbstractDsfService { } private int fTriggerNumberCounter = 1; - private Map<TriggerDMContext, Integer> fTriggers = new LinkedHashMap<TriggerDMContext, Integer>(); + private Map<TriggerDMContext, Integer> fTriggers = new LinkedHashMap<>(); AlarmService(DsfSession session) { super(session); diff --git a/dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/TimerService.java b/dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/TimerService.java index 48e4988115c..caf6e2b91b9 100644 --- a/dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/TimerService.java +++ b/dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/TimerService.java @@ -91,9 +91,9 @@ public class TimerService extends AbstractDsfService { private int fTimerNumberCounter = 1; // Use a linked hash in order to be able to return an ordered list of timers. - private Map<TimerDMContext, Integer> fTimers = new LinkedHashMap<TimerDMContext, Integer>(); + private Map<TimerDMContext, Integer> fTimers = new LinkedHashMap<>(); - private Map<TimerDMContext, Future<?>> fTimerFutures = new HashMap<TimerDMContext, Future<?>>(); + private Map<TimerDMContext, Future<?>> fTimerFutures = new HashMap<>(); TimerService(DsfSession session) { super(session); diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/ViewerUpdatesListener.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/ViewerUpdatesListener.java index 8bc4c17d55a..37aef7d6aa7 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/ViewerUpdatesListener.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/ViewerUpdatesListener.java @@ -46,7 +46,7 @@ public class ViewerUpdatesListener implements IViewerUpdateListener, ILabelUpdat private ITreeModelViewer fViewer; private boolean fFailOnRedundantUpdates; - private Set<IViewerUpdate> fRedundantUpdates = new HashSet<IViewerUpdate>(); + private Set<IViewerUpdate> fRedundantUpdates = new HashSet<>(); private boolean fFailOnMultipleModelUpdateSequences; private boolean fMultipleModelUpdateSequencesObserved; @@ -54,20 +54,20 @@ public class ViewerUpdatesListener implements IViewerUpdateListener, ILabelUpdat private boolean fMultipleLabelUpdateSequencesObserved; private Set<TreePath> fHasChildrenUpdatesScheduled = makeTreePathSet(); - private Set<IViewerUpdate> fHasChildrenUpdatesRunning = new HashSet<IViewerUpdate>(); - private Set<IViewerUpdate> fHasChildrenUpdatesCompleted = new HashSet<IViewerUpdate>(); + private Set<IViewerUpdate> fHasChildrenUpdatesRunning = new HashSet<>(); + private Set<IViewerUpdate> fHasChildrenUpdatesCompleted = new HashSet<>(); private Map<TreePath, Set<Integer>> fChildrenUpdatesScheduled = makeTreePathMap(); - private Set<IViewerUpdate> fChildrenUpdatesRunning = new HashSet<IViewerUpdate>(); - private Set<IViewerUpdate> fChildrenUpdatesCompleted = new HashSet<IViewerUpdate>(); + private Set<IViewerUpdate> fChildrenUpdatesRunning = new HashSet<>(); + private Set<IViewerUpdate> fChildrenUpdatesCompleted = new HashSet<>(); private Set<TreePath> fChildCountUpdatesScheduled = makeTreePathSet(); - private Set<IViewerUpdate> fChildCountUpdatesRunning = new HashSet<IViewerUpdate>(); - private Set<IViewerUpdate> fChildCountUpdatesCompleted = new HashSet<IViewerUpdate>(); + private Set<IViewerUpdate> fChildCountUpdatesRunning = new HashSet<>(); + private Set<IViewerUpdate> fChildCountUpdatesCompleted = new HashSet<>(); private Set<TreePath> fLabelUpdates = makeTreePathSet(); - private Set<IViewerUpdate> fLabelUpdatesRunning = new HashSet<IViewerUpdate>(); - private Set<IViewerUpdate> fLabelUpdatesCompleted = new HashSet<IViewerUpdate>(); + private Set<IViewerUpdate> fLabelUpdatesRunning = new HashSet<>(); + private Set<IViewerUpdate> fLabelUpdatesCompleted = new HashSet<>(); private Set<TreePath> fPropertiesUpdates = makeTreePathSet(); - private Set<IViewerUpdate> fPropertiesUpdatesRunning = new HashSet<IViewerUpdate>(); - private Set<IViewerUpdate> fPropertiesUpdatesCompleted = new HashSet<IViewerUpdate>(); + private Set<IViewerUpdate> fPropertiesUpdatesRunning = new HashSet<>(); + private Set<IViewerUpdate> fPropertiesUpdatesCompleted = new HashSet<>(); // private Set<TreePath> fProxyModels = new HashSet<TreePath>(); private Set<TreePath> fStateUpdates = makeTreePathSet(); private boolean fContentSequenceStarted; @@ -86,11 +86,11 @@ public class ViewerUpdatesListener implements IViewerUpdateListener, ILabelUpdat private long fTimeoutTime; protected Set<TreePath> makeTreePathSet() { - return new HashSet<TreePath>(); + return new HashSet<>(); } protected <V> Map<TreePath, V> makeTreePathMap() { - return new HashMap<TreePath, V>(); + return new HashMap<>(); } public ViewerUpdatesListener(ITreeModelViewer viewer, boolean failOnRedundantUpdates, @@ -194,7 +194,7 @@ public class ViewerUpdatesListener implements IViewerUpdateListener, ILabelUpdat public void addChildreUpdate(TreePath path, int index) { Set<Integer> childrenIndexes = fChildrenUpdatesScheduled.get(path); if (childrenIndexes == null) { - childrenIndexes = new TreeSet<Integer>(); + childrenIndexes = new TreeSet<>(); fChildrenUpdatesScheduled.put(path, childrenIndexes); } childrenIndexes.add(index); diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/BreakpointMediatorTests.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/BreakpointMediatorTests.java index 09d2c6e95b1..e441e1d573e 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/BreakpointMediatorTests.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/BreakpointMediatorTests.java @@ -174,7 +174,7 @@ public class BreakpointMediatorTests { @Test public void proofOfConceptTest() throws Exception { - ServiceEventWaitor<BreakpointsAddedEvent> waitor = new ServiceEventWaitor<BreakpointsAddedEvent>(fSession, + ServiceEventWaitor<BreakpointsAddedEvent> waitor = new ServiceEventWaitor<>(fSession, BreakpointsAddedEvent.class); new DsfTestBreakpoint(); diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpointAttributeTranslator2.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpointAttributeTranslator2.java index 203a3892524..8fad86deceb 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpointAttributeTranslator2.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpointAttributeTranslator2.java @@ -52,9 +52,9 @@ public class DsfTestBreakpointAttributeTranslator2 implements IBreakpointAttribu if (num == null) { num = 1; } - List<Map<String, Object>> subBpsAttrs = new ArrayList<Map<String, Object>>(num); + List<Map<String, Object>> subBpsAttrs = new ArrayList<>(num); for (int i = 0; i < num; i++) { - Map<String, Object> subBpAttr = new HashMap<String, Object>(bpAttrs); + Map<String, Object> subBpAttr = new HashMap<>(bpAttrs); subBpAttr.put(DsfTestBreakpoints.ATTR_SUB_ID, i); subBpsAttrs.add(subBpAttr); } @@ -75,7 +75,7 @@ public class DsfTestBreakpointAttributeTranslator2 implements IBreakpointAttribu @Override public Map<String, Object> convertAttributes(Map<String, Object> platformBPAttr) { - Map<String, Object> debugAttrs = new HashMap<String, Object>(platformBPAttr.size()); + Map<String, Object> debugAttrs = new HashMap<>(platformBPAttr.size()); for (Map.Entry<String, Object> entry : platformBPAttr.entrySet()) { if (DsfTestBreakpoint.ATTR_TRANSLATED.equals(entry.getKey())) { debugAttrs.put(DsfTestBreakpoints.ATTR_TRANSLATED, entry.getValue()); diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpoints.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpoints.java index 852332dad55..6256aeb1f66 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpoints.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpoints.java @@ -113,7 +113,7 @@ public class DsfTestBreakpoints extends AbstractDsfService implements IBreakpoin public final Map<String, Object> fAttributes; public BreakpointDMData(Map<String, Object> attributes) { - fAttributes = Collections.unmodifiableMap(new HashMap<String, Object>(attributes)); + fAttributes = Collections.unmodifiableMap(new HashMap<>(attributes)); } @Override @@ -205,7 +205,7 @@ public class DsfTestBreakpoints extends AbstractDsfService implements IBreakpoin } // Breakpoints currently installed - private Map<BreakpointDMContext, BreakpointDMData> fBreakpoints = new HashMap<BreakpointDMContext, BreakpointDMData>(); + private Map<BreakpointDMContext, BreakpointDMData> fBreakpoints = new HashMap<>(); /** * The service constructor @@ -355,7 +355,7 @@ public class DsfTestBreakpoints extends AbstractDsfService implements IBreakpoin } if (bpCtx instanceof BreakpointDMContext) { - Map<String, Object> newAttrs = new HashMap<String, Object>(fBreakpoints.get(bpCtx).getAttributes()); + Map<String, Object> newAttrs = new HashMap<>(fBreakpoints.get(bpCtx).getAttributes()); newAttrs.putAll(attributes); fBreakpoints.put((BreakpointDMContext) bpCtx, new BreakpointDMData(newAttrs)); getSession().dispatchEvent(new BreakpointsRemovedEvent((BreakpointDMContext) bpCtx), getProperties()); diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/CacheTests.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/CacheTests.java index 0700113988c..09263a25193 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/CacheTests.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/CacheTests.java @@ -283,7 +283,7 @@ public class CacheTests { assertFalse(fTestCache.isValid()); // Request data from cache - List<Query<Integer>> qList = new ArrayList<Query<Integer>>(); + List<Query<Integer>> qList = new ArrayList<>(); for (int i = 0; i < 10; i++) { Query<Integer> q = new TestQuery(); fExecutor.execute(q); @@ -759,7 +759,7 @@ public class CacheTests { @Test public void cancelWhilePendingWithManyClientsTest() throws InterruptedException, ExecutionException { // Request data from cache - List<Query<Integer>> qList = new ArrayList<Query<Integer>>(); + List<Query<Integer>> qList = new ArrayList<>(); for (int i = 0; i < 10; i++) { Query<Integer> q = new TestQuery(); fExecutor.submit(q).get(); diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/RangeCacheTests.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/RangeCacheTests.java index d9891679e50..5070560cbff 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/RangeCacheTests.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/RangeCacheTests.java @@ -120,7 +120,7 @@ public class RangeCacheTests { ICache<List<Integer>> fRangeCache; private List<Integer> makeList(long offset, int count) { - List<Integer> list = new ArrayList<Integer>(count); + List<Integer> list = new ArrayList<>(count); for (int i = 0; i < count; i++) { list.add((int) (i + offset)); } @@ -148,7 +148,7 @@ public class RangeCacheTests { public void startExecutor() throws ExecutionException, InterruptedException { fExecutor = new TestDsfExecutor(); fTestCache = new TestRangeCache(); - fRetrieveInfos = new TreeSet<RetrieveInfo>(); + fRetrieveInfos = new TreeSet<>(); fRangeCache = null; } diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/debug/vm/launch/VMTest1.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/debug/vm/launch/VMTest1.java index bc18745abbf..eac07d119c4 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/debug/vm/launch/VMTest1.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/debug/vm/launch/VMTest1.java @@ -125,7 +125,7 @@ public class VMTest1 extends VMTestBase implements IViewerUpdatesListenerConstan Query<Map<String, Object>> suspendedQuery = new Query<Map<String, Object>>() { @Override protected void execute(DataRequestMonitor<Map<String, Object>> rm) { - Set<String> properties = new HashSet<String>(); + Set<String> properties = new HashSet<>(); properties.add(ILaunchVMConstants.PROP_IS_SUSPENDED); containerPropProvider.update(new VMPropertiesUpdate[] { new VMPropertiesUpdate(properties, diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/debug/vm/launch/VMTestBase.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/debug/vm/launch/VMTestBase.java index 2a2a610a7c8..b0d1c961918 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/debug/vm/launch/VMTestBase.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/debug/vm/launch/VMTestBase.java @@ -65,7 +65,7 @@ public class VMTestBase { @Before public void baseBeforeMethod() throws Exception { - Map<String, Object> attrs = new HashMap<String, Object>(); + Map<String, Object> attrs = new HashMap<>(); initLaunchAttributes(attrs); @@ -91,7 +91,7 @@ public class VMTestBase { SessionStartedListener newSessionListener = new SessionStartedListener() { @Override public void sessionStarted(DsfSession session) { - eventWaitor[0] = new ServiceEventWaitor<IStartedDMEvent>(session, IStartedDMEvent.class); + eventWaitor[0] = new ServiceEventWaitor<>(session, IStartedDMEvent.class); } }; diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/BasicTests.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/BasicTests.java index 21357136060..d34814e66ab 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/BasicTests.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/BasicTests.java @@ -61,10 +61,10 @@ public class BasicTests extends CommandControlTestsBase { class CommandListener implements ICommandListener { - List<CommandInfo> fDoneCommands = new LinkedList<CommandInfo>(); - List<CommandInfo> fQueuedCommands = new LinkedList<CommandInfo>(); - List<CommandInfo> fRemovedCommands = new LinkedList<CommandInfo>(); - List<CommandInfo> fSentCommands = new LinkedList<CommandInfo>(); + List<CommandInfo> fDoneCommands = new LinkedList<>(); + List<CommandInfo> fQueuedCommands = new LinkedList<>(); + List<CommandInfo> fRemovedCommands = new LinkedList<>(); + List<CommandInfo> fSentCommands = new LinkedList<>(); @Override public void commandDone(ICommandToken token, ICommandResult result) { diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/CommandControlTestsBase.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/CommandControlTestsBase.java index 0480e093099..638a3b303dd 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/CommandControlTestsBase.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/CommandControlTestsBase.java @@ -49,7 +49,7 @@ public class CommandControlTestsBase { protected DsfSession fSession; protected PDABackend fPDABackend; protected PDACommandControl fCommandControl; - private BlockingQueue<Object> fEventsQueue = new LinkedBlockingQueue<Object>(); + private BlockingQueue<Object> fEventsQueue = new LinkedBlockingQueue<>(); private BufferedReader fOutputReader; diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/service/MultiInstanceTestService.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/service/MultiInstanceTestService.java index 9d04589f1bb..ddf6785e232 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/service/MultiInstanceTestService.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/service/MultiInstanceTestService.java @@ -47,7 +47,7 @@ public class MultiInstanceTestService extends AbstractDsfService { } private void doInitialize(RequestMonitor requestMonitor) { - Hashtable<String, String> properties = new Hashtable<String, String>(); + Hashtable<String, String> properties = new Hashtable<>(); properties.put(PROP_INSTANCE_ID, fInstanceId); register(new String[] { MultiInstanceTestService.class.getName() }, properties); requestMonitor.done(); diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/FormattedValueTests.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/FormattedValueTests.java index 0edd588ff2a..032f4fb1ef6 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/FormattedValueTests.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/FormattedValueTests.java @@ -323,17 +323,17 @@ abstract public class FormattedValueTests extends TestCase String preferenceFormat = IFormattedValues.NATURAL_FORMAT; setInput(preferenceFormat); // set each element to the same element format different than the preference format, and verify - HashMap<String, ElementFormatSetting> map = new HashMap<String, ElementFormatSetting>(); + HashMap<String, ElementFormatSetting> map = new HashMap<>(); String[] format = { IFormattedValues.HEX_FORMAT }; makeElementFormatSetting(fViewer, TreePath.EMPTY, format, -1, 0, map); - ArrayList<ElementFormatSetting> elementFormats = new ArrayList<ElementFormatSetting>(map.values()); + ArrayList<ElementFormatSetting> elementFormats = new ArrayList<>(map.values()); setFormatAndValidate(preferenceFormat, elementFormats, elementFormats, true, false, false); // element of same level use the same format and different levels have different formats, and verify map.clear(); format = new String[] { IFormattedValues.HEX_FORMAT, IFormattedValues.DECIMAL_FORMAT, IFormattedValues.OCTAL_FORMAT, IFormattedValues.BINARY_FORMAT, IFormattedValues.NATURAL_FORMAT }; makeElementFormatSetting(fViewer, TreePath.EMPTY, format, -1, 0, map); - elementFormats = new ArrayList<ElementFormatSetting>(map.values()); + elementFormats = new ArrayList<>(map.values()); setFormatAndValidate(preferenceFormat, elementFormats, elementFormats, false, false, false); } @@ -346,11 +346,11 @@ abstract public class FormattedValueTests extends TestCase setInput(IFormattedValues.NATURAL_FORMAT); setFormatAndValidate(preferenceFormat, false, false, false); // set each element to a format, and verify - HashMap<String, ElementFormatSetting> map = new HashMap<String, ElementFormatSetting>(); + HashMap<String, ElementFormatSetting> map = new HashMap<>(); String[] format = { IFormattedValues.HEX_FORMAT, IFormattedValues.DECIMAL_FORMAT, IFormattedValues.OCTAL_FORMAT, IFormattedValues.BINARY_FORMAT, IFormattedValues.NATURAL_FORMAT }; makeElementFormatSetting(fViewer, TreePath.EMPTY, format, -1, 0, map); - ArrayList<ElementFormatSetting> elementFormats = new ArrayList<ElementFormatSetting>(map.values()); + ArrayList<ElementFormatSetting> elementFormats = new ArrayList<>(map.values()); setFormatAndValidate(preferenceFormat, elementFormats, elementFormats, false, false, false); // Restore each element to preference format, and verify for (ElementFormatSetting e : elementFormats) { @@ -379,12 +379,12 @@ abstract public class FormattedValueTests extends TestCase // set top level element to a format, and verify top and child elements // at certain levels have the correct format. String[] format = { IFormattedValues.DECIMAL_FORMAT }; - HashMap<String, ElementFormatSetting> map = new HashMap<String, ElementFormatSetting>(); + HashMap<String, ElementFormatSetting> map = new HashMap<>(); makeElementFormatSetting(fViewer, TreePath.EMPTY, format, 1, 0, map); - ArrayList<ElementFormatSetting> setElementFormats = new ArrayList<ElementFormatSetting>(map.values()); - HashMap<String, ElementFormatSetting> expMap = new HashMap<String, ElementFormatSetting>(); + ArrayList<ElementFormatSetting> setElementFormats = new ArrayList<>(map.values()); + HashMap<String, ElementFormatSetting> expMap = new HashMap<>(); makeElementFormatSetting(fViewer, TreePath.EMPTY, format, depth, 0, expMap); - ArrayList<ElementFormatSetting> expectElementFormats = new ArrayList<ElementFormatSetting>(expMap.values()); + ArrayList<ElementFormatSetting> expectElementFormats = new ArrayList<>(expMap.values()); setFormatAndValidate(preferenceFormat, setElementFormats, expectElementFormats, false, false, false); // Restore top level element to preference format, and verify. for (ElementFormatSetting e : setElementFormats) { @@ -410,17 +410,17 @@ abstract public class FormattedValueTests extends TestCase // Change to a new format, this does not cause the cache entries to be // set to dirty. Retrieving new format values should happen from the service. - HashMap<String, ElementFormatSetting> map1 = new HashMap<String, ElementFormatSetting>(); + HashMap<String, ElementFormatSetting> map1 = new HashMap<>(); String[] format1 = { IFormattedValues.HEX_FORMAT }; makeElementFormatSetting(fViewer, TreePath.EMPTY, format1, -1, 0, map1); - ArrayList<ElementFormatSetting> elementFormats1 = new ArrayList<ElementFormatSetting>(map1.values()); + ArrayList<ElementFormatSetting> elementFormats1 = new ArrayList<>(map1.values()); setFormatAndValidate(preferenceFormat, elementFormats1, elementFormats1, true, false, false); // Remove element format and so restore back to preference - natural format. Values should be retrieved from cache. - HashMap<String, ElementFormatSetting> map2 = new HashMap<String, ElementFormatSetting>(); + HashMap<String, ElementFormatSetting> map2 = new HashMap<>(); String[] format2 = { null }; makeElementFormatSetting(fViewer, TreePath.EMPTY, format2, -1, 0, map2); - ArrayList<ElementFormatSetting> elementFormats2 = new ArrayList<ElementFormatSetting>(map2.values()); + ArrayList<ElementFormatSetting> elementFormats2 = new ArrayList<>(map2.values()); setFormatAndValidate(preferenceFormat, elementFormats2, elementFormats2, true, true, false); // Generate an event which will cause all cache entries to be marked dirty. @@ -430,10 +430,10 @@ abstract public class FormattedValueTests extends TestCase setFormatAndValidate(preferenceFormat, elementFormats1, elementFormats1, true, true, false); // Change to a decimal, which is not cached, values should come with an error. - HashMap<String, ElementFormatSetting> map3 = new HashMap<String, ElementFormatSetting>(); + HashMap<String, ElementFormatSetting> map3 = new HashMap<>(); String[] format3 = { IFormattedValues.DECIMAL_FORMAT }; makeElementFormatSetting(fViewer, TreePath.EMPTY, format3, -1, 0, map3); - ArrayList<ElementFormatSetting> elementFormats3 = new ArrayList<ElementFormatSetting>(map3.values()); + ArrayList<ElementFormatSetting> elementFormats3 = new ArrayList<>(map3.values()); setFormatAndValidate(preferenceFormat, elementFormats3, elementFormats3, true, true, true); } @@ -457,24 +457,24 @@ abstract public class FormattedValueTests extends TestCase // Change top level to a new format, this does not cause the cache entries to be // set to dirty. Retrieving new format values should happen from the service. String[] format1 = { IFormattedValues.HEX_FORMAT }; - HashMap<String, ElementFormatSetting> map1 = new HashMap<String, ElementFormatSetting>(); + HashMap<String, ElementFormatSetting> map1 = new HashMap<>(); makeElementFormatSetting(fViewer, TreePath.EMPTY, format1, 1, 0, map1); - ArrayList<ElementFormatSetting> elementFormats1 = new ArrayList<ElementFormatSetting>(map1.values()); - HashMap<String, ElementFormatSetting> expMap1 = new HashMap<String, ElementFormatSetting>(); + ArrayList<ElementFormatSetting> elementFormats1 = new ArrayList<>(map1.values()); + HashMap<String, ElementFormatSetting> expMap1 = new HashMap<>(); makeElementFormatSetting(fViewer, TreePath.EMPTY, format1, depth, 0, expMap1); - ArrayList<ElementFormatSetting> expectElementFormats1 = new ArrayList<ElementFormatSetting>( + ArrayList<ElementFormatSetting> expectElementFormats1 = new ArrayList<>( expMap1.values()); vmListenerLevel = depth; setFormatAndValidate(preferenceFormat, elementFormats1, expectElementFormats1, true, false, false); // Remove element format and so restore back to preference format - natural. Values should be retrieved from cache. String[] format2 = { null }; - HashMap<String, ElementFormatSetting> map2 = new HashMap<String, ElementFormatSetting>(); + HashMap<String, ElementFormatSetting> map2 = new HashMap<>(); makeElementFormatSetting(fViewer, TreePath.EMPTY, format2, 1, 0, map2); - ArrayList<ElementFormatSetting> elementFormats2 = new ArrayList<ElementFormatSetting>(map2.values()); - HashMap<String, ElementFormatSetting> expMap2 = new HashMap<String, ElementFormatSetting>(); + ArrayList<ElementFormatSetting> elementFormats2 = new ArrayList<>(map2.values()); + HashMap<String, ElementFormatSetting> expMap2 = new HashMap<>(); makeElementFormatSetting(fViewer, TreePath.EMPTY, format2, depth, 0, expMap2); - ArrayList<ElementFormatSetting> expectElementFormats2 = new ArrayList<ElementFormatSetting>( + ArrayList<ElementFormatSetting> expectElementFormats2 = new ArrayList<>( expMap2.values()); setFormatAndValidate(preferenceFormat, elementFormats2, expectElementFormats2, true, true, false); @@ -486,12 +486,12 @@ abstract public class FormattedValueTests extends TestCase // Change to a decimal, which is not cached, values should come with an error. String[] format3 = { IFormattedValues.DECIMAL_FORMAT }; - HashMap<String, ElementFormatSetting> map3 = new HashMap<String, ElementFormatSetting>(); + HashMap<String, ElementFormatSetting> map3 = new HashMap<>(); makeElementFormatSetting(fViewer, TreePath.EMPTY, format3, 1, 0, map3); - ArrayList<ElementFormatSetting> elementFormats3 = new ArrayList<ElementFormatSetting>(map3.values()); - HashMap<String, ElementFormatSetting> expMap3 = new HashMap<String, ElementFormatSetting>(); + ArrayList<ElementFormatSetting> elementFormats3 = new ArrayList<>(map3.values()); + HashMap<String, ElementFormatSetting> expMap3 = new HashMap<>(); makeElementFormatSetting(fViewer, TreePath.EMPTY, format3, depth, 0, expMap3); - ArrayList<ElementFormatSetting> expectElementFormats3 = new ArrayList<ElementFormatSetting>( + ArrayList<ElementFormatSetting> expectElementFormats3 = new ArrayList<>( expMap3.values()); setFormatAndValidate(preferenceFormat, elementFormats3, expectElementFormats3, true, true, true); } @@ -509,11 +509,11 @@ abstract public class FormattedValueTests extends TestCase // set preference format to an invalid format and verify setInvalidPreferenceAndVerify(); // set each element to a format, and verify - HashMap<String, ElementFormatSetting> map = new HashMap<String, ElementFormatSetting>(); + HashMap<String, ElementFormatSetting> map = new HashMap<>(); String[] format = { IFormattedValues.HEX_FORMAT, IFormattedValues.DECIMAL_FORMAT, IFormattedValues.OCTAL_FORMAT, IFormattedValues.BINARY_FORMAT, IFormattedValues.NATURAL_FORMAT }; makeElementFormatSetting(fViewer, TreePath.EMPTY, format, -1, 0, map); - ArrayList<ElementFormatSetting> elementFormats = new ArrayList<ElementFormatSetting>(map.values()); + ArrayList<ElementFormatSetting> elementFormats = new ArrayList<>(map.values()); setFormatAndValidate("invalid format", elementFormats, elementFormats, false, false, false); // Restore each element to preference format which is an invalid format for (ElementFormatSetting e : elementFormats) { @@ -584,11 +584,11 @@ abstract public class FormattedValueTests extends TestCase setInput(IFormattedValues.NATURAL_FORMAT); setFormatAndValidate(preferenceFormat, false, false, false); // set each element to a format, and verify - HashMap<String, ElementFormatSetting> map = new HashMap<String, ElementFormatSetting>(); + HashMap<String, ElementFormatSetting> map = new HashMap<>(); String[] format = { IFormattedValues.HEX_FORMAT, IFormattedValues.DECIMAL_FORMAT, IFormattedValues.OCTAL_FORMAT, IFormattedValues.BINARY_FORMAT, IFormattedValues.NATURAL_FORMAT }; makeElementFormatSetting(fViewer, TreePath.EMPTY, format, -1, 0, map); - ArrayList<ElementFormatSetting> elementFormats = new ArrayList<ElementFormatSetting>(map.values()); + ArrayList<ElementFormatSetting> elementFormats = new ArrayList<>(map.values()); setFormatAndValidate(preferenceFormat, elementFormats, elementFormats, false, false, false); // save settings XMLMemento memento = XMLMemento.createWriteRoot("TEST"); @@ -640,8 +640,8 @@ abstract public class FormattedValueTests extends TestCase ElementFormatSetting setting = result.get(fmt); if (setting == null) { setting = new ElementFormatSetting(); - setting.nodes = new ArrayList<IVMNode>(childCount); - setting.elementPaths = new ArrayList<TreePath>(childCount); + setting.nodes = new ArrayList<>(childCount); + setting.elementPaths = new ArrayList<>(childCount); setting.formatId = fmt; result.put(fmt, setting); } @@ -665,10 +665,10 @@ abstract public class FormattedValueTests extends TestCase ALL_UPDATES_COMPLETE | PROPERTY_UPDATES); fVMListener.reset(); fVMListener.addUpdates(TreePath.EMPTY, fModel.getRootElement(), -1, ALL_UPDATES_COMPLETE | PROPERTY_UPDATES); - HashMap<String, ElementFormatSetting> map = new HashMap<String, ElementFormatSetting>(); + HashMap<String, ElementFormatSetting> map = new HashMap<>(); String[] format = { "invalid element format" }; makeElementFormatSetting(fViewer, TreePath.EMPTY, format, -1, 0, map); - ArrayList<ElementFormatSetting> elementFormats = new ArrayList<ElementFormatSetting>(map.values()); + ArrayList<ElementFormatSetting> elementFormats = new ArrayList<>(map.values()); if (fVMProvider instanceof IElementFormatProvider) { IElementFormatProvider ep = ((IElementFormatProvider) fVMProvider); for (ElementFormatSetting es : elementFormats) { diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/FormattedValuesListener.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/FormattedValuesListener.java index 66d29c992bf..75d5141c580 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/FormattedValuesListener.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/FormattedValuesListener.java @@ -39,14 +39,14 @@ public class FormattedValuesListener implements IFormattedValuesListener, IPrope private final TestModel fModel; - private List<IPropertiesUpdate> fPropertiesUpdates = new ArrayList<IPropertiesUpdate>(); - private List<List<FormattedValueDMContext>> fFormattedValuesInPending = new ArrayList<List<FormattedValueDMContext>>(); - private List<FormattedValueDMContext> fFormattedValuesInProgress = new LinkedList<FormattedValueDMContext>(); - private List<FormattedValueDMContext> fFormattedValuesCompleted = new ArrayList<FormattedValueDMContext>(); + private List<IPropertiesUpdate> fPropertiesUpdates = new ArrayList<>(); + private List<List<FormattedValueDMContext>> fFormattedValuesInPending = new ArrayList<>(); + private List<FormattedValueDMContext> fFormattedValuesInProgress = new LinkedList<>(); + private List<FormattedValueDMContext> fFormattedValuesCompleted = new ArrayList<>(); private DsfRunnable fProcessUpdatedFormattedValuesRunnable = null; - private Set<String> fCachedFormats = new HashSet<String>(); + private Set<String> fCachedFormats = new HashSet<>(); public FormattedValuesListener(TestModel model) { fModel = model; @@ -60,7 +60,7 @@ public class FormattedValuesListener implements IFormattedValuesListener, IPrope @Override public void propertiesUpdatesStarted(IPropertiesUpdate[] updates) { fPropertiesUpdates.addAll(Arrays.asList(updates)); - List<FormattedValueDMContext> pending = new ArrayList<FormattedValueDMContext>(updates.length); + List<FormattedValueDMContext> pending = new ArrayList<>(updates.length); for (IPropertiesUpdate update : updates) { List<String> formatIds = getRequestedFormatIDs(update); for (String formatId : formatIds) { @@ -74,7 +74,7 @@ public class FormattedValuesListener implements IFormattedValuesListener, IPrope } private List<String> getRequestedFormatIDs(IPropertiesUpdate update) { - List<String> formatIds = new ArrayList<String>(1); + List<String> formatIds = new ArrayList<>(1); for (String property : update.getProperties()) { if (property.equals(IDebugVMConstants.PROP_FORMATTED_VALUE_ACTIVE_FORMAT_VALUE)) { formatIds.add(ANY_FORMAT); diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestElementFormatVMProvider.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestElementFormatVMProvider.java index 05733ea4d12..9a1377e8d5a 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestElementFormatVMProvider.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestElementFormatVMProvider.java @@ -84,7 +84,7 @@ class TestElementFormatVMProvider extends TestModelCachingVMProvider implements persistable = new TestPersistable(); context.setProperty(myPersistId, persistable); } - HashSet<Object> changed = new HashSet<Object>(elementPath.length); + HashSet<Object> changed = new HashSet<>(elementPath.length); for (int i = 0; i < elementPath.length; i++) { Object x = elementPath[i].getLastSegment(); if (x instanceof TestElementVMContext) { diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelUpdatesListener.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelUpdatesListener.java index 751ccc0eefc..d28c4ead9cc 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelUpdatesListener.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelUpdatesListener.java @@ -109,12 +109,12 @@ public class TestModelUpdatesListener extends ViewerUpdatesListener { @Override protected Set<TreePath> makeTreePathSet() { - return new TreeSet<TreePath>(fTestElementVMCComparator); + return new TreeSet<>(fTestElementVMCComparator); } @Override protected <V> Map<TreePath, V> makeTreePathMap() { - return new TreeMap<TreePath, V>(fTestElementVMCComparator); + return new TreeMap<>(fTestElementVMCComparator); } public TestModelUpdatesListener() { diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestPersistable.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestPersistable.java index 3ec4a104b84..2680b77865e 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestPersistable.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestPersistable.java @@ -28,13 +28,13 @@ import org.eclipse.ui.IPersistableElement; */ class TestPersistable implements IPersistableElement, IAdaptable { - HashMap<String, String> map = new HashMap<String, String>(); + HashMap<String, String> map = new HashMap<>(); @Override public void saveState(IMemento memento) { HashMap<String, String> clone = null; synchronized (map) { - clone = new HashMap<String, String>(map); + clone = new HashMap<>(map); } Iterator<Entry<String, String>> it = clone.entrySet().iterator(); while (it.hasNext()) { @@ -46,7 +46,7 @@ class TestPersistable implements IPersistableElement, IAdaptable { void restore(IMemento memento) { IMemento[] list = memento.getChildren("variable"); - HashMap<String, String> clone = new HashMap<String, String>(); + HashMap<String, String> clone = new HashMap<>(); for (int i = 0; i < list.length; i++) { clone.put(list[i].getID(), list[i].getString("format")); } diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java index f5155865f27..c7225ac7417 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java @@ -91,7 +91,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { /** utility method; cuts down on clutter */ private void queueCommands(List<String> commands, RequestMonitor rm) { if (!commands.isEmpty()) { - fCommandControl.queueCommand(new CLICommand<MIInfo>(fCommandControl.getContext(), composeCommand(commands)), + fCommandControl.queueCommand(new CLICommand<>(fCommandControl.getContext(), composeCommand(commands)), new DataRequestMonitor<MIInfo>(getExecutor(), rm)); } else { rm.done(); @@ -124,7 +124,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { return launch.getLaunchConfiguration().getAttributes(); } catch (CoreException e) { } - return new HashMap<String, Object>(); + return new HashMap<>(); } /** @since 8.2 */ @@ -145,7 +145,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { if (GROUP_TOP_LEVEL.equals(group)) { // Initialize the list with the base class' steps // We need to create a list that we can modify, which is why we create our own ArrayList. - List<String> orderList = new ArrayList<String>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); + List<String> orderList = new ArrayList<>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); // First, remove all steps of the base class that we don't want to use. orderList.removeAll(Arrays.asList(new String[] { "stepNewProcess", //$NON-NLS-1$ @@ -299,7 +299,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { if (symbolsOffset.length() > 0) { symbolsOffset = "0x" + symbolsOffset; } - List<String> commands = new ArrayList<String>(); + List<String> commands = new ArrayList<>(); fGdbJtagDevice.doLoadSymbol(symbolsFileName, symbolsOffset, commands); queueCommands(commands, rm); @@ -322,7 +322,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { try { if (CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_USE_REMOTE_TARGET, IGDBJtagConstants.DEFAULT_USE_REMOTE_TARGET)) { - List<String> commands = new ArrayList<String>(); + List<String> commands = new ArrayList<>(); if (fGdbJtagDevice instanceof IGDBJtagConnection) { URI uri = new URI(CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_CONNECTION, IGDBJtagConstants.DEFAULT_CONNECTION)); @@ -355,7 +355,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { public void stepResetBoard(final RequestMonitor rm) { if (CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_DO_RESET, IGDBJtagConstants.DEFAULT_DO_RESET)) { - List<String> commands = new ArrayList<String>(); + List<String> commands = new ArrayList<>(); fGdbJtagDevice.doReset(commands); if (commands.isEmpty()) { setError(String.format(Messages.getString("GDBJtagDebugger.reset_not_defined"), getGDBJtagDeviceName()), //$NON-NLS-1$ @@ -378,7 +378,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { if (CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_DO_RESET, IGDBJtagConstants.DEFAULT_DO_RESET)) { int defaultDelay = fGdbJtagDevice.getDefaultDelay(); - List<String> commands = new ArrayList<String>(); + List<String> commands = new ArrayList<>(); int delay = CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_DELAY, defaultDelay); fGdbJtagDevice.doDelay(delay, commands); if (commands.isEmpty() && (delay != 0)) { @@ -400,7 +400,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { public void stepHaltBoard(final RequestMonitor rm) { if (CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_DO_HALT, IGDBJtagConstants.DEFAULT_DO_HALT)) { - List<String> commands = new ArrayList<String>(); + List<String> commands = new ArrayList<>(); fGdbJtagDevice.doHalt(commands); if (commands.isEmpty()) { setError(String.format(Messages.getString("GDBJtagDebugger.halt_not_defined"), getGDBJtagDeviceName()), //$NON-NLS-1$ @@ -429,7 +429,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { CountingRequestMonitor crm = new CountingRequestMonitor(getExecutor(), rm); crm.setDoneCount(commands.length); for (int i = 0; i < commands.length; ++i) { - fCommandControl.queueCommand(new CLICommand<MIInfo>(fCommandControl.getContext(), commands[i]), + fCommandControl.queueCommand(new CLICommand<>(fCommandControl.getContext(), commands[i]), new DataRequestMonitor<MIInfo>(getExecutor(), crm)); } } else { @@ -489,7 +489,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { : "0x" + CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET); } - List<String> commands = new ArrayList<String>(); + List<String> commands = new ArrayList<>(); fGdbJtagDevice.doLoadImage(imageFileName, imageOffset, commands); queueCommands(commands, rm); } else { @@ -584,7 +584,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { String pcRegister = CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_PC_REGISTER, CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_PC_REGISTER)); - List<String> commands = new ArrayList<String>(); + List<String> commands = new ArrayList<>(); fGdbJtagDevice.doSetPC(pcRegister, commands); queueCommands(commands, rm); } else { @@ -602,7 +602,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { IGDBJtagConstants.DEFAULT_SET_STOP_AT)) { String stopAt = CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_STOP_AT, IGDBJtagConstants.DEFAULT_STOP_AT); - List<String> commands = new ArrayList<String>(); + List<String> commands = new ArrayList<>(); fGdbJtagDevice.doStopAt(stopAt, commands); queueCommands(commands, rm); } else { @@ -618,7 +618,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { public void stepResumeScript(final RequestMonitor rm) { if (CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_SET_RESUME, IGDBJtagConstants.DEFAULT_SET_RESUME)) { - List<String> commands = new ArrayList<String>(); + List<String> commands = new ArrayList<>(); fGdbJtagDevice.doContinue(commands); queueCommands(commands, rm); } else { @@ -642,7 +642,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { CountingRequestMonitor crm = new CountingRequestMonitor(getExecutor(), rm); crm.setDoneCount(commands.length); for (int i = 0; i < commands.length; ++i) { - fCommandControl.queueCommand(new CLICommand<MIInfo>(fCommandControl.getContext(), commands[i]), + fCommandControl.queueCommand(new CLICommand<>(fCommandControl.getContext(), commands[i]), new DataRequestMonitor<MIInfo>(getExecutor(), crm)); } } else { diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence_7_12.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence_7_12.java index a538a8eb8ac..07906b652f4 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence_7_12.java +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence_7_12.java @@ -39,7 +39,7 @@ public class GDBJtagDSFFinalLaunchSequence_7_12 extends GDBJtagDSFFinalLaunchSeq protected String[] getExecutionOrder(String group) { if (GROUP_TOP_LEVEL.equals(group)) { // Initialize the list with the steps from the base class - List<String> orderList = new ArrayList<String>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); + List<String> orderList = new ArrayList<>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); // Add the new step after we source the gdbinit file to make sure the user // cannot change this behavior diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence_7_2.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence_7_2.java index 157981ed03f..efca626cd9b 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence_7_2.java +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence_7_2.java @@ -44,7 +44,7 @@ public class GDBJtagDSFFinalLaunchSequence_7_2 extends GDBJtagDSFFinalLaunchSequ if (GROUP_JTAG.equals(group)) { // Initialize the list with the base class' steps // We need to create a list that we can modify, which is why we create our own ArrayList. - List<String> orderList = new ArrayList<String>(Arrays.asList(super.getExecutionOrder(GROUP_JTAG))); + List<String> orderList = new ArrayList<>(Arrays.asList(super.getExecutionOrder(GROUP_JTAG))); // Now insert our steps right after the initialization of the base class. orderList.add(orderList.indexOf("stepInitializeJTAGFinalLaunchSequence") + 1, //$NON-NLS-1$ diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence_7_7.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence_7_7.java index dd9c2f48a80..701f7f68cbf 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence_7_7.java +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence_7_7.java @@ -44,7 +44,7 @@ public class GDBJtagDSFFinalLaunchSequence_7_7 extends GDBJtagDSFFinalLaunchSequ if (GROUP_TOP_LEVEL.equals(group)) { // Initialize the list with the base class' steps // We need to create a list that we can modify, which is why we create our own ArrayList. - List<String> orderList = new ArrayList<String>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); + List<String> orderList = new ArrayList<>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); // Add the dprintf style steps before we source the gdbinit file orderList.add(orderList.indexOf("stepSourceGDBInitFile"), "stepSetDPrinfStyle"); //$NON-NLS-1$ //$NON-NLS-2$ diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/GDBJtagDeviceContributionFactory.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/GDBJtagDeviceContributionFactory.java index 12b9582b80b..afda65663ba 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/GDBJtagDeviceContributionFactory.java +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/GDBJtagDeviceContributionFactory.java @@ -37,7 +37,7 @@ public class GDBJtagDeviceContributionFactory { protected ArrayList<GDBJtagDeviceContribution> contributions; private GDBJtagDeviceContributionFactory() { - contributions = new ArrayList<GDBJtagDeviceContribution>(); + contributions = new ArrayList<>(); loadSubtypeContributions(); } diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/Activator.java b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/Activator.java index 9acb75b1d61..988fb43b8c3 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/Activator.java +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/Activator.java @@ -111,7 +111,7 @@ public class Activator extends AbstractUIPlugin { // Set the default launch delegates as early as possible, and do it only once (Bug 312997) ILaunchManager launchMgr = DebugPlugin.getDefault().getLaunchManager(); - HashSet<String> debugSet = new HashSet<String>(); + HashSet<String> debugSet = new HashSet<>(); debugSet.add(ILaunchManager.DEBUG_MODE); ILaunchConfigurationType remoteCfg = launchMgr.getLaunchConfigurationType(HARDWARE_LAUNCH_TYPE); diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java index e1099aaeec8..de3cf485146 100644 --- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java +++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java @@ -686,7 +686,7 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab return; } connection.removeImageListener(containerTab); - ArrayList<String> imageNames = new ArrayList<String>(); + ArrayList<String> imageNames = new ArrayList<>(); displayedImages = new ArrayList<>(); for (IDockerImage image : images) { java.util.List<String> tags = image.repoTags(); @@ -981,7 +981,7 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab @Override public void run() { connection.removeImageListener(containerTab); - ArrayList<String> imageNames = new ArrayList<String>(); + ArrayList<String> imageNames = new ArrayList<>(); displayedImages = new ArrayList<>(); for (IDockerImage image : finalList) { java.util.List<String> tags = image.repoTags(); diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java index 40223b45487..a86960e8041 100644 --- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java +++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java @@ -539,7 +539,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab return; } connection.removeImageListener(containerTab); - ArrayList<String> imageNames = new ArrayList<String>(); + ArrayList<String> imageNames = new ArrayList<>(); for (IDockerImage image : images) { java.util.List<String> tags = image.repoTags(); if (tags != null) { @@ -740,7 +740,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab @Override public void run() { connection.removeImageListener(containerTab); - ArrayList<String> imageNames = new ArrayList<String>(); + ArrayList<String> imageNames = new ArrayList<>(); for (IDockerImage image : finalList) { java.util.List<String> tags = image.repoTags(); if (tags != null) { diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java index 5cf77110ffd..de8e86e96f3 100644 --- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java +++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java @@ -209,7 +209,7 @@ public class NewContainerTargetWizardPage extends WizardPage return; } connection.removeImageListener(wizardPage); - ArrayList<String> imageNames = new ArrayList<String>(); + ArrayList<String> imageNames = new ArrayList<>(); for (IDockerImage image : images) { java.util.List<String> tags = image.repoTags(); if (tags != null) { @@ -277,7 +277,7 @@ public class NewContainerTargetWizardPage extends WizardPage @Override public void run() { connection.removeImageListener(wizardPage); - ArrayList<String> imageNames = new ArrayList<String>(); + ArrayList<String> imageNames = new ArrayList<>(); for (IDockerImage image : finalList) { java.util.List<String> tags = image.repoTags(); if (tags != null) { diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate2.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate2.java index 0ee855ec3f9..26be3410d2c 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate2.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate2.java @@ -148,9 +148,9 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega String[] orderedNames = ResourcesPlugin.getWorkspace().getDescription().getBuildOrder(); if (orderedNames != null) { //Projects may not be in the build order but should still be built if selected - ArrayList<IProject> unorderedProjects = new ArrayList<IProject>(projectSet.size()); + ArrayList<IProject> unorderedProjects = new ArrayList<>(projectSet.size()); unorderedProjects.addAll(projectSet); - orderedProjList = new ArrayList<IProject>(projectSet.size()); + orderedProjList = new ArrayList<>(projectSet.size()); for (String projectName : orderedNames) { for (IProject proj : unorderedProjects) { @@ -366,7 +366,7 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega for (ICommand command : commands) { Map<String, String> args = command.getArguments(); if (args == null) { - args = new HashMap<String, String>(cfgIdArgs); + args = new HashMap<>(cfgIdArgs); } else { args.putAll(cfgIdArgs); } diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalRunLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalRunLaunchDelegate.java index 981d769fbcb..b7e28b2eb29 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalRunLaunchDelegate.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalRunLaunchDelegate.java @@ -147,7 +147,7 @@ public class LocalRunLaunchDelegate extends AbstractCLaunchDelegate2 { } } - HashMap<String, String> envMap = new HashMap<String, String>(); + HashMap<String, String> envMap = new HashMap<>(); // If the launch configuration is the only environment the inferior should see, just use that boolean append = config.getAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, true); @@ -224,7 +224,7 @@ public class LocalRunLaunchDelegate extends AbstractCLaunchDelegate2 { } // Turn it into an envp format - List<String> strings = new ArrayList<String>(envMap.size()); + List<String> strings = new ArrayList<>(envMap.size()); for (Entry<String, String> entry : envMap.entrySet()) { StringBuilder buffer = new StringBuilder(entry.getKey()); buffer.append('=').append(entry.getValue()); diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java index 05e5e7c62dc..879a05e77fd 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java @@ -131,7 +131,7 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat * A map of all our sub-launches and the current processes that belong * to each one. */ - private Map<ILaunch, IProcess[]> subLaunches = new HashMap<ILaunch, IProcess[]>(); + private Map<ILaunch, IProcess[]> subLaunches = new HashMap<>(); public MultiLaunch(ILaunchConfiguration launchConfiguration, String mode) { super(launchConfiguration, mode, null); diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationSelectionDialog.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationSelectionDialog.java index c7c4fe502c7..c4fdd796303 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationSelectionDialog.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationSelectionDialog.java @@ -133,7 +133,7 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp : LaunchMessages.MultiLaunchConfigurationSelectionDialog_14); fStackComposite = new ComboControlledStackComposite(comp, SWT.NONE); - HashMap<String, ILaunchGroup> modes = new HashMap<String, ILaunchGroup>(); + HashMap<String, ILaunchGroup> modes = new HashMap<>(); for (ILaunchGroup launchGroup : launchGroups) { if (!modes.containsKey(launchGroup.getMode())) { modes.put(launchGroup.getMode(), launchGroup); @@ -270,7 +270,7 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp } public ILaunchConfiguration[] getSelectedLaunchConfigurations() { - List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>(); + List<ILaunchConfiguration> configs = new ArrayList<>(); if (fSelection != null && !fSelection.isEmpty()) { for (Iterator<?> iter = ((IStructuredSelection) fSelection).iterator(); iter.hasNext();) { Object selection = iter.next(); diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationTabGroup.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationTabGroup.java index 62404d4391f..d029fa7d340 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationTabGroup.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationTabGroup.java @@ -264,7 +264,7 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio static class GroupLaunchTab extends AbstractLaunchConfigurationTab { protected CheckboxTreeViewer treeViewer; - protected List<LaunchElement> input = new ArrayList<LaunchElement>(); + protected List<LaunchElement> input = new ArrayList<>(); private String mode; public GroupLaunchTab(String mode) { @@ -394,7 +394,7 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio */ private int[] getMultiSelectionIndices() { StructuredSelection sel = (StructuredSelection) treeViewer.getSelection(); - List<Integer> indices = new ArrayList<Integer>(); + List<Integer> indices = new ArrayList<>(); for (Iterator<?> iter = sel.iterator(); iter.hasNext();) { MultiLaunchConfigurationDelegate.LaunchElement el = (MultiLaunchConfigurationDelegate.LaunchElement) iter diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java index ba5d8de8e05..d0a1a612db2 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java @@ -90,7 +90,7 @@ public abstract class CAbstractMainTab extends CLaunchConfigurationTab { protected Button fWorkspaceSettingsButton; /** @since 6.1 */ protected Link fWorkpsaceSettingsLink; - protected final Map<IPath, Boolean> fBinaryExeCache = new HashMap<IPath, Boolean>(); + protected final Map<IPath, Boolean> fBinaryExeCache = new HashMap<>(); protected Label fProjLabel; protected Text fProjText; protected Button fProjButton; @@ -203,7 +203,7 @@ public abstract class CAbstractMainTab extends CLaunchConfigurationTab { */ protected ICProject[] getCProjects() throws CModelException { ICProject cproject[] = CoreModel.getDefault().getCModel().getCProjects(); - ArrayList<ICProject> list = new ArrayList<ICProject>(cproject.length); + ArrayList<ICProject> list = new ArrayList<>(cproject.length); for (int i = 0; i < cproject.length; i++) { ICDescriptor cdesciptor = null; try { diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ComboControlledStackComposite.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ComboControlledStackComposite.java index 3b235c9c02c..a4034119e94 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ComboControlledStackComposite.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ComboControlledStackComposite.java @@ -41,7 +41,7 @@ public class ComboControlledStackComposite extends Composite { public ComboControlledStackComposite(Composite parent, int style) { super(parent, style); - tabMap = new LinkedHashMap<String, Composite>(); + tabMap = new LinkedHashMap<>(); setLayout(new GridLayout(2, false)); createContents(this); } diff --git a/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/service/LLDBProcesses.java b/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/service/LLDBProcesses.java index 089014b3407..91c9dc0a028 100644 --- a/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/service/LLDBProcesses.java +++ b/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/service/LLDBProcesses.java @@ -48,7 +48,7 @@ public class LLDBProcesses extends GDBProcesses_7_4 { // A map of pid to names. It is filled when we get all the // processes that are running - private Map<Integer, String> fProcessNames = new HashMap<Integer, String>(); + private Map<Integer, String> fProcessNames = new HashMap<>(); /** * Constructs the {@link LLDBProcesses} service. diff --git a/lrparser/org.eclipse.cdt.core.lrparser.tests/src/org/eclipse/cdt/core/lrparser/tests/ParseHelper.java b/lrparser/org.eclipse.cdt.core.lrparser.tests/src/org/eclipse/cdt/core/lrparser/tests/ParseHelper.java index d75cc556899..f0b8a091cc0 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser.tests/src/org/eclipse/cdt/core/lrparser/tests/ParseHelper.java +++ b/lrparser/org.eclipse.cdt.core.lrparser.tests/src/org/eclipse/cdt/core/lrparser/tests/ParseHelper.java @@ -52,8 +52,8 @@ public class ParseHelper { shouldVisitNames = true; } - public List<IASTName> nameList = new ArrayList<IASTName>(); - public List<String> problemBindings = new ArrayList<String>(); + public List<IASTName> nameList = new ArrayList<>(); + public List<String> problemBindings = new ArrayList<>(); public int numNullBindings = 0; @Override diff --git a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/action/deprecated/C99ResolveParserAction.java b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/action/deprecated/C99ResolveParserAction.java index abd52f2f27a..61df620b94f 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/action/deprecated/C99ResolveParserAction.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/action/deprecated/C99ResolveParserAction.java @@ -96,16 +96,16 @@ public class C99ResolveParserAction { private C99SymbolTable symbolTable = C99SymbolTable.EMPTY_TABLE; // A stack that keeps track of scopes in the symbol table, used to "close" scopes and to undo the opening of scopes - private final LinkedList<C99SymbolTable> symbolTableScopeStack = new LinkedList<C99SymbolTable>(); + private final LinkedList<C99SymbolTable> symbolTableScopeStack = new LinkedList<>(); // A stack that keeps track of scopes that are set on bindings - private final LinkedList<IC99Scope> bindingScopeStack = new LinkedList<IC99Scope>(); + private final LinkedList<IC99Scope> bindingScopeStack = new LinkedList<>(); // keeps track of nested declarations - private final LinkedList<DeclaratorFrame> declarationStack = new LinkedList<DeclaratorFrame>(); + private final LinkedList<DeclaratorFrame> declarationStack = new LinkedList<>(); // keeps track of expression types - private final ScopedStack<IType> exprTypeStack = new ScopedStack<IType>(); + private final ScopedStack<IType> exprTypeStack = new ScopedStack<>(); private TypeQualifiers typeQualifiers; // TODO: can this go in the declaration stack? @@ -114,7 +114,7 @@ public class C99ResolveParserAction { } // "For every action there is an equal and opposite reaction." - Newton's third law - private final LinkedList<IUndoAction> undoStack = new LinkedList<IUndoAction>(); + private final LinkedList<IUndoAction> undoStack = new LinkedList<>(); private interface IUndoAction { void undo(); diff --git a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/action/deprecated/C99TypedefTrackerParserAction.java b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/action/deprecated/C99TypedefTrackerParserAction.java index 3a282c4ac6f..74e784810a9 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/action/deprecated/C99TypedefTrackerParserAction.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/action/deprecated/C99TypedefTrackerParserAction.java @@ -41,13 +41,13 @@ public class C99TypedefTrackerParserAction { private TypedefSymbolTable symbolTable = TypedefSymbolTable.EMPTY_TABLE; // A stack that keeps track of scopes in the symbol table, used to "close" scopes and to undo the opening of scopes - private final LinkedList<TypedefSymbolTable> symbolTableScopeStack = new LinkedList<TypedefSymbolTable>(); + private final LinkedList<TypedefSymbolTable> symbolTableScopeStack = new LinkedList<>(); // keeps track of nested declarations - private final LinkedList<DeclaratorFrame> declarationStack = new LinkedList<DeclaratorFrame>(); + private final LinkedList<DeclaratorFrame> declarationStack = new LinkedList<>(); // "For every action there is an equal and opposite reaction." - Newton's third law - private final LinkedList<IUndoAction> undoStack = new LinkedList<IUndoAction>(); + private final LinkedList<IUndoAction> undoStack = new LinkedList<>(); /** * A command object that provides undo functionality. diff --git a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/action/deprecated/DeclSpec.java b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/action/deprecated/DeclSpec.java index 7139946aad1..feb69f60b9b 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/action/deprecated/DeclSpec.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/action/deprecated/DeclSpec.java @@ -55,7 +55,7 @@ import org.eclipse.cdt.internal.core.dom.lrparser.c99.bindings.C99Variable; class DeclSpec { // maps token kinds to the number of occurrences of that kind - private Map<Integer, Integer> tokenKindMap = new HashMap<Integer, Integer>(); + private Map<Integer, Integer> tokenKindMap = new HashMap<>(); private IType type = null; diff --git a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/action/deprecated/DeclaratorFrame.java b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/action/deprecated/DeclaratorFrame.java index eafe559a0c6..d4c9c6cf304 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/action/deprecated/DeclaratorFrame.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/action/deprecated/DeclaratorFrame.java @@ -39,12 +39,12 @@ public class DeclaratorFrame { private boolean isFunctionDeclarator = false; // temporary storage for pointer modifiers - private LinkedList<LinkedList<C99PointerType>> pointerModifiers = new LinkedList<LinkedList<C99PointerType>>(); + private LinkedList<LinkedList<C99PointerType>> pointerModifiers = new LinkedList<>(); // stores pointer and array modifiers that are applied to the declarator - private LinkedList<ITypeContainer> typeModifiers = new LinkedList<ITypeContainer>(); + private LinkedList<ITypeContainer> typeModifiers = new LinkedList<>(); - private LinkedList<IBinding> nestedDeclarations = new LinkedList<IBinding>(); + private LinkedList<IBinding> nestedDeclarations = new LinkedList<>(); public DeclaratorFrame() { } diff --git a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Enumeration.java b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Enumeration.java index e0b0f1b03ee..f8964535df2 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Enumeration.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Enumeration.java @@ -32,7 +32,7 @@ import org.eclipse.core.runtime.PlatformObject; @SuppressWarnings("restriction") public class C99Enumeration extends PlatformObject implements IC99Binding, IEnumeration, ITypeable { - private List<IEnumerator> enumerators = new ArrayList<IEnumerator>(); + private List<IEnumerator> enumerators = new ArrayList<>(); private String name; private IScope scope; @@ -86,7 +86,7 @@ public class C99Enumeration extends PlatformObject implements IC99Binding, IEnum public C99Enumeration clone() { try { C99Enumeration clone = (C99Enumeration) super.clone(); - clone.enumerators = new ArrayList<IEnumerator>(); + clone.enumerators = new ArrayList<>(); for (IEnumerator e : enumerators) { // TODO this is wrong, // IEnumerator is not Cloneable so we are not returning a deep copy here diff --git a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Function.java b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Function.java index 28a449d23c1..b6c73081316 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Function.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Function.java @@ -30,7 +30,7 @@ import org.eclipse.core.runtime.PlatformObject; public class C99Function extends PlatformObject implements IC99Binding, IFunction, ITypeable { private String name; private IFunctionType type; - private List<IParameter> parameters = new ArrayList<IParameter>(); + private List<IParameter> parameters = new ArrayList<>(); private boolean isAuto; private boolean isExtern; diff --git a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99FunctionType.java b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99FunctionType.java index 2580f7ee632..085352c45f2 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99FunctionType.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99FunctionType.java @@ -22,7 +22,7 @@ import org.eclipse.cdt.core.dom.ast.IType; public class C99FunctionType implements IFunctionType { private IType returnType; - private List<IType> parameterTypes = new ArrayList<IType>(); + private List<IType> parameterTypes = new ArrayList<>(); @Override public IType[] getParameterTypes() { @@ -53,7 +53,7 @@ public class C99FunctionType implements IFunctionType { try { C99FunctionType clone = (C99FunctionType) super.clone(); clone.setReturnType((IType) returnType.clone()); - clone.parameterTypes = new ArrayList<IType>(); + clone.parameterTypes = new ArrayList<>(); for (IType parameterType : parameterTypes) { clone.addParameterType((IType) parameterType.clone()); } diff --git a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Structure.java b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Structure.java index 1d8bf52e450..9f74f221916 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Structure.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Structure.java @@ -31,7 +31,7 @@ import org.eclipse.core.runtime.PlatformObject; @SuppressWarnings("restriction") public class C99Structure extends PlatformObject implements IC99Binding, ICompositeType, ITypeable { - private Map<String, IField> fields = new LinkedHashMap<String, IField>(); + private Map<String, IField> fields = new LinkedHashMap<>(); private IField[] fieldArray = null; /** either t_union or t_structure defined in IASTCompositeTypeSpecifier */ @@ -137,7 +137,7 @@ public class C99Structure extends PlatformObject implements IC99Binding, ICompos C99Structure clone = (C99Structure) super.clone(); //clone.scope = (IScope) scope.clone(); TODO clone.fieldArray = null; - clone.fields = new LinkedHashMap<String, IField>(); + clone.fields = new LinkedHashMap<>(); for (IField field : fields.values()) clone.addField(field); // TODO not a deep clone return clone; diff --git a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/symboltable/CImperativeSymbolTable.java b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/symboltable/CImperativeSymbolTable.java index 41dd3df62f4..ce2db41b52b 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/symboltable/CImperativeSymbolTable.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/symboltable/CImperativeSymbolTable.java @@ -37,7 +37,7 @@ public class CImperativeSymbolTable { private Bucket[] table = new Bucket[TABLE_SIZE]; - private LinkedList<SymbolScope> scopeStack = new LinkedList<SymbolScope>(); + private LinkedList<SymbolScope> scopeStack = new LinkedList<>(); /** * Represents a scope in the C language. @@ -49,7 +49,7 @@ public class CImperativeSymbolTable { * When the scope is closed these buckets are popped, returning the * symbol table to the state it was in before the scope was opened. */ - List<Integer> modifiedBuckets = new ArrayList<Integer>(); + List<Integer> modifiedBuckets = new ArrayList<>(); } /** diff --git a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/symboltable/FunctionalMap.java b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/symboltable/FunctionalMap.java index 098868ec851..98f70bc07ad 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/symboltable/FunctionalMap.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/symboltable/FunctionalMap.java @@ -75,7 +75,7 @@ public class FunctionalMap<K extends Comparable<K>, V> { // factory method makes it cleaner to instantiate objects public static <K extends Comparable<K>, V> FunctionalMap<K, V> emptyMap() { - return new FunctionalMap<K, V>(); + return new FunctionalMap<>(); } /** @@ -86,7 +86,7 @@ public class FunctionalMap<K extends Comparable<K>, V> { if (key == null) throw new NullPointerException(); - FunctionalMap<K, V> newMap = new FunctionalMap<K, V>(); + FunctionalMap<K, V> newMap = new FunctionalMap<>(); newMap.root = insert(this.root, key, val); newMap.root.color = BLACK; // force the root to be black @@ -97,7 +97,7 @@ public class FunctionalMap<K extends Comparable<K>, V> { private Node<K, V> insert(Node<K, V> n, K key, V val) { if (n == null) - return new Node<K, V>(key, val, RED, null, null); // new nodes are always red + return new Node<>(key, val, RED, null, null); // new nodes are always red int c = key.compareTo(n.key); if (c < 0) @@ -105,12 +105,12 @@ public class FunctionalMap<K extends Comparable<K>, V> { else if (c > 0) return balance(n.key, n.val, n.color, n.left, insert(n.right, key, val)); else // equal, create a new node that overwrites the old value - return new Node<K, V>(key, val, n.color, n.left, n.right); + return new Node<>(key, val, n.color, n.left, n.right); } private Node<K, V> balance(K key, V val, boolean color, Node<K, V> left, Node<K, V> right) { if (color == RED) - return new Node<K, V>(key, val, color, left, right); + return new Node<>(key, val, color, left, right); final Node<K, V> newLeft, newRight; @@ -118,30 +118,30 @@ public class FunctionalMap<K extends Comparable<K>, V> { if (left != null && left.color == RED) { if (left.left != null && left.left.color == RED) { - newLeft = new Node<K, V>(left.left.key, left.left.val, BLACK, left.left.left, left.left.right); - newRight = new Node<K, V>(key, val, BLACK, left.right, right); - return new Node<K, V>(left.key, left.val, RED, newLeft, newRight); + newLeft = new Node<>(left.left.key, left.left.val, BLACK, left.left.left, left.left.right); + newRight = new Node<>(key, val, BLACK, left.right, right); + return new Node<>(left.key, left.val, RED, newLeft, newRight); } if (left.right != null && left.right.color == RED) { - newLeft = new Node<K, V>(left.key, left.val, BLACK, left.left, left.right.left); - newRight = new Node<K, V>(key, val, BLACK, left.right.right, right); - return new Node<K, V>(left.right.key, left.right.val, RED, newLeft, newRight); + newLeft = new Node<>(left.key, left.val, BLACK, left.left, left.right.left); + newRight = new Node<>(key, val, BLACK, left.right.right, right); + return new Node<>(left.right.key, left.right.val, RED, newLeft, newRight); } } if (right != null && right.color == RED) { if (right.left != null && right.left.color == RED) { - newLeft = new Node<K, V>(key, val, BLACK, left, right.left.left); - newRight = new Node<K, V>(right.key, right.val, BLACK, right.left.right, right.right); - return new Node<K, V>(right.left.key, right.left.val, RED, newLeft, newRight); + newLeft = new Node<>(key, val, BLACK, left, right.left.left); + newRight = new Node<>(right.key, right.val, BLACK, right.left.right, right.right); + return new Node<>(right.left.key, right.left.val, RED, newLeft, newRight); } if (right.right != null && right.right.color == RED) { - newLeft = new Node<K, V>(key, val, BLACK, left, right.left); - newRight = new Node<K, V>(right.right.key, right.right.val, BLACK, right.right.left, right.right.right); - return new Node<K, V>(right.key, right.val, RED, newLeft, newRight); + newLeft = new Node<>(key, val, BLACK, left, right.left); + newRight = new Node<>(right.right.key, right.right.val, BLACK, right.right.left, right.right.right); + return new Node<>(right.key, right.val, RED, newLeft, newRight); } } - return new Node<K, V>(key, val, BLACK, left, right); + return new Node<>(key, val, BLACK, left, right); } /** diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/BaseExtensibleLanguage.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/BaseExtensibleLanguage.java index 208b8403510..2455bd3eab6 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/BaseExtensibleLanguage.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/BaseExtensibleLanguage.java @@ -179,7 +179,7 @@ public abstract class BaseExtensibleLanguage extends AbstractLanguage { final IScanner preprocessor = new CPreprocessor(reader, scanInfo, pl, log, config, fileCreator); preprocessor.setComputeImageLocations((options & ILanguage.OPTION_NO_IMAGE_LOCATIONS) == 0); - final Map<String, String> parserProperties = new HashMap<String, String>(); + final Map<String, String> parserProperties = new HashMap<>(); parserProperties.put(LRParserProperties.TRANSLATION_UNIT_PATH, reader.getFileLocation()); if ((options & OPTION_SKIP_FUNCTION_BODIES) != 0) parserProperties.put(LRParserProperties.SKIP_FUNCTION_BODIES, "true"); @@ -369,7 +369,7 @@ public abstract class BaseExtensibleLanguage extends AbstractLanguage { IScanner preprocessor = new CPreprocessor(reader, scanInfo, pl, log, config, fileCreator); preprocessor.setContentAssistMode(offset); - Map<String, String> parserProperties = new HashMap<String, String>(); + Map<String, String> parserProperties = new HashMap<>(); parserProperties.put(LRParserProperties.TRANSLATION_UNIT_PATH, reader.getFileLocation()); parserProperties.put(LRParserProperties.SKIP_FUNCTION_BODIES, "true"); parserProperties.put(LRParserProperties.SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS, "true"); diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/ScopedStack.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/ScopedStack.java index 4cc9c773963..77078b613d9 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/ScopedStack.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/ScopedStack.java @@ -67,8 +67,8 @@ public class ScopedStack<T> { * Creates a new ScopedStack with the first scope already open. */ public ScopedStack() { - topScope = new LinkedList<T>(); - scopeStack = new LinkedList<LinkedList<T>>(); + topScope = new LinkedList<>(); + scopeStack = new LinkedList<>(); } /** @@ -76,7 +76,7 @@ public class ScopedStack<T> { */ public void openScope() { scopeStack.add(topScope); - topScope = new LinkedList<T>(); + topScope = new LinkedList<>(); } /** diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/TokenMap.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/TokenMap.java index 49939895471..a63388091df 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/TokenMap.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/TokenMap.java @@ -44,7 +44,7 @@ public class TokenMap implements ITokenMap { kindMap = new int[fromSymbols.length]; - HashMap<String, Integer> toMap = new HashMap<String, Integer>(); + HashMap<String, Integer> toMap = new HashMap<>(); for (int i = 0, n = toSymbols.length; i < n; i++) { toMap.put(toSymbols[i], i); } diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/cpp/CPPBuildASTParserAction.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/cpp/CPPBuildASTParserAction.java index 4a97e4c916b..a2408001604 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/cpp/CPPBuildASTParserAction.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/cpp/CPPBuildASTParserAction.java @@ -182,7 +182,7 @@ public class CPPBuildASTParserAction extends BuildASTParserAction { protected final ICPPSecondaryParserFactory parserFactory; /** Stack that provides easy access to the current class name, used to disambiguate declarators. */ - protected final LinkedList<IASTName> classNames = new LinkedList<IASTName>(); + protected final LinkedList<IASTName> classNames = new LinkedList<>(); /** * @param parser @@ -834,7 +834,7 @@ public class CPPBuildASTParserAction extends BuildASTParserAction { if (hasNested) names = (LinkedList<IASTName>) astStack.pop(); else - names = new LinkedList<IASTName>(); + names = new LinkedList<>(); IASTName name = (IASTName) astStack.pop(); names.add(name); @@ -1285,7 +1285,7 @@ public class CPPBuildASTParserAction extends BuildASTParserAction { * ::= declaration_specifiers_opt <openscope-ast> init_declarator_list_opt ';' */ public void consumeDeclarationSimple(boolean hasDeclaratorList) { - List<Object> declarators = hasDeclaratorList ? astStack.closeScope() : new ArrayList<Object>(); + List<Object> declarators = hasDeclaratorList ? astStack.closeScope() : new ArrayList<>(); ICPPASTDeclSpecifier declSpec = (ICPPASTDeclSpecifier) astStack.pop(); // may be null List<IToken> ruleTokens = stream.getRuleTokens(); @@ -1302,7 +1302,7 @@ public class CPPBuildASTParserAction extends BuildASTParserAction { IASTName name = createName(stream.getLeftIToken()); declSpec = nodeFactory.newTypedefNameSpecifier(name); ParserUtil.setOffsetAndLength(declSpec, offset(name), length(name)); - declarators = new ArrayList<Object>(); // throw away the bogus declarator + declarators = new ArrayList<>(); // throw away the bogus declarator } // can happen if implicit int is used diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/lpgextensions/AbstractTrialUndoActionProvider.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/lpgextensions/AbstractTrialUndoActionProvider.java index 217fde12e73..94bd6db7fde 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/lpgextensions/AbstractTrialUndoActionProvider.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/lpgextensions/AbstractTrialUndoActionProvider.java @@ -29,7 +29,7 @@ public abstract class AbstractTrialUndoActionProvider<ACT, RULE_DATA> extends Pr /** * An action that does nothing. */ - public static final Action<Object, Object> EMPTY_ACTION = new Action<Object, Object>(); + public static final Action<Object, Object> EMPTY_ACTION = new Action<>(); /** * The parser table interpreter. @@ -141,7 +141,7 @@ public abstract class AbstractTrialUndoActionProvider<ACT, RULE_DATA> extends Pr } public static <ACT, RULE_DATA> Action<ACT, RULE_DATA> emptyAction() { - return new Action<ACT, RULE_DATA>(); + return new Action<>(); } @SuppressWarnings("unused") diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/lpgextensions/TrialUndoParser.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/lpgextensions/TrialUndoParser.java index 796fc8df888..6181c7b67d4 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/lpgextensions/TrialUndoParser.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/lpgextensions/TrialUndoParser.java @@ -223,7 +223,7 @@ public class TrialUndoParser { // Allocate configuration stack. // state.configurationStack = new ConfigurationStack(prs); - state.trialActionStack = new LinkedList<Integer>(); + state.trialActionStack = new LinkedList<>(); state.trialActionStack.add(Integer.valueOf(state.trialActionCount)); // @@ -329,7 +329,7 @@ public class TrialUndoParser { // Allocate configuration stack. // state.configurationStack = new ConfigurationStack(prs); - state.trialActionStack = new LinkedList<Integer>(); + state.trialActionStack = new LinkedList<>(); state.trialActionStack.add(Integer.valueOf(state.trialActionCount)); // diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/c99/C99ExpressionParser.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/c99/C99ExpressionParser.java index d1942165a46..dcc4650529f 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/c99/C99ExpressionParser.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/c99/C99ExpressionParser.java @@ -228,7 +228,7 @@ public class C99ExpressionParser extends PrsStream implements RuleAction, IToken } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new C99BuildASTParserAction(this, astStack, CNodeFactory.getDefault(), C99SecondaryParserFactory.getDefault()); diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/c99/C99NoCastExpressionParser.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/c99/C99NoCastExpressionParser.java index d1aec14f116..cf08f2201f6 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/c99/C99NoCastExpressionParser.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/c99/C99NoCastExpressionParser.java @@ -228,7 +228,7 @@ public class C99NoCastExpressionParser extends PrsStream implements RuleAction, } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new C99BuildASTParserAction(this, astStack, CNodeFactory.getDefault(), C99SecondaryParserFactory.getDefault()); diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/c99/C99Parser.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/c99/C99Parser.java index 011cc7bf8e2..9732b5ac37a 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/c99/C99Parser.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/c99/C99Parser.java @@ -225,7 +225,7 @@ public class C99Parser extends PrsStream } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new C99BuildASTParserAction(this, astStack, CNodeFactory.getDefault(), C99SecondaryParserFactory.getDefault()); diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/c99/C99SizeofExpressionParser.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/c99/C99SizeofExpressionParser.java index eb472080d1a..431d32c914c 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/c99/C99SizeofExpressionParser.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/c99/C99SizeofExpressionParser.java @@ -228,7 +228,7 @@ public class C99SizeofExpressionParser extends PrsStream implements RuleAction, } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new C99BuildASTParserAction(this, astStack, CNodeFactory.getDefault(), C99SecondaryParserFactory.getDefault()); diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPExpressionParser.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPExpressionParser.java index 273ba36cb53..ad608341e88 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPExpressionParser.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPExpressionParser.java @@ -227,7 +227,7 @@ public class CPPExpressionParser extends PrsStream implements RuleAction, IToken } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new CPPBuildASTParserAction(this, astStack, CPPNodeFactory.getDefault(), CPPSecondaryParserFactory.getDefault()); diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPNoCastExpressionParser.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPNoCastExpressionParser.java index 3e97046ad6f..abcc58130fe 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPNoCastExpressionParser.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPNoCastExpressionParser.java @@ -228,7 +228,7 @@ public class CPPNoCastExpressionParser extends PrsStream implements RuleAction, } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new CPPBuildASTParserAction(this, astStack, CPPNodeFactory.getDefault(), CPPSecondaryParserFactory.getDefault()); diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPNoFunctionDeclaratorParser.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPNoFunctionDeclaratorParser.java index baac3dd691d..3fe05594cb4 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPNoFunctionDeclaratorParser.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPNoFunctionDeclaratorParser.java @@ -228,7 +228,7 @@ public class CPPNoFunctionDeclaratorParser extends PrsStream implements RuleActi } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new CPPBuildASTParserAction(this, astStack, CPPNodeFactory.getDefault(), CPPSecondaryParserFactory.getDefault()); diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPParser.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPParser.java index 9eaecd071bc..51f57124e4e 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPParser.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPParser.java @@ -224,7 +224,7 @@ public class CPPParser extends PrsStream } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new CPPBuildASTParserAction(this, astStack, CPPNodeFactory.getDefault(), CPPSecondaryParserFactory.getDefault()); diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPSizeofExpressionParser.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPSizeofExpressionParser.java index 9ba3c8bf77c..3f8479efd75 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPSizeofExpressionParser.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPSizeofExpressionParser.java @@ -227,7 +227,7 @@ public class CPPSizeofExpressionParser extends PrsStream implements RuleAction, } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new CPPBuildASTParserAction(this, astStack, CPPNodeFactory.getDefault(), CPPSecondaryParserFactory.getDefault()); diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPTemplateTypeParameterParser.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPTemplateTypeParameterParser.java index a8044972e2b..47787436398 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPTemplateTypeParameterParser.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/cpp/CPPTemplateTypeParameterParser.java @@ -228,7 +228,7 @@ public class CPPTemplateTypeParameterParser extends PrsStream implements RuleAct } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new CPPBuildASTParserAction(this, astStack, CPPNodeFactory.getDefault(), CPPSecondaryParserFactory.getDefault()); diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/gcc/GCCParser.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/gcc/GCCParser.java index 550bfaa011a..ff441f30a97 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/gcc/GCCParser.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/gcc/GCCParser.java @@ -226,7 +226,7 @@ public class GCCParser extends PrsStream } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new GCCBuildASTParserAction(this, astStack, CNodeFactory.getDefault(), GCCSecondaryParserFactory.getDefault()); diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/gcc/GCCSizeofExpressionParser.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/gcc/GCCSizeofExpressionParser.java index b61e1f616e1..ae422232892 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/gcc/GCCSizeofExpressionParser.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/gcc/GCCSizeofExpressionParser.java @@ -230,7 +230,7 @@ public class GCCSizeofExpressionParser extends PrsStream implements RuleAction, } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new GCCBuildASTParserAction(this, astStack, CNodeFactory.getDefault(), GCCSecondaryParserFactory.getDefault()); diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/gpp/GPPParser.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/gpp/GPPParser.java index ab3c2e7ed2f..6a6f4133832 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/gpp/GPPParser.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/gpp/GPPParser.java @@ -228,7 +228,7 @@ public class GPPParser extends PrsStream } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new GPPBuildASTParserAction(this, astStack, CPPNodeFactory.getDefault(), GPPSecondaryParserFactory.getDefault()); diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/gpp/GPPSizeofExpressionParser.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/gpp/GPPSizeofExpressionParser.java index 61af36c4800..8849579a52d 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/gpp/GPPSizeofExpressionParser.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/internal/core/dom/lrparser/gpp/GPPSizeofExpressionParser.java @@ -231,7 +231,7 @@ public class GPPSizeofExpressionParser extends PrsStream implements RuleAction, } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new GPPBuildASTParserAction(this, astStack, CPPNodeFactory.getDefault(), GPPSecondaryParserFactory.getDefault()); diff --git a/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/GoToAddressBarWidget.java b/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/GoToAddressBarWidget.java index c718418a810..df485de6e84 100644 --- a/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/GoToAddressBarWidget.java +++ b/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/GoToAddressBarWidget.java @@ -131,7 +131,7 @@ public class GoToAddressBarWidget { /* * Parse through the list creating an ordered array for display. */ - ArrayList<String> list = new ArrayList<String>(); + ArrayList<String> list = new ArrayList<>(); while (st.hasMoreElements()) { String expression = (String) st.nextElement(); list.add(expression); @@ -243,7 +243,7 @@ public class GoToAddressBarWidget { /* * Parse through the list creating an ordered array for display. */ - ArrayList<String> list = new ArrayList<String>(); + ArrayList<String> list = new ArrayList<>(); while (st.hasMoreElements()) { list.add(st.nextToken()); } diff --git a/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java b/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java index 920d59d2e1a..cf6e6e646c4 100644 --- a/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java +++ b/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java @@ -148,9 +148,9 @@ public class MemoryBrowser extends ViewPart * elements of a "process" (process, threads, frames) have the same * retrieval object. */ - private Map<IMemoryBlockRetrieval, CTabFolder> fContextFolders = new HashMap<IMemoryBlockRetrieval, CTabFolder>(); + private Map<IMemoryBlockRetrieval, CTabFolder> fContextFolders = new HashMap<>(); - private List<IMemoryRenderingContainer> fCurrentContainers = new ArrayList<IMemoryRenderingContainer>(); + private List<IMemoryRenderingContainer> fCurrentContainers = new ArrayList<>(); private final static String KEY_CONTEXT = "CONTEXT"; //$NON-NLS-1$ private final static String KEY_CONTAINER = "CONTAINER"; //$NON-NLS-1$ @@ -962,7 +962,7 @@ public class MemoryBrowser extends ViewPart } private final class MemoryBrowserRenderingContainer implements IMemoryRenderingContainer { - private final List<IMemoryRendering> renderings = new ArrayList<IMemoryRendering>(); + private final List<IMemoryRendering> renderings = new ArrayList<>(); private MemoryBrowserRenderingContainer() { } @@ -1358,7 +1358,7 @@ public class MemoryBrowser extends ViewPart class SelectionProviderAdapter implements ISelectionProvider { - List<ISelectionChangedListener> listeners = new ArrayList<ISelectionChangedListener>(); + List<ISelectionChangedListener> listeners = new ArrayList<>(); ISelection theSelection = StructuredSelection.EMPTY; diff --git a/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/FindReplaceDialog.java b/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/FindReplaceDialog.java index d27e761d433..fbd8a0a83f1 100644 --- a/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/FindReplaceDialog.java +++ b/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/FindReplaceDialog.java @@ -177,7 +177,7 @@ public class FindReplaceDialog extends SelectionDialog { } protected byte[] parseByteSequence(String s) { - Vector<Byte> sequence = new Vector<Byte>(); + Vector<Byte> sequence = new Vector<>(); StringTokenizer st = new StringTokenizer(s, " "); //$NON-NLS-1$ while (st.hasMoreElements()) { String element = ((String) st.nextElement()).trim(); @@ -436,7 +436,7 @@ public class FindReplaceDialog extends SelectionDialog { } private String[] removeNullElements(String strings[]) { - Vector<String> nonNullStrings = new Vector<String>(); + Vector<String> nonNullStrings = new Vector<>(); for (String string : strings) if (string != null) nonNullStrings.addElement(string); diff --git a/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/MemorySearchResult.java b/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/MemorySearchResult.java index 2953d3f8e89..ea40c9a07f3 100644 --- a/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/MemorySearchResult.java +++ b/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/MemorySearchResult.java @@ -27,9 +27,9 @@ public class MemorySearchResult implements ISearchResult { private ISearchQuery fQuery; private String fLabel; - private Vector<ISearchResultListener> listeners = new Vector<ISearchResultListener>(); + private Vector<ISearchResultListener> listeners = new Vector<>(); - private Vector<MemoryMatch> fMatches = new Vector<MemoryMatch>(); + private Vector<MemoryMatch> fMatches = new Vector<>(); public MemorySearchResult(ISearchQuery query, String label) { fQuery = query; diff --git a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/internal/MemorySpacePreferencesHelper.java b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/internal/MemorySpacePreferencesHelper.java index 3b17799516d..fa4a15839a6 100644 --- a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/internal/MemorySpacePreferencesHelper.java +++ b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/internal/MemorySpacePreferencesHelper.java @@ -63,8 +63,8 @@ public class MemorySpacePreferencesHelper implements IMemorySpacePreferencesHelp */ @Override public void updateMemorySpaces(String[] ids) { - List<String> inputIdList = new ArrayList<String>(Arrays.asList(ids)); - List<String> knownIdList = new ArrayList<String>(Arrays.asList(getMemorySpaceIds())); + List<String> inputIdList = new ArrayList<>(Arrays.asList(ids)); + List<String> knownIdList = new ArrayList<>(Arrays.asList(getMemorySpaceIds())); int nextIdIndex = knownIdList.size(); boolean newIds; @@ -140,7 +140,7 @@ public class MemorySpacePreferencesHelper implements IMemorySpacePreferencesHelp public Map<String, String> getMemorySpaceDefaultColors() { String prefix = TraditionalRenderingPreferenceConstants.MEM_MEMORY_SPACE_ID_PREFIX; String[] ids = getMemorySpaceIds(); - Map<String, String> mapKeyToColor = new HashMap<String, String>(); + Map<String, String> mapKeyToColor = new HashMap<>(); String key, color; for (int i = 0; i < ids.length; i++) { key = prefix + ids[i]; diff --git a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java index 05b5fb8245f..4b897352d73 100755 --- a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java +++ b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java @@ -688,13 +688,13 @@ public class Rendering extends Composite implements IDebugEventSetListener { } } - private HashMap<BigInteger, TraditionalMemoryByte[]> fEditBuffer = new HashMap<BigInteger, TraditionalMemoryByte[]>(); + private HashMap<BigInteger, TraditionalMemoryByte[]> fEditBuffer = new HashMap<>(); private boolean fDisposed = false; private Object fLastQueued = null; - private Vector<Object> fQueue = new Vector<Object>(); + private Vector<Object> fQueue = new Vector<>(); protected MemoryUnit fCache = null; diff --git a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/RenderingAddressInfo.java b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/RenderingAddressInfo.java index 09d7ed74cc7..ad02d424f97 100644 --- a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/RenderingAddressInfo.java +++ b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/RenderingAddressInfo.java @@ -308,7 +308,7 @@ public class RenderingAddressInfo extends Rendering implements IDebugContextList } private String[] orderTypesAscending(Set<String> items) { - List<String> collection = new ArrayList<String>(items); + List<String> collection = new ArrayList<>(items); Collections.sort(collection); return collection.toArray(new String[collection.size()]); } @@ -544,7 +544,7 @@ public class RenderingAddressInfo extends Rendering implements IDebugContextList @Override public Action[] getDynamicActions() { - List<Action> actionList = new ArrayList<Action>(fAddressInfoTypeStatusMap.size()); + List<Action> actionList = new ArrayList<>(fAddressInfoTypeStatusMap.size()); if (getPaneVisible(Rendering.PANE_BINARY)) { for (final String infoType : fAddressInfoTypeStatusMap.keySet()) { Action action = fAddressInfoTypeStatusMap.getAction(infoType); diff --git a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraceOptions.java b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraceOptions.java index c4f34b6f848..8cef91279ba 100644 --- a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraceOptions.java +++ b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraceOptions.java @@ -48,7 +48,7 @@ class TraceOptions implements DebugOptionsListener { */ public TraceOptions(BundleContext context, String pluginID) { this.pluginID = pluginID; - Hashtable<String, String> props = new Hashtable<String, String>(2); + Hashtable<String, String> props = new Hashtable<>(2); props.put(org.eclipse.osgi.service.debug.DebugOptions.LISTENER_SYMBOLICNAME, pluginID); context.registerService(DebugOptionsListener.class.getName(), this, props); } diff --git a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRendering.java b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRendering.java index ff75ae58328..e972256bc0b 100644 --- a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRendering.java +++ b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRendering.java @@ -503,7 +503,7 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe private Color colorText; private Color colorTextAlternate; - private Map<Integer, Font> fonts = new HashMap<Integer, Font>(3); + private Map<Integer, Font> fonts = new HashMap<>(3); public void allocateColors() { diff --git a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/ExportMemoryDialog.java b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/ExportMemoryDialog.java index 1697919212f..2e4707b7fa7 100644 --- a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/ExportMemoryDialog.java +++ b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/ExportMemoryDialog.java @@ -172,7 +172,7 @@ public class ExportMemoryDialog extends SelectionDialog { data.left = new FormAttachment(textLabel); fFormatCombo.setLayoutData(data); - Vector<IMemoryExporter> exporters = new Vector<IMemoryExporter>(); + Vector<IMemoryExporter> exporters = new Vector<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint extensionPoint = registry diff --git a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/ImportMemoryDialog.java b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/ImportMemoryDialog.java index 701fcda642b..738134e4365 100644 --- a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/ImportMemoryDialog.java +++ b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/ImportMemoryDialog.java @@ -210,7 +210,7 @@ public class ImportMemoryDialog extends SelectionDialog { data.left = new FormAttachment(textLabel); fFormatCombo.setLayoutData(data); - Vector<Object> importers = new Vector<Object>(); + Vector<Object> importers = new Vector<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint extensionPoint = registry diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/ASTUtil.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/ASTUtil.java index 713ed93e70c..0623dee3a60 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/ASTUtil.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/ASTUtil.java @@ -185,7 +185,7 @@ public class ASTUtil { * Does not return null. */ public static Collection<IQMethod> findMethods(IQObject qobj, QtMethodReference ref) { - Set<IQMethod> bindings = new LinkedHashSet<IQMethod>(); + Set<IQMethod> bindings = new LinkedHashSet<>(); Iterable<IQMethod> methods = null; switch (ref.getType()) { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCall.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCall.java index f1a3677be61..cf046ae0c54 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCall.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCall.java @@ -174,7 +174,7 @@ public class QtFunctionCall { else if (firstNonNull == null) firstNonNull = t; else { - list = new ArrayList<T>(withNulls.length); + list = new ArrayList<>(withNulls.length); list.add(firstNonNull); list.add(t); } diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePaths.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePaths.java index 4f19b787631..53fbb559603 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePaths.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePaths.java @@ -258,7 +258,7 @@ public class QtIncludePaths extends LanguageSettingsSerializableProvider { } }); - List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(files.length + 1); + List<ICLanguageSettingEntry> entries = new ArrayList<>(files.length + 1); safeAdd(entries, qtInstallHeadersDir); for (File file : files) safeAdd(entries, file); diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePathsProvider.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePathsProvider.java index bbb5d68feea..2dcd0e02ffa 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePathsProvider.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePathsProvider.java @@ -39,7 +39,7 @@ public class QtIncludePathsProvider extends LanguageSettingsSerializableProvider * The provider identifies Qt installations by the absolute path to the qmake binary. The * include paths relevant to the installations are computed and persisted in {@link QtIncludePaths}. */ - private final Map<String, QtIncludePaths> qtInstallHeaders = new HashMap<String, QtIncludePaths>(); + private final Map<String, QtIncludePaths> qtInstallHeaders = new HashMap<>(); /** * The build configuration stores the path to the qmake binary as an environment variable. diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtMethodUtil.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtMethodUtil.java index bcecfeda006..42233f6e361 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtMethodUtil.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtMethodUtil.java @@ -114,7 +114,7 @@ public class QtMethodUtil { signature.append('('); boolean first = true; - List<String> signatures = new ArrayList<String>(); + List<String> signatures = new ArrayList<>(); qtEncSignatures = qtEncSignatures.substring(i + 1); Pattern p = Pattern.compile("^([a-zA-Z0-9+/=]*)(@?).*$"); while (!qtEncSignatures.isEmpty()) { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QEnum.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QEnum.java index 945352f4016..d904a628ef2 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QEnum.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QEnum.java @@ -26,7 +26,7 @@ public class QEnum implements IQEnum { public QEnum(String name, boolean isFlag, List<IEnumerator> enumerators) { this.name = name; this.isFlag = isFlag; - this.enumerators = new ArrayList<IQEnum.Enumerator>(enumerators.size()); + this.enumerators = new ArrayList<>(enumerators.size()); for (IEnumerator enumerator : enumerators) this.enumerators.add(new Enumerator(enumerator)); } diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QGadget.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QGadget.java index 0d2f4306bfc..6174ec9e6ca 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QGadget.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QGadget.java @@ -26,7 +26,7 @@ public class QGadget implements IQGadget { public QGadget(QtIndexImpl qtIndex, CDTIndex cdtIndex, AbstractQtPDOMClass pdomQGadget) throws CoreException { this.name = pdomQGadget.getName(); - this.enums = new ArrayList<IQEnum>(); + this.enums = new ArrayList<>(); for (QtPDOMQEnum pdom : pdomQGadget.getChildren(QtPDOMQEnum.class)) this.enums.add(new QEnum(pdom.getName(), pdom.isFlag(), pdom.getEnumerators())); } diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvInfo.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvInfo.java index 602891fab97..eb8e1f39923 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvInfo.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvInfo.java @@ -42,9 +42,9 @@ public final class QMakeEnvInfo { Collection<IFile> sensitiveFiles) { this.proFile = proFile; this.qmakeFilePath = qmakeFilePath; - this.environment = environment != null ? new HashMap<String, String>(environment) + this.environment = environment != null ? new HashMap<>(environment) : Collections.<String, String>emptyMap(); - this.sensitiveFiles = sensitiveFiles != null ? new HashSet<IFile>(sensitiveFiles) + this.sensitiveFiles = sensitiveFiles != null ? new HashSet<>(sensitiveFiles) : Collections.<IFile>emptySet(); } diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvProviderDescriptor.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvProviderDescriptor.java index 22e04f7fcd9..1d46f15cd9f 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvProviderDescriptor.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvProviderDescriptor.java @@ -37,7 +37,7 @@ public final class QMakeEnvProviderDescriptor implements Comparable<QMakeEnvProv private final IConfigurationElement element; private final String id; private final int priority; - private final AtomicReference<Boolean> evaluation = new AtomicReference<Boolean>(); + private final AtomicReference<Boolean> evaluation = new AtomicReference<>(); private final Expression enablementExpression; QMakeEnvProviderDescriptor(IConfigurationElement element) { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvProviderManager.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvProviderManager.java index 69ea716b94a..d63c9a56546 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvProviderManager.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvProviderManager.java @@ -46,7 +46,7 @@ public final class QMakeEnvProviderManager { * @return the list of extensions */ private static List<QMakeEnvProviderDescriptor> loadDescriptors() { - List<QMakeEnvProviderDescriptor> descriptors = new ArrayList<QMakeEnvProviderDescriptor>(); + List<QMakeEnvProviderDescriptor> descriptors = new ArrayList<>(); IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(Activator.ID, Activator.QMAKE_ENV_PROVIDER_EXT_POINT_NAME); for (IConfigurationElement element : elements) { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeInfo.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeInfo.java index 98a0716e19d..4d744d59737 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeInfo.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeInfo.java @@ -59,9 +59,9 @@ public final class QMakeInfo implements IQMakeInfo { this.qmakeQueryMap = Collections.unmodifiableMap(queryMap); this.qtVersion = QMakeVersion.create(queryMap.get(QMakeParser.KEY_QT_VERSION)); - List<String> tmpQtImportPaths = new ArrayList<String>( + List<String> tmpQtImportPaths = new ArrayList<>( QMakeParser.singleValue(queryMap, QMakeParser.KEY_QT_INSTALL_IMPORTS)); - List<String> tmpQtQmlPaths = new ArrayList<String>( + List<String> tmpQtQmlPaths = new ArrayList<>( QMakeParser.singleValue(queryMap, QMakeParser.KEY_QT_INSTALL_QML)); this.qtDocPath = QMakeParser.singleValue(queryMap, QMakeParser.KEY_QT_INSTALL_DOCS); diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeParser.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeParser.java index 2b0a7d2dcc3..b9b5485d933 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeParser.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeParser.java @@ -51,7 +51,7 @@ public final class QMakeParser { * @throws IOException when io error happens */ public static Map<String, String> parse(Pattern regex, BufferedReader reader) throws IOException { - Map<String, String> result = new LinkedHashMap<String, String>(); + Map<String, String> result = new LinkedHashMap<>(); String line; while ((line = reader.readLine()) != null) { @@ -95,7 +95,7 @@ public final class QMakeParser { return Collections.emptyList(); } - List<String> result = new ArrayList<String>(); + List<String> result = new ArrayList<>(); for (String item : qmake3SplitValueList(value)) { result.add(qmake3DecodeValue(item)); } @@ -161,7 +161,7 @@ public final class QMakeParser { * @return the modifiable list of values */ private static List<String> qmake3SplitValueList(String value) { - List<String> result = new ArrayList<String>(); + List<String> result = new ArrayList<>(); StringBuilder sb = new StringBuilder(); char quote = 0; boolean hadWord = false; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfo.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfo.java index d8f68fec4b5..63e66f69742 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfo.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfo.java @@ -42,7 +42,7 @@ public final class QMakeProjectInfo implements IQMakeProjectInfo { private final State STATE_INVALID = new State(); // listeners - private final List<IQMakeProjectInfoListener> listeners = new CopyOnWriteArrayList<IQMakeProjectInfoListener>(); + private final List<IQMakeProjectInfoListener> listeners = new CopyOnWriteArrayList<>(); private final IProject project; @@ -190,7 +190,7 @@ public final class QMakeProjectInfo implements IQMakeProjectInfo { // retrieves qmake executable path String qmakeFilePath = qmakeEnvInfo != null ? qmakeEnvInfo.getQMakeFilePath() : null; // retries environment - List<String> envList = new ArrayList<String>(); + List<String> envList = new ArrayList<>(); Map<String, String> envMap = qmakeEnvInfo != null ? qmakeEnvInfo.getEnvironment() : Collections.<String, String>emptyMap(); for (Map.Entry<String, String> entry : envMap.entrySet()) { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfoManager.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfoManager.java index e2d1f7ad25c..04337a12b2d 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfoManager.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfoManager.java @@ -47,7 +47,7 @@ public class QMakeProjectInfoManager { // called by QtPlugin activator to setup this class public static final void start() { synchronized (CACHE_SYNC) { - CACHE = new HashMap<IProject, QMakeProjectInfo>(); + CACHE = new HashMap<>(); } CoreModel.getDefault().addCProjectDescriptionListener(PD_LISTENER, CProjectDescriptionEvent.LOADED | CProjectDescriptionEvent.APPLIED); @@ -61,7 +61,7 @@ public class QMakeProjectInfoManager { CoreModel.getDefault().removeCProjectDescriptionListener(PD_LISTENER); List<QMakeProjectInfo> infos; synchronized (CACHE_SYNC) { - infos = new ArrayList<QMakeProjectInfo>(CACHE.values()); + infos = new ArrayList<>(CACHE.values()); CACHE = null; } for (QMakeProjectInfo info : infos) { @@ -176,9 +176,9 @@ public class QMakeProjectInfoManager { private static final class RDVisitor implements IResourceDeltaVisitor { - private final Set<IResource> projectsToDelete = new HashSet<IResource>(); - private final Set<IResource> projectsToUpdate = new HashSet<IResource>(); - private final Set<IPath> changedFiles = new HashSet<IPath>(); + private final Set<IResource> projectsToDelete = new HashSet<>(); + private final Set<IResource> projectsToUpdate = new HashSet<>(); + private final Set<IPath> changedFiles = new HashSet<>(); @Override public boolean visit(IResourceDelta delta) throws CoreException { @@ -233,7 +233,7 @@ public class QMakeProjectInfoManager { if (CACHE == null) return; - infos = new ArrayList<QMakeProjectInfo>(CACHE.values()); + infos = new ArrayList<>(CACHE.values()); } for (QMakeProjectInfo info : infos) { // checking if any project description change or any of the changed files affect QMakeProjectInfo diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QObject.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QObject.java index 3e61526fcad..44b6948379b 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QObject.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QObject.java @@ -40,12 +40,12 @@ public class QObject implements IQObject { this.name = pdomQObject.getName(); this.pdomQObject = pdomQObject; - List<IQMethod> baseSlots = new ArrayList<IQMethod>(); - List<IQMethod> baseSignals = new ArrayList<IQMethod>(); - List<IQMethod> baseInvokables = new ArrayList<IQMethod>(); - List<IQProperty> baseProps = new ArrayList<IQProperty>(); + List<IQMethod> baseSlots = new ArrayList<>(); + List<IQMethod> baseSignals = new ArrayList<>(); + List<IQMethod> baseInvokables = new ArrayList<>(); + List<IQProperty> baseProps = new ArrayList<>(); - this.bases = new ArrayList<IQObject>(); + this.bases = new ArrayList<>(); for (QtPDOMQObject base : pdomQObject.findBases()) { QObject baseQObj = new QObject(qtIndex, cdtIndex, base); this.bases.add(baseQObj); @@ -57,9 +57,9 @@ public class QObject implements IQObject { this.classInfos = pdomQObject.getClassInfos(); - List<IQMethod> slots = new ArrayList<IQMethod>(); - List<IQMethod> signals = new ArrayList<IQMethod>(); - List<IQMethod> invokables = new ArrayList<IQMethod>(); + List<IQMethod> slots = new ArrayList<>(); + List<IQMethod> signals = new ArrayList<>(); + List<IQMethod> invokables = new ArrayList<>(); for (QtPDOMQMethod pdom : pdomQObject.getChildren(QtPDOMQMethod.class)) switch (pdom.getKind()) { case Slot: @@ -79,11 +79,11 @@ public class QObject implements IQObject { this.signals = QObjectMembers.create(signals, baseSignals); this.invokables = QObjectMembers.create(invokables, baseInvokables); - this.enums = new ArrayList<IQEnum>(); + this.enums = new ArrayList<>(); for (QtPDOMQEnum pdom : pdomQObject.getChildren(QtPDOMQEnum.class)) this.enums.add(new QEnum(pdom.getName(), pdom.isFlag(), pdom.getEnumerators())); - List<IQProperty> props = new ArrayList<IQProperty>(); + List<IQProperty> props = new ArrayList<>(); for (QtPDOMProperty pdom : pdomQObject.getChildren(QtPDOMProperty.class)) { QProperty qProp = new QProperty(this, pdom.getType(), pdom.getName()); for (QtPDOMProperty.Attribute attr : pdom.getAttributes()) @@ -92,7 +92,7 @@ public class QObject implements IQObject { } this.properties = QObjectMembers.create(props, baseProps); - this.qmlRegistrations = new ArrayList<IQmlRegistration>(); + this.qmlRegistrations = new ArrayList<>(); for (QtPDOMQmlRegistration pdom : QtPDOMQmlRegistration.findFor(pdomQObject)) this.qmlRegistrations.add(QmlRegistration.create(qtIndex, pdom)); } diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QObjectMembers.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QObjectMembers.java index 246d855912a..6dc717b808b 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QObjectMembers.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QObjectMembers.java @@ -27,10 +27,10 @@ public class QObjectMembers<T extends IQObject.IMember> implements IQObject.IMem // the algorithm for computing #withoutOverrides will filter out the parent members and // not the local ones. // @see withoutOverrides() - ArrayList<T> all = new ArrayList<T>(locals.size() + inherited.size()); + ArrayList<T> all = new ArrayList<>(locals.size() + inherited.size()); all.addAll(locals); all.addAll(inherited); - return new QObjectMembers<T>(all, locals); + return new QObjectMembers<>(all, locals); } private QObjectMembers(List<T> all, Collection<T> locals) { @@ -69,7 +69,7 @@ public class QObjectMembers<T extends IQObject.IMember> implements IQObject.IMem // / \ // o1 o2 - ArrayList<T> filtered = new ArrayList<T>(all.size()); + ArrayList<T> filtered = new ArrayList<>(all.size()); for (T member : all) { boolean isOverridden = false; for (Iterator<T> i = filtered.iterator(); !isOverridden && i.hasNext();) diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtFactory.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtFactory.java index e860808c22d..c77a9701708 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtFactory.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtFactory.java @@ -108,7 +108,7 @@ public class QtFactory { @Override public QtVersion access(IIndex index) throws CoreException { // Multiple macros might be found, sort the values and choose the highest version. - SortedSet<String> versions = new TreeSet<String>(); + SortedSet<String> versions = new TreeSet<>(); try { for (IIndexMacro macro : index.findMacros(QT_VERSION, IndexFilter.ALL, null)) versions.add(new String(macro.getExpansion()).toLowerCase()); diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java index 1b3436cad10..f049cc248d2 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java @@ -116,7 +116,7 @@ public class QtIndexImpl extends QtIndex { IQmlRegistration qml = QmlRegistration.create(QtIndexImpl.this, binding); if (qml != null) { if (types == null) - types = new ArrayList<IQmlRegistration>(); + types = new ArrayList<>(); types.add(qml); } } diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/AbstractQtPDOMClass.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/AbstractQtPDOMClass.java index fabed2893d6..8900d6b4a46 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/AbstractQtPDOMClass.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/AbstractQtPDOMClass.java @@ -105,7 +105,7 @@ public abstract class AbstractQtPDOMClass extends QtPDOMBinding { } public <T extends QtPDOMBinding> List<T> getChildren(Class<T> cls) throws CoreException { - QtPDOMVisitor.All<T> collector = new QtPDOMVisitor.All<T>(cls); + QtPDOMVisitor.All<T> collector = new QtPDOMVisitor.All<>(cls); try { children.accept(collector); } catch (CoreException e) { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QObjectName.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QObjectName.java index 782833f587c..0c707c535e1 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QObjectName.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QObjectName.java @@ -27,8 +27,8 @@ import org.eclipse.core.runtime.CoreException; public class QObjectName extends AbstractQClassName { private final char[] fullyQualifiedName; - private final List<QtPropertyName> properties = new ArrayList<QtPropertyName>(); - private final Map<String, String> classInfos = new LinkedHashMap<String, String>(); + private final List<QtPropertyName> properties = new ArrayList<>(); + private final Map<String, String> classInfos = new LinkedHashMap<>(); public QObjectName(ICPPASTCompositeTypeSpecifier spec) { super(spec); diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTClass.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTClass.java index 67d63467011..10b15df5a7f 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTClass.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTClass.java @@ -153,9 +153,9 @@ public class QtASTClass { // tags (including resolving precedence). // This allows single-method tags to overlap regions because regions may be shortened // by a later step. - ArrayList<Tag> tags = new ArrayList<Tag>(); - ArrayList<Revision> revisions = new ArrayList<Revision>(); - ArrayList<Region> regions = new ArrayList<Region>(); + ArrayList<Tag> tags = new ArrayList<>(); + ArrayList<Revision> revisions = new ArrayList<>(); + ArrayList<Region> regions = new ArrayList<>(); Region currRegion = null; for (IASTNodeLocation location : spec.getNodeLocations()) { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTVisitor.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTVisitor.java index cf15b3d2946..1b07883e68c 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTVisitor.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTVisitor.java @@ -271,8 +271,8 @@ public class QtASTVisitor extends ASTVisitor { // three. Two lists are created during this processing. Then those lists are uses to create // the QEnum instances. - List<EnumDecl> enumDecls = new ArrayList<QtASTVisitor.EnumDecl>(); - Map<String, String> flagAliases = new HashMap<String, String>(); + List<EnumDecl> enumDecls = new ArrayList<>(); + Map<String, String> flagAliases = new HashMap<>(); for (IASTPreprocessorMacroExpansion expansion : expansions) { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMLinkage.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMLinkage.java index 253fa534b9a..7ddfd2afccc 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMLinkage.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMLinkage.java @@ -63,7 +63,7 @@ public class QtPDOMLinkage extends PDOMLinkage { // The version that has been read from/written to the persisted file. private int version; - private final Map<IQtASTName, PDOMBinding> cache = new WeakHashMap<IQtASTName, PDOMBinding>(); + private final Map<IQtASTName, PDOMBinding> cache = new WeakHashMap<>(); public QtPDOMLinkage(PDOM pdom, long record) throws CoreException { super(pdom, record); @@ -257,7 +257,7 @@ public class QtPDOMLinkage extends PDOMLinkage { if (names.isEmpty()) return Collections.emptyList(); - ArrayList<QtPDOMQmlRegistration> registrations = new ArrayList<QtPDOMQmlRegistration>(); + ArrayList<QtPDOMQmlRegistration> registrations = new ArrayList<>(); for (PDOMName name : names) { PDOMBinding binding = name.getBinding(); if (binding instanceof QtPDOMQmlRegistration) diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMNameIndex.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMNameIndex.java index 887fb462b15..0d5ce1e632c 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMNameIndex.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMNameIndex.java @@ -57,7 +57,7 @@ public class QtPDOMNameIndex { if (finder.headRec == 0) return Collections.emptyList(); - List<PDOMName> names = new ArrayList<PDOMName>(); + List<PDOMName> names = new ArrayList<>(); for (long node = db.getRecPtr(finder.headRec); node != 0; node = db.getRecPtr(node + Database.PTR_SIZE)) names.add(new PDOMName(qtLinkage, db.getRecPtr(node))); return names; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMProperty.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMProperty.java index 3dafe8144da..204b73c5ea3 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMProperty.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMProperty.java @@ -95,14 +95,14 @@ public class QtPDOMProperty extends QtPDOMBinding { public void setAttributes(Attribute[] attributes) throws CoreException { long rec = getDB().getRecPtr(Field.Attributes.getRecord(record)); - QtPDOMArray<Attribute> pdomArray = new QtPDOMArray<Attribute>(getQtLinkage(), Attribute.Codec, rec); + QtPDOMArray<Attribute> pdomArray = new QtPDOMArray<>(getQtLinkage(), Attribute.Codec, rec); rec = pdomArray.set(attributes); getDB().putRecPtr(Field.Attributes.getRecord(record), rec); } public Attribute[] getAttributes() throws CoreException { long rec = getDB().getRecPtr(Field.Attributes.getRecord(record)); - QtPDOMArray<Attribute> pdomArray = new QtPDOMArray<Attribute>(getQtLinkage(), Attribute.Codec, rec); + QtPDOMArray<Attribute> pdomArray = new QtPDOMArray<>(getQtLinkage(), Attribute.Codec, rec); return pdomArray.get(); } diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMQObject.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMQObject.java index 5fcaaaefb12..9707501aead 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMQObject.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMQObject.java @@ -60,7 +60,7 @@ public class QtPDOMQObject extends AbstractQtPDOMClass { public void delete() throws CoreException { long fieldRec = Field.ClassInfos.getRecord(record); - new QtPDOMArray<ClassInfo>(getQtLinkage(), ClassInfo.Codec, fieldRec).delete(); + new QtPDOMArray<>(getQtLinkage(), ClassInfo.Codec, fieldRec).delete(); getDB().putRecPtr(Field.ClassInfos.getRecord(record), 0); } @@ -76,7 +76,7 @@ public class QtPDOMQObject extends AbstractQtPDOMClass { // Store the array into the Database. long arrayRec = getDB().getRecPtr(Field.ClassInfos.getRecord(record)); - QtPDOMArray<ClassInfo> pdomArray = new QtPDOMArray<QtPDOMQObject.ClassInfo>(getQtLinkage(), ClassInfo.Codec, + QtPDOMArray<ClassInfo> pdomArray = new QtPDOMArray<>(getQtLinkage(), ClassInfo.Codec, arrayRec); arrayRec = pdomArray.set(array); @@ -85,11 +85,11 @@ public class QtPDOMQObject extends AbstractQtPDOMClass { } public Map<String, String> getClassInfos() throws CoreException { - Map<String, String> classInfos = new LinkedHashMap<String, String>(); + Map<String, String> classInfos = new LinkedHashMap<>(); // Read the array from the Database and insert the elements into the Map that is to be returned. long arrayRec = getDB().getRecPtr(Field.ClassInfos.getRecord(record)); - QtPDOMArray<ClassInfo> pdomArray = new QtPDOMArray<QtPDOMQObject.ClassInfo>(getQtLinkage(), ClassInfo.Codec, + QtPDOMArray<ClassInfo> pdomArray = new QtPDOMArray<>(getQtLinkage(), ClassInfo.Codec, arrayRec); ClassInfo[] array = pdomArray.get(); @@ -124,7 +124,7 @@ public class QtPDOMQObject extends AbstractQtPDOMClass { if (cppClassType == null) return Collections.emptyList(); - List<QtPDOMQObject> bases = new ArrayList<QtPDOMQObject>(); + List<QtPDOMQObject> bases = new ArrayList<>(); for (ICPPBase base : cppClassType.getBases()) { if (base.getVisibility() != ICPPBase.v_public) continue; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMVisitor.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMVisitor.java index 67b3e9c7f13..e423c75d964 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMVisitor.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMVisitor.java @@ -34,7 +34,7 @@ public abstract class QtPDOMVisitor implements IPDOMVisitor { public static class All<T> extends QtPDOMVisitor { private final Class<T> cls; - public final ArrayList<T> list = new ArrayList<T>(); + public final ArrayList<T> list = new ArrayList<>(); public All(Class<T> cls) { this.cls = cls; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPropertyName.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPropertyName.java index ca7145dbb5e..f1eee967885 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPropertyName.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPropertyName.java @@ -24,7 +24,7 @@ public class QtPropertyName extends AbstractQObjectMemberName implements IQtASTN private String type; // TODO The PDOM attrs should only be created in #createPDOMBinding - private List<QtPDOMProperty.Attribute> attributes = new ArrayList<QtPDOMProperty.Attribute>(); + private List<QtPDOMProperty.Attribute> attributes = new ArrayList<>(); public QtPropertyName(QObjectName qobjName, IASTName ast, String name, QtASTImageLocation location) { super(qobjName, ast, name, location); diff --git a/qt/org.eclipse.cdt.qt.ui.tests/src/org/eclipse/cdt/qt/tests/ASTUtilTests.java b/qt/org.eclipse.cdt.qt.ui.tests/src/org/eclipse/cdt/qt/tests/ASTUtilTests.java index c4a9bb42883..af7a4cf2edb 100644 --- a/qt/org.eclipse.cdt.qt.ui.tests/src/org/eclipse/cdt/qt/tests/ASTUtilTests.java +++ b/qt/org.eclipse.cdt.qt.ui.tests/src/org/eclipse/cdt/qt/tests/ASTUtilTests.java @@ -39,7 +39,7 @@ public class ASTUtilTests extends AST2TestBase { assertNotNull(tu); // Find the callee function call. - ArrayList<IASTFunctionCallExpression> fnCalls = new ArrayList<IASTFunctionCallExpression>(); + ArrayList<IASTFunctionCallExpression> fnCalls = new ArrayList<>(); collectChildren(fnCalls, tu, IASTFunctionCallExpression.class); assertEquals(7, fnCalls.size()); @@ -89,7 +89,7 @@ public class ASTUtilTests extends AST2TestBase { assertNotNull(tu); // Find the C1 type. - ArrayList<ICPPASTCompositeTypeSpecifier> specs = new ArrayList<ICPPASTCompositeTypeSpecifier>(); + ArrayList<ICPPASTCompositeTypeSpecifier> specs = new ArrayList<>(); collectChildren(specs, tu, ICPPASTCompositeTypeSpecifier.class); assertEquals(1, specs.size()); @@ -101,7 +101,7 @@ public class ASTUtilTests extends AST2TestBase { assertEquals("C1", specName.getRawSignature()); // Find the function call expression "c.get()". - ArrayList<IASTFunctionCallExpression> fnCalls = new ArrayList<IASTFunctionCallExpression>(); + ArrayList<IASTFunctionCallExpression> fnCalls = new ArrayList<>(); collectChildren(fnCalls, tu, IASTFunctionCallExpression.class); assertEquals(2, fnCalls.size()); diff --git a/qt/org.eclipse.cdt.qt.ui.tests/src/org/eclipse/cdt/qt/tests/QObjectTests.java b/qt/org.eclipse.cdt.qt.ui.tests/src/org/eclipse/cdt/qt/tests/QObjectTests.java index 4617dbb955c..59d87af3c2a 100644 --- a/qt/org.eclipse.cdt.qt.ui.tests/src/org/eclipse/cdt/qt/tests/QObjectTests.java +++ b/qt/org.eclipse.cdt.qt.ui.tests/src/org/eclipse/cdt/qt/tests/QObjectTests.java @@ -368,7 +368,7 @@ public class QObjectTests extends BaseQtTestCase { throws Exception { // this map is used to make sure that all expected attributes are found - Map<String, ExpectedQProperty> qprops = new HashMap<String, QObjectTests.ExpectedQProperty>(); + Map<String, ExpectedQProperty> qprops = new HashMap<>(); for (ExpectedQProperty qprop : expectedProperties) if (qprops.containsKey(qprop.name)) fail("duplicate properties in expected list " + qprop.name); @@ -382,7 +382,7 @@ public class QObjectTests extends BaseQtTestCase { assertEquals("unexpected type for " + expected.name, expected.name, qprop.getName()); // make sure that all attributes that were found were expected - Set<Attribute> allAttrs = new HashSet<Attribute>(Arrays.asList(Attribute.values())); + Set<Attribute> allAttrs = new HashSet<>(Arrays.asList(Attribute.values())); for (int i = 0; i < expected.attributes.length; ++i) { Attribute attr = (Attribute) expected.attributes[i]; diff --git a/qt/org.eclipse.cdt.qt.ui.tests/src/org/eclipse/cdt/qt/tests/QtRegressionTests.java b/qt/org.eclipse.cdt.qt.ui.tests/src/org/eclipse/cdt/qt/tests/QtRegressionTests.java index 55e2d3eb5b0..a99208621bf 100644 --- a/qt/org.eclipse.cdt.qt.ui.tests/src/org/eclipse/cdt/qt/tests/QtRegressionTests.java +++ b/qt/org.eclipse.cdt.qt.ui.tests/src/org/eclipse/cdt/qt/tests/QtRegressionTests.java @@ -41,12 +41,12 @@ import org.eclipse.ui.ide.IDE; public class QtRegressionTests extends BaseQtTestCase { private static Map<String, Set<String>> buildExpectedMap(String mocOutput) { - Map<String, Set<String>> expected = new HashMap<String, Set<String>>(); + Map<String, Set<String>> expected = new HashMap<>(); for (String moc_signature : mocOutput.split("\0")) { String name = moc_signature.split("\\(")[0]; Set<String> set = expected.get(name); if (set == null) { - set = new HashSet<String>(); + set = new HashSet<>(); expected.put(name, set); } set.add(moc_signature); @@ -334,7 +334,7 @@ public class QtRegressionTests extends BaseQtTestCase { // make sure that the three slot functions are found, but none of the inherited or // non-slot functions - Set<String> expected = new HashSet<String>(Arrays.asList("slot1", "slot2", "slot3")); + Set<String> expected = new HashSet<>(Arrays.asList("slot1", "slot2", "slot3")); for (IQMethod method : localSlots) assertTrue("unexpected slot " + method.getName(), expected.remove(method.getName())); assertEquals("missing slots " + expected.toString(), 0, expected.size()); diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectConnectCompletion.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectConnectCompletion.java index a2f29cc0183..68293764986 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectConnectCompletion.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectConnectCompletion.java @@ -155,7 +155,7 @@ public class QObjectConnectCompletion { private static int[] computeCommaPositions(String code) { final int length = code.length(); int pos = 0; - List<Integer> positions = new ArrayList<Integer>(); + List<Integer> positions = new ArrayList<>(); positions.add(-1); while (pos < length && pos != -1) { char ch = code.charAt(pos); @@ -207,7 +207,7 @@ public class QObjectConnectCompletion { if (qobj == null) return null; - Collection<QObjectConnectCompletion> completions = new ArrayList<QObjectConnectCompletion>(); + Collection<QObjectConnectCompletion> completions = new ArrayList<>(); String raw = arg.getRawSignature(); if (raw.startsWith(QtKeywords.SIGNAL)) for (IQMethod method : qobj.getSignals().withoutOverrides()) @@ -304,7 +304,7 @@ public class QObjectConnectCompletion { if (qtProposals == null || qtProposals.isEmpty()) return null; - Collection<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(); + Collection<ICompletionProposal> proposals = new ArrayList<>(); for (QObjectConnectCompletion qtProposal : qtProposals) qtProposal.addProposals(proposals, context); return proposals; diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QtCompletionProposalComputer.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QtCompletionProposalComputer.java index 713329a7d50..cee5b5d6845 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QtCompletionProposalComputer.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QtCompletionProposalComputer.java @@ -116,7 +116,7 @@ public class QtCompletionProposalComputer extends ParsingBasedProposalComputer { return list; if (list == null) - return new ArrayList<T>(toAdd); + return new ArrayList<>(toAdd); list.addAll(toAdd); return list; diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyAttributeProposal.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyAttributeProposal.java index c64b5d1494f..ea0b2865fd0 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyAttributeProposal.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyAttributeProposal.java @@ -118,7 +118,7 @@ public class QPropertyAttributeProposal { // Return all the methods, including inherited and non-visible ones. ICPPMethod[] methods = cls.getMethods(); - List<ICPPMethod> filtered = new ArrayList<ICPPMethod>(methods.length); + List<ICPPMethod> filtered = new ArrayList<>(methods.length); for (ICPPMethod method : methods) if (methodAttribute.keep(method)) filtered.add(method); @@ -126,7 +126,7 @@ public class QPropertyAttributeProposal { // TODO Choose the overload that is the best match -- closest parameter type and fewest // parameters with default values. - List<QPropertyAttributeProposal> proposals = new ArrayList<QPropertyAttributeProposal>(); + List<QPropertyAttributeProposal> proposals = new ArrayList<>(); for (ICPPMethod method : getMethods(context, methodAttribute)) proposals.add(new QPropertyAttributeProposal(method.getName(), getDisplay(cls, method), methodAttribute.getRelevance(method))); @@ -158,7 +158,7 @@ public class QPropertyAttributeProposal { if (qobj == null) return Collections.emptyList(); - List<QPropertyAttributeProposal> proposals = new ArrayList<QPropertyAttributeProposal>(); + List<QPropertyAttributeProposal> proposals = new ArrayList<>(); for (IQMethod qMethod : qobj.getSignals().all()) proposals.add(new QPropertyAttributeProposal(qMethod.getName(), IMethodAttribute.BaseRelevance)); @@ -488,7 +488,7 @@ public class QPropertyAttributeProposal { // Return all the methods, including inherited and non-visible ones. ICPPMethod[] methods = cls.getMethods(); - List<ICPPMethod> filtered = new ArrayList<ICPPMethod>(methods.length); + List<ICPPMethod> filtered = new ArrayList<>(methods.length); for (ICPPMethod method : methods) if (methodAttribute.keep(method)) filtered.add(method); diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyExpansion.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyExpansion.java index 7f1ec424c89..4b7c1519991 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyExpansion.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyExpansion.java @@ -348,14 +348,14 @@ public class QPropertyExpansion { // it is added as an unspecified attribute. If the loop completes, then we create a list of proposals // for from that unspecified list. - List<Attribute> unspecifiedAttributes = new ArrayList<Attribute>(); + List<Attribute> unspecifiedAttributes = new ArrayList<>(); for (IQProperty.Attribute attr : IQProperty.Attribute.values()) { if (attr.hasValue && (prevIdentifier != null && attr.identifier.equals(prevIdentifier.ident))) { Collection<QPropertyAttributeProposal> attrProposals = QPropertyAttributeProposal.buildProposals(attr, context, type, name); if (attrProposals != null) { - List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(); + List<ICompletionProposal> proposals = new ArrayList<>(); for (QPropertyAttributeProposal value : attrProposals) if (prefix == null || value.getIdentifier().startsWith(prefix)) proposals.add(value.createProposal(prefix, context.getInvocationOffset())); @@ -373,7 +373,7 @@ public class QPropertyExpansion { unspecifiedAttributes.add(new Attribute(attr)); } - List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(); + List<ICompletionProposal> proposals = new ArrayList<>(); for (Attribute attr : unspecifiedAttributes) { ICompletionProposal proposal = attr.getProposal(contextId, context); if (proposal != null) diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/pro/parser/QtProjectVariable.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/pro/parser/QtProjectVariable.java index 3ad0517e738..afde85f2992 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/pro/parser/QtProjectVariable.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/pro/parser/QtProjectVariable.java @@ -154,7 +154,7 @@ public class QtProjectVariable { * @return a List containing all of the value(s) assigned to this variable */ public List<String> getValues() { - List<String> values = new ArrayList<String>(); + List<String> values = new ArrayList<>(); values.add(matchResults.get(0).group(GROUP_VAR_CONTENTS)); for (int i = 1; i < matchResults.size(); i++) { values.add(matchResults.get(i).group(GROUP_LINE_CONTENTS)); diff --git a/testsrunner/org.eclipse.cdt.testsrunner.boost/src/org/eclipse/cdt/testsrunner/internal/boost/BoostXmlLogHandler.java b/testsrunner/org.eclipse.cdt.testsrunner.boost/src/org/eclipse/cdt/testsrunner/internal/boost/BoostXmlLogHandler.java index 19f034d968f..a66cbd70998 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner.boost/src/org/eclipse/cdt/testsrunner/internal/boost/BoostXmlLogHandler.java +++ b/testsrunner/org.eclipse.cdt.testsrunner.boost/src/org/eclipse/cdt/testsrunner/internal/boost/BoostXmlLogHandler.java @@ -59,7 +59,7 @@ public class BoostXmlLogHandler extends DefaultHandler { /** Maps the string message level representation to the Tests Runner internal enum code. */ private static final Map<String, ITestMessage.Level> STRING_TO_MESSAGE_LEVEL; static { - Map<String, ITestMessage.Level> aMap = new HashMap<String, ITestMessage.Level>(); + Map<String, ITestMessage.Level> aMap = new HashMap<>(); aMap.put(XML_NODE_INFO, ITestMessage.Level.Info); aMap.put(XML_NODE_MESSAGE, ITestMessage.Level.Message); aMap.put(XML_NODE_WARNING, ITestMessage.Level.Warning); @@ -79,7 +79,7 @@ public class BoostXmlLogHandler extends DefaultHandler { private ITestModelUpdater modelUpdater; /** Stores the text between XML tags. */ - private Stack<StringBuilder> elementDataStack = new Stack<StringBuilder>(); + private Stack<StringBuilder> elementDataStack = new Stack<>(); /** File name for current test message location. */ private String fileName; diff --git a/testsrunner/org.eclipse.cdt.testsrunner.gtest/src/org/eclipse/cdt/testsrunner/internal/gtest/OutputHandler.java b/testsrunner/org.eclipse.cdt.testsrunner.gtest/src/org/eclipse/cdt/testsrunner/internal/gtest/OutputHandler.java index 67cc732216d..af9bf6ae687 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner.gtest/src/org/eclipse/cdt/testsrunner/internal/gtest/OutputHandler.java +++ b/testsrunner/org.eclipse.cdt.testsrunner.gtest/src/org/eclipse/cdt/testsrunner/internal/gtest/OutputHandler.java @@ -507,7 +507,7 @@ public class OutputHandler { private State stateEmptyTestModuleFinal = new State(".*\\[\\s*PASSED\\s*\\]\\s+0\\s+tests.*"); //$NON-NLS-1$ // Transitions table - private Map<State, State[]> transitions = new HashMap<State, State[]>(); + private Map<State, State[]> transitions = new HashMap<>(); { // NOTE: Next states order is important! transitions.put(from(stateInitial), to(stateInitialized, stateEmptyTestModuleFinal)); diff --git a/testsrunner/org.eclipse.cdt.testsrunner.qttest/src/org/eclipse/cdt/testsrunner/internal/qttest/QtXmlLogHandler.java b/testsrunner/org.eclipse.cdt.testsrunner.qttest/src/org/eclipse/cdt/testsrunner/internal/qttest/QtXmlLogHandler.java index 76a9ce7dfe8..ae0ba0280a8 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner.qttest/src/org/eclipse/cdt/testsrunner/internal/qttest/QtXmlLogHandler.java +++ b/testsrunner/org.eclipse.cdt.testsrunner.qttest/src/org/eclipse/cdt/testsrunner/internal/qttest/QtXmlLogHandler.java @@ -85,7 +85,7 @@ public class QtXmlLogHandler extends DefaultHandler { /** Maps the string message level representation to the Tests Runner internal enum code. */ private static final Map<String, ITestMessage.Level> STRING_TO_MESSAGE_LEVEL; static { - Map<String, ITestMessage.Level> aMap = new HashMap<String, ITestMessage.Level>(); + Map<String, ITestMessage.Level> aMap = new HashMap<>(); aMap.put(XML_VALUE_MESSAGE_WARN, ITestMessage.Level.Warning); aMap.put(XML_VALUE_MESSAGE_SYSTEM, ITestMessage.Level.Message); aMap.put(XML_VALUE_MESSAGE_QDEBUG, ITestMessage.Level.Message); @@ -101,7 +101,7 @@ public class QtXmlLogHandler extends DefaultHandler { /** Maps the string incident status representation to the test case status. */ private static final Map<String, ITestCase.Status> STRING_TO_TEST_STATUS; static { - Map<String, ITestCase.Status> aMap = new HashMap<String, ITestCase.Status>(); + Map<String, ITestCase.Status> aMap = new HashMap<>(); aMap.put(XML_VALUE_INCIDENT_PASS, ITestCase.Status.Passed); aMap.put(XML_VALUE_INCIDENT_XFAIL, ITestCase.Status.Failed); aMap.put(XML_VALUE_INCIDENT_FAIL, ITestCase.Status.Failed); @@ -114,7 +114,7 @@ public class QtXmlLogHandler extends DefaultHandler { /** Maps the string incident status representation to the test message level to log about it. */ private static final Map<String, ITestMessage.Level> STRING_INCIDENT_TO_MESSAGE_LEVEL; static { - Map<String, ITestMessage.Level> aMap = new HashMap<String, ITestMessage.Level>(); + Map<String, ITestMessage.Level> aMap = new HashMap<>(); aMap.put(XML_VALUE_INCIDENT_PASS, ITestMessage.Level.Info); aMap.put(XML_VALUE_INCIDENT_XFAIL, ITestMessage.Level.Error); aMap.put(XML_VALUE_INCIDENT_FAIL, ITestMessage.Level.FatalError); @@ -127,7 +127,7 @@ public class QtXmlLogHandler extends DefaultHandler { /** Maps the metrics unit ids to the user readable names. */ private static final Map<String, String> XML_METRICS_TO_UNIT_NAME; static { - Map<String, String> aMap = new HashMap<String, String>(); + Map<String, String> aMap = new HashMap<>(); aMap.put("events", QtTestsRunnerMessages.QtXmlLogHandler_metrics_unit_events); //$NON-NLS-1$ aMap.put("callgrind", QtTestsRunnerMessages.QtXmlLogHandler_metrics_unit_instructions); //$NON-NLS-1$ aMap.put("walltime", QtTestsRunnerMessages.QtXmlLogHandler_metrics_unit_msec); //$NON-NLS-1$ diff --git a/testsrunner/org.eclipse.cdt.testsrunner.tests/src/org/eclipse/cdt/testsrunner/core/TestModelManagerBaseReorderingTestCase.java b/testsrunner/org.eclipse.cdt.testsrunner.tests/src/org/eclipse/cdt/testsrunner/core/TestModelManagerBaseReorderingTestCase.java index 7e3c46915e5..26e51dc6326 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner.tests/src/org/eclipse/cdt/testsrunner/core/TestModelManagerBaseReorderingTestCase.java +++ b/testsrunner/org.eclipse.cdt.testsrunner.tests/src/org/eclipse/cdt/testsrunner/core/TestModelManagerBaseReorderingTestCase.java @@ -29,7 +29,7 @@ import junit.framework.TestCase; public abstract class TestModelManagerBaseReorderingTestCase extends TestCase { protected TestModelManager modelManager; - protected List<String> expectedSuitesOrder = new ArrayList<String>(); + protected List<String> expectedSuitesOrder = new ArrayList<>(); protected abstract ITestSuite createTestsHierarchy(); diff --git a/testsrunner/org.eclipse.cdt.testsrunner.tests/src/org/eclipse/cdt/testsrunner/testsrunners/MockTestModelUpdater.java b/testsrunner/org.eclipse.cdt.testsrunner.tests/src/org/eclipse/cdt/testsrunner/testsrunners/MockTestModelUpdater.java index 188f1c593b3..b2962330261 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner.tests/src/org/eclipse/cdt/testsrunner/testsrunners/MockTestModelUpdater.java +++ b/testsrunner/org.eclipse.cdt.testsrunner.tests/src/org/eclipse/cdt/testsrunner/testsrunners/MockTestModelUpdater.java @@ -162,9 +162,9 @@ public class MockTestModelUpdater implements ITestModelUpdater { } } - private LinkedList<MethodInfo> methodCalls = new LinkedList<MethodInfo>(); + private LinkedList<MethodInfo> methodCalls = new LinkedList<>(); private boolean replayMode = false; - private Set<String> skippedMethods = new HashSet<String>(); + private Set<String> skippedMethods = new HashSet<>(); // NOTE: Test suites nesting is not supported yet cause there is no need in it private FakeTestSuite currentTestSuite = new FakeTestSuite(); diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/TestsRunnerPlugin.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/TestsRunnerPlugin.java index 51c587818da..c9d7166c1db 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/TestsRunnerPlugin.java +++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/TestsRunnerPlugin.java @@ -210,7 +210,7 @@ public class TestsRunnerPlugin extends AbstractUIPlugin { * @param mode launch mode */ private void setDefaultLaunchDelegate(ILaunchConfigurationType cfgType, String delegateId, String mode) { - HashSet<String> modes = new HashSet<String>(); + HashSet<String> modes = new HashSet<>(); modes.add(mode); try { if (cfgType.getPreferredDelegate(modes) == null) { diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestsRunnerProvidersManager.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestsRunnerProvidersManager.java index 28d425805fa..254223d6a1f 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestsRunnerProvidersManager.java +++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestsRunnerProvidersManager.java @@ -42,7 +42,7 @@ public class TestsRunnerProvidersManager { public TestsRunnerProviderInfo[] getTestsRunnersProviderInfo() { if (testsRunnerProviders == null) { // Initialize tests runners info - List<TestsRunnerProviderInfo> testsRunnerProvidersList = new ArrayList<TestsRunnerProviderInfo>(); + List<TestsRunnerProviderInfo> testsRunnerProvidersList = new ArrayList<>(); for (IConfigurationElement element : Platform.getExtensionRegistry() .getConfigurationElementsFor(TESTS_RUNNER_EXTENSION_POINT_ID)) { testsRunnerProvidersList.add(new TestsRunnerProviderInfo(element)); diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestCase.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestCase.java index 4ee08dbe835..836a3866f19 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestCase.java +++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestCase.java @@ -34,7 +34,7 @@ public class TestCase extends TestItem implements ITestCase { * The messages that were generated by testing framework during test * running. */ - private List<TestMessage> testMessages = new ArrayList<TestMessage>(); + private List<TestMessage> testMessages = new ArrayList<>(); public TestCase(String name, TestSuite parent) { super(name, parent); diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestModelManager.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestModelManager.java index 998fe870b00..0bd655a7486 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestModelManager.java +++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestModelManager.java @@ -47,7 +47,7 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor { public static final String ROOT_TEST_SUITE_NAME = "<root>"; //$NON-NLS-1$ /** Stack of the currently entered (and not existed) test suites. */ - private Stack<TestSuite> testSuitesStack = new Stack<TestSuite>(); + private Stack<TestSuite> testSuitesStack = new Stack<>(); /** * Currently running test case. There are no nested test cases, so the @@ -64,10 +64,10 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor { * testing is finished cause they are considered as renamed or removed). * @note Test suite insert position is important for insertion algorithm. */ - private Map<TestItem, Integer> testSuitesIndex = new HashMap<TestItem, Integer>(); + private Map<TestItem, Integer> testSuitesIndex = new HashMap<>(); /** Listeners collection. */ - private List<ITestingSessionListener> listeners = new ArrayList<ITestingSessionListener>(); + private List<ITestingSessionListener> listeners = new ArrayList<>(); /** Flag stores whether test execution time should be measured for the session. */ private boolean timeMeasurement = false; diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestSuite.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestSuite.java index c8a2911ee57..66d0b494e65 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestSuite.java +++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestSuite.java @@ -29,7 +29,7 @@ public class TestSuite extends TestItem implements ITestSuite { * * @note Children order is important. */ - private List<TestItem> children = new ArrayList<TestItem>(); + private List<TestItem> children = new ArrayList<>(); public TestSuite(String name, TestSuite parent) { super(name, parent); diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestingSession.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestingSession.java index ec2f37be2e1..d9ce77fd76a 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestingSession.java +++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestingSession.java @@ -72,7 +72,7 @@ public class TestingSession implements ITestingSession { * statistics without model scanning. * */ - private Map<ITestItem.Status, Integer> statusCounters = new EnumMap<ITestItem.Status, Integer>( + private Map<ITestItem.Status, Integer> statusCounters = new EnumMap<>( ITestItem.Status.class); /** diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestingSessionsManager.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestingSessionsManager.java index 1bbe0bc6806..0a1fdb5cc90 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestingSessionsManager.java +++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestingSessionsManager.java @@ -36,13 +36,13 @@ public class TestingSessionsManager implements ILaunchConfigurationListener { private TestsRunnerProvidersManager testsRunnersManager; /** Testing sessions history list (the first is the newest). */ - private LinkedList<TestingSession> sessions = new LinkedList<TestingSession>(); + private LinkedList<TestingSession> sessions = new LinkedList<>(); /** Currently active testing session. */ private TestingSession activeSession; /** Listeners collection. */ - private List<ITestingSessionsManagerListener> listeners = new ArrayList<ITestingSessionsManagerListener>(); + private List<ITestingSessionsManagerListener> listeners = new ArrayList<>(); /** The size limit of the testing sessions history. */ private int historySizeLimit = 10; diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/MessagesViewer.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/MessagesViewer.java index 791591da6a4..aaea323aa37 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/MessagesViewer.java +++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/MessagesViewer.java @@ -199,7 +199,7 @@ public class MessagesViewer { * @return set to store the test messages */ private TreeSet<ITestMessage> createMessagesSet() { - return new TreeSet<ITestMessage>(new Comparator<ITestMessage>() { + return new TreeSet<>(new Comparator<ITestMessage>() { @Override public int compare(ITestMessage message1, ITestMessage message2) { @@ -248,7 +248,7 @@ public class MessagesViewer { * @return list to store the test messages */ private ArrayList<ITestMessage> createMessagesList() { - return new ArrayList<ITestMessage>(); + return new ArrayList<>(); } /** @@ -358,7 +358,7 @@ public class MessagesViewer { private boolean showFileNameOnly = false; /** The set of message level to show the messages with. */ - private Set<ITestMessage.Level> acceptedMessageLevels = new HashSet<ITestMessage.Level>(); + private Set<ITestMessage.Level> acceptedMessageLevels = new HashSet<>(); /** Specifies whether test messages ordering is on or off. */ private boolean orderingMode = false; diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/TestPathUtils.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/TestPathUtils.java index 8642f8f2982..ed3f024709a 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/TestPathUtils.java +++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/TestPathUtils.java @@ -43,7 +43,7 @@ public class TestPathUtils { */ public static String getTestItemPath(ITestItem testItem) { StringBuilder itemPath = new StringBuilder(); - List<ITestItem> parentItems = new ArrayList<ITestItem>(); + List<ITestItem> parentItems = new ArrayList<>(); while (testItem != null) { parentItems.add(testItem); testItem = testItem.getParent(); @@ -85,7 +85,7 @@ public class TestPathUtils { */ public static String[] packTestPaths(ITestItem[] testItems) { String[] result = new String[testItems.length]; - List<String> testPath = new ArrayList<String>(); + List<String> testPath = new ArrayList<>(); for (int itemIdx = 0; itemIdx < testItems.length; itemIdx++) { // Collect test path parts (in reverse order) diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/TestsHierarchyViewer.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/TestsHierarchyViewer.java index 2177dc2e740..c00e4783920 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/TestsHierarchyViewer.java +++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/TestsHierarchyViewer.java @@ -75,7 +75,7 @@ public class TestsHierarchyViewer { */ private class TestCasesCollector implements IModelVisitor { - public List<ITestCase> testCases = new ArrayList<ITestCase>(); + public List<ITestCase> testCases = new ArrayList<>(); @Override public void visit(ITestCase testCase) { @@ -144,7 +144,7 @@ public class TestsHierarchyViewer { private class TestLabelProvider extends LabelProvider implements IStyledLabelProvider { /** Images for the test cases with the different statuses. */ - private Map<ITestItem.Status, Image> testCaseImages = new HashMap<ITestItem.Status, Image>(); + private Map<ITestItem.Status, Image> testCaseImages = new HashMap<>(); { testCaseImages.put(ITestItem.Status.NotRun, TestsRunnerPlugin.createAutoImage("obj16/test_notrun.gif")); //$NON-NLS-1$ testCaseImages.put(ITestItem.Status.Skipped, TestsRunnerPlugin.createAutoImage("obj16/test_skipped.gif")); //$NON-NLS-1$ @@ -157,7 +157,7 @@ public class TestsHierarchyViewer { private Image testCaseRunImage = TestsRunnerPlugin.createAutoImage("obj16/test_run.gif"); //$NON-NLS-1$ /** Images for the test suites with the different statuses. */ - private Map<ITestItem.Status, Image> testSuiteImages = new HashMap<ITestItem.Status, Image>(); + private Map<ITestItem.Status, Image> testSuiteImages = new HashMap<>(); { // NOTE: There is no skipped-icon for test suite, but it seems it is not a problem testSuiteImages.put(ITestItem.Status.NotRun, TestsRunnerPlugin.createAutoImage("obj16/tsuite_notrun.gif")); //$NON-NLS-1$ diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/UIUpdater.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/UIUpdater.java index 3a83152d162..ec4516de776 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/UIUpdater.java +++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/UIUpdater.java @@ -102,19 +102,19 @@ public class UIUpdater { * Set of tree objects on which <code>refresh()</code> should be called * during the next UI update. */ - private Set<Object> treeItemsToRefresh = new HashSet<Object>(); + private Set<Object> treeItemsToRefresh = new HashSet<>(); /** * Set of tree objects on which <code>update()</code> should be called * during the next UI update. */ - private Set<Object> treeItemsToUpdate = new HashSet<Object>(); + private Set<Object> treeItemsToUpdate = new HashSet<>(); /** Tree object that should be revealed during the next UI update. */ private Object treeItemToReveal; /** Map of tree objects that should be expanded or collapsed to their new states. */ - private Map<Object, Boolean> treeItemsToExpand = new LinkedHashMap<Object, Boolean>(); + private Map<Object, Boolean> treeItemsToExpand = new LinkedHashMap<>(); UIChangesCache() { resetChanges(); diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/HistoryDropDownAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/HistoryDropDownAction.java index 620604e7e15..393ce9e367a 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/HistoryDropDownAction.java +++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/HistoryDropDownAction.java @@ -122,7 +122,7 @@ public class HistoryDropDownAction extends Action { String[] buttonLabels = new String[] { ActionsMessages.HistoryAction_dialog_button_remove, ActionsMessages.HistoryAction_dialog_button_remove_all }; LabelProvider labelProvider = new TestRunLabelProvider(); - historyList = new ListDialogField<ITestingSession>(adapter, buttonLabels, labelProvider); + historyList = new ListDialogField<>(adapter, buttonLabels, labelProvider); historyList.setLabelText(ActionsMessages.HistoryAction_dialog_list_title); historyList.setElements(testingSessionsManager.getSessions()); @@ -318,7 +318,7 @@ public class HistoryDropDownAction extends Action { @Override public void run() { - List<ITestingSession> remainingSessions = new ArrayList<ITestingSession>(); + List<ITestingSession> remainingSessions = new ArrayList<>(); for (ITestingSession testingSession : testingSessionsManager.getSessions()) { if (!testingSession.isFinished()) { remainingSessions.add(testingSession); diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/BaseTestsLaunchDelegate.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/BaseTestsLaunchDelegate.java index efd2be596be..dfd80e78f5b 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/BaseTestsLaunchDelegate.java +++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/BaseTestsLaunchDelegate.java @@ -53,7 +53,7 @@ import org.eclipse.ui.PartInitException; public abstract class BaseTestsLaunchDelegate extends LaunchConfigurationDelegate { /** Stores the changes made to the launch configuration. */ - private Map<String, String> changesToLaunchConfiguration = new HashMap<String, String>(); + private Map<String, String> changesToLaunchConfiguration = new HashMap<>(); @Override public ILaunch getLaunch(ILaunchConfiguration config, String mode) throws CoreException { diff --git a/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/LinkedProperties.java b/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/LinkedProperties.java index af181dbc2ae..9b9bfc02f61 100644 --- a/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/LinkedProperties.java +++ b/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/LinkedProperties.java @@ -20,7 +20,7 @@ public class LinkedProperties extends Properties { private static final long serialVersionUID = 1L; - private final HashSet<Object> keys = new LinkedHashSet<Object>(); + private final HashSet<Object> keys = new LinkedHashSet<>(); public Iterable<Object> orderedKeys() { return Collections.list(keys()); diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/UPCKeyword.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/UPCKeyword.java index a3162c8f9cb..0b03b24a9df 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/UPCKeyword.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/UPCKeyword.java @@ -46,7 +46,7 @@ public enum UPCKeyword { private final int tokenKind; - private static final CharArrayMap<Integer> tokenMap = new CharArrayMap<Integer>(); + private static final CharArrayMap<Integer> tokenMap = new CharArrayMap<>(); private static final String[] upcKeywords; private static final String[] allKeywords; diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCExpressionParser.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCExpressionParser.java index ca37ad62c5c..7f5dbeba906 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCExpressionParser.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCExpressionParser.java @@ -231,7 +231,7 @@ public class UPCExpressionParser extends PrsStream implements RuleAction, IToken } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new UPCParserAction(this, astStack, new UPCASTNodeFactory(), UPCSecondaryParserFactory.getDefault()); action.setParserProperties(properties); diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCNoCastExpressionParser.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCNoCastExpressionParser.java index ade5075117e..0f9df34d01c 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCNoCastExpressionParser.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCNoCastExpressionParser.java @@ -231,7 +231,7 @@ public class UPCNoCastExpressionParser extends PrsStream implements RuleAction, } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new UPCParserAction(this, astStack, new UPCASTNodeFactory(), UPCSecondaryParserFactory.getDefault()); action.setParserProperties(properties); diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParser.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParser.java index 694f1e0fff0..f180117b510 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParser.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParser.java @@ -228,7 +228,7 @@ public class UPCParser extends PrsStream } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new UPCParserAction(this, astStack, new UPCASTNodeFactory(), UPCSecondaryParserFactory.getDefault()); action.setParserProperties(properties); diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCSizeofExpressionParser.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCSizeofExpressionParser.java index 7e90b77d25d..1c4524a1359 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCSizeofExpressionParser.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCSizeofExpressionParser.java @@ -231,7 +231,7 @@ public class UPCSizeofExpressionParser extends PrsStream implements RuleAction, } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new UPCParserAction(this, astStack, new UPCASTNodeFactory(), UPCSecondaryParserFactory.getDefault()); action.setParserProperties(properties); diff --git a/visualizer/org.eclipse.cdt.visualizer.core/src/org/eclipse/cdt/visualizer/core/Extension.java b/visualizer/org.eclipse.cdt.visualizer.core/src/org/eclipse/cdt/visualizer/core/Extension.java index ee566d3f62e..d25af0c4171 100644 --- a/visualizer/org.eclipse.cdt.visualizer.core/src/org/eclipse/cdt/visualizer/core/Extension.java +++ b/visualizer/org.eclipse.cdt.visualizer.core/src/org/eclipse/cdt/visualizer/core/Extension.java @@ -62,7 +62,7 @@ public class Extension extends ExtensionElement { /** Wraps list of raw extension declarations. */ public static List<Extension> wrapExtensions(IConfigurationElement[] elements) { int count = (elements == null) ? 0 : elements.length; - List<Extension> result = new ArrayList<Extension>(count); + List<Extension> result = new ArrayList<>(count); for (int i = 0; i < count; ++i) { result.add(new Extension(elements[i])); } diff --git a/visualizer/org.eclipse.cdt.visualizer.core/src/org/eclipse/cdt/visualizer/core/ExtensionElement.java b/visualizer/org.eclipse.cdt.visualizer.core/src/org/eclipse/cdt/visualizer/core/ExtensionElement.java index 61c1faee6cc..49e4bdce1f7 100755 --- a/visualizer/org.eclipse.cdt.visualizer.core/src/org/eclipse/cdt/visualizer/core/ExtensionElement.java +++ b/visualizer/org.eclipse.cdt.visualizer.core/src/org/eclipse/cdt/visualizer/core/ExtensionElement.java @@ -39,7 +39,7 @@ public class ExtensionElement { /** Wraps list of raw extension declarations. */ public static List<ExtensionElement> wrapExtensionElements(IConfigurationElement[] elements) { int count = (elements == null) ? 0 : elements.length; - List<ExtensionElement> result = new ArrayList<ExtensionElement>(count); + List<ExtensionElement> result = new ArrayList<>(count); for (int i = 0; i < count; ++i) { result.add(new ExtensionElement(elements[i])); } diff --git a/visualizer/org.eclipse.cdt.visualizer.examples/src/org/eclipse/cdt/visualizer/examples/sourcegraph/SourceGraphControl.java b/visualizer/org.eclipse.cdt.visualizer.examples/src/org/eclipse/cdt/visualizer/examples/sourcegraph/SourceGraphControl.java index 9843aa983df..b2764f5a9b6 100644 --- a/visualizer/org.eclipse.cdt.visualizer.examples/src/org/eclipse/cdt/visualizer/examples/sourcegraph/SourceGraphControl.java +++ b/visualizer/org.eclipse.cdt.visualizer.examples/src/org/eclipse/cdt/visualizer/examples/sourcegraph/SourceGraphControl.java @@ -89,7 +89,7 @@ public class SourceGraphControl extends BufferedCanvas { /** Constructor. */ public SourceGraphControl(Composite parent) { super(parent); - m_characters = new ArrayList<CharStat>(); + m_characters = new ArrayList<>(); m_banner = new GraphicObject(); } @@ -117,7 +117,7 @@ public class SourceGraphControl extends BufferedCanvas { // TODO: reuse the array/hashtable and stat objects - Hashtable<String, CharStat> characters = new Hashtable<String, CharStat>(); + Hashtable<String, CharStat> characters = new Hashtable<>(); int len = m_sourceText.length(); int fragment_length = 2; diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/VisualizerViewer.java b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/VisualizerViewer.java index 5d548bd7a95..2aa59e9a0e6 100644 --- a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/VisualizerViewer.java +++ b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/VisualizerViewer.java @@ -267,7 +267,7 @@ public class VisualizerViewer extends PageBook // TODO: add error checking, logging for errors in extension declarations // TODO: do we need to worry about this being called more than once? - m_visualizers = new Hashtable<String, IVisualizer>(); + m_visualizers = new Hashtable<>(); List<Extension> visualizers = Extension.getExtensions(CDTVisualizerUIPlugin.FEATURE_ID, VISUALIZER_EXTENSION_POINT_NAME); diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/GraphicCanvas.java b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/GraphicCanvas.java index 1dd1559e419..28c5da4b28b 100755 --- a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/GraphicCanvas.java +++ b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/GraphicCanvas.java @@ -46,7 +46,7 @@ public class GraphicCanvas extends BufferedCanvas { /** Constructor. */ public GraphicCanvas(Composite parent) { super(parent); - m_objects = new ArrayList<IGraphicObject>(); + m_objects = new ArrayList<>(); Listener mouseListener = new Listener() { @Override public void handleEvent(Event event) { diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/VirtualBoundsGraphicObject.java b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/VirtualBoundsGraphicObject.java index b24b59f7f36..2381c74fd7e 100644 --- a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/VirtualBoundsGraphicObject.java +++ b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/VirtualBoundsGraphicObject.java @@ -40,10 +40,10 @@ public class VirtualBoundsGraphicObject extends GraphicObject { protected Rectangle m_virtualBounds = new Rectangle(0, 0, 0, 0); /** List of children objects contained in this one */ - protected ArrayList<VirtualBoundsGraphicObject> m_childrenObjects = new ArrayList<VirtualBoundsGraphicObject>(); + protected ArrayList<VirtualBoundsGraphicObject> m_childrenObjects = new ArrayList<>(); /** Map of contained objects and their identifying labels. for quick look-up */ - protected HashMap<String, VirtualBoundsGraphicObject> m_childrenObjectsMap = new HashMap<String, VirtualBoundsGraphicObject>(); + protected HashMap<String, VirtualBoundsGraphicObject> m_childrenObjectsMap = new HashMap<>(); /** Whether the container's boundaries should be drawn */ protected boolean m_drawContainerBounds = true; @@ -262,7 +262,7 @@ public class VirtualBoundsGraphicObject extends GraphicObject { /** Returns a list of child objects of a given derived class, optionally recursing through child objects */ public ArrayList<VirtualBoundsGraphicObject> getChildObjects(Class<?> type, boolean recurse) { - ArrayList<VirtualBoundsGraphicObject> objs = new ArrayList<VirtualBoundsGraphicObject>(); + ArrayList<VirtualBoundsGraphicObject> objs = new ArrayList<>(); for (VirtualBoundsGraphicObject o : this.getAllObjects(recurse)) { if (type.isInstance(o)) { @@ -295,7 +295,7 @@ public class VirtualBoundsGraphicObject extends GraphicObject { /** Gets all objects from this container. Optionally recurse to all sub-objects */ public ArrayList<VirtualBoundsGraphicObject> getAllObjects(boolean recurse) { - ArrayList<VirtualBoundsGraphicObject> list = new ArrayList<VirtualBoundsGraphicObject>(); + ArrayList<VirtualBoundsGraphicObject> list = new ArrayList<>(); for (VirtualBoundsGraphicObject o : m_childrenObjects) { list.add(o); if (recurse) { @@ -307,7 +307,7 @@ public class VirtualBoundsGraphicObject extends GraphicObject { /** Returns a list of selectable objects */ public List<VirtualBoundsGraphicObject> getSelectableObjects() { - List<VirtualBoundsGraphicObject> list = new ArrayList<VirtualBoundsGraphicObject>(); + List<VirtualBoundsGraphicObject> list = new ArrayList<>(); for (VirtualBoundsGraphicObject o : m_childrenObjects) { if (o.isSelectable()) { list.add(o); diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/ListenerList.java b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/ListenerList.java index 35c25ecee66..a2352fac2a0 100755 --- a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/ListenerList.java +++ b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/ListenerList.java @@ -78,7 +78,7 @@ abstract public class ListenerList { /** Adds a listener */ public synchronized void addListener(Object listener) { if (m_listeners == null) { - m_listeners = new ArrayList<Object>(); + m_listeners = new ArrayList<>(); } if (!m_listeners.contains(listener)) { m_listeners.add(listener); @@ -105,7 +105,7 @@ abstract public class ListenerList { synchronized (this) { // keep the lock on the listener list as brief as possible if (m_listeners != null) { - listeners = new ArrayList<Object>(m_listeners); + listeners = new ArrayList<>(m_listeners); } } int count = (listeners == null) ? 0 : listeners.size(); diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/SelectionUtils.java b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/SelectionUtils.java index b9cde133363..3a489fec137 100644 --- a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/SelectionUtils.java +++ b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/SelectionUtils.java @@ -49,12 +49,12 @@ public class SelectionUtils { @Override public Iterator<Object> iterator() { - return new ArrayList<Object>().iterator(); + return new ArrayList<>().iterator(); } @Override public List<Object> toList() { - return new ArrayList<Object>(); + return new ArrayList<>(); } @Override @@ -138,9 +138,9 @@ public class SelectionUtils { result = new ArrayList<Object>(structuredSelection.toList()); } else if (selection instanceof Collection) { Collection<?> collection = (Collection<?>) selection; - result = new ArrayList<Object>(collection); + result = new ArrayList<>(collection); } else { - List<Object> list = new ArrayList<Object>(); + List<Object> list = new ArrayList<>(); list.add(selection); result = list; } @@ -233,7 +233,7 @@ public class SelectionUtils { /** Creates list from array/set of elements */ public static List<Object> toList(Collection<?> collection) { int size = (collection == null) ? 0 : collection.size(); - List<Object> result = new ArrayList<Object>(size); + List<Object> result = new ArrayList<>(size); if (collection != null) result.addAll(collection); return result; diff --git a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinDiscoveredPathInfo.java b/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinDiscoveredPathInfo.java index 9d43eda9ebe..90669f42f9e 100644 --- a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinDiscoveredPathInfo.java +++ b/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinDiscoveredPathInfo.java @@ -25,7 +25,7 @@ import org.eclipse.core.runtime.IPath; public class WinDiscoveredPathInfo implements IDiscoveredPathInfo { private final IPath[] paths; - private final Map<String, String> symbols = new HashMap<String, String>(); + private final Map<String, String> symbols = new HashMap<>(); public WinDiscoveredPathInfo() { // Include paths diff --git a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinEnvironmentVariableSupplier.java b/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinEnvironmentVariableSupplier.java index 13863cadca2..7ec9e358730 100644 --- a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinEnvironmentVariableSupplier.java +++ b/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinEnvironmentVariableSupplier.java @@ -133,7 +133,7 @@ public class WinEnvironmentVariableSupplier public static IPath[] getIncludePath() { // Include paths - List<IPath> includePaths = new ArrayList<IPath>(); + List<IPath> includePaths = new ArrayList<>(); if (sdkDir != null) { includePaths.add(new Path(sdkDir.concat("Include"))); includePaths.add(new Path(sdkDir.concat("Include\\gl"))); @@ -152,7 +152,7 @@ public class WinEnvironmentVariableSupplier private static synchronized void initvars() { if (envvars != null) return; - envvars = new HashMap<String, IBuildEnvironmentVariable>(); + envvars = new HashMap<>(); // The SDK Location sdkDir = getSDKDir(); diff --git a/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/core/lrparser/xlc/XlcKeywords.java b/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/core/lrparser/xlc/XlcKeywords.java index b8227279d18..d8984870628 100644 --- a/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/core/lrparser/xlc/XlcKeywords.java +++ b/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/core/lrparser/xlc/XlcKeywords.java @@ -30,7 +30,7 @@ public class XlcKeywords extends CLanguageKeywords { public static final XlcKeywords ALL_C_KEYWORDS = createC(true, true); public static final XlcKeywords ALL_CPP_KEYWORDS = createCPP(true, true, true, true, true); - private final CharArrayMap<Integer> map = new CharArrayMap<Integer>(); + private final CharArrayMap<Integer> map = new CharArrayMap<>(); private final ParserLanguage language; private String[] allKeywords = null; @@ -107,7 +107,7 @@ public class XlcKeywords extends CLanguageKeywords { ICLanguageKeywords base = new CLanguageKeywords(language, getConfig(language)); String[] baseKeywords = base.getKeywords(); - List<String> keywords = new ArrayList<String>(); + List<String> keywords = new ArrayList<>(); keywords.addAll(Arrays.asList(baseKeywords)); for (char[] keyword : map.keys()) { diff --git a/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/internal/core/lrparser/xlc/c/XlcCParser.java b/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/internal/core/lrparser/xlc/c/XlcCParser.java index 72b62e87b0d..19e0999a649 100644 --- a/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/internal/core/lrparser/xlc/c/XlcCParser.java +++ b/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/internal/core/lrparser/xlc/c/XlcCParser.java @@ -228,7 +228,7 @@ public class XlcCParser extends PrsStream } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new XlcCBuildASTParserAction(this, astStack, XlcCNodeFactory.getDefault(), GCCSecondaryParserFactory.getDefault()); diff --git a/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/internal/core/lrparser/xlc/cpp/XlcCPPParser.java b/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/internal/core/lrparser/xlc/cpp/XlcCPPParser.java index 4d05f69e37d..89e38f2ba29 100644 --- a/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/internal/core/lrparser/xlc/cpp/XlcCPPParser.java +++ b/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/internal/core/lrparser/xlc/cpp/XlcCPPParser.java @@ -230,7 +230,7 @@ public class XlcCPPParser extends PrsStream } private void initActions(Map<String, String> properties) { - ScopedStack<Object> astStack = new ScopedStack<Object>(); + ScopedStack<Object> astStack = new ScopedStack<>(); action = new XlcCPPBuildASTParserAction(this, astStack, XlcCPPNodeFactory.getDefault(), GPPSecondaryParserFactory.getDefault()); diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/XlcErrorParserTester.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/XlcErrorParserTester.java index 217943ebd27..da531ab13ef 100644 --- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/XlcErrorParserTester.java +++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/XlcErrorParserTester.java @@ -59,7 +59,7 @@ public class XlcErrorParserTester { private String message; } - private List<MarkerData> markerDataList = new ArrayList<MarkerData>(); + private List<MarkerData> markerDataList = new ArrayList<>(); /* * Dummy class implementing IMarkerGenerator lets get through testing diff --git a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/AbstractXLCBuildOutputParser.java b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/AbstractXLCBuildOutputParser.java index e7ef4adde10..10edebfaf5a 100644 --- a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/AbstractXLCBuildOutputParser.java +++ b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/AbstractXLCBuildOutputParser.java @@ -226,8 +226,8 @@ public abstract class AbstractXLCBuildOutputParser implements IScannerInfoConsol * @return array of commands */ protected String[][] tokenize(String line, boolean escapeInsideDoubleQuotes) { - ArrayList<String[]> commands = new ArrayList<String[]>(); - ArrayList<String> tokens = new ArrayList<String>(); + ArrayList<String[]> commands = new ArrayList<>(); + ArrayList<String> tokens = new ArrayList<>(); StringBuffer token = new StringBuffer(); final char[] input = line.toCharArray(); @@ -388,7 +388,7 @@ public abstract class AbstractXLCBuildOutputParser implements IScannerInfoConsol protected List<String> getFileExtensionsList() { IContentTypeManager manager = Platform.getContentTypeManager(); - List<String> extensions = new LinkedList<String>(); + List<String> extensions = new LinkedList<>(); IContentType cSource = manager.getContentType(CCorePlugin.CONTENT_TYPE_CSOURCE); IContentType cppSource = manager.getContentType(CCorePlugin.CONTENT_TYPE_CXXSOURCE); @@ -408,7 +408,7 @@ public abstract class AbstractXLCBuildOutputParser implements IScannerInfoConsol protected String[] getFileExtensions() { IContentTypeManager manager = Platform.getContentTypeManager(); - List<String> extensions = new LinkedList<String>(); + List<String> extensions = new LinkedList<>(); IContentType cSource = manager.getContentType(CCorePlugin.CONTENT_TYPE_CSOURCE); IContentType cppSource = manager.getContentType(CCorePlugin.CONTENT_TYPE_CXXSOURCE); diff --git a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/PerFileXLCScannerInfoCollector.java b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/PerFileXLCScannerInfoCollector.java index 5ef88b40059..6c399b62398 100644 --- a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/PerFileXLCScannerInfoCollector.java +++ b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/PerFileXLCScannerInfoCollector.java @@ -181,7 +181,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I private boolean updateMacroSettings(ICLanguageSetting langSetting) { ICLanguageSettingEntry[] entries = langSetting.getSettingEntries(ICSettingEntry.MACRO); - List<ICLanguageSettingEntry> newEntries = new LinkedList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> newEntries = new LinkedList<>(); for (ICLanguageSettingEntry entry : entries) { newEntries.add(entry); } @@ -219,7 +219,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I private boolean updateIncludeSettings(ICLanguageSetting langSetting) { ICLanguageSettingEntry[] entries = langSetting.getSettingEntries(ICSettingEntry.INCLUDE_PATH); - List<ICLanguageSettingEntry> newEntries = new LinkedList<ICLanguageSettingEntry>(); + List<ICLanguageSettingEntry> newEntries = new LinkedList<>(); for (ICLanguageSettingEntry entry : entries) { newEntries.add(entry); } @@ -281,7 +281,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I synchronized (fLock) { IPerFileDiscoveredPathInfo2 info1 = getPerFileInfo1(); if (info1 != null) { - Map<IResource, PathInfo> map = new HashMap<IResource, PathInfo>(); + Map<IResource, PathInfo> map = new HashMap<>(); map.putAll(info1.getPathInfoMap()); map.putAll(fInfo2.getPathInfoMap()); return map; @@ -301,7 +301,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I synchronized (fLock) { IPerFileDiscoveredPathInfo2 info1 = getPerFileInfo1(); if (info1 != null) { - List<IPath> list = new LinkedList<IPath>(); + List<IPath> list = new LinkedList<>(); for (IPath path1 : info1.getIncludeFiles(path)) { list.add(path1); } @@ -322,7 +322,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I public IPath[] getIncludePaths(IPath path) { synchronized (fLock) { - Set<IPath> pathSet = new HashSet<IPath>(); + Set<IPath> pathSet = new HashSet<>(); // add project level settings if other info is per project if (fInfo1 instanceof DiscoveredPathInfo) { @@ -353,7 +353,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I @Override public IPath[] getMacroFiles(IPath path) { synchronized (fLock) { - Set<IPath> pathSet = new HashSet<IPath>(); + Set<IPath> pathSet = new HashSet<>(); IPerFileDiscoveredPathInfo2 info1 = getPerFileInfo1(); if (info1 != null) { @@ -376,7 +376,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I public IPath[] getQuoteIncludePaths(IPath path) { synchronized (fLock) { - Set<IPath> pathSet = new HashSet<IPath>(); + Set<IPath> pathSet = new HashSet<>(); IPerFileDiscoveredPathInfo2 info1 = getPerFileInfo1(); if (info1 != null) { @@ -399,7 +399,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I public Map<String, String> getSymbols(IPath path) { synchronized (fLock) { - Map<String, String> symbols = new HashMap<String, String>(); + Map<String, String> symbols = new HashMap<>(); // add project level settings Map<String, String> projectSymbols = fInfo1.getSymbols(); @@ -478,7 +478,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I public IPath[] getIncludeFiles(IPath path) { synchronized (fLock) { - Set<IPath> pathSet = new LinkedHashSet<IPath>(); + Set<IPath> pathSet = new LinkedHashSet<>(); // get the command CCommandDSC cmd = getCommand(path); if (cmd != null) { @@ -516,7 +516,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I if (includepaths == null || includepaths.length == 0) { return quotepaths; } - ArrayList<IPath> result = new ArrayList<IPath>(includepaths.length + quotepaths.length); + ArrayList<IPath> result = new ArrayList<>(includepaths.length + quotepaths.length); result.addAll(Arrays.asList(includepaths)); result.addAll(Arrays.asList(quotepaths)); return result.toArray(new IPath[result.size()]); @@ -528,7 +528,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I @Override public IPath[] getIncludePaths(IPath path) { synchronized (fLock) { - Set<IPath> pathSet = new LinkedHashSet<IPath>(); + Set<IPath> pathSet = new LinkedHashSet<>(); // get the command CCommandDSC cmd = getCommand(path); if (cmd != null) { @@ -554,7 +554,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I @Override public IPath[] getMacroFiles(IPath path) { synchronized (fLock) { - Set<IPath> pathSet = new LinkedHashSet<IPath>(); + Set<IPath> pathSet = new LinkedHashSet<>(); // get the command CCommandDSC cmd = getCommand(path); if (cmd != null) { @@ -596,7 +596,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I @Override public IPath[] getQuoteIncludePaths(IPath path) { synchronized (fLock) { - Set<IPath> pathSet = new LinkedHashSet<IPath>(); + Set<IPath> pathSet = new LinkedHashSet<>(); // get the command CCommandDSC cmd = getCommand(path); if (cmd != null) { @@ -646,7 +646,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I @Override public Map<String, String> getSymbols(IPath path) { synchronized (fLock) { - Map<String, String> definedSymbols = new HashMap<String, String>(); + Map<String, String> definedSymbols = new HashMap<>(); // put project data in first so file level data can override it // use project scope scanner info @@ -728,9 +728,9 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I public final Map<IFile, Integer> fileToCommandIdMap; // maps each file to the corresponding command id public ScannerInfoData() { - commandIdCommandMap = new LinkedHashMap<Integer, CCommandDSC>(); // [commandId, command] - fileToCommandIdMap = new HashMap<IFile, Integer>(); // [file, commandId] - commandIdToFilesMap = new HashMap<Integer, Set<IFile>>(); // [commandId, set of files] + commandIdCommandMap = new LinkedHashMap<>(); // [commandId, command] + fileToCommandIdMap = new HashMap<>(); // [file, commandId] + commandIdToFilesMap = new HashMap<>(); // [commandId, set of files] } /* (non-Javadoc) @@ -747,10 +747,10 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); - Map<ScannerInfoTypes, List<String>> scannerInfo = new HashMap<ScannerInfoTypes, List<String>>(); + Map<ScannerInfoTypes, List<String>> scannerInfo = new HashMap<>(); - List<String> includes = new LinkedList<String>(); - List<String> symbols = new LinkedList<String>(); + List<String> includes = new LinkedList<>(); + List<String> symbols = new LinkedList<>(); // iterate over children for (Node projectChild = projectElement @@ -852,7 +852,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I } // serialize file level info - List<Integer> commandIds = new ArrayList<Integer>(commandIdCommandMap.keySet()); + List<Integer> commandIds = new ArrayList<>(commandIdCommandMap.keySet()); Collections.sort(commandIds); for (Iterator<Integer> i = commandIds.iterator(); i.hasNext();) { Integer commandId = i.next(); @@ -915,7 +915,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I IPath[] incFiles = stringListToPathArray(cmd.getIncludeFile()); IPath[] macroFiles = stringListToPathArray(cmd.getImacrosFile()); List symbols = cmd.getSymbols(); - Map<String, String> definedSymbols = new HashMap<String, String>(symbols.size()); + Map<String, String> definedSymbols = new HashMap<>(symbols.size()); for (Iterator i = symbols.iterator(); i.hasNext();) { String symbol = (String) i.next(); String key = ScannerConfigUtil.getSymbolKey(symbol); @@ -932,7 +932,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I * @return */ protected static IPath[] stringListToPathArray(List<String> discovered) { - List<Path> allIncludes = new ArrayList<Path>(discovered.size()); + List<Path> allIncludes = new ArrayList<>(discovered.size()); for (Iterator<String> j = discovered.iterator(); j.hasNext();) { String include = j.next(); if (!allIncludes.contains(include)) { @@ -948,7 +948,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I /** monitor for data access */ protected final Object fLock = new Object(); - private Map<IProject, Map<?, ?>> fProjectSettingsMap = new HashMap<IProject, Map<?, ?>>(); + private Map<IProject, Map<?, ?>> fProjectSettingsMap = new HashMap<>(); protected final SortedSet<Integer> freeCommandIdPool; // sorted set of free command ids protected IProject project; @@ -965,10 +965,10 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I sid = new ScannerInfoData(); // siChangedForFileList = new ArrayList(); - siChangedForFileMap = new HashMap<IResource, Integer>(); - siChangedForCommandIdList = new ArrayList<Integer>(); + siChangedForFileMap = new HashMap<>(); + siChangedForCommandIdList = new ArrayList<>(); - freeCommandIdPool = new TreeSet<Integer>(); + freeCommandIdPool = new TreeSet<>(); } /** @@ -977,7 +977,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I */ protected void addCompilerCommand(IFile file, CCommandDSC cmd) { synchronized (fLock) { - List<CCommandDSC> existingCommands = new ArrayList<CCommandDSC>(sid.commandIdCommandMap.values()); + List<CCommandDSC> existingCommands = new ArrayList<>(sid.commandIdCommandMap.values()); int index = existingCommands.indexOf(cmd); if (index != -1) { cmd = existingCommands.get(index); @@ -1045,7 +1045,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I // update sid.commandIdToFilesMap Set<IFile> fileSet = sid.commandIdToFilesMap.get(commandId); if (fileSet == null) { - fileSet = new HashSet<IFile>(); + fileSet = new HashSet<>(); sid.commandIdToFilesMap.put(commandId, fileSet); CCommandDSC cmd = sid.commandIdCommandMap.get(commandId); if (cmd != null) { @@ -1083,7 +1083,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I protected Map<IResource, PathInfo> calculatePathInfoMap() { synchronized (fLock) { - Map<IResource, PathInfo> map = new HashMap<IResource, PathInfo>(sid.fileToCommandIdMap.size() + 1); + Map<IResource, PathInfo> map = new HashMap<>(sid.fileToCommandIdMap.size() + 1); Map.Entry entry; IFile file; CCommandDSC cmd; @@ -1317,7 +1317,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I includes = (List<String>) projectScannerInfo.get(ScannerInfoTypes.INCLUDE_PATHS); } - List<IPath> pathList = new LinkedList<IPath>(); + List<IPath> pathList = new LinkedList<>(); if (includes != null) { for (String include : includes) { @@ -1346,7 +1346,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I */ protected IPath[] getAllIncludePaths1(int type) { synchronized (fLock) { - List<String> allIncludes = new ArrayList<String>(); + List<String> allIncludes = new ArrayList<>(); for (Iterator<Integer> i = sid.commandIdCommandMap.keySet().iterator(); i.hasNext();) { Integer cmdId = i.next(); CCommandDSC cmd = sid.commandIdCommandMap.get(cmdId); @@ -1397,7 +1397,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I Map projectScannerInfo = fProjectSettingsMap.get(project); - Map<String, String> symbols = new HashMap<String, String>(); + Map<String, String> symbols = new HashMap<>(); if (projectScannerInfo != null) { List<String> projectSymbols = (List<String>) projectScannerInfo @@ -1427,7 +1427,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I */ protected Map<String, String> getAllSymbols1() { synchronized (fLock) { - Map<String, String> symbols = new HashMap<String, String>(); + Map<String, String> symbols = new HashMap<>(); for (Iterator<Integer> i = sid.commandIdCommandMap.keySet().iterator(); i.hasNext();) { Integer cmdId = i.next(); CCommandDSC cmd = sid.commandIdCommandMap.get(cmdId); @@ -1451,7 +1451,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I @Override public List<CCommandDSC> getCollectedScannerInfo(Object resource, ScannerInfoTypes type) { - List<CCommandDSC> rv = new ArrayList<CCommandDSC>(); + List<CCommandDSC> rv = new ArrayList<>(); // check the resource String errorMessage = null; if (resource == null) { @@ -1554,7 +1554,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I @Override public List<String> getIncludePaths() { synchronized (fLock) { - List<String> pathStrings = new LinkedList<String>(); + List<String> pathStrings = new LinkedList<>(); List<IPath> paths = Arrays.asList(getAllIncludePaths(INCLUDE_PATH)); paths.addAll(Arrays.asList(getAllIncludePaths(QUOTE_INCLUDE_PATH))); @@ -1637,7 +1637,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I } monitor.beginTask(Messages.getString("ScannerInfoCollector.Processing"), 100); //$NON-NLS-1$ monitor.subTask(Messages.getString("ScannerInfoCollector.Processing")); //$NON-NLS-1$ - ArrayList<IResource> changedResources = new ArrayList<IResource>(); + ArrayList<IResource> changedResources = new ArrayList<>(); synchronized (fLock) { if (scannerInfoChanged()) { applyFileDeltas(); diff --git a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCBuildOutputParserUtility.java b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCBuildOutputParserUtility.java index 6e7e3048fe1..dec8c2aebd4 100644 --- a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCBuildOutputParserUtility.java +++ b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCBuildOutputParserUtility.java @@ -101,8 +101,8 @@ public class XLCBuildOutputParserUtility { private List<String> fNameConflicts; protected XLCBuildOutputParserUtility(IPath baseDirectory, IPath workingDirectory) { - fDirectoryStack = new Vector<IPath>(); - fErrors = new ArrayList<Problem>(); + fDirectoryStack = new Vector<>(); + fErrors = new ArrayList<>(); this.fBaseDirectory = baseDirectory; if (workingDirectory != null) { pushDirectory(workingDirectory); @@ -114,8 +114,8 @@ public class XLCBuildOutputParserUtility { * */ public XLCBuildOutputParserUtility(IProject project, IPath workingDirectory, IMarkerGenerator markerGenerator) { - fDirectoryStack = new Vector<IPath>(); - fErrors = new ArrayList<Problem>(); + fDirectoryStack = new Vector<>(); + fErrors = new ArrayList<>(); this.project = project; fBaseDirectory = getPathForResource(project); if (workingDirectory != null) { diff --git a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerFileBuildOutputParser.java b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerFileBuildOutputParser.java index 9f55f00aeb8..c0f7b78c395 100644 --- a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerFileBuildOutputParser.java +++ b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerFileBuildOutputParser.java @@ -132,9 +132,9 @@ public class XLCPerFileBuildOutputParser extends AbstractXLCBuildOutputParser { if (true /*file != null*/) { CCommandDSC cmd = getUtility().getNewCCommandDSC(tokens, compilerInvocationIndex, extensionsIndex > 0); - List<CCommandDSC> cmdList = new CopyOnWriteArrayList<CCommandDSC>(); + List<CCommandDSC> cmdList = new CopyOnWriteArrayList<>(); cmdList.add(cmd); - Map<ScannerInfoTypes, List<CCommandDSC>> sc = new HashMap<ScannerInfoTypes, List<CCommandDSC>>(1); + Map<ScannerInfoTypes, List<CCommandDSC>> sc = new HashMap<>(1); sc.put(ScannerInfoTypes.COMPILER_COMMAND, cmdList); getCollector().contributeToScannerConfig(file, sc); if (fCollector != null && fCollector instanceof IScannerInfoCollector2) { diff --git a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerProjectBuildOutputParser.java b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerProjectBuildOutputParser.java index 04a188f0ef2..c2a19dce496 100644 --- a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerProjectBuildOutputParser.java +++ b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerProjectBuildOutputParser.java @@ -49,9 +49,9 @@ public class XLCPerProjectBuildOutputParser extends AbstractXLCBuildOutputParser } // Recognized gcc or g++ compiler invocation - List<String> includes = new CopyOnWriteArrayList<String>(); - List<String> symbols = new CopyOnWriteArrayList<String>(); - List<String> targetSpecificOptions = new CopyOnWriteArrayList<String>(); + List<String> includes = new CopyOnWriteArrayList<>(); + List<String> symbols = new CopyOnWriteArrayList<>(); + List<String> targetSpecificOptions = new CopyOnWriteArrayList<>(); String fileName = null; for (int j = compilerInvocationIdx + 1; j < tokens.length; j++) { @@ -148,7 +148,7 @@ public class XLCPerProjectBuildOutputParser extends AbstractXLCBuildOutputParser } // Contribute discovered includes and symbols to the ScannerInfoCollector if (translatedIncludes.size() > 0 || symbols.size() > 0) { - Map<ScannerInfoTypes, List<String>> scannerInfo = new HashMap<ScannerInfoTypes, List<String>>(); + Map<ScannerInfoTypes, List<String>> scannerInfo = new HashMap<>(); scannerInfo.put(ScannerInfoTypes.INCLUDE_PATHS, translatedIncludes); scannerInfo.put(ScannerInfoTypes.SYMBOL_DEFINITIONS, symbols); scannerInfo.put(ScannerInfoTypes.TARGET_SPECIFIC_OPTION, targetSpecificOptions); diff --git a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XlCSpecsConsoleParser.java b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XlCSpecsConsoleParser.java index 35f7fc71547..54a9af68d69 100644 --- a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XlCSpecsConsoleParser.java +++ b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XlCSpecsConsoleParser.java @@ -64,11 +64,11 @@ public class XlCSpecsConsoleParser implements IScannerInfoConsoleParser { protected IScannerInfoCollector fCollector = null; - protected List<String> symbols = new ArrayList<String>(); + protected List<String> symbols = new ArrayList<>(); - protected List<String> includes = new ArrayList<String>(); - protected List<String> c_includes = new ArrayList<String>(); - protected List<String> cpp_includes = new ArrayList<String>(); + protected List<String> includes = new ArrayList<>(); + protected List<String> c_includes = new ArrayList<>(); + protected List<String> cpp_includes = new ArrayList<>(); boolean c_lang; // if language is C only search for the C include paths from the XL Compiler, otherwise get the C++ ones. @@ -173,7 +173,7 @@ public class XlCSpecsConsoleParser implements IScannerInfoConsoleParser { */ @Override public void shutdown() { - Map<ScannerInfoTypes, List<String>> scannerInfo = new HashMap<ScannerInfoTypes, List<String>>(); + Map<ScannerInfoTypes, List<String>> scannerInfo = new HashMap<>(); // insert compiler constants, work around buggy xlC option for dumping symbols (it misses a few) for (String constant : compilerConstants) { diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.core/src/org/eclipse/cdt/managedbuilder/xlc/core/XlcBuiltinSpecsDetector.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.core/src/org/eclipse/cdt/managedbuilder/xlc/core/XlcBuiltinSpecsDetector.java index cadfcf72135..edc06ec460a 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.core/src/org/eclipse/cdt/managedbuilder/xlc/core/XlcBuiltinSpecsDetector.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.core/src/org/eclipse/cdt/managedbuilder/xlc/core/XlcBuiltinSpecsDetector.java @@ -72,7 +72,7 @@ public class XlcBuiltinSpecsDetector extends ToolchainBuiltinSpecsDetector @Override protected List<String> parseOptions(String line) { - List<String> options = new ArrayList<String>(); + List<String> options = new ArrayList<>(); Matcher optionMatcher = OPTIONS_PATTERN.matcher(line); while (optionMatcher.find()) { String option = optionMatcher.group(OPTION_GROUP); |