diff options
author | Jonah Graham | 2018-11-20 16:20:42 +0000 |
---|---|---|
committer | Jonah Graham | 2018-11-22 21:55:36 +0000 |
commit | caf2292768deccd885b5b6989b731742e2e5edf4 (patch) | |
tree | 711a6088f2e17c7e31ebb51af1eadc1af00768e5 /core/org.eclipse.cdt.core/parser | |
parent | 8844a8f9f22802fedffa3cb2a8a21b041aa64b74 (diff) | |
download | org.eclipse.cdt-caf2292768deccd885b5b6989b731742e2e5edf4.tar.gz org.eclipse.cdt-caf2292768deccd885b5b6989b731742e2e5edf4.tar.xz org.eclipse.cdt-caf2292768deccd885b5b6989b731742e2e5edf4.zip |
Bug 540373: Cleanup: Remove redundant type arguments
This was done by selecting all projects in Eclipse then
Source -> Clean Up... -> choosing:
- Remove redundant type arguments
and completing the wizard
Change-Id: Iaecc7010f097b4b1fabd29ccaa34ccb23a716fbf
Diffstat (limited to 'core/org.eclipse.cdt.core/parser')
82 files changed, 194 insertions, 194 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/AbstractCLikeLanguage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/AbstractCLikeLanguage.java index aea50a97ef2..38de308e655 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/AbstractCLikeLanguage.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/AbstractCLikeLanguage.java @@ -70,7 +70,7 @@ public abstract class AbstractCLikeLanguage extends AbstractLanguage implements shouldVisitNames = true; } - private List<IASTName> nameList = new ArrayList<IASTName>(); + private List<IASTName> nameList = new ArrayList<>(); @Override public int visit(IASTName name) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/AbstractScannerExtensionConfiguration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/AbstractScannerExtensionConfiguration.java index a69b8f69a32..810288e77af 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/AbstractScannerExtensionConfiguration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/AbstractScannerExtensionConfiguration.java @@ -163,7 +163,7 @@ public abstract class AbstractScannerExtensionConfiguration implements IScannerE */ protected void addMacro(String signature, String value) { if (fAddMacroList == null) { - fAddMacroList = new ArrayList<IMacro>(); + fAddMacroList = new ArrayList<>(); } fAddMacroList.add(new MacroDefinition(signature.toCharArray(), value.toCharArray())); fAddMacros = null; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/CLanguageKeywords.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/CLanguageKeywords.java index aa6be5e53de..0fc68f3baef 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/CLanguageKeywords.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/CLanguageKeywords.java @@ -55,7 +55,7 @@ public class CLanguageKeywords implements ICLanguageKeywords { @Override public String[] getKeywords() { if (keywords == null) { - Set<String> keywordSet = new HashSet<String>(KeywordSets.getKeywords(KeywordSetKey.KEYWORDS, language)); + Set<String> keywordSet = new HashSet<>(KeywordSets.getKeywords(KeywordSetKey.KEYWORDS, language)); CharArrayIntMap additionalKeywords = config.getAdditionalKeywords(); if (additionalKeywords != null) { for (Iterator<char[]> iterator = additionalKeywords.toList().iterator(); iterator.hasNext();) { @@ -80,7 +80,7 @@ public class CLanguageKeywords implements ICLanguageKeywords { @Override public String[] getPreprocessorKeywords() { if (preprocessorKeywords == null) { - Set<String> keywords = new HashSet<String>(KeywordSets.getKeywords(KeywordSetKey.PP_DIRECTIVE, language)); + Set<String> keywords = new HashSet<>(KeywordSets.getKeywords(KeywordSetKey.PP_DIRECTIVE, language)); CharArrayIntMap additionalKeywords = config.getAdditionalPreprocessorKeywords(); if (additionalKeywords != null) { for (Iterator<char[]> iterator = additionalKeywords.toList().iterator(); iterator.hasNext();) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/export/ExternalExportProjectProvider.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/export/ExternalExportProjectProvider.java index e6c17afcd31..daffd9eb830 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/export/ExternalExportProjectProvider.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/export/ExternalExportProjectProvider.java @@ -90,13 +90,13 @@ public class ExternalExportProjectProvider extends AbstractExportProjectProvider } // -include - List<String> includeFiles = new ArrayList<String>(); + List<String> includeFiles = new ArrayList<>(); if (isPresent(OPT_INCLUDE)) { includeFiles.addAll(getParameters(OPT_INCLUDE)); } // -exclude - List<String> excludeFiles = new ArrayList<String>(); + List<String> excludeFiles = new ArrayList<>(); if (isPresent(OPT_EXCLUDE)) { excludeFiles.addAll(getParameters(OPT_EXCLUDE)); } @@ -157,7 +157,7 @@ public class ExternalExportProjectProvider extends AbstractExportProjectProvider content.createLink(new Path(location.getAbsolutePath()), IResource.NONE, null); // Setup path entries - List<IPathEntry> entries = new ArrayList<IPathEntry>( + List<IPathEntry> entries = new ArrayList<>( Arrays.asList(CoreModel.getRawPathEntries(cproject))); // pre-include files @@ -192,7 +192,7 @@ public class ExternalExportProjectProvider extends AbstractExportProjectProvider * @return a list of additional entries to add to the project */ protected List<IPathEntry> getAdditionalRawEntries() { - List<IPathEntry> entries = new ArrayList<IPathEntry>(); + List<IPathEntry> entries = new ArrayList<>(); entries.add(CoreModel.newIncludeEntry(content.getProjectRelativePath(), null, content.getLocation(), true)); return entries; } @@ -218,7 +218,7 @@ public class ExternalExportProjectProvider extends AbstractExportProjectProvider */ @Override public Map<String, String> getExportProperties() { - Map<String, String> properties = new HashMap<String, String>(); + Map<String, String> properties = new HashMap<>(); Date now = Calendar.getInstance().getTime(); properties.put(ORG_ECLIPSE_CDT_CORE_INDEX_EXPORT_DATESTAMP, DateFormat.getDateInstance().format(now) + " " + DateFormat.getTimeInstance().format(now)); //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ArrayUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ArrayUtil.java index 6fbc94ec148..f1262a972f3 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ArrayUtil.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ArrayUtil.java @@ -707,7 +707,7 @@ public abstract class ArrayUtil { public static <T> T[] removeDuplicates(T[] array) { int k = 0; if (array.length >= 16) { - HashSet<T> set = new HashSet<T>(array.length); + HashSet<T> set = new HashSet<>(array.length); for (int i = 0; i < array.length; i++) { T obj = array[i]; if (obj != null && set.add(obj)) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayMap.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayMap.java index 3d089c53ba3..e0cc6898a2e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayMap.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayMap.java @@ -141,7 +141,7 @@ public final class CharArrayMap<V> { * Constructs an empty CharArrayMap with default initial capacity. */ public CharArrayMap() { - map = new HashMap<Key, V>(); + map = new HashMap<>(); } /** @@ -152,7 +152,7 @@ public final class CharArrayMap<V> { */ public static <V> CharArrayMap<V> createOrderedMap() { // TreeMap does not have a constructor that takes an initial capacity - return new CharArrayMap<V>(new TreeMap<Key, V>()); + return new CharArrayMap<>(new TreeMap<Key, V>()); } private CharArrayMap(Map<Key, V> map) { @@ -165,7 +165,7 @@ public final class CharArrayMap<V> { * @throws IllegalArgumentException if the initial capacity is negative */ public CharArrayMap(int initialCapacity) { - map = new HashMap<Key, V>(initialCapacity); + map = new HashMap<>(initialCapacity); } /** @@ -267,7 +267,7 @@ public final class CharArrayMap<V> { */ public Collection<char[]> keys() { Set<Key> keys = map.keySet(); - ArrayList<char[]> r = new ArrayList<char[]>(keys.size()); + ArrayList<char[]> r = new ArrayList<>(keys.size()); for (Key key : keys) { r.add(CharArrayUtils.extract(key.buffer, key.start, key.length)); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharTable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharTable.java index dba19db4a42..b50721b4277 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharTable.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharTable.java @@ -119,7 +119,7 @@ public class CharTable extends HashTable { } public List<char[]> toList() { - List<char[]> list = new ArrayList<char[]>(size()); + List<char[]> list = new ArrayList<>(size()); int size = size(); for (int i = 0; i < size; i++) { list.add(keyAt(i)); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CollectionUtils.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CollectionUtils.java index 982dcf01008..850435cb8ad 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CollectionUtils.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CollectionUtils.java @@ -152,7 +152,7 @@ public final class CollectionUtils { public static <T, U> List<U> listMapGet(Map<T, List<U>> m, T t) { List<U> result = m.get(t); if (result == null) { - result = new ArrayList<U>(); + result = new ArrayList<>(); m.put(t, result); } return result; @@ -175,7 +175,7 @@ public final class CollectionUtils { ++n; } } else if (result == null) { - result = new ArrayList<T>(collection.size() - 1); + result = new ArrayList<>(collection.size() - 1); for (T u : collection) { if (--n < 0) break; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectTable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectTable.java index 84e917d1e41..331aa7ba873 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectTable.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectTable.java @@ -47,7 +47,7 @@ public abstract class ObjectTable<T> extends HashTable implements Iterable<T> { public List<T> toList() { int size = size(); - List<T> list = new ArrayList<T>(size); + List<T> list = new ArrayList<>(size); for (int i = 0; i < size; i++) { list.add(keyAt(i)); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TagManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TagManager.java index 83602c9d2f1..a7042ac4e0b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TagManager.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TagManager.java @@ -47,7 +47,7 @@ public class TagManager { } private static Map<String, TaggerDescriptor> loadExtensions() { - Map<String, TaggerDescriptor> taggers = new HashMap<String, TaggerDescriptor>(); + Map<String, TaggerDescriptor> taggers = new HashMap<>(); // Load the extensions IConfigurationElement[] elements = Platform.getExtensionRegistry() @@ -75,7 +75,7 @@ public class TagManager { /** Provides an opportunity for all enabled taggers to process the given values. */ public Iterable<ITag> process(ITagWriter tagWriter, IBinding binding, IASTName ast) { - List<ITag> tags = new LinkedList<ITag>(); + List<ITag> tags = new LinkedList<>(); for (TaggerDescriptor desc : taggers.values()) { IBindingTagger tagger = desc.getBindingTaggerFor(binding, ast); if (tagger != null) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTNodeSelector.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTNodeSelector.java index e7d9ec8565d..27b07a17890 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTNodeSelector.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTNodeSelector.java @@ -84,7 +84,7 @@ public class ASTNodeSelector implements IASTNodeSelector { } } } - final ASTNodeSpecification<T> nodeSpec = new ASTNodeSpecification<T>(relation, requiredClass, offsetInFile, + final ASTNodeSpecification<T> nodeSpec = new ASTNodeSpecification<>(relation, requiredClass, offsetInFile, lengthInFile); nodeSpec.setRangeInSequence(sequenceNumber, sequenceLength, false); nodeSpec.setSearchInExpansion(searchInExpansion); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTProblem.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTProblem.java index 6e1db9ca820..92c0d3149d1 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTProblem.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTProblem.java @@ -32,7 +32,7 @@ import com.ibm.icu.text.MessageFormat; public class ASTProblem extends ASTNode implements IASTProblem { protected static final Map<Integer, String> errorMessages; static { - errorMessages = new HashMap<Integer, String>(); + errorMessages = new HashMap<>(); errorMessages.put(Integer.valueOf(PREPROCESSOR_POUND_ERROR), ParserMessages.getString("ScannerProblemFactory.error.preproc.error")); //$NON-NLS-1$ errorMessages.put(Integer.valueOf(PREPROCESSOR_POUND_WARNING), diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java index b80211fb166..7b9d8ba7562 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java @@ -2449,12 +2449,12 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser { final int lt = LTcatchEOF(1); if (allowAttrib && (lt == IGCCToken.t__attribute__)) { if (result == null) { - result = new ArrayList<IASTAttributeSpecifier>(); + result = new ArrayList<>(); } result.add(__attribute__()); } else if (allowDeclspec && (lt == IGCCToken.t__declspec)) { if (result == null) { - result = new ArrayList<IASTAttributeSpecifier>(); + result = new ArrayList<>(); } result.add(__declspec()); } else { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/CStringValue.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/CStringValue.java index a20e86ec9f1..6aa59fb0cf2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/CStringValue.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/CStringValue.java @@ -27,7 +27,7 @@ import org.eclipse.core.runtime.CoreException; public final class CStringValue implements IValue { private static final Map<Character, Character> escapeSequences; static { - Map<Character, Character> map = new HashMap<Character, Character>(); + Map<Character, Character> map = new HashMap<>(); map.put('\'', '\''); map.put('"', '"'); map.put('?', '?'); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ChildCollector.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ChildCollector.java index 74264b0fa33..40fd93139b8 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ChildCollector.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ChildCollector.java @@ -44,7 +44,7 @@ class ChildCollector extends ASTGenericVisitor { if (fNodes == null) { if (child == fNode) return PROCESS_CONTINUE; - fNodes = new ArrayList<IASTNode>(); + fNodes = new ArrayList<>(); } fNodes.add(child); return PROCESS_SKIP; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/GCCBuiltinSymbolProvider.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/GCCBuiltinSymbolProvider.java index a6529b19558..9cdbc3a49fb 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/GCCBuiltinSymbolProvider.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/GCCBuiltinSymbolProvider.java @@ -66,7 +66,7 @@ public class GCCBuiltinSymbolProvider implements IBuiltinBindingsProvider { public static final ASTNodeProperty BUILTIN_GCC_SYMBOL = new ASTNodeProperty( "GCCBuiltinSymbolProvider.BUILTIN_GCC_SYMBOL - built-in GCC symbol"); //$NON-NLS-1$ - private static final Map<String, char[]> CHAR_ARRAYS = new HashMap<String, char[]>(); + private static final Map<String, char[]> CHAR_ARRAYS = new HashMap<>(); private IBinding[] fBindings; private IScope fScope; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/SizeofCalculator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/SizeofCalculator.java index e9bc40364e3..2b29f562aa1 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/SizeofCalculator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/SizeofCalculator.java @@ -110,7 +110,7 @@ public class SizeofCalculator { public SizeofCalculator(IASTTranslationUnit ast) { this.ast = ast; int maxAlignment = 32; - Map<String, String> sizeofMacros = new HashMap<String, String>(); + Map<String, String> sizeofMacros = new HashMap<>(); for (IASTPreprocessorMacroDefinition macro : ast.getBuiltinMacroDefinitions()) { String name = macro.getName().toString(); if ("__BIGGEST_ALIGNMENT__".equals(name)) { //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CScope.java index 7b7ead2be1a..3f8a13aa10a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CScope.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CScope.java @@ -205,7 +205,7 @@ public class CScope implements ICScope, IASTInternalScope { @SuppressWarnings("unchecked") CharArrayObjectMap<Object> map = (CharArrayObjectMap<Object>) mapsToNameOrBinding[type]; if (map == CharArrayObjectMap.EMPTY_MAP) - mapsToNameOrBinding[type] = map = new CharArrayObjectMap<Object>(1); + mapsToNameOrBinding[type] = map = new CharArrayObjectMap<>(1); Object o = map.get(nchars); if (o instanceof IASTName) { @@ -643,7 +643,7 @@ public class CScope implements ICScope, IASTInternalScope { @SuppressWarnings("unchecked") CharArrayObjectMap<Object> map = (CharArrayObjectMap<Object>) mapsToNameOrBinding[type]; if (map == CharArrayObjectMap.EMPTY_MAP) - mapsToNameOrBinding[type] = map = new CharArrayObjectMap<Object>(2); + mapsToNameOrBinding[type] = map = new CharArrayObjectMap<>(2); map.put(binding.getNameCharArray(), binding); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CStructMapper.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CStructMapper.java index 69bf58513b9..7e182fd188c 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CStructMapper.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CStructMapper.java @@ -60,7 +60,7 @@ public class CStructMapper { public ICompositeType mapToAST(ICompositeType type) { if (fStructs == null) { - fStructs = new CharArrayMap<IASTName>(); + fStructs = new CharArrayMap<>(); fTranslationUnit.accept(new Visitor()); } IASTName name = fStructs.get(type.getNameCharArray()); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTAmbiguousTemplateArgument.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTAmbiguousTemplateArgument.java index b8b6fd82250..29590cb6bcc 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTAmbiguousTemplateArgument.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTAmbiguousTemplateArgument.java @@ -44,7 +44,7 @@ public class CPPASTAmbiguousTemplateArgument extends ASTAmbiguousNode implements * or {@link ICPPASTPackExpansionExpression}. */ public CPPASTAmbiguousTemplateArgument(IASTNode... nodes) { - fNodes = new ArrayList<IASTNode>(2); + fNodes = new ArrayList<>(2); for (IASTNode node : nodes) { if (node instanceof IASTTypeId || node instanceof IASTExpression) { fNodes.add(node); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java index b8971514149..8b894b79128 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java @@ -398,7 +398,7 @@ public class CPPASTQualifiedName extends CPPASTNameBase implements ICPPASTQualif private List<IBinding> filterClassScopeBindings(ICPPClassType classType, IBinding[] bindings, final boolean isDeclaration) { - List<IBinding> filtered = new ArrayList<IBinding>(); + List<IBinding> filtered = new ArrayList<>(); final boolean allowNonstatic = canBeFieldAccess(classType) || isAddressOf() || inUsingDecl(); final IBinding templateDefinition = (classType instanceof ICPPTemplateInstance) ? ((ICPPTemplateInstance) classType).getTemplateDefinition() diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java index 8b12c6387af..1022c0ec963 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java @@ -143,7 +143,7 @@ public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPI } static private class NamespaceMemberCollector extends ASTVisitor { - public ObjectSet<IBinding> members = new ObjectSet<IBinding>(8); + public ObjectSet<IBinding> members = new ObjectSet<>(8); public NamespaceMemberCollector() { shouldVisitNamespaces = true; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScopeMapper.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScopeMapper.java index 947cb7c687b..e20ccb8291a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScopeMapper.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScopeMapper.java @@ -304,7 +304,7 @@ public class CPPScopeMapper { final String name = getReverseQualifiedName(container); List<UsingDirectiveWrapper> list = fPerName.get(name); if (list == null) { - list = new LinkedList<UsingDirectiveWrapper>(); + list = new LinkedList<>(); fPerName.put(name, list); } list.add(new UsingDirectiveWrapper(offset, ud)); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java index a2a87d03683..d4e6b667c63 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java @@ -1537,7 +1537,7 @@ public class CPPSemantics { if (listOfNominated == null) { listOfNominated = new ArrayList<>(1); if (data.usingDirectives.isEmpty()) { - data.usingDirectives = new HashMap<ICPPNamespaceScope, List<ICPPNamespaceScope>>(); + data.usingDirectives = new HashMap<>(); } data.usingDirectives.put((ICPPNamespaceScope) appearsIn, listOfNominated); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUtil.java index 3c18ebdc69d..67ed6a80cf2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUtil.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUtil.java @@ -130,7 +130,7 @@ public class EvalUtil { fixed = fixed.computeForFunctionCall(record, context); } } - return new Pair<ICPPEvaluation, ICPPEvaluation>(updateable, fixed); + return new Pair<>(updateable, fixed); } public static class Pair<T1, T2> { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTModificationStore.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTModificationStore.java index d8753d270e5..43c9ad8b83e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTModificationStore.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTModificationStore.java @@ -24,7 +24,7 @@ public class ASTModificationStore { private HashMap<ASTModification, ASTModificationMap> fNestedModMaps; public ASTModificationStore() { - fNestedModMaps = new HashMap<ASTModification, ASTModificationMap>(); + fNestedModMaps = new HashMap<>(); } /** diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/DeclarationGeneratorImpl.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/DeclarationGeneratorImpl.java index b6325f26519..4dd516b0cf3 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/DeclarationGeneratorImpl.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/DeclarationGeneratorImpl.java @@ -141,7 +141,7 @@ public class DeclarationGeneratorImpl extends DeclarationGenerator { try { // Addition of pointer operators has to be in reverse order, so it's deferred until // the end. - Map<IASTDeclarator, LinkedList<IASTPointerOperator>> pointerOperatorMap = new HashMap<IASTDeclarator, LinkedList<IASTPointerOperator>>(); + Map<IASTDeclarator, LinkedList<IASTPointerOperator>> pointerOperatorMap = new HashMap<>(); // If the type is an array of something, create a declaration of a pointer to something // instead (to allow assignment, etc). diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ContainerNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ContainerNode.java index 2e6010d0053..578c1816b1a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ContainerNode.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ContainerNode.java @@ -31,7 +31,7 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode; * @author Emanuel Graf IFS */ public class ContainerNode extends ASTNode { - private final ArrayList<IASTNode> nodes = new ArrayList<IASTNode>(); + private final ArrayList<IASTNode> nodes = new ArrayList<>(); public ContainerNode(IASTNode... nodes) { Collections.addAll(this.nodes, nodes); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/MacroExpansionHandler.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/MacroExpansionHandler.java index 1b6fdeabf6b..c63e660c8c5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/MacroExpansionHandler.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/MacroExpansionHandler.java @@ -47,7 +47,7 @@ public class MacroExpansionHandler { private final Scribe scribe; private int lastMacroExpOffset; private IASTTranslationUnit ast; - private Map<String, List<IIndexName>> macroExpansion = new TreeMap<String, List<IIndexName>>(); + private Map<String, List<IIndexName>> macroExpansion = new TreeMap<>(); public MacroExpansionHandler(Scribe scribe) { this.scribe = scribe; @@ -189,10 +189,10 @@ public class MacroExpansionHandler { ast = unit; IIndex index = ast.getIndex(); if (index != null) { - macroExpansion = new TreeMap<String, List<IIndexName>>(); + macroExpansion = new TreeMap<>(); IASTPreprocessorMacroDefinition[] md = ast.getMacroDefinitions(); - TreeSet<String> paths = new TreeSet<String>(); + TreeSet<String> paths = new TreeSet<>(); for (IASTPreprocessorIncludeStatement is : ast.getIncludeDirectives()) { if (!is.isSystemInclude()) { paths.add(is.getContainingFilename()); @@ -212,7 +212,7 @@ public class MacroExpansionHandler { List<IIndexName> fileList = macroExpansion.get(filename); if (paths.contains(filename)) { if (fileList == null) { - fileList = new ArrayList<IIndexName>(); + fileList = new ArrayList<>(); macroExpansion.put(filename, fileList); } fileList.add(iIndexName); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ASTModificationHelper.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ASTModificationHelper.java index cf6bcc39ed1..15b2491370d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ASTModificationHelper.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ASTModificationHelper.java @@ -40,7 +40,7 @@ public class ASTModificationHelper { public <T extends IASTNode> T[] createModifiedChildArray(IASTNode parent, T[] unmodifiedChildren, Class<T> clazz, NodeCommentMap commentMap) { - ArrayList<T> modifiedChildren = new ArrayList<T>(Arrays.asList(unmodifiedChildren)); + ArrayList<T> modifiedChildren = new ArrayList<>(Arrays.asList(unmodifiedChildren)); for (ASTModification parentModification : modificationsForNode(parent)) { switch (parentModification.getKind()) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/NodeCommentMap.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/NodeCommentMap.java index f8f0d14d342..8753023c21a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/NodeCommentMap.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/NodeCommentMap.java @@ -34,10 +34,10 @@ import org.eclipse.cdt.internal.core.dom.rewrite.util.ASTNodes; * @author Guido Zgraggen IFS */ public class NodeCommentMap { - protected final Map<IASTNode, List<IASTComment>> leadingMap = new HashMap<IASTNode, List<IASTComment>>(); - protected final Map<IASTNode, List<IASTComment>> trailingMap = new HashMap<IASTNode, List<IASTComment>>(); - protected final Map<IASTNode, List<IASTComment>> freestandingMap = new HashMap<IASTNode, List<IASTComment>>(); - protected final List<IASTTranslationUnit> coveredUnits = new ArrayList<IASTTranslationUnit>(); + protected final Map<IASTNode, List<IASTComment>> leadingMap = new HashMap<>(); + protected final Map<IASTNode, List<IASTComment>> trailingMap = new HashMap<>(); + protected final Map<IASTNode, List<IASTComment>> freestandingMap = new HashMap<>(); + protected final List<IASTTranslationUnit> coveredUnits = new ArrayList<>(); /** * Add a comment to the map with the trailing comments. @@ -47,7 +47,7 @@ public class NodeCommentMap { public void addTrailingCommentToNode(IASTNode node, IASTComment comment) { List<IASTComment> comments = trailingMap.get(node); if (comments == null) { - comments = new ArrayList<IASTComment>(); + comments = new ArrayList<>(); } comments.add(comment); trailingMap.put(node, comments); @@ -62,7 +62,7 @@ public class NodeCommentMap { */ public List<IASTComment> getTrailingCommentsForNode(IASTNode node) { List<IASTComment> list = trailingMap.get(node); - return list != null ? list : new ArrayList<IASTComment>(); + return list != null ? list : new ArrayList<>(); } /** @@ -73,7 +73,7 @@ public class NodeCommentMap { public void addLeadingCommentToNode(IASTNode node, IASTComment comment) { List<IASTComment> comments = leadingMap.get(node); if (comments == null) { - comments = new ArrayList<IASTComment>(); + comments = new ArrayList<>(); } comments.add(comment); leadingMap.put(node, comments); @@ -88,7 +88,7 @@ public class NodeCommentMap { */ public List<IASTComment> getLeadingCommentsForNode(IASTNode node) { List<IASTComment> list = leadingMap.get(node); - return list != null ? list : new ArrayList<IASTComment>(); + return list != null ? list : new ArrayList<>(); } /** @@ -99,7 +99,7 @@ public class NodeCommentMap { public void addFreestandingCommentToNode(IASTNode node, IASTComment comment) { List<IASTComment> comments = freestandingMap.get(node); if (comments == null) { - comments = new ArrayList<IASTComment>(); + comments = new ArrayList<>(); } comments.add(comment); freestandingMap.put(node, comments); @@ -114,7 +114,7 @@ public class NodeCommentMap { */ public List<IASTComment> getFreestandingCommentsForNode(IASTNode node) { List<IASTComment> list = freestandingMap.get(node); - return list != null ? list : new ArrayList<IASTComment>(); + return list != null ? list : new ArrayList<>(); } /** @@ -149,7 +149,7 @@ public class NodeCommentMap { * @return List */ public List<IASTComment> getAllCommentsForNode(IASTNode node) { - List<IASTComment> comment = new ArrayList<IASTComment>(); + List<IASTComment> comment = new ArrayList<>(); comment.addAll(getFreestandingCommentsForNode(node)); comment.addAll(getLeadingCommentsForNode(node)); comment.addAll(getTrailingCommentsForNode(node)); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/NodeCommenter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/NodeCommenter.java index 378f98c5cc5..65f9aac1c05 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/NodeCommenter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/NodeCommenter.java @@ -73,7 +73,7 @@ public class NodeCommenter { this.visitor = visitor; this.commentHandler = commHandler; this.commentMap = commentMap; - this.children = new ArrayList<IASTNode>(); + this.children = new ArrayList<>(); } protected void writeNodeList(IASTNode[] nodes) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java index 530bf307be4..a95f8b3e640 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java @@ -322,7 +322,7 @@ public class CIndex implements IIndex { Collection<IIndexFile> in = Collections.singletonList(file); Set<FileContentKey> handled = new HashSet<>(); while (true) { - Collection<IIndexFile> nextLevel = depth != 0 ? new ArrayDeque<IIndexFile>() : null; + Collection<IIndexFile> nextLevel = depth != 0 ? new ArrayDeque<>() : null; for (IIndexFile indexFile : in) { IIndexFragmentFile file1 = (IIndexFragmentFile) indexFile; for (IIndexFragment fragment : fFragments) { @@ -362,7 +362,7 @@ public class CIndex implements IIndex { Collection<IIndexFile> in = Collections.singletonList(file); Set<Object> handled = new HashSet<>(); while (true) { - Collection<IIndexFile> nextLevel = depth != 0 ? new ArrayDeque<IIndexFile>() : null; + Collection<IIndexFile> nextLevel = depth != 0 ? new ArrayDeque<>() : null; for (IIndexFile indexFile : in) { IIndexFragmentFile file1 = (IIndexFragmentFile) indexFile; IIndexInclude[] includes = file1.getIncludes(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexBasedFileContentProvider.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexBasedFileContentProvider.java index bc7d040d14f..374d75bdc53 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexBasedFileContentProvider.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexBasedFileContentProvider.java @@ -63,7 +63,7 @@ public final class IndexBasedFileContentProvider extends InternalFileContentProv private final AbstractIndexerTask fRelatedIndexerTask; private long fFileSizeLimit = 0; private IIndexFile[] fContextToHeaderGap; - private final Map<IIndexFileLocation, IFileNomination> fPragmaOnce = new HashMap<IIndexFileLocation, IFileNomination>(); + private final Map<IIndexFileLocation, IFileNomination> fPragmaOnce = new HashMap<>(); private Set<String> fHeadersToIndexAllVersions = Collections.emptySet(); private boolean fIndexAllHeaderVersions; @@ -133,11 +133,11 @@ public final class IndexBasedFileContentProvider extends InternalFileContentProv IIndexFile file = selectIndexFile(macroDictionary, ifl); if (file != null) { try { - List<IIndexFile> files = new ArrayList<IIndexFile>(); - List<IIndexMacro> macros = new ArrayList<IIndexMacro>(); - List<ICPPUsingDirective> directives = new ArrayList<ICPPUsingDirective>(); - Map<IIndexFileLocation, IFileNomination> newPragmaOnce = new HashMap<IIndexFileLocation, IFileNomination>(); - LinkedHashSet<IIndexFile> preLoaded = new LinkedHashSet<IIndexFile>(); + List<IIndexFile> files = new ArrayList<>(); + List<IIndexMacro> macros = new ArrayList<>(); + List<ICPPUsingDirective> directives = new ArrayList<>(); + Map<IIndexFileLocation, IFileNomination> newPragmaOnce = new HashMap<>(); + LinkedHashSet<IIndexFile> preLoaded = new LinkedHashSet<>(); collectFileContent(file, null, newPragmaOnce, preLoaded, files, macros, directives, null); // Report pragma once inclusions, only if no exception was thrown. fPragmaOnce.putAll(newPragmaOnce); @@ -164,7 +164,7 @@ public final class IndexBasedFileContentProvider extends InternalFileContentProv } public List<String> toPathList(Collection<IIndexFileLocation> newPragmaOnce) { - List<String> newPragmaOncePaths = new ArrayList<String>(newPragmaOnce.size()); + List<String> newPragmaOncePaths = new ArrayList<>(newPragmaOnce.size()); for (IIndexFileLocation l : newPragmaOnce) { newPragmaOncePaths.add(fPathResolver.getASTPath(l)); } @@ -207,7 +207,7 @@ public final class IndexBasedFileContentProvider extends InternalFileContentProv if (fPragmaOnce.containsKey(ifl)) return false; } else { - preventRecursion = new HashSet<IIndexFile>(); + preventRecursion = new HashSet<>(); } if (!preventRecursion.add(file)) return false; @@ -267,11 +267,11 @@ public final class IndexBasedFileContentProvider extends InternalFileContentProv if (contextFile == null || targetFile == null || contextFile == targetFile) return null; - Map<IIndexFileLocation, IFileNomination> newPragmaOnce = new HashMap<IIndexFileLocation, IFileNomination>(); - List<IIndexFile> filesIncluded = new ArrayList<IIndexFile>(); - ArrayList<IIndexMacro> macros = new ArrayList<IIndexMacro>(); - ArrayList<ICPPUsingDirective> directives = new ArrayList<ICPPUsingDirective>(); - LinkedHashSet<IIndexFile> preLoaded = new LinkedHashSet<IIndexFile>(); + Map<IIndexFileLocation, IFileNomination> newPragmaOnce = new HashMap<>(); + List<IIndexFile> filesIncluded = new ArrayList<>(); + ArrayList<IIndexMacro> macros = new ArrayList<>(); + ArrayList<ICPPUsingDirective> directives = new ArrayList<>(); + LinkedHashSet<IIndexFile> preLoaded = new LinkedHashSet<>(); if (!collectFileContent(contextFile, targetFile, newPragmaOnce, preLoaded, filesIncluded, macros, directives, new HashSet<IIndexFile>())) { return null; @@ -287,7 +287,7 @@ public final class IndexBasedFileContentProvider extends InternalFileContentProv } private List<FileVersion> toList(LinkedHashSet<IIndexFile> preLoaded) throws CoreException { - List<FileVersion> result = new ArrayList<InternalFileContent.FileVersion>(preLoaded.size()); + List<FileVersion> result = new ArrayList<>(preLoaded.size()); for (IIndexFile file : preLoaded) { String path = fPathResolver.getASTPath(file.getLocation()); result.add(new FileVersion(path, file.getSignificantMacros())); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFactory.java index b8bd5f7b64c..46e70ee569f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFactory.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFactory.java @@ -77,7 +77,7 @@ public class IndexFactory { Collection<ICProject> indexProjects = getProjects(projects, addDependencies, addDependent, new HashSet<IProject>()); - HashMap<String, IIndexFragment> fragments = new LinkedHashMap<String, IIndexFragment>(); + HashMap<String, IIndexFragment> fragments = new LinkedHashMap<>(); for (ICProject cproject : indexProjects) { IIndexFragment pdom = fPDOMManager.getPDOM(cproject); if (pdom != null) { @@ -106,7 +106,7 @@ public class IndexFactory { private Collection<ICProject> getProjects(ICProject[] projects, boolean addDependencies, boolean addDependent, Set<IProject> handled) { - List<ICProject> result = new ArrayList<ICProject>(); + List<ICProject> result = new ArrayList<>(); for (ICProject cproject : projects) { checkAddProject(cproject, handled, result); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/AbstractCompositeFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/AbstractCompositeFactory.java index 7be14caaa5b..c16920c8197 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/AbstractCompositeFactory.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/AbstractCompositeFactory.java @@ -93,7 +93,7 @@ public abstract class AbstractCompositeFactory implements ICompositesFactory { * @return an array of unique bindings */ protected IIndexFragmentBinding[] mergeBindingArrays(IIndexFragmentBinding[][] fragmentBindings) { - TreeSet<IIndexFragmentBinding> ts = new TreeSet<IIndexFragmentBinding>(fragmentComparator); + TreeSet<IIndexFragmentBinding> ts = new TreeSet<>(fragmentComparator); for (IIndexFragmentBinding[] array : fragmentBindings) { if (array != null) { for (IIndexFragmentBinding element : array) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassSpecialization.java index 9c1c38b4314..37f0da7e435 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassSpecialization.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassSpecialization.java @@ -48,7 +48,7 @@ public class CompositeCPPClassSpecialization extends CompositeCPPClassType imple private final ThreadLocal<Set<IBinding>> fInProgress = new ThreadLocal<Set<IBinding>>() { @Override protected Set<IBinding> initialValue() { - return new HashSet<IBinding>(); + return new HashSet<>(); } }; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeInstanceCache.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeInstanceCache.java index 244d0934821..3dd1afca195 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeInstanceCache.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeInstanceCache.java @@ -47,7 +47,7 @@ public class CompositeInstanceCache { private ICPPDeferredClassInstance fDeferredInstance; public CompositeInstanceCache() { - fMap = new HashMap<String, ICPPTemplateInstance>(); + fMap = new HashMap<>(); } synchronized public final void addInstance(ICPPTemplateArgument[] arguments, ICPPTemplateInstance instance) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/IndexProviderManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/IndexProviderManager.java index 40a227bb81d..20c66dac259 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/IndexProviderManager.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/IndexProviderManager.java @@ -101,14 +101,14 @@ public final class IndexProviderManager implements IElementChangedListener { */ public void reset(VersionRange pdomVersionRange) { this.fragmentProviders = new IIndexFragmentProvider[0]; - this.provisionMap = new HashMap<ProvisionMapKey, Boolean>(); + this.provisionMap = new HashMap<>(); this.pdomVersionRange = pdomVersionRange; - this.compatibleFragmentUnavailable = new HashSet<String>(); + this.compatibleFragmentUnavailable = new HashSet<>(); } public void startup() { - List<IIndexFragmentProvider> providers = new ArrayList<IIndexFragmentProvider>(); - List<IConfigurationElement[]> usageSpecifications = new ArrayList<IConfigurationElement[]>(); + List<IIndexFragmentProvider> providers = new ArrayList<>(); + List<IConfigurationElement[]> usageSpecifications = new ArrayList<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint indexProviders = registry.getExtensionPoint(CCorePlugin.INDEX_UNIQ_ID); for (IExtension extension : indexProviders.getExtensions()) { @@ -189,7 +189,7 @@ public final class IndexProviderManager implements IElementChangedListener { */ public IIndexFragment[] getProvidedIndexFragments(ICConfigurationDescription config, int usage) throws CoreException { - Map<String, IIndexFragment> id2fragment = new HashMap<String, IIndexFragment>(); + Map<String, IIndexFragment> id2fragment = new HashMap<>(); IProject project = config.getProjectDescription().getProject(); for (int i = 0; i < fragmentProviders.length; i++) { @@ -215,7 +215,7 @@ public final class IndexProviderManager implements IElementChangedListener { } // Make log entries for any fragments which have no compatible equivalents - List<IIndexFragment> preresult = new ArrayList<IIndexFragment>(); + List<IIndexFragment> preresult = new ArrayList<>(); for (Map.Entry<String, IIndexFragment> entry : id2fragment.entrySet()) { if (entry.getValue() == null) { String key = entry.getKey(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/PDOMCache.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/PDOMCache.java index e10ec6a9128..ad7a40789ca 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/PDOMCache.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/PDOMCache.java @@ -35,7 +35,7 @@ class PDOMCache { private static Object singletonMutex = new Object(); private PDOMCache() { - this.path2pdom = new HashMap<File, PDOM>(); + this.path2pdom = new HashMap<>(); } /** diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/ReadOnlyPDOMProviderBridge.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/ReadOnlyPDOMProviderBridge.java index f1f1a7657d0..0f7404f9242 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/ReadOnlyPDOMProviderBridge.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/ReadOnlyPDOMProviderBridge.java @@ -36,7 +36,7 @@ public class ReadOnlyPDOMProviderBridge implements IIndexFragmentProvider { @Override public IIndexFragment[] getIndexFragments(ICConfigurationDescription config) throws CoreException { - List<PDOM> result = new ArrayList<PDOM>(); + List<PDOM> result = new ArrayList<>(); IPDOMDescriptor[] descriptions = provider.getDescriptors(config); if (descriptions != null) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/FileEncodingRegistry.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/FileEncodingRegistry.java index 8934321f936..24e905984df 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/FileEncodingRegistry.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/FileEncodingRegistry.java @@ -34,7 +34,7 @@ public class FileEncodingRegistry implements Serializable { public FileEncodingRegistry(String defaultEncoding) { this.defaultEncoding = defaultEncoding; - fFilePathToEncodingMap = new TreeMap<String, String>(); + fFilePathToEncodingMap = new TreeMap<>(); } public void setDefaultEncoding(String newDefaultEncoding) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexer.java index a8a4d2a8183..9e958f3e5b4 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexer.java @@ -435,7 +435,7 @@ public abstract class StandaloneIndexer { * @return */ private List<String> getFilesAdded(List<String> tus) { - List<String> added = new ArrayList<String>(); + List<String> added = new ArrayList<>(); FilenameFilter filter = getExclusionFilter(); if (filter == null) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerInputAdapter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerInputAdapter.java index 4a244ba0eb9..064a34a9924 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerInputAdapter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerInputAdapter.java @@ -39,7 +39,7 @@ import org.eclipse.core.runtime.Path; * @since 5.0 */ public class StandaloneIndexerInputAdapter extends IndexerInputAdapter { - private final HashMap<String, IIndexFileLocation> fIflCache = new HashMap<String, IIndexFileLocation>(); + private final HashMap<String, IIndexFileLocation> fIflCache = new HashMap<>(); private final FileExistsCache fExistsCache; private final StandaloneIndexer fIndexer; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/EmptyIterator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/EmptyIterator.java index 40c40ea7ef3..cf4d1624448 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/EmptyIterator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/EmptyIterator.java @@ -17,7 +17,7 @@ import java.util.Iterator; import java.util.NoSuchElementException; public final class EmptyIterator<T> implements Iterator<T> { - public static final EmptyIterator<?> EMPTY_ITERATOR = new EmptyIterator<Object>(); + public static final EmptyIterator<?> EMPTY_ITERATOR = new EmptyIterator<>(); @SuppressWarnings("unchecked") public static <T> EmptyIterator<T> empty() { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java index 19997ccd301..4716f38abe5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java @@ -708,7 +708,7 @@ class ASTInclusionNode implements IASTInclusionNode { @Override public IASTInclusionNode[] getNestedInclusions() { if (fInclusions == null) { - ArrayList<IASTInclusionNode> result = new ArrayList<IASTInclusionNode>(); + ArrayList<IASTInclusionNode> result = new ArrayList<>(); fLocationCtx.getInclusions(result); fInclusions = result.toArray(new IASTInclusionNode[result.size()]); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LazyCharArray.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LazyCharArray.java index e4c98e7dc70..7aa2f983a08 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LazyCharArray.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LazyCharArray.java @@ -38,12 +38,12 @@ public abstract class LazyCharArray extends AbstractCharArray { fCharEndOffset = charOffset + chars.length; fSourceOffset = sourceOffset; fSourceEndOffset = sourceEndOffset; - fCharsReference = new SoftReference<char[]>(chars); + fCharsReference = new SoftReference<>(chars); } } private int fLength = -1; - private List<Chunk> fChunks = new ArrayList<Chunk>(); + private List<Chunk> fChunks = new ArrayList<>(); private StreamHasher fHasher; private long fHash64; // Make a reference to the currently used char[], such that it is not collected. @@ -182,7 +182,7 @@ public abstract class LazyCharArray extends AbstractCharArray { if (data == null) { data = new char[chunk.fCharEndOffset - chunk.fCharOffset]; rereadChunkData(chunk, data); - chunk.fCharsReference = new SoftReference<char[]>(data); + chunk.fCharsReference = new SoftReference<>(data); } return fCurrentChars = data; } @@ -198,7 +198,7 @@ public abstract class LazyCharArray extends AbstractCharArray { */ public void testClearData() { for (Chunk chunk : fChunks) { - chunk.fCharsReference = new SoftReference<char[]>(null); + chunk.fCharsReference = new SoftReference<>(null); } if (fCurrentChars != null) fCurrentChars = null; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpander.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpander.java index 3fad817a9bc..a292c8bd945 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpander.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpander.java @@ -130,8 +130,8 @@ public class MacroExpander { private final CharArrayMap<PreprocessorMacro> fDictionary; private final LocationMap fLocationMap; private final LexerOptions fLexOptions; - private ArrayList<IASTName> fImplicitMacroExpansions = new ArrayList<IASTName>(); - private ArrayList<ImageLocationInfo> fImageLocationInfos = new ArrayList<ImageLocationInfo>(); + private ArrayList<IASTName> fImplicitMacroExpansions = new ArrayList<>(); + private ArrayList<ImageLocationInfo> fImageLocationInfos = new ArrayList<>(); private boolean fCompletionMode; private int fStartOffset; private int fEndOffset; @@ -173,7 +173,7 @@ public class MacroExpander { fEndOffset = identifier.getEndOffset(); fCompletionMode = completionMode; - IdentityHashMap<PreprocessorMacro, PreprocessorMacro> forbidden = new IdentityHashMap<PreprocessorMacro, PreprocessorMacro>(); + IdentityHashMap<PreprocessorMacro, PreprocessorMacro> forbidden = new IdentityHashMap<>(); // setup input sequence TokenSource input = new TokenSource(lexer); @@ -232,7 +232,7 @@ public class MacroExpander { fStartOffset = identifier.getOffset(); fEndOffset = identifier.getEndOffset(); fCompletionMode = false; - IdentityHashMap<PreprocessorMacro, PreprocessorMacro> forbidden = new IdentityHashMap<PreprocessorMacro, PreprocessorMacro>(); + IdentityHashMap<PreprocessorMacro, PreprocessorMacro> forbidden = new IdentityHashMap<>(); // setup input sequence TokenSource input = new TokenSource(lexer); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpansionTracker.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpansionTracker.java index 44de7cc5ac0..0f55e98f958 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpansionTracker.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpansionTracker.java @@ -26,7 +26,7 @@ import org.eclipse.text.edits.ReplaceEdit; public class MacroExpansionTracker { public class MacroInfo { private TokenList fMacroCall = new TokenList(); - private ArrayList<TokenList> fArguments = new ArrayList<TokenList>(); + private ArrayList<TokenList> fArguments = new ArrayList<>(); public MacroInfo(Token identifier) { fMacroCall.append(identifier); @@ -46,7 +46,7 @@ public class MacroExpansionTracker { private char[] fInput; private String fReplacementText = ""; //$NON-NLS-1$ - private LinkedList<MacroInfo> fMacroStack = new LinkedList<MacroInfo>(); + private LinkedList<MacroInfo> fMacroStack = new LinkedList<>(); private IToken fReplaceFrom; private IToken fReplaceTo; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MultiMacroExpansionExplorer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MultiMacroExpansionExplorer.java index 92ff75e22a7..6005cfd3712 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MultiMacroExpansionExplorer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MultiMacroExpansionExplorer.java @@ -119,7 +119,7 @@ public class MultiMacroExpansionExplorer extends MacroExpansionExplorer { for (IASTPreprocessorMacroExpansion expansion : expansions) { IASTName ref = expansion.getMacroReference(); if (ref != null) { - ArrayList<IASTName> refs = new ArrayList<IASTName>(); + ArrayList<IASTName> refs = new ArrayList<>(); refs.add(ref); refs.addAll(Arrays.asList(expansion.getNestedMacroReferences())); IASTFileLocation refLoc = expansion.getFileLocation(); @@ -166,7 +166,7 @@ public class MultiMacroExpansionExplorer extends MacroExpansionExplorer { } private Map<IMacroBinding, IASTFileLocation> getMacroLocations(final ILocationResolver resolver) { - final Map<IMacroBinding, IASTFileLocation> result = new HashMap<IMacroBinding, IASTFileLocation>(); + final Map<IMacroBinding, IASTFileLocation> result = new HashMap<>(); addLocations(resolver.getBuiltinMacroDefinitions(), result); addLocations(resolver.getMacroDefinitions(), result); return result; @@ -203,7 +203,7 @@ public class MultiMacroExpansionExplorer extends MacroExpansionExplorer { * Combines the replace edits of the leading delegates. */ private List<ReplaceEdit> combineReplaceEdits(int count) { - ArrayList<ReplaceEdit> edits = new ArrayList<ReplaceEdit>(); + ArrayList<ReplaceEdit> edits = new ArrayList<>(); for (int i = 0; i < count; i++) { IMacroExpansionStep step = fDelegates[i].getFullExpansion(); shiftAndAddEdits(fBoundaries[2 * i], step.getReplacements(), edits); @@ -264,7 +264,7 @@ public class MultiMacroExpansionExplorer extends MacroExpansionExplorer { before.append(dresult.getCodeBeforeStep()); before.append(fSource, end, fSource.length - end); - List<ReplaceEdit> replacements = new ArrayList<ReplaceEdit>(); + List<ReplaceEdit> replacements = new ArrayList<>(); shiftAndAddEdits(shift, dresult.getReplacements(), replacements); fCachedStep = new MacroExpansionStep(before.toString(), dresult.getExpandedMacro(), dresult.getLocationOfExpandedMacroDefinition(), diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java index e3b822970e4..9afbae833b8 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java @@ -126,7 +126,7 @@ final class ScannerContext { */ public final Conditional newBranch(BranchKind branchKind, boolean withinExpansion) { if (fConditionals == null) { - fConditionals = new ArrayList<Conditional>(); + fConditionals = new ArrayList<>(); } Conditional result; @@ -325,7 +325,7 @@ final class ScannerContext { public void trackSignificantMacros() { fInternalModifications = new CharArraySet(5); - fSignificantMacros = new CharArrayObjectMap<char[]>(5); + fSignificantMacros = new CharArrayObjectMap<>(5); } public void setPragmaOnce(boolean val) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/SingleMacroExpansionExplorer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/SingleMacroExpansionExplorer.java index e0d7b0b1f2b..2ab2723bcb4 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/SingleMacroExpansionExplorer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/SingleMacroExpansionExplorer.java @@ -53,7 +53,7 @@ public class SingleMacroExpansionExplorer extends MacroExpansionExplorer { } private CharArrayMap<PreprocessorMacro> createDictionary(IASTName[] refs) { - CharArrayMap<PreprocessorMacro> map = new CharArrayMap<PreprocessorMacro>(refs.length); + CharArrayMap<PreprocessorMacro> map = new CharArrayMap<>(refs.length); for (IASTName name : refs) { addMacroDefinition(map, name); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/token/KeywordSets.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/token/KeywordSets.java index b7e117a2b35..f2edfaf1f96 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/token/KeywordSets.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/token/KeywordSets.java @@ -65,23 +65,23 @@ public class KeywordSets { return null; } - private static final Set<String> EMPTY_TABLE = new HashSet<String>(0); + private static final Set<String> EMPTY_TABLE = new HashSet<>(0); private static final Set<String> NAMESPACE_ONLY_SET; static { - NAMESPACE_ONLY_SET = new HashSet<String>(1); + NAMESPACE_ONLY_SET = new HashSet<>(1); NAMESPACE_ONLY_SET.add(Keywords.NAMESPACE); } private static final Set<String> MACRO_ONLY; static { - MACRO_ONLY = new HashSet<String>(1); + MACRO_ONLY = new HashSet<>(1); MACRO_ONLY.add("defined()"); //$NON-NLS-1$ } private static final Set<String> DECL_SPECIFIER_SEQUENCE_C; static { - DECL_SPECIFIER_SEQUENCE_C = new TreeSet<String>(); + DECL_SPECIFIER_SEQUENCE_C = new TreeSet<>(); DECL_SPECIFIER_SEQUENCE_C.add(Keywords.INLINE); DECL_SPECIFIER_SEQUENCE_C.add(Keywords.AUTO); DECL_SPECIFIER_SEQUENCE_C.add(Keywords.REGISTER); @@ -110,7 +110,7 @@ public class KeywordSets { private static final Set<String> DECL_SPECIFIER_SEQUENCE_CPP; static { - DECL_SPECIFIER_SEQUENCE_CPP = new TreeSet<String>(); + DECL_SPECIFIER_SEQUENCE_CPP = new TreeSet<>(); // add all of C then remove the ones we don't need DECL_SPECIFIER_SEQUENCE_CPP.addAll(DECL_SPECIFIER_SEQUENCE_C); DECL_SPECIFIER_SEQUENCE_CPP.remove(Keywords._COMPLEX); @@ -132,14 +132,14 @@ public class KeywordSets { private static final Map<ParserLanguage, Set<String>> DECL_SPECIFIER_SEQUENCE_TABLE; static { - DECL_SPECIFIER_SEQUENCE_TABLE = new HashMap<ParserLanguage, Set<String>>(); + DECL_SPECIFIER_SEQUENCE_TABLE = new HashMap<>(); DECL_SPECIFIER_SEQUENCE_TABLE.put(ParserLanguage.CPP, DECL_SPECIFIER_SEQUENCE_CPP); DECL_SPECIFIER_SEQUENCE_TABLE.put(ParserLanguage.C, DECL_SPECIFIER_SEQUENCE_C); } private static final Set<String> DECLARATION_CPP; static { - DECLARATION_CPP = new TreeSet<String>(); + DECLARATION_CPP = new TreeSet<>(); DECLARATION_CPP.addAll(DECL_SPECIFIER_SEQUENCE_CPP); DECLARATION_CPP.add(Keywords.ASM); DECLARATION_CPP.add(Keywords.TEMPLATE); @@ -151,21 +151,21 @@ public class KeywordSets { private static final Set<String> DECLARATION_C; static { - DECLARATION_C = new TreeSet<String>(); + DECLARATION_C = new TreeSet<>(); DECLARATION_C.addAll(DECL_SPECIFIER_SEQUENCE_C); DECLARATION_C.add(Keywords.ASM); } private static final Map<ParserLanguage, Set<String>> DECLARATION_TABLE; static { - DECLARATION_TABLE = new HashMap<ParserLanguage, Set<String>>(2); + DECLARATION_TABLE = new HashMap<>(2); DECLARATION_TABLE.put(ParserLanguage.CPP, DECLARATION_CPP); DECLARATION_TABLE.put(ParserLanguage.C, DECLARATION_C); } private static final Set<String> EXPRESSION_C; static { - EXPRESSION_C = new TreeSet<String>(); + EXPRESSION_C = new TreeSet<>(); EXPRESSION_C.add(Keywords.CHAR); EXPRESSION_C.add(Keywords.SHORT); EXPRESSION_C.add(Keywords.INT); @@ -179,7 +179,7 @@ public class KeywordSets { private static final Set<String> EXPRESSION_CPP; static { - EXPRESSION_CPP = new TreeSet<String>(EXPRESSION_C); + EXPRESSION_CPP = new TreeSet<>(EXPRESSION_C); EXPRESSION_CPP.add(Keywords.BOOL); EXPRESSION_CPP.add(Keywords.CHAR16_T); EXPRESSION_CPP.add(Keywords.CHAR32_T); @@ -202,14 +202,14 @@ public class KeywordSets { private static final Map<ParserLanguage, Set<String>> EXPRESSION_TABLE; static { - EXPRESSION_TABLE = new HashMap<ParserLanguage, Set<String>>(2); + EXPRESSION_TABLE = new HashMap<>(2); EXPRESSION_TABLE.put(ParserLanguage.CPP, EXPRESSION_CPP); EXPRESSION_TABLE.put(ParserLanguage.C, EXPRESSION_C); } private static final Set<String> STATEMENT_C; static { - STATEMENT_C = new TreeSet<String>(); + STATEMENT_C = new TreeSet<>(); STATEMENT_C.addAll(DECLARATION_C); STATEMENT_C.addAll(EXPRESSION_C); STATEMENT_C.add(Keywords.FOR); @@ -228,7 +228,7 @@ public class KeywordSets { private static final Set<String> STATEMENT_CPP; static { - STATEMENT_CPP = new TreeSet<String>(DECLARATION_CPP); + STATEMENT_CPP = new TreeSet<>(DECLARATION_CPP); STATEMENT_CPP.addAll(EXPRESSION_CPP); STATEMENT_CPP.add(Keywords.TRY); STATEMENT_CPP.add(Keywords.FOR); @@ -248,14 +248,14 @@ public class KeywordSets { private static final Map<ParserLanguage, Set<String>> STATEMENT_TABLE; static { - STATEMENT_TABLE = new HashMap<ParserLanguage, Set<String>>(); + STATEMENT_TABLE = new HashMap<>(); STATEMENT_TABLE.put(ParserLanguage.CPP, STATEMENT_CPP); STATEMENT_TABLE.put(ParserLanguage.C, STATEMENT_C); } private static final Set<String> BASE_SPECIFIER_CPP; static { - BASE_SPECIFIER_CPP = new TreeSet<String>(); + BASE_SPECIFIER_CPP = new TreeSet<>(); BASE_SPECIFIER_CPP.add(Keywords.PUBLIC); BASE_SPECIFIER_CPP.add(Keywords.PROTECTED); BASE_SPECIFIER_CPP.add(Keywords.PRIVATE); @@ -264,7 +264,7 @@ public class KeywordSets { private static final Set<String> CLASS_MEMBER; static { - CLASS_MEMBER = new TreeSet<String>(DECL_SPECIFIER_SEQUENCE_CPP); + CLASS_MEMBER = new TreeSet<>(DECL_SPECIFIER_SEQUENCE_CPP); CLASS_MEMBER.add(Keywords.PUBLIC); CLASS_MEMBER.add(Keywords.PROTECTED); CLASS_MEMBER.add(Keywords.PRIVATE); @@ -272,7 +272,7 @@ public class KeywordSets { private static final Set<String> POST_USING_CPP; static { - POST_USING_CPP = new TreeSet<String>(); + POST_USING_CPP = new TreeSet<>(); POST_USING_CPP.add(Keywords.NAMESPACE); POST_USING_CPP.add(Keywords.TYPENAME); } @@ -281,7 +281,7 @@ public class KeywordSets { private static final Set<String> FUNCTION_MODIFIER_CPP; static { - FUNCTION_MODIFIER_CPP = new TreeSet<String>(FUNCTION_MODIFIER_C); + FUNCTION_MODIFIER_CPP = new TreeSet<>(FUNCTION_MODIFIER_C); FUNCTION_MODIFIER_CPP.add(Keywords.THROW); FUNCTION_MODIFIER_CPP.add(Keywords.TRY); @@ -290,14 +290,14 @@ public class KeywordSets { private static final Map<ParserLanguage, Set<String>> FUNCTION_MODIFIER_TABLE; static { - FUNCTION_MODIFIER_TABLE = new HashMap<ParserLanguage, Set<String>>(2); + FUNCTION_MODIFIER_TABLE = new HashMap<>(2); FUNCTION_MODIFIER_TABLE.put(ParserLanguage.CPP, FUNCTION_MODIFIER_CPP); FUNCTION_MODIFIER_TABLE.put(ParserLanguage.C, FUNCTION_MODIFIER_C); } private static final Set<String> PP_DIRECTIVES_C; static { - PP_DIRECTIVES_C = new TreeSet<String>(); + PP_DIRECTIVES_C = new TreeSet<>(); PP_DIRECTIVES_C.add(Directives.POUND_BLANK); PP_DIRECTIVES_C.add(Directives.POUND_DEFINE); PP_DIRECTIVES_C.add(Directives.POUND_UNDEF); @@ -317,7 +317,7 @@ public class KeywordSets { private static final Set<String> PP_DIRECTIVES_CPP; static { - PP_DIRECTIVES_CPP = new TreeSet<String>(); + PP_DIRECTIVES_CPP = new TreeSet<>(); PP_DIRECTIVES_CPP.add(Directives.POUND_BLANK); PP_DIRECTIVES_CPP.add(Directives.POUND_DEFINE); PP_DIRECTIVES_CPP.add(Directives.POUND_UNDEF); @@ -337,7 +337,7 @@ public class KeywordSets { private static final Set<String> ALL_C; static { - ALL_C = new TreeSet<String>(PP_DIRECTIVES_CPP); + ALL_C = new TreeSet<>(PP_DIRECTIVES_CPP); ALL_C.add(Keywords.AUTO); ALL_C.add(Keywords.BREAK); ALL_C.add(Keywords.CASE); @@ -382,7 +382,7 @@ public class KeywordSets { private static final Set<String> ALL_CPP; static { - ALL_CPP = new TreeSet<String>(PP_DIRECTIVES_CPP); + ALL_CPP = new TreeSet<>(PP_DIRECTIVES_CPP); ALL_CPP.add(Keywords.ALIGNAS); ALL_CPP.add(Keywords.ALIGNOF); ALL_CPP.add(Keywords.AND); @@ -471,14 +471,14 @@ public class KeywordSets { private static final Map<ParserLanguage, Set<String>> ALL_TABLE; static { - ALL_TABLE = new HashMap<ParserLanguage, Set<String>>(2); + ALL_TABLE = new HashMap<>(2); ALL_TABLE.put(ParserLanguage.C, ALL_C); ALL_TABLE.put(ParserLanguage.CPP, ALL_CPP); } private static final Set<String> KEYWORDS_CPP; static { - KEYWORDS_CPP = new TreeSet<String>(); + KEYWORDS_CPP = new TreeSet<>(); KEYWORDS_CPP.add(Keywords.ALIGNAS); KEYWORDS_CPP.add(Keywords.ALIGNOF); KEYWORDS_CPP.add(Keywords.AND); @@ -568,7 +568,7 @@ public class KeywordSets { private static Set<String> KEYWORDS_C; static { - KEYWORDS_C = new TreeSet<String>(); + KEYWORDS_C = new TreeSet<>(); KEYWORDS_C.add(Keywords.ASM); KEYWORDS_C.add(Keywords.AUTO); KEYWORDS_C.add(Keywords.BREAK); @@ -610,14 +610,14 @@ public class KeywordSets { private static final Map<ParserLanguage, Set<String>> KEYWORDS_TABLE; static { - KEYWORDS_TABLE = new HashMap<ParserLanguage, Set<String>>(2); + KEYWORDS_TABLE = new HashMap<>(2); KEYWORDS_TABLE.put(ParserLanguage.C, KEYWORDS_C); KEYWORDS_TABLE.put(ParserLanguage.CPP, KEYWORDS_CPP); } private static final Set<String> TYPES_C; static { - TYPES_C = new TreeSet<String>(); + TYPES_C = new TreeSet<>(); TYPES_C.add(Keywords.CHAR); TYPES_C.add(Keywords.DOUBLE); TYPES_C.add(Keywords.FLOAT); @@ -634,7 +634,7 @@ public class KeywordSets { private static final Set<String> TYPES_CPP; static { - TYPES_CPP = new TreeSet<String>(); + TYPES_CPP = new TreeSet<>(); TYPES_CPP.add(Keywords.BOOL); TYPES_CPP.add(Keywords.CHAR); TYPES_CPP.add(Keywords.CHAR16_T); @@ -652,14 +652,14 @@ public class KeywordSets { private static Map<ParserLanguage, Set<String>> TYPES_TABLE; static { - TYPES_TABLE = new HashMap<ParserLanguage, Set<String>>(2); + TYPES_TABLE = new HashMap<>(2); TYPES_TABLE.put(ParserLanguage.C, TYPES_C); TYPES_TABLE.put(ParserLanguage.CPP, TYPES_CPP); } private static Map<ParserLanguage, Set<String>> PP_DIRECTIVES_TABLE; static { - PP_DIRECTIVES_TABLE = new HashMap<ParserLanguage, Set<String>>(2); + PP_DIRECTIVES_TABLE = new HashMap<>(2); PP_DIRECTIVES_TABLE.put(ParserLanguage.C, PP_DIRECTIVES_C); PP_DIRECTIVES_TABLE.put(ParserLanguage.CPP, PP_DIRECTIVES_CPP); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/Profiler.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/Profiler.java index c31175cd270..5bedde683a2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/Profiler.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/Profiler.java @@ -82,11 +82,11 @@ public class Profiler { private Map<String, int[]> counters; private Profiler() { - timers = new HashMap<String, Timer>(); - counters = new HashMap<String, int[]>(); + timers = new HashMap<>(); + counters = new HashMap<>(); } - private static ThreadLocal<Profiler> threadProfiler = new ThreadLocal<Profiler>(); + private static ThreadLocal<Profiler> threadProfiler = new ThreadLocal<>(); /** * @@ -136,7 +136,7 @@ public class Profiler { public static void printStats() { Profiler profiler = threadProfiler.get(); if (profiler != null) { - List<Map.Entry<String, Timer>> list = new ArrayList<Map.Entry<String, Timer>>(profiler.timers.entrySet()); + List<Map.Entry<String, Timer>> list = new ArrayList<>(profiler.timers.entrySet()); Comparator<Map.Entry<String, Timer>> c = new Comparator<Map.Entry<String, Timer>>() { @Override public int compare(Entry<String, Timer> o1, Entry<String, Timer> o2) { @@ -152,7 +152,7 @@ public class Profiler { } if (!profiler.counters.isEmpty()) { - List<Map.Entry<String, int[]>> keyList = new ArrayList<Map.Entry<String, int[]>>( + List<Map.Entry<String, int[]>> keyList = new ArrayList<>( profiler.counters.entrySet()); Comparator<Map.Entry<String, int[]>> c2 = new Comparator<Map.Entry<String, int[]>>() { @Override diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/Checksums.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/Checksums.java index 21a22f57be1..70143155075 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/Checksums.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/Checksums.java @@ -105,7 +105,7 @@ public class Checksums { */ public static Map<String, Object> createChecksumMap(IFile[] tus, MessageDigest md, IProgressMonitor pm) throws OperationCanceledException { - Map<String, Object> result = new HashMap<String, Object>(); + Map<String, Object> result = new HashMap<>(); putAlgorithm(result, md); pm.beginTask(Messages.Checksums_taskComputeChecksums, tus.length); for (IFile file : tus) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexUpdatePolicy.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexUpdatePolicy.java index dad14340d4f..4c0d54c62de 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexUpdatePolicy.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexUpdatePolicy.java @@ -32,9 +32,9 @@ public class IndexUpdatePolicy { private final ICProject fCProject; private int fKind; - private HashSet<ITranslationUnit> fForce = new HashSet<ITranslationUnit>(); - private HashSet<ITranslationUnit> fTimestamp = new HashSet<ITranslationUnit>(); - private HashSet<ITranslationUnit> fRemoved = new HashSet<ITranslationUnit>(); + private HashSet<ITranslationUnit> fForce = new HashSet<>(); + private HashSet<ITranslationUnit> fTimestamp = new HashSet<>(); + private HashSet<ITranslationUnit> fRemoved = new HashSet<>(); private IPDOMIndexer fIndexer; private boolean fReindexRequested; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/LanguageSettingsChangeListener.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/LanguageSettingsChangeListener.java index ed9dfd528e8..04ea3d69079 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/LanguageSettingsChangeListener.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/LanguageSettingsChangeListener.java @@ -71,7 +71,7 @@ public class LanguageSettingsChangeListener implements ILanguageSettingsChangeLi private void reindex(String cfgId, ILanguageSettingsChangeEvent event) { CModelManager manager = CModelManager.getDefault(); ICProject cProject = manager.getCModel().getCProject(event.getProjectName()); - Set<ICElement> tuSelection = new HashSet<ICElement>(); + Set<ICElement> tuSelection = new HashSet<>(); Set<IResource> resources = event.getAffectedResources(cfgId); if (resources != null && !resources.isEmpty()) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java index af60d35e886..3cdb615386e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java @@ -1581,7 +1581,7 @@ public class PDOM extends PlatformObject implements IPDOM { public void putCachedVariableResult(Long key, IValue result) { synchronized (fVariableResultCache) { - fVariableResultCache.put(key, new WeakReference<IValue>(result)); + fVariableResultCache.put(key, new WeakReference<>(result)); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMASTProcessorManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMASTProcessorManager.java index 1f5c4fb55c6..4877dd3340f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMASTProcessorManager.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMASTProcessorManager.java @@ -29,7 +29,7 @@ public class PDOMASTProcessorManager { private static final String EXTENSION_POINT = "PDOMASTProcessor"; //$NON-NLS-1$ - private static final List<PDOMASTProcessorDesc> processors = new ArrayList<PDOMASTProcessorDesc>(); + private static final List<PDOMASTProcessorDesc> processors = new ArrayList<>(); static { // Load the extensions IConfigurationElement[] elements = Platform.getExtensionRegistry() @@ -52,7 +52,7 @@ public class PDOMASTProcessorManager { IPDOMASTProcessor processor = desc.getProcessorFor(ast); if (processor != null) { if (list == null) - list = new ArrayList<IPDOMASTProcessor>(); + list = new ArrayList<>(); list.add(processor); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMProxy.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMProxy.java index 5db504904f9..b678934cb27 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMProxy.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMProxy.java @@ -49,12 +49,12 @@ import org.eclipse.core.runtime.IProgressMonitor; public class PDOMProxy implements IPDOM { private PDOM fDelegate; private int fReadLockCount; - private Set<IListener> fListeners = new HashSet<IListener>(); + private Set<IListener> fListeners = new HashSet<>(); private Map<Thread, DebugLockInfo> fLockDebugging; public PDOMProxy() { if (PDOM.sDEBUG_LOCKS) { - fLockDebugging = new HashMap<Thread, DebugLockInfo>(); + fLockDebugging = new HashMap<>(); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/TeamPDOMExportOperation.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/TeamPDOMExportOperation.java index 8a600e4c5e1..6b1a4c9686b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/TeamPDOMExportOperation.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/TeamPDOMExportOperation.java @@ -176,7 +176,7 @@ public class TeamPDOMExportOperation implements IWorkspaceRunnable { private void createChecksums(ICProject cproject, PDOM pdom, File target, IProgressMonitor monitor) throws CoreException { - HashSet<String> fullPaths = new HashSet<String>(); + HashSet<String> fullPaths = new HashSet<>(); try { pdom.acquireReadLock(); } catch (InterruptedException e) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WaitForRefreshJobs.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WaitForRefreshJobs.java index 8cacdff1a32..d9dbbc435ec 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WaitForRefreshJobs.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WaitForRefreshJobs.java @@ -29,7 +29,7 @@ import org.eclipse.core.runtime.jobs.Job; * Postpones indexer setup until there are no running refresh jobs. */ public class WaitForRefreshJobs extends IndexerSetupParticipant { - private Set<ICProject> fProjects = new HashSet<ICProject>(); + private Set<ICProject> fProjects = new HashSet<>(); private Set<Job> fRefreshJobs = Collections.synchronizedSet(new HashSet<Job>()); private IJobChangeListener fJobListener = new IJobChangeListener() { @@ -85,7 +85,7 @@ public class WaitForRefreshJobs extends IndexerSetupParticipant { if (isRefreshing()) return; projects = fProjects; - fProjects = new HashSet<ICProject>(); + fProjects = new HashSet<>(); } for (ICProject project : projects) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java index 6d95d6822ee..fd38a885dd9 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java @@ -215,7 +215,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment { * @throws CoreException */ public void rewriteLocations(final IIndexLocationConverter newConverter) throws CoreException { - final List<PDOMFile> pdomfiles = new ArrayList<PDOMFile>(); + final List<PDOMFile> pdomfiles = new ArrayList<>(); getFileIndex().accept(new IBTreeVisitor() { @Override public int compare(long record) throws CoreException { @@ -231,7 +231,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment { }); clearFileIndex(); - final List<PDOMFile> notConverted = new ArrayList<PDOMFile>(); + final List<PDOMFile> notConverted = new ArrayList<>(); for (PDOMFile file : pdomfiles) { String internalFormat = newConverter.toInternalFormat(file.getLocation()); if (internalFormat != null) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java index d154b94a61f..14672682e25 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java @@ -242,7 +242,7 @@ public class DBProperties { } public static Set<String> getKeySet(final Database db, final BTree index) throws CoreException { - final Set<String> result = new HashSet<String>(); + final Set<String> result = new HashSet<>(); index.accept(new IBTreeVisitor() { @Override public int compare(long record) throws CoreException { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/PDOMStringSet.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/PDOMStringSet.java index fe50f7cc582..df7caae07e3 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/PDOMStringSet.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/PDOMStringSet.java @@ -99,7 +99,7 @@ public class PDOMStringSet { NodeType.Item.put(db, new_node, record); if (lazyCache == null) - lazyCache = new HashMap<String, Long>(); + lazyCache = new HashMap<>(); lazyCache.put(str, record); // If the Database has already been partially searched, then the loaded pointer will be after the @@ -131,7 +131,7 @@ public class PDOMStringSet { // otherwise prepare the cache for the data that is about to be loaded if (lazyCache == null) - lazyCache = new HashMap<String, Long>(); + lazyCache = new HashMap<>(); // if nothing has been loaded, then start loading with the head node, otherwise continue // loading from whatever is after the last loaded node diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerCollector.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerCollector.java index 75f57112fab..0e79ad238b3 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerCollector.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerCollector.java @@ -38,7 +38,7 @@ public final class MacroContainerCollector implements IBTreeVisitor { private IProgressMonitor monitor = null; private int monitorCheckCounter = 0; - private List<PDOMMacroContainer> macros = new ArrayList<PDOMMacroContainer>(); + private List<PDOMMacroContainer> macros = new ArrayList<>(); /** * Collects all nodes with given name, passing the filter. If prefixLookup is set to diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerPatternCollector.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerPatternCollector.java index 3f3bd84f67d..e3a6abfd7e5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerPatternCollector.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/MacroContainerPatternCollector.java @@ -29,7 +29,7 @@ import org.eclipse.core.runtime.OperationCanceledException; public final class MacroContainerPatternCollector implements IBTreeVisitor { private final PDOMLinkage fLinkage; - private final List<PDOMMacroContainer> macros = new ArrayList<PDOMMacroContainer>(); + private final List<PDOMMacroContainer> macros = new ArrayList<>(); private final Pattern fPattern; private final IProgressMonitor fMonitor; private int fMonitorCheckCounter = 0; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java index 0c7ea7d0aaf..fa841dd5ace 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java @@ -476,7 +476,7 @@ public class PDOMFile implements IIndexFragmentFile { assert getFirstName() == null; assert getFirstMacroReference() == null; final PDOMLinkage linkage = getLinkage(); - HashMap<IASTName, PDOMName> nameCache = new HashMap<IASTName, PDOMName>(); + HashMap<IASTName, PDOMName> nameCache = new HashMap<>(); PDOMName lastName = null; PDOMMacroReferenceName lastMacroName = null; for (IASTName[] name : names) { @@ -592,7 +592,7 @@ public class PDOMFile implements IIndexFragmentFile { setFirstMacro(null); // Delete all the names in this file - ArrayList<PDOMName> names = new ArrayList<PDOMName>(); + ArrayList<PDOMName> names = new ArrayList<>(); PDOMName name = getFirstName(); while (name != null) { names.add(name); @@ -606,7 +606,7 @@ public class PDOMFile implements IIndexFragmentFile { setFirstName(null); // Delete all macro references - ArrayList<PDOMMacroReferenceName> mrefs = new ArrayList<PDOMMacroReferenceName>(); + ArrayList<PDOMMacroReferenceName> mrefs = new ArrayList<>(); PDOMMacroReferenceName mref = getFirstMacroReference(); while (mref != null) { mrefs.add(mref); @@ -684,7 +684,7 @@ public class PDOMFile implements IIndexFragmentFile { @Override public IIndexInclude[] getIncludes() throws CoreException { - List<PDOMInclude> result = new ArrayList<PDOMInclude>(); + List<PDOMInclude> result = new ArrayList<>(); PDOMInclude include = getFirstInclude(); while (include != null) { result.add(include); @@ -706,7 +706,7 @@ public class PDOMFile implements IIndexFragmentFile { @Override public IIndexMacro[] getMacros() throws CoreException { - List<PDOMMacro> result = new ArrayList<PDOMMacro>(); + List<PDOMMacro> result = new ArrayList<>(); PDOMMacro macro = getFirstMacro(); while (macro != null) { result.add(macro); @@ -722,7 +722,7 @@ public class PDOMFile implements IIndexFragmentFile { @Override public IIndexName[] findNames(int offset, int length) throws CoreException { - ArrayList<IIndexName> result = new ArrayList<IIndexName>(); + ArrayList<IIndexName> result = new ArrayList<>(); for (PDOMName name = getFirstName(); name != null; name = name.getNextInFile()) { int nameOffset = name.getNodeOffset(); if (nameOffset >= offset) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java index ea02592d4c8..170f025f470 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java @@ -440,7 +440,7 @@ public abstract class PDOMLinkage extends PDOMNamedNode implements IIndexLinkage .getCachedResult(key); CharArrayMap<PDOMBinding[]> map = cached == null ? null : cached.get(); if (map == null) { - map = new CharArrayMap<PDOMBinding[]>(); + map = new CharArrayMap<>(); pdom.putCachedResult(key, new SoftReference<CharArrayMap<?>>(map)); } return map; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCEnumeration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCEnumeration.java index da1f2588880..df26b63665a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCEnumeration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCEnumeration.java @@ -104,13 +104,13 @@ class PDOMCEnumeration extends PDOMBinding implements IEnumeration, IIndexType, if (result == null && create) { // there is no cache, build it: result = loadEnumerators(); - pdom.putCachedResult(key, new SoftReference<List<PDOMCEnumerator>>(result)); + pdom.putCachedResult(key, new SoftReference<>(result)); } return result; } private List<PDOMCEnumerator> loadEnumerators() { - final ArrayList<PDOMCEnumerator> result = new ArrayList<PDOMCEnumerator>(); + final ArrayList<PDOMCEnumerator> result = new ArrayList<>(); try { PDOMNodeLinkedList list = new PDOMNodeLinkedList(getLinkage(), record + OFFSET_ENUMERATOR_LIST); list.accept(new IPDOMVisitor() { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java index b1a7f443859..1cb22a003c7 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java @@ -219,7 +219,7 @@ public class PDOMCPPClassTemplate extends PDOMCPPClassType @Override public ICPPClassTemplatePartialSpecialization[] getPartialSpecializations() { try { - ArrayList<PDOMCPPClassTemplatePartialSpecialization> partials = new ArrayList<PDOMCPPClassTemplatePartialSpecialization>(); + ArrayList<PDOMCPPClassTemplatePartialSpecialization> partials = new ArrayList<>(); for (PDOMCPPClassTemplatePartialSpecialization partial = getFirstPartial(); partial != null; partial = partial .getNextPartial()) { partials.add(partial); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumScope.java index 4c8a6eea309..3dca8c8e21c 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumScope.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumScope.java @@ -88,7 +88,7 @@ class PDOMCPPEnumScope implements ICPPEnumScope, IIndexScope { try { CharArrayObjectMap<IPDOMCPPEnumerator> map = getBindingMap(fBinding); if (lookup.isPrefixLookup()) { - final List<IBinding> result = new ArrayList<IBinding>(); + final List<IBinding> result = new ArrayList<>(); final char[] nc = lookup.getLookupKey(); IContentAssistMatcher matcher = ContentAssistMatcherFactory.getInstance().createMatcher(nc); for (char[] key : map.keys()) { @@ -187,7 +187,7 @@ class PDOMCPPEnumScope implements ICPPEnumScope, IIndexScope { // loses the order. List<IPDOMCPPEnumerator> enumerators = new ArrayList<>(); enumType.loadEnumerators(enumerators); - List<IEnumerator> result = new ArrayList<IEnumerator>(); + List<IEnumerator> result = new ArrayList<>(); for (IEnumerator value : enumerators) { if (IndexFilter.ALL_DECLARED.acceptBinding(value)) { result.add(value); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java index d3d099b6034..4752e5e0ab5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java @@ -196,7 +196,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants { private final static int RECORD_SIZE = FIRST_NAMESPACE_CHILD_OFFSET + Database.PTR_SIZE; // Only used when writing to database, which is single-threaded - private final LinkedList<Runnable> postProcesses = new LinkedList<Runnable>(); + private final LinkedList<Runnable> postProcesses = new LinkedList<>(); public PDOMCPPLinkage(PDOM pdom, long record) { super(pdom, record); @@ -1533,7 +1533,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants { if (rec == 0) { return ICPPUsingDirective.EMPTY_ARRAY; } - LinkedList<ICPPUsingDirective> uds = new LinkedList<ICPPUsingDirective>(); + LinkedList<ICPPUsingDirective> uds = new LinkedList<>(); do { PDOMCPPUsingDirective ud = new PDOMCPPUsingDirective(this, rec); uds.addFirst(ud); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDeclarationSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDeclarationSpecialization.java index 9baaef0f319..0460b2c70d3 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDeclarationSpecialization.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDeclarationSpecialization.java @@ -43,7 +43,7 @@ class PDOMCPPUsingDeclarationSpecialization extends PDOMCPPSpecialization implem PDOMBinding specialized) throws CoreException { super(linkage, parent, (ICPPSpecialization) using, specialized); - Set<PDOMBinding> targets = new LinkedHashSet<PDOMBinding>(); + Set<PDOMBinding> targets = new LinkedHashSet<>(); PDOMNodeLinkedList list = new PDOMNodeLinkedList(getLinkage(), record + TARGET_BINDINGS); for (IBinding delegate : using.getDelegates()) { PDOMBinding target = getLinkage().adaptBinding(delegate); @@ -71,7 +71,7 @@ class PDOMCPPUsingDeclarationSpecialization extends PDOMCPPSpecialization implem public IBinding[] getDelegates() { if (delegates == null) { PDOMNodeLinkedList list = new PDOMNodeLinkedList(getLinkage(), record + TARGET_BINDINGS); - final List<IBinding> result = new ArrayList<IBinding>(); + final List<IBinding> result = new ArrayList<>(); try { list.accept(new IPDOMVisitor() { @Override diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/CLIUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/CLIUtil.java index fd11cfcfeed..fb4e8167288 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/CLIUtil.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/CLIUtil.java @@ -54,7 +54,7 @@ public class CLIUtil { * Returns a map of String option to List of String parameters. */ public static Map<String, List<String>> parseToMap(String[] args) { - Map<String, List<String>> result = new HashMap<String, List<String>>(); + Map<String, List<String>> result = new HashMap<>(); String current = null; for (String arg : args) { if (arg.startsWith("-")) { //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOMApplication.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOMApplication.java index a9942840597..91b1f2ab80d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOMApplication.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOMApplication.java @@ -182,7 +182,7 @@ public class GeneratePDOMApplication implements IApplication { */ private static synchronized IExportProjectProvider getExportProjectProvider(String fqn) { if (projectInitializers == null) { - projectInitializers = new HashMap<String, IExportProjectProvider>(); + projectInitializers = new HashMap<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint indexExtensions = registry.getExtensionPoint(CCorePlugin.INDEX_UNIQ_ID); IExtension[] extensions = indexExtensions.getExtensions(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/DeltaAnalyzer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/DeltaAnalyzer.java index 2af7bbe956d..76999c465d9 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/DeltaAnalyzer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/DeltaAnalyzer.java @@ -30,9 +30,9 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.NullProgressMonitor; public class DeltaAnalyzer { - private final List<ITranslationUnit> fForce = new ArrayList<ITranslationUnit>(); - private final List<ITranslationUnit> fChanged = new ArrayList<ITranslationUnit>(); - private final List<ITranslationUnit> fRemoved = new ArrayList<ITranslationUnit>(); + private final List<ITranslationUnit> fForce = new ArrayList<>(); + private final List<ITranslationUnit> fChanged = new ArrayList<>(); + private final List<ITranslationUnit> fRemoved = new ArrayList<>(); // For testing purposes, only. public static boolean sSuppressPotentialTUs = false; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerASTVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerASTVisitor.java index d825be11530..a6f73f930c8 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerASTVisitor.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerASTVisitor.java @@ -91,8 +91,8 @@ abstract public class IndexerASTVisitor extends ASTVisitor { private IASTName fDefinitionName; private IASTNode fDefinitionNode; - private ArrayList<Definition> fStack = new ArrayList<Definition>(); - private ArrayList<IASTProblem> fProblems = new ArrayList<IASTProblem>(); + private ArrayList<Definition> fStack = new ArrayList<>(); + private ArrayList<IASTProblem> fProblems = new ArrayList<>(); public IndexerASTVisitor(boolean visitImplicitNames) { shouldVisitNames = true; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMUpdateTask.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMUpdateTask.java index 96104d923bc..f96164e0f7b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMUpdateTask.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMUpdateTask.java @@ -99,7 +99,7 @@ public class PDOMUpdateTask implements IPDOMIndexerTask { private void createDelegate(ICProject project, IProgressMonitor monitor) throws CoreException, InterruptedException { - HashSet<ITranslationUnit> set = new HashSet<ITranslationUnit>(); + HashSet<ITranslationUnit> set = new HashSet<>(); if ((fUpdateOptions & (IIndexManager.UPDATE_ALL | IIndexManager.UPDATE_CHECK_TIMESTAMPS)) != 0) { TranslationUnitCollector collector = new TranslationUnitCollector(set, set, monitor); boolean haveProject = false; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerIncludeResolutionHeuristics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerIncludeResolutionHeuristics.java index cdcfb6c8689..685e482daea 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerIncludeResolutionHeuristics.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerIncludeResolutionHeuristics.java @@ -109,12 +109,12 @@ public class ProjectIndexerIncludeResolutionHeuristics implements IIncludeFileRe } private IProject[] getOpenReferencedProjects(IProject prj) { - Set<IProject> result = new HashSet<IProject>(); + Set<IProject> result = new HashSet<>(); if (prj.isOpen()) { result.add(prj); - List<IProject> projectsToSearch = new ArrayList<IProject>(); + List<IProject> projectsToSearch = new ArrayList<>(); projectsToSearch.add(prj); for (int i = 0; i < projectsToSearch.size(); i++) { IProject project = projectsToSearch.get(i); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerInputAdapter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerInputAdapter.java index 0e4c1f06e06..3e199f69eea 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerInputAdapter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/ProjectIndexerInputAdapter.java @@ -69,7 +69,7 @@ public class ProjectIndexerInputAdapter extends IndexerInputAdapter { fCProject = cproject; fProjectPrefix = cproject.getProject().getFullPath().toString() + IPath.SEPARATOR; if (useCache) { - fIflCache = new HashMap<String, IIndexFileLocation>(); + fIflCache = new HashMap<>(); fExistsCache = new FileExistsCache(isCaseInsensitiveFileSystem()); } else { fIflCache = null; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/tag/PDOMTagIndex.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/tag/PDOMTagIndex.java index 05f9f9a3267..458cbc26520 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/tag/PDOMTagIndex.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/tag/PDOMTagIndex.java @@ -156,7 +156,7 @@ public class PDOMTagIndex { } final Long bindingRecord = Long.valueOf(binding_record); - return new BTreeIterable<ITag>(btree, new BTreeIterable.Descriptor<ITag>() { + return new BTreeIterable<>(btree, new BTreeIterable.Descriptor<ITag>() { @Override public ITag create(long record) { return new PDOMTag(db, record); @@ -179,7 +179,7 @@ public class PDOMTagIndex { // record. In each case we decide whether to delete or update the tag. Tags of the same size can be // updated in place, otherwise the tag needs to be deleted and recreated. - final Map<String, ITag> newTags = new HashMap<String, ITag>(); + final Map<String, ITag> newTags = new HashMap<>(); for (ITag tag : tags) { ITag dupTag = newTags.put(tag.getTaggerId(), tag); if (dupTag != null) |