diff options
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom')
28 files changed, 49 insertions, 49 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/Checksums.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/Checksums.java index 21a22f57be1..70143155075 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/Checksums.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/Checksums.java @@ -105,7 +105,7 @@ public class Checksums { */ public static Map<String, Object> createChecksumMap(IFile[] tus, MessageDigest md, IProgressMonitor pm) throws OperationCanceledException { - Map<String, Object> result = new HashMap<String, Object>(); + Map<String, Object> result = new HashMap<>(); putAlgorithm(result, md); pm.beginTask(Messages.Checksums_taskComputeChecksums, tus.length); for (IFile file : tus) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexUpdatePolicy.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexUpdatePolicy.java index dad14340d4f..4c0d54c62de 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexUpdatePolicy.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexUpdatePolicy.java @@ -32,9 +32,9 @@ public class IndexUpdatePolicy { private final ICProject fCProject; private int fKind; - private HashSet<ITranslationUnit> fForce = new HashSet<ITranslationUnit>(); - private HashSet<ITranslationUnit> fTimestamp = new HashSet<ITranslationUnit>(); - private HashSet<ITranslationUnit> fRemoved = new HashSet<ITranslationUnit>(); + private HashSet<ITranslationUnit> fForce = new HashSet<>(); + private HashSet<ITranslationUnit> fTimestamp = new HashSet<>(); + private HashSet<ITranslationUnit> fRemoved = new HashSet<>(); private IPDOMIndexer fIndexer; private boolean fReindexRequested; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/LanguageSettingsChangeListener.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/LanguageSettingsChangeListener.java index ed9dfd528e8..04ea3d69079 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/LanguageSettingsChangeListener.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/LanguageSettingsChangeListener.java @@ -71,7 +71,7 @@ public class LanguageSettingsChangeListener implements ILanguageSettingsChangeLi private void reindex(String cfgId, ILanguageSettingsChangeEvent event) { CModelManager manager = CModelManager.getDefault(); ICProject cProject = manager.getCModel().getCProject(event.getProjectName()); - Set<ICElement> tuSelection = new HashSet<ICElement>(); + Set<ICElement> tuSelection = new HashSet<>(); Set<IResource> resources = event.getAffectedResources(cfgId); if (resources != null && !resources.isEmpty()) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java index af60d35e886..3cdb615386e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java @@ -1581,7 +1581,7 @@ public class PDOM extends PlatformObject implements IPDOM { public void putCachedVariableResult(Long key, IValue result) { synchronized (fVariableResultCache) { - fVariableResultCache.put(key, new WeakReference<IValue>(result)); + fVariableResultCache.put(key, new WeakReference<>(result)); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMASTProcessorManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMASTProcessorManager.java index 1f5c4fb55c6..4877dd3340f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMASTProcessorManager.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMASTProcessorManager.java @@ -29,7 +29,7 @@ public class PDOMASTProcessorManager { private static final String EXTENSION_POINT = "PDOMASTProcessor"; //$NON-NLS-1$ - private static final List<PDOMASTProcessorDesc> processors = new ArrayList<PDOMASTProcessorDesc>(); + private static final List<PDOMASTProcessorDesc> processors = new ArrayList<>(); static { // Load the extensions IConfigurationElement[] elements = Platform.getExtensionRegistry() @@ -52,7 +52,7 @@ public class PDOMASTProcessorManager { IPDOMASTProcessor processor = desc.getProcessorFor(ast); if (processor != null) { if (list == null) - list = new ArrayList<IPDOMASTProcessor>(); + list = new ArrayList<>(); list.add(processor); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMProxy.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMProxy.java index 5db504904f9..b678934cb27 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMProxy.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMProxy.java @@ -49,12 +49,12 @@ import org.eclipse.core.runtime.IProgressMonitor; public class PDOMProxy implements IPDOM { private PDOM fDelegate; private int fReadLockCount; - private Set<IListener> fListeners = new HashSet<IListener>(); + private Set<IListener> fListeners = new HashSet<>(); private Map<Thread, DebugLockInfo> fLockDebugging; public PDOMProxy() { if (PDOM.sDEBUG_LOCKS) { - fLockDebugging = new HashMap<Thread, DebugLockInfo>(); + fLockDebugging = new HashMap<>(); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/TeamPDOMExportOperation.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/TeamPDOMExportOperation.java index 8a600e4c5e1..6b1a4c9686b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/TeamPDOMExportOperation.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/TeamPDOMExportOperation.java @@ -176,7 +176,7 @@ public class TeamPDOMExportOperation implements IWorkspaceRunnable { private void createChecksums(ICProject cproject, PDOM pdom, File target, IProgressMonitor monitor) throws CoreException { - HashSet<String> fullPaths = new HashSet<String>(); + HashSet<String> fullPaths = new HashSet<>(); try { pdom.acquireReadLock(); } catch (InterruptedException e) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WaitForRefreshJobs.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WaitForRefreshJobs.java index 8cacdff1a32..d9dbbc435ec 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WaitForRefreshJobs.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WaitForRefreshJobs.java @@ -29,7 +29,7 @@ import org.eclipse.core.runtime.jobs.Job; * Postpones indexer setup until there are no running refresh jobs. */ public class WaitForRefreshJobs extends IndexerSetupParticipant { - private Set<ICProject> fProjects = new HashSet<ICProject>(); + private Set<ICProject> fProjects = new HashSet<>(); private Set<Job> fRefreshJobs = Collections.synchronizedSet(new HashSet<Job>()); private IJobChangeListener fJobListener = new IJobChangeListener() { @@ -85,7 +85,7 @@ public class WaitForRefreshJobs extends IndexerSetupParticipant { if (isRefreshing()) return; projects = fProjects; - fProjects = new HashSet<ICProject>(); + fProjects = new HashSet<>(); } for (ICProject project : projects) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java index 6d95d6822ee..fd38a885dd9 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java @@ -215,7 +215,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment { * @throws CoreException */ public void rewriteLocations(final IIndexLocationConverter newConverter) throws CoreException { - final List<PDOMFile> pdomfiles = new ArrayList<PDOMFile>(); + final List<PDOMFile> pdomfiles = new ArrayList<>(); getFileIndex().accept(new IBTreeVisitor() { @Override public int compare(long record) throws CoreException { @@ -231,7 +231,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment { }); clearFileIndex(); - final List<PDOMFile> notConverted = new ArrayList<PDOMFile>(); + final List<PDOMFile> notConverted = new ArrayList<>(); for (PDOMFile file : pdomfiles) { String internalFormat = newConverter.toInternalFormat(file.getLocation()); if (internalFormat != null) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java index d154b94a61f..14672682e25 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java @@ -242,7 +242,7 @@ public class DBProperties { } public static Set<String> getKeySet(final Database db, final BTree index) throws CoreException { - final Set<String> result = new HashSet<String>(); + final Set<String> result = new HashSet<>(); index.accept(new IBTreeVisitor() { @Override public int compare(long record) throws CoreException { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/PDOMStringSet.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/PDOMStringSet.java index fe50f7cc582..df7caae07e3 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/PDOMStringSet.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/PDOMStringSet.java @@ -99,7 +99,7 @@ public class PDOMStringSet { NodeType.Item.put(db, new_node, record); if (lazyCache == null) - lazyCache = new HashMap<String, Long>(); + lazyCache = new HashMap<>(); lazyCache.put(str, record); // If the Database has already been partially searched, then the loaded pointer will be after the @@ -131,7 +131,7 @@ public class PDOMStringSet { // otherwise prepare the cache for the data that is about to be loaded if (lazyCache == null) - lazyCache = new HashMap<String, Long>(); + lazyCache = new HashMap<>(); // if nothing has been loaded, then start loading with the head node, otherwise continue // loading from whatever is after the last loaded node diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerCollector.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerCollector.java index 75f57112fab..0e79ad238b3 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerCollector.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerCollector.java @@ -38,7 +38,7 @@ public final class MacroContainerCollector implements IBTreeVisitor { private IProgressMonitor monitor = null; private int monitorCheckCounter = 0; - private List<PDOMMacroContainer> macros = new ArrayList<PDOMMacroContainer>(); + private List<PDOMMacroContainer> macros = new ArrayList<>(); /** * Collects all nodes with given name, passing the filter. If prefixLookup is set to diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerPatternCollector.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerPatternCollector.java index 3f3bd84f67d..e3a6abfd7e5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerPatternCollector.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerPatternCollector.java @@ -29,7 +29,7 @@ import org.eclipse.core.runtime.OperationCanceledException; public final class MacroContainerPatternCollector implements IBTreeVisitor { private final PDOMLinkage fLinkage; - private final List<PDOMMacroContainer> macros = new ArrayList<PDOMMacroContainer>(); + private final List<PDOMMacroContainer> macros = new ArrayList<>(); private final Pattern fPattern; private final IProgressMonitor fMonitor; private int fMonitorCheckCounter = 0; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java index 0c7ea7d0aaf..fa841dd5ace 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java @@ -476,7 +476,7 @@ public class PDOMFile implements IIndexFragmentFile { assert getFirstName() == null; assert getFirstMacroReference() == null; final PDOMLinkage linkage = getLinkage(); - HashMap<IASTName, PDOMName> nameCache = new HashMap<IASTName, PDOMName>(); + HashMap<IASTName, PDOMName> nameCache = new HashMap<>(); PDOMName lastName = null; PDOMMacroReferenceName lastMacroName = null; for (IASTName[] name : names) { @@ -592,7 +592,7 @@ public class PDOMFile implements IIndexFragmentFile { setFirstMacro(null); // Delete all the names in this file - ArrayList<PDOMName> names = new ArrayList<PDOMName>(); + ArrayList<PDOMName> names = new ArrayList<>(); PDOMName name = getFirstName(); while (name != null) { names.add(name); @@ -606,7 +606,7 @@ public class PDOMFile implements IIndexFragmentFile { setFirstName(null); // Delete all macro references - ArrayList<PDOMMacroReferenceName> mrefs = new ArrayList<PDOMMacroReferenceName>(); + ArrayList<PDOMMacroReferenceName> mrefs = new ArrayList<>(); PDOMMacroReferenceName mref = getFirstMacroReference(); while (mref != null) { mrefs.add(mref); @@ -684,7 +684,7 @@ public class PDOMFile implements IIndexFragmentFile { @Override public IIndexInclude[] getIncludes() throws CoreException { - List<PDOMInclude> result = new ArrayList<PDOMInclude>(); + List<PDOMInclude> result = new ArrayList<>(); PDOMInclude include = getFirstInclude(); while (include != null) { result.add(include); @@ -706,7 +706,7 @@ public class PDOMFile implements IIndexFragmentFile { @Override public IIndexMacro[] getMacros() throws CoreException { - List<PDOMMacro> result = new ArrayList<PDOMMacro>(); + List<PDOMMacro> result = new ArrayList<>(); PDOMMacro macro = getFirstMacro(); while (macro != null) { result.add(macro); @@ -722,7 +722,7 @@ public class PDOMFile implements IIndexFragmentFile { @Override public IIndexName[] findNames(int offset, int length) throws CoreException { - ArrayList<IIndexName> result = new ArrayList<IIndexName>(); + ArrayList<IIndexName> result = new ArrayList<>(); for (PDOMName name = getFirstName(); name != null; name = name.getNextInFile()) { int nameOffset = name.getNodeOffset(); if (nameOffset >= offset) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java index ea02592d4c8..170f025f470 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java @@ -440,7 +440,7 @@ public abstract class PDOMLinkage extends PDOMNamedNode implements IIndexLinkage .getCachedResult(key); CharArrayMap<PDOMBinding[]> map = cached == null ? null : cached.get(); if (map == null) { - map = new CharArrayMap<PDOMBinding[]>(); + map = new CharArrayMap<>(); pdom.putCachedResult(key, new SoftReference<CharArrayMap<?>>(map)); } return map; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCEnumeration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCEnumeration.java index da1f2588880..df26b63665a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCEnumeration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCEnumeration.java @@ -104,13 +104,13 @@ class PDOMCEnumeration extends PDOMBinding implements IEnumeration, IIndexType, if (result == null && create) { // there is no cache, build it: result = loadEnumerators(); - pdom.putCachedResult(key, new SoftReference<List<PDOMCEnumerator>>(result)); + pdom.putCachedResult(key, new SoftReference<>(result)); } return result; } private List<PDOMCEnumerator> loadEnumerators() { - final ArrayList<PDOMCEnumerator> result = new ArrayList<PDOMCEnumerator>(); + final ArrayList<PDOMCEnumerator> result = new ArrayList<>(); try { PDOMNodeLinkedList list = new PDOMNodeLinkedList(getLinkage(), record + OFFSET_ENUMERATOR_LIST); list.accept(new IPDOMVisitor() { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java index b1a7f443859..1cb22a003c7 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java @@ -219,7 +219,7 @@ public class PDOMCPPClassTemplate extends PDOMCPPClassType @Override public ICPPClassTemplatePartialSpecialization[] getPartialSpecializations() { try { - ArrayList<PDOMCPPClassTemplatePartialSpecialization> partials = new ArrayList<PDOMCPPClassTemplatePartialSpecialization>(); + ArrayList<PDOMCPPClassTemplatePartialSpecialization> partials = new ArrayList<>(); for (PDOMCPPClassTemplatePartialSpecialization partial = getFirstPartial(); partial != null; partial = partial .getNextPartial()) { partials.add(partial); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumScope.java index 4c8a6eea309..3dca8c8e21c 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumScope.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumScope.java @@ -88,7 +88,7 @@ class PDOMCPPEnumScope implements ICPPEnumScope, IIndexScope { try { CharArrayObjectMap<IPDOMCPPEnumerator> map = getBindingMap(fBinding); if (lookup.isPrefixLookup()) { - final List<IBinding> result = new ArrayList<IBinding>(); + final List<IBinding> result = new ArrayList<>(); final char[] nc = lookup.getLookupKey(); IContentAssistMatcher matcher = ContentAssistMatcherFactory.getInstance().createMatcher(nc); for (char[] key : map.keys()) { @@ -187,7 +187,7 @@ class PDOMCPPEnumScope implements ICPPEnumScope, IIndexScope { // loses the order. List<IPDOMCPPEnumerator> enumerators = new ArrayList<>(); enumType.loadEnumerators(enumerators); - List<IEnumerator> result = new ArrayList<IEnumerator>(); + List<IEnumerator> result = new ArrayList<>(); for (IEnumerator value : enumerators) { if (IndexFilter.ALL_DECLARED.acceptBinding(value)) { result.add(value); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java index d3d099b6034..4752e5e0ab5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java @@ -196,7 +196,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants { private final static int RECORD_SIZE = FIRST_NAMESPACE_CHILD_OFFSET + Database.PTR_SIZE; // Only used when writing to database, which is single-threaded - private final LinkedList<Runnable> postProcesses = new LinkedList<Runnable>(); + private final LinkedList<Runnable> postProcesses = new LinkedList<>(); public PDOMCPPLinkage(PDOM pdom, long record) { super(pdom, record); @@ -1533,7 +1533,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants { if (rec == 0) { return ICPPUsingDirective.EMPTY_ARRAY; } - LinkedList<ICPPUsingDirective> uds = new LinkedList<ICPPUsingDirective>(); + LinkedList<ICPPUsingDirective> uds = new LinkedList<>(); do { PDOMCPPUsingDirective ud = new PDOMCPPUsingDirective(this, rec); uds.addFirst(ud); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDeclarationSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDeclarationSpecialization.java index 9baaef0f319..0460b2c70d3 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDeclarationSpecialization.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDeclarationSpecialization.java @@ -43,7 +43,7 @@ class PDOMCPPUsingDeclarationSpecialization extends PDOMCPPSpecialization implem PDOMBinding specialized) throws CoreException { super(linkage, parent, (ICPPSpecialization) using, specialized); - Set<PDOMBinding> targets = new LinkedHashSet<PDOMBinding>(); + Set<PDOMBinding> targets = new LinkedHashSet<>(); PDOMNodeLinkedList list = new PDOMNodeLinkedList(getLinkage(), record + TARGET_BINDINGS); for (IBinding delegate : using.getDelegates()) { PDOMBinding target = getLinkage().adaptBinding(delegate); @@ -71,7 +71,7 @@ class PDOMCPPUsingDeclarationSpecialization extends PDOMCPPSpecialization implem public IBinding[] getDelegates() { if (delegates == null) { PDOMNodeLinkedList list = new PDOMNodeLinkedList(getLinkage(), record + TARGET_BINDINGS); - final List<IBinding> result = new ArrayList<IBinding>(); + final List<IBinding> result = new ArrayList<>(); try { list.accept(new IPDOMVisitor() { @Override diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/CLIUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/CLIUtil.java index fd11cfcfeed..fb4e8167288 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/CLIUtil.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/CLIUtil.java @@ -54,7 +54,7 @@ public class CLIUtil { * Returns a map of String option to List of String parameters. */ public static Map<String, List<String>> parseToMap(String[] args) { - Map<String, List<String>> result = new HashMap<String, List<String>>(); + Map<String, List<String>> result = new HashMap<>(); String current = null; for (String arg : args) { if (arg.startsWith("-")) { //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOMApplication.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOMApplication.java index a9942840597..91b1f2ab80d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOMApplication.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOMApplication.java @@ -182,7 +182,7 @@ public class GeneratePDOMApplication implements IApplication { */ private static synchronized IExportProjectProvider getExportProjectProvider(String fqn) { if (projectInitializers == null) { - projectInitializers = new HashMap<String, IExportProjectProvider>(); + projectInitializers = new HashMap<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint indexExtensions = registry.getExtensionPoint(CCorePlugin.INDEX_UNIQ_ID); IExtension[] extensions = indexExtensions.getExtensions(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/DeltaAnalyzer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/DeltaAnalyzer.java index 2af7bbe956d..76999c465d9 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/DeltaAnalyzer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/DeltaAnalyzer.java @@ -30,9 +30,9 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.NullProgressMonitor; public class DeltaAnalyzer { - private final List<ITranslationUnit> fForce = new ArrayList<ITranslationUnit>(); - private final List<ITranslationUnit> fChanged = new ArrayList<ITranslationUnit>(); - private final List<ITranslationUnit> fRemoved = new ArrayList<ITranslationUnit>(); + private final List<ITranslationUnit> fForce = new ArrayList<>(); + private final List<ITranslationUnit> fChanged = new ArrayList<>(); + private final List<ITranslationUnit> fRemoved = new ArrayList<>(); // For testing purposes, only. public static boolean sSuppressPotentialTUs = false; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerASTVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerASTVisitor.java index d825be11530..a6f73f930c8 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerASTVisitor.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerASTVisitor.java @@ -91,8 +91,8 @@ abstract public class IndexerASTVisitor extends ASTVisitor { private IASTName fDefinitionName; private IASTNode fDefinitionNode; - private ArrayList<Definition> fStack = new ArrayList<Definition>(); - private ArrayList<IASTProblem> fProblems = new ArrayList<IASTProblem>(); + private ArrayList<Definition> fStack = new ArrayList<>(); + private ArrayList<IASTProblem> fProblems = new ArrayList<>(); public IndexerASTVisitor(boolean visitImplicitNames) { shouldVisitNames = true; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMUpdateTask.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMUpdateTask.java index 96104d923bc..f96164e0f7b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMUpdateTask.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMUpdateTask.java @@ -99,7 +99,7 @@ public class PDOMUpdateTask implements IPDOMIndexerTask { private void createDelegate(ICProject project, IProgressMonitor monitor) throws CoreException, InterruptedException { - HashSet<ITranslationUnit> set = new HashSet<ITranslationUnit>(); + HashSet<ITranslationUnit> set = new HashSet<>(); if ((fUpdateOptions & (IIndexManager.UPDATE_ALL | IIndexManager.UPDATE_CHECK_TIMESTAMPS)) != 0) { TranslationUnitCollector collector = new TranslationUnitCollector(set, set, monitor); boolean haveProject = false; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerIncludeResolutionHeuristics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerIncludeResolutionHeuristics.java index cdcfb6c8689..685e482daea 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerIncludeResolutionHeuristics.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerIncludeResolutionHeuristics.java @@ -109,12 +109,12 @@ public class ProjectIndexerIncludeResolutionHeuristics implements IIncludeFileRe } private IProject[] getOpenReferencedProjects(IProject prj) { - Set<IProject> result = new HashSet<IProject>(); + Set<IProject> result = new HashSet<>(); if (prj.isOpen()) { result.add(prj); - List<IProject> projectsToSearch = new ArrayList<IProject>(); + List<IProject> projectsToSearch = new ArrayList<>(); projectsToSearch.add(prj); for (int i = 0; i < projectsToSearch.size(); i++) { IProject project = projectsToSearch.get(i); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerInputAdapter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerInputAdapter.java index 0e4c1f06e06..3e199f69eea 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerInputAdapter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerInputAdapter.java @@ -69,7 +69,7 @@ public class ProjectIndexerInputAdapter extends IndexerInputAdapter { fCProject = cproject; fProjectPrefix = cproject.getProject().getFullPath().toString() + IPath.SEPARATOR; if (useCache) { - fIflCache = new HashMap<String, IIndexFileLocation>(); + fIflCache = new HashMap<>(); fExistsCache = new FileExistsCache(isCaseInsensitiveFileSystem()); } else { fIflCache = null; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/tag/PDOMTagIndex.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/tag/PDOMTagIndex.java index 05f9f9a3267..458cbc26520 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/tag/PDOMTagIndex.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/tag/PDOMTagIndex.java @@ -156,7 +156,7 @@ public class PDOMTagIndex { } final Long bindingRecord = Long.valueOf(binding_record); - return new BTreeIterable<ITag>(btree, new BTreeIterable.Descriptor<ITag>() { + return new BTreeIterable<>(btree, new BTreeIterable.Descriptor<ITag>() { @Override public ITag create(long record) { return new PDOMTag(db, record); @@ -179,7 +179,7 @@ public class PDOMTagIndex { // record. In each case we decide whether to delete or update the tag. Tags of the same size can be // updated in place, otherwise the tag needs to be deleted and recreated. - final Map<String, ITag> newTags = new HashMap<String, ITag>(); + final Map<String, ITag> newTags = new HashMap<>(); for (ITag tag : tags) { ITag dupTag = newTags.put(tag.getTaggerId(), tag); if (dupTag != null) |