mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 09:16:02 +02:00
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
This commit is contained in:
parent
8844a8f9f2
commit
caf2292768
1432 changed files with 4538 additions and 4538 deletions
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)));
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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]);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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() {
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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++) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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];
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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>,
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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])) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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)));
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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) {
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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++) {
|
||||
|
|
|
@ -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) {
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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]);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue