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.ui/src/org/eclipse/cdt/internal/ui/text/contentassist | |
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.ui/src/org/eclipse/cdt/internal/ui/text/contentassist')
7 files changed, 21 insertions, 21 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerDescriptor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerDescriptor.java index 9eaa7ddc221..67ac911e7f7 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerDescriptor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerDescriptor.java @@ -80,7 +80,7 @@ final class CompletionProposalComputerDescriptor { private static final String SESSION_ENDED = "sessionEnded()"; //$NON-NLS-1$ static { - Set<String> partitions = new HashSet<String>(); + Set<String> partitions = new HashSet<>(); partitions.add(IDocument.DEFAULT_CONTENT_TYPE); partitions.addAll(Arrays.asList(ICPartitions.ALL_CPARTITIONS)); @@ -142,7 +142,7 @@ final class CompletionProposalComputerDescriptor { else fName = name; - Set<String> partitions = new HashSet<String>(); + Set<String> partitions = new HashSet<>(); IConfigurationElement[] children = element.getChildren(PARTITION); if (children.length == 0) { fPartitions = PARTITION_SET; // add to all partition types if no partition is configured diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerRegistry.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerRegistry.java index 268639f0f3d..12c66d662e1 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerRegistry.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerRegistry.java @@ -83,26 +83,26 @@ public final class CompletionProposalComputerRegistry { * {@link String}, value type: * {@linkplain List List<CompletionProposalComputerDescriptor>}). */ - private final Map<String, List<CompletionProposalComputerDescriptor>> fDescriptorsByPartition = new HashMap<String, List<CompletionProposalComputerDescriptor>>(); + private final Map<String, List<CompletionProposalComputerDescriptor>> fDescriptorsByPartition = new HashMap<>(); /** * Unmodifiable versions of the sets stored in * <code>fDescriptorsByPartition</code> (key type: {@link String}, * value type: * {@linkplain List List<CompletionProposalComputerDescriptor>}). */ - private final Map<String, List<CompletionProposalComputerDescriptor>> fPublicDescriptorsByPartition = new HashMap<String, List<CompletionProposalComputerDescriptor>>(); + private final Map<String, List<CompletionProposalComputerDescriptor>> fPublicDescriptorsByPartition = new HashMap<>(); /** * All descriptors (element type: * {@link CompletionProposalComputerDescriptor}). */ - private final List<CompletionProposalComputerDescriptor> fDescriptors = new ArrayList<CompletionProposalComputerDescriptor>(); + private final List<CompletionProposalComputerDescriptor> fDescriptors = new ArrayList<>(); /** * Unmodifiable view of <code>fDescriptors</code> */ private final List<CompletionProposalComputerDescriptor> fPublicDescriptors = Collections .unmodifiableList(fDescriptors); - private final List<CompletionProposalCategory> fCategories = new ArrayList<CompletionProposalCategory>(); + private final List<CompletionProposalCategory> fCategories = new ArrayList<>(); private final List<CompletionProposalCategory> fPublicCategories = Collections.unmodifiableList(fCategories); /** * <code>true</code> if this registry has been loaded. @@ -209,11 +209,11 @@ public final class CompletionProposalComputerRegistry { */ public void reload() { IExtensionRegistry registry = Platform.getExtensionRegistry(); - List<IConfigurationElement> elements = new ArrayList<IConfigurationElement>( + List<IConfigurationElement> elements = new ArrayList<>( Arrays.asList(registry.getConfigurationElementsFor(CUIPlugin.getPluginId(), EXTENSION_POINT))); - Map<String, List<CompletionProposalComputerDescriptor>> map = new HashMap<String, List<CompletionProposalComputerDescriptor>>(); - List<CompletionProposalComputerDescriptor> all = new ArrayList<CompletionProposalComputerDescriptor>(); + Map<String, List<CompletionProposalComputerDescriptor>> map = new HashMap<>(); + List<CompletionProposalComputerDescriptor> all = new ArrayList<>(); List<CompletionProposalCategory> categories = getCategories(elements); for (IConfigurationElement element : elements) { @@ -225,7 +225,7 @@ public final class CompletionProposalComputerRegistry { String partition = (String) element2; List<CompletionProposalComputerDescriptor> list = map.get(partition); if (list == null) { - list = new ArrayList<CompletionProposalComputerDescriptor>(); + list = new ArrayList<>(); map.put(partition, list); } list.add(desc); @@ -273,11 +273,11 @@ public final class CompletionProposalComputerRegistry { private List<CompletionProposalCategory> getCategories(List<IConfigurationElement> elements) { IPreferenceStore store = CUIPlugin.getDefault().getPreferenceStore(); String preference = store.getString(PreferenceConstants.CODEASSIST_EXCLUDED_CATEGORIES); - Set<String> disabled = new HashSet<String>(); + Set<String> disabled = new HashSet<>(); StringTokenizer tok = new StringTokenizer(preference, "\0"); //$NON-NLS-1$ while (tok.hasMoreTokens()) disabled.add(tok.nextToken()); - Map<String, Integer> ordered = new HashMap<String, Integer>(); + Map<String, Integer> ordered = new HashMap<>(); preference = store.getString(PreferenceConstants.CODEASSIST_CATEGORY_ORDER); tok = new StringTokenizer(preference, "\0"); //$NON-NLS-1$ while (tok.hasMoreTokens()) { @@ -287,7 +287,7 @@ public final class CompletionProposalComputerRegistry { ordered.put(id, Integer.valueOf(rank)); } - List<CompletionProposalCategory> categories = new ArrayList<CompletionProposalCategory>(); + List<CompletionProposalCategory> categories = new ArrayList<>(); for (Iterator<IConfigurationElement> iter = elements.iterator(); iter.hasNext();) { IConfigurationElement element = iter.next(); try { @@ -382,7 +382,7 @@ public final class CompletionProposalComputerRegistry { * @return the names of the contributors other than <code>culprit</code> that contribute to <code>category</code> (element type: {@link String}) */ private Set<String> getAffectedContributors(CompletionProposalCategory category, IContributor culprit) { - Set<String> affectedPlugins = new HashSet<String>(); + Set<String> affectedPlugins = new HashSet<>(); for (CompletionProposalComputerDescriptor desc : getProposalComputerDescriptors()) { CompletionProposalCategory cat = desc.getCategory(); if (cat.equals(category)) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistComputerParameter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistComputerParameter.java index c22f5ff5716..90873817348 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistComputerParameter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistComputerParameter.java @@ -33,7 +33,7 @@ public final class ContentAssistComputerParameter implements IParameterValues { public Map<String, String> getParameterValues() { Collection<CompletionProposalCategory> descriptors = CompletionProposalComputerRegistry.getDefault() .getProposalCategories(); - Map<String, String> map = new HashMap<String, String>(descriptors.size()); + Map<String, String> map = new HashMap<>(descriptors.size()); for (CompletionProposalCategory category : descriptors) { map.put(category.getDisplayName(), category.getId()); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/HelpCompletionProposalComputer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/HelpCompletionProposalComputer.java index aeb25719866..dd7b1084dfe 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/HelpCompletionProposalComputer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/HelpCompletionProposalComputer.java @@ -110,7 +110,7 @@ public class HelpCompletionProposalComputer extends ParsingBasedProposalComputer // not generate prefix matches to begin with if it's set. boolean requireExactMatch = cContext.isContextInformationStyle(); - List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(); + List<ICompletionProposal> proposals = new ArrayList<>(); for (IFunctionSummary summary : summaries) { if (requireExactMatch && !summary.getName().equals(prefix)) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/InclusionProposalComputer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/InclusionProposalComputer.java index c4867ebaeb5..725ebb7ba1d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/InclusionProposalComputer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/InclusionProposalComputer.java @@ -71,7 +71,7 @@ public class InclusionProposalComputer implements ICompletionProposalComputer { CContentAssistInvocationContext cContext = (CContentAssistInvocationContext) context; if (inIncludeDirective(cContext)) { // add include file proposals - proposals = new ArrayList<ICompletionProposal>(); + proposals = new ArrayList<>(); try { addInclusionProposals(cContext, proposals); } catch (Exception exc) { @@ -157,7 +157,7 @@ public class InclusionProposalComputer implements ICompletionProposalComputer { PotentialInclude[] potentialIncludes = collectIncludeFiles(tu, prefixPath, angleBrackets); if (potentialIncludes.length > 0) { IInclude[] includes = tu.getIncludes(); - Set<String> alreadyIncluded = new HashSet<String>(); + Set<String> alreadyIncluded = new HashSet<>(); for (IInclude includeDirective : includes) { alreadyIncluded.add(includeDirective.getElementName()); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/KeywordCompletionProposalComputer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/KeywordCompletionProposalComputer.java index c153fd1d8d6..2b7ca4b0c93 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/KeywordCompletionProposalComputer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/KeywordCompletionProposalComputer.java @@ -59,7 +59,7 @@ public class KeywordCompletionProposalComputer extends ParsingBasedProposalCompu // keywords are matched case-sensitive final int relevance = RelevanceConstants.CASE_MATCH_RELEVANCE + RelevanceConstants.KEYWORD_TYPE_RELEVANCE; - List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(); + List<ICompletionProposal> proposals = new ArrayList<>(); ICLanguageKeywords languageKeywords = null; ITranslationUnit tu = context.getTranslationUnit(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ParsingBasedProposalComputer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ParsingBasedProposalComputer.java index 2c5a6fa02e2..1c0f7cb6c28 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ParsingBasedProposalComputer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ParsingBasedProposalComputer.java @@ -71,8 +71,8 @@ public abstract class ParsingBasedProposalComputer implements ICompletionProposa IProgressMonitor monitor) { Collection<ICompletionProposal> proposals = computeCompletionProposals(context, monitor); // Remove duplicates - proposals = (new LinkedHashSet<ICompletionProposal>(proposals)); - List<IContextInformation> result = new ArrayList<IContextInformation>(); + proposals = (new LinkedHashSet<>(proposals)); + List<IContextInformation> result = new ArrayList<>(); for (ICompletionProposal proposal : proposals) { IContextInformation contextInformation = proposal.getContextInformation(); if (contextInformation != null) { |