Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah Graham2018-11-20 16:20:42 +0000
committerJonah Graham2018-11-22 21:55:36 +0000
commitcaf2292768deccd885b5b6989b731742e2e5edf4 (patch)
tree711a6088f2e17c7e31ebb51af1eadc1af00768e5 /core/org.eclipse.cdt.ui.tests
parent8844a8f9f22802fedffa3cb2a8a21b041aa64b74 (diff)
downloadorg.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.tests')
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/Main.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/ResourceTestHelper.java4
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/util/StringAsserts.java8
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/DOMASTNodeLeaf.java4
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameDialog.java4
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameTarget.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/templateengine/TemplateEngineTestsHelper.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/templateengine/TestTemplateEngineBugs.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/BaseUITestCase.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/extension/CHOpenListener.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/chelp/CHelpProviderTester.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/misc/LanguageVerifierTests.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/quickfix/AssistQuickFixTest.java4
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AbstractAutoEditTest.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CAutoIndentTest.java12
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CPartitionScanner.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTestBase.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/SemanticHighlightingTest.java4
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TemplateFormatterTest.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/DocCommentHighlightingTest.java4
22 files changed, 36 insertions, 36 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/Main.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/Main.java
index c349cf8736c..cb6818d2419 100644
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/Main.java
+++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/Main.java
@@ -404,7 +404,7 @@ public class Main {
* @exception Exception thrown if a problem occurs during launching
*/
public static void main(String argString) throws Exception {
- Vector<Object> list = new Vector<Object>(5);
+ Vector<Object> list = new Vector<>(5);
for (StringTokenizer tokens = new StringTokenizer(argString, " "); tokens.hasMoreElements();) //$NON-NLS-1$
list.addElement(tokens.nextElement());
main(list.toArray(new String[list.size()]));
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/ResourceTestHelper.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/ResourceTestHelper.java
index 16781c35505..c456faa47b2 100644
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/ResourceTestHelper.java
+++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/ResourceTestHelper.java
@@ -129,7 +129,7 @@ public class ResourceTestHelper {
}
public static IFile[] findFiles(String prefix, String suffix, int i, int n) {
- List<IFile> files = new ArrayList<IFile>(n);
+ List<IFile> files = new ArrayList<>(n);
for (int j = i; j < i + n; j++) {
String path = prefix + j + suffix;
files.add(findFile(path));
@@ -187,7 +187,7 @@ public class ResourceTestHelper {
}
private static List<Integer> identifierPositions(StringBuffer buffer, String identifier) {
- List<Integer> positions = new ArrayList<Integer>();
+ List<Integer> positions = new ArrayList<>();
int i = -1;
while (true) {
i = buffer.indexOf(identifier, i + 1);
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/util/StringAsserts.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/util/StringAsserts.java
index e3668d9f026..15eecccfcb5 100644
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/util/StringAsserts.java
+++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/util/StringAsserts.java
@@ -109,8 +109,8 @@ abstract public class StringAsserts {
}
public static void assertEqualStringsIgnoreOrder(String[] actuals, String[] expecteds) {
- ArrayList<String> list1 = new ArrayList<String>(Arrays.asList(actuals));
- ArrayList<String> list2 = new ArrayList<String>(Arrays.asList(expecteds));
+ ArrayList<String> list1 = new ArrayList<>(Arrays.asList(actuals));
+ ArrayList<String> list2 = new ArrayList<>(Arrays.asList(expecteds));
for (int i = list1.size() - 1; i >= 0; i--) {
if (list2.remove(list1.get(i))) {
@@ -152,8 +152,8 @@ abstract public class StringAsserts {
}
public static void assertExpectedExistInProposals(String[] actuals, String[] expecteds) {
- ArrayList<String> list1 = new ArrayList<String>(Arrays.asList(actuals));
- ArrayList<String> list2 = new ArrayList<String>(Arrays.asList(expecteds));
+ ArrayList<String> list1 = new ArrayList<>(Arrays.asList(actuals));
+ ArrayList<String> list2 = new ArrayList<>(Arrays.asList(expecteds));
for (int i = list1.size() - 1; i >= 0; i--) {
if (list2.remove(list1.get(i))) {
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/DOMASTNodeLeaf.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/DOMASTNodeLeaf.java
index a95d2ab179c..eadac4a534f 100644
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/DOMASTNodeLeaf.java
+++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/DOMASTNodeLeaf.java
@@ -90,7 +90,7 @@ public class DOMASTNodeLeaf implements IAdaptable {
// used for applying filters to the tree, since it is lazily populated
// all parents of the desired tree object to display need to have a flag as well
private int filterFlag = 0;
- private static Set<String> ignoreInterfaces = new HashSet<String>();
+ private static Set<String> ignoreInterfaces = new HashSet<>();
public static final int FLAG_PROBLEM = 1 << 0;
public static final int FLAG_PREPROCESSOR = 1 << 1;
public static final int FLAG_INCLUDE_STATEMENTS = 1 << 2;
@@ -131,7 +131,7 @@ public class DOMASTNodeLeaf implements IAdaptable {
if (node == null)
return BLANK_STRING;
StringBuilder buffer = new StringBuilder();
- List<Class<?>> search = new LinkedList<Class<?>>();
+ List<Class<?>> search = new LinkedList<>();
boolean done = false;
boolean needComma = false;
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameDialog.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameDialog.java
index 431d37f4fb5..ed53bd7a8ea 100644
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameDialog.java
+++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameDialog.java
@@ -76,7 +76,7 @@ class FindIASTNameDialog extends Dialog {
@Override
public void shellActivated(ShellEvent e) {
String oldText = fFindField.getText(); // XXX workaround for 10766
- List<String> oldList = new ArrayList<String>();
+ List<String> oldList = new ArrayList<>();
oldList.addAll(fFindHistory);
readConfiguration();
@@ -248,7 +248,7 @@ class FindIASTNameDialog extends Dialog {
updateTarget(target, false);
fDialogPositionInit = null;
- fFindHistory = new ArrayList<String>(HISTORY_SIZE - 1);
+ fFindHistory = new ArrayList<>(HISTORY_SIZE - 1);
fWrapInit = false;
fCaseInit = false;
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameTarget.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameTarget.java
index 4bf95d24c96..cff7352c1ba 100644
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameTarget.java
+++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameTarget.java
@@ -48,7 +48,7 @@ public class FindIASTNameTarget implements IFindReplaceTarget, IFindReplaceTarge
{
shouldVisitNames = true;
}
- public List<IASTName> nameList = new ArrayList<IASTName>();
+ public List<IASTName> nameList = new ArrayList<>();
String findString = null;
boolean caseSensitive = true;
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/templateengine/TemplateEngineTestsHelper.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/templateengine/TemplateEngineTestsHelper.java
index 60d31e69e96..6a3c93f1f52 100644
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/templateengine/TemplateEngineTestsHelper.java
+++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/templateengine/TemplateEngineTestsHelper.java
@@ -64,7 +64,7 @@ public class TemplateEngineTestsHelper {
public static TemplateCore[] getTestTemplates() {
TemplateCore[] templates = TemplateEngine.getDefault().getTemplates();
- List<TemplateCore> testTemplates = new ArrayList<TemplateCore>();
+ List<TemplateCore> testTemplates = new ArrayList<>();
for (int i = 0; i < templates.length; i++) {
if (templates[i].getTemplateType().equals("TestTemplate")) {
testTemplates.add(templates[i]);
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/templateengine/TestTemplateEngineBugs.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/templateengine/TestTemplateEngineBugs.java
index 7a7ee994b2d..ff1c3b19fe0 100644
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/templateengine/TestTemplateEngineBugs.java
+++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/templateengine/TestTemplateEngineBugs.java
@@ -34,7 +34,7 @@ public class TestTemplateEngineBugs extends BaseTestCase {
}
private Set<String> set(String... s) {
- HashSet<String> result = new HashSet<String>();
+ HashSet<String> result = new HashSet<>();
result.addAll(Arrays.asList(s));
return result;
}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/BaseUITestCase.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/BaseUITestCase.java
index a33b833762a..8de614ba976 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/BaseUITestCase.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/BaseUITestCase.java
@@ -234,7 +234,7 @@ public class BaseUITestCase extends BaseTestCase {
}
private Control[] findControls(Control w, Class<?> clazz) {
- ArrayList<Control> result = new ArrayList<Control>();
+ ArrayList<Control> result = new ArrayList<>();
findControls(w, clazz, result);
return result.toArray(new Control[result.size()]);
}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/extension/CHOpenListener.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/extension/CHOpenListener.java
index c70d5240fd2..173bd41196c 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/extension/CHOpenListener.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/extension/CHOpenListener.java
@@ -74,7 +74,7 @@ public class CHOpenListener implements IOpenListener {
}
IEditorPart editor = page.openEditor(input, editorId);
IMarker fMarker = file.createMarker(IMarker.TEXT);
- HashMap<String, Object> map = new HashMap<String, Object>();
+ HashMap<String, Object> map = new HashMap<>();
map.put(IMarker.LINE_NUMBER, 3);
fMarker.setAttributes(map);
IDE.gotoMarker(editor, fMarker);
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/chelp/CHelpProviderTester.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/chelp/CHelpProviderTester.java
index 0c3f125b721..799bb863d46 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/chelp/CHelpProviderTester.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/chelp/CHelpProviderTester.java
@@ -295,7 +295,7 @@ public class CHelpProviderTester {
}
public IFunctionSummary[] generateMatchingFunctions(ICHelpBook[] helpBooks, String prefix, String providerID) {
- ArrayList<IFunctionSummary> lst = new ArrayList<IFunctionSummary>();
+ ArrayList<IFunctionSummary> lst = new ArrayList<>();
for (ICHelpBook helpBook : helpBooks) {
if (helpBook instanceof CHelpBook) {
lst.addAll(((CHelpBook) helpBook).getMatchingFunctions(prefix));
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/misc/LanguageVerifierTests.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/misc/LanguageVerifierTests.java
index 3a3a929ff52..af6ca6bd603 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/misc/LanguageVerifierTests.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/misc/LanguageVerifierTests.java
@@ -39,7 +39,7 @@ public class LanguageVerifierTests extends TestCase {
config.addWorkspaceMapping("foo", "bar");
config.addWorkspaceMapping("foo2", "bar2");
- Map<String, ILanguage> availableLanguages = new HashMap<String, ILanguage>();
+ Map<String, ILanguage> availableLanguages = new HashMap<>();
availableLanguages.put("foo", null);
availableLanguages.put("foo3", null);
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/quickfix/AssistQuickFixTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/quickfix/AssistQuickFixTest.java
index ab6032e1dc0..86a65d792c6 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/quickfix/AssistQuickFixTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/quickfix/AssistQuickFixTest.java
@@ -149,7 +149,7 @@ public class AssistQuickFixTest extends BaseUITestCase {
private static final List<ICCompletionProposal> collectCorrections(CorrectionContext context,
Class<?>[] filteredTypes) throws CoreException {
- List<ICCompletionProposal> proposals = new ArrayList<ICCompletionProposal>();
+ List<ICCompletionProposal> proposals = new ArrayList<>();
IStatus status = CCorrectionProcessor.collectCorrections(context, new IProblemLocation[0], proposals);
assertStatusOk(status);
@@ -183,7 +183,7 @@ public class AssistQuickFixTest extends BaseUITestCase {
private static final ArrayList<ICCompletionProposal> collectAssists(CorrectionContext context,
Class<?>[] filteredTypes) throws CoreException {
- ArrayList<ICCompletionProposal> proposals = new ArrayList<ICCompletionProposal>();
+ ArrayList<ICCompletionProposal> proposals = new ArrayList<>();
IStatus status = CCorrectionProcessor.collectAssists(context, new IProblemLocation[0], proposals);
assertStatusOk(status);
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AbstractAutoEditTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AbstractAutoEditTest.java
index 8068418c1c4..9b2bdd678fc 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AbstractAutoEditTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AbstractAutoEditTest.java
@@ -45,7 +45,7 @@ public class AbstractAutoEditTest extends BaseTestCase {
*/
protected static class AutoEditTester {
private IAutoEditStrategy tabsToSpacesConverter;
- private Map<String, IAutoEditStrategy> fStrategyMap = new HashMap<String, IAutoEditStrategy>();
+ private Map<String, IAutoEditStrategy> fStrategyMap = new HashMap<>();
IDocument fDoc;
private String fPartitioning;
private int fCaretOffset;
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CAutoIndentTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CAutoIndentTest.java
index c0356e8cbe2..294e7ea268d 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CAutoIndentTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CAutoIndentTest.java
@@ -347,7 +347,7 @@ public class CAutoIndentTest extends AbstractAutoEditTest {
public void testBracketIndentForConstructorDefinition_Bug183814() throws BadLocationException {
DefaultCodeFormatterOptions whitesmiths = DefaultCodeFormatterOptions.getWhitesmithsSettings();
- CCorePlugin.setOptions(new HashMap<String, String>(whitesmiths.getMap()));
+ CCorePlugin.setOptions(new HashMap<>(whitesmiths.getMap()));
AutoEditTester tester = createAutoEditTester();
tester.type("Foo::Foo()\n{");
@@ -356,7 +356,7 @@ public class CAutoIndentTest extends AbstractAutoEditTest {
public void testSmartPasteWhitesmiths_Bug180531() throws Exception {
DefaultCodeFormatterOptions whitesmiths = DefaultCodeFormatterOptions.getWhitesmithsSettings();
- CCorePlugin.setOptions(new HashMap<String, String>(whitesmiths.getMap()));
+ CCorePlugin.setOptions(new HashMap<>(whitesmiths.getMap()));
AutoEditTester tester = createAutoEditTester();
tester.type("A::~A()\n{");
@@ -380,7 +380,7 @@ public class CAutoIndentTest extends AbstractAutoEditTest {
DefaultCodeFormatterOptions defaultOptions = DefaultCodeFormatterOptions.getDefaultSettings();
defaultOptions.indent_body_declarations_compare_to_namespace_header = true;
- CCorePlugin.setOptions(new HashMap<String, String>(defaultOptions.getMap()));
+ CCorePlugin.setOptions(new HashMap<>(defaultOptions.getMap()));
tester = createAutoEditTester();
tester.type("namespace ns {\n");
@@ -431,13 +431,13 @@ public class CAutoIndentTest extends AbstractAutoEditTest {
}
public void testTabsAsSpaces_SmartIndentDisabled_Bug242707() throws Exception {
- HashMap<String, String> options = new HashMap<String, String>();
+ HashMap<String, String> options = new HashMap<>();
options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
options.put(DefaultCodeFormatterConstants.FORMATTER_INDENTATION_SIZE, "3");
options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "3");
DefaultCodeFormatterOptions defaultOptions = DefaultCodeFormatterOptions.getDefaultSettings();
defaultOptions.set(options);
- CCorePlugin.setOptions(new HashMap<String, String>(defaultOptions.getMap()));
+ CCorePlugin.setOptions(new HashMap<>(defaultOptions.getMap()));
IPreferenceStore store = PreferenceConstants.getPreferenceStore();
store.setValue(PreferenceConstants.EDITOR_SMART_TAB, false);
@@ -542,7 +542,7 @@ public class CAutoIndentTest extends AbstractAutoEditTest {
public void testSkipToStatementStartWhitesmiths_Bug311018() throws Exception {
DefaultCodeFormatterOptions whitesmiths = DefaultCodeFormatterOptions.getWhitesmithsSettings();
- CCorePlugin.setOptions(new HashMap<String, String>(whitesmiths.getMap()));
+ CCorePlugin.setOptions(new HashMap<>(whitesmiths.getMap()));
AutoEditTester tester = createAutoEditTester();
tester.type("if (i > 0)\n"); //$NON-NLS-1$
tester.type("{\n"); //$NON-NLS-1$
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CPartitionScanner.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CPartitionScanner.java
index 1aab6b1b4b4..6d95f66db72 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CPartitionScanner.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CPartitionScanner.java
@@ -102,7 +102,7 @@ public class CPartitionScanner extends RuleBasedPartitionScanner implements ICPa
IToken single_comment = new Token(C_SINGLE_LINE_COMMENT);
IToken string = new Token(C_STRING);
IToken character = new Token(C_CHARACTER);
- List<IPredicateRule> rules = new ArrayList<IPredicateRule>();
+ List<IPredicateRule> rules = new ArrayList<>();
// Minimize the number of rules, since we have duplicate rules
// in the CCodeScanner...
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java
index ad6014f0ba8..4c2a10cc35a 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java
@@ -51,7 +51,7 @@ public class CodeFormatterTest extends BaseUITestCase {
protected void setUp() throws Exception {
super.setUp();
fDefaultOptions = DefaultCodeFormatterOptions.getDefaultSettings().getMap();
- fOptions = new HashMap<String, Object>(fDefaultOptions);
+ fOptions = new HashMap<>(fDefaultOptions);
}
@Override
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTestBase.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTestBase.java
index 8cec47298e2..2e738b1a860 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTestBase.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTestBase.java
@@ -252,7 +252,7 @@ abstract public class FoldingTestBase extends BaseUITestCase {
}
protected PositionAndCollapsed[] getFoldingPositions() {
- List<PositionAndCollapsed> positionAndCollapseds = new ArrayList<PositionAndCollapsed>();
+ List<PositionAndCollapsed> positionAndCollapseds = new ArrayList<>();
ProjectionAnnotationModel model = fEditor
.getAdapter(ProjectionAnnotationModel.class);
assertNotNull(model);
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/SemanticHighlightingTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/SemanticHighlightingTest.java
index a34bbb6ea4f..7537a80bb10 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/SemanticHighlightingTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/SemanticHighlightingTest.java
@@ -205,7 +205,7 @@ public class SemanticHighlightingTest extends TestCase {
List<String>[] expected = new List[lines];
for (int i = 0; i < lines; ++i) {
- expected[i] = new ArrayList<String>();
+ expected[i] = new ArrayList<>();
}
for (IASTComment comment : fAST.getComments()) {
String contents = new String(comment.getComment());
@@ -219,7 +219,7 @@ public class SemanticHighlightingTest extends TestCase {
List<String>[] actual = new List[lines];
for (int i = 0; i < lines; ++i) {
- actual[i] = new ArrayList<String>();
+ actual[i] = new ArrayList<>();
}
for (Position p : getSemanticHighlightingPositions()) {
assertTrue(p instanceof HighlightedPosition);
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TemplateFormatterTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TemplateFormatterTest.java
index c26ff63cba7..e53386dba7c 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TemplateFormatterTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TemplateFormatterTest.java
@@ -73,7 +73,7 @@ public class TemplateFormatterTest extends BaseUITestCase {
}
private void setOption(String key, String value) {
- HashMap<String, String> options = new HashMap<String, String>(1);
+ HashMap<String, String> options = new HashMap<>(1);
options.put(key, value);
CCorePlugin.setOptions(options);
}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java
index 14b25dbe037..483f7f1c1b6 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java
@@ -920,7 +920,7 @@ public class CompletionTests extends CompletionTestBase {
}
private static void createIncludeFiles(File dir, String[] files) throws IOException {
- Set<String> includeDirs = new HashSet<String>();
+ Set<String> includeDirs = new HashSet<>();
for (String file2 : files) {
File file = new File(dir, file2);
final File parentFile = file.getParentFile();
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/DocCommentHighlightingTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/DocCommentHighlightingTest.java
index 40bd5f3db07..440c2fa4f4c 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/DocCommentHighlightingTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/DocCommentHighlightingTest.java
@@ -136,7 +136,7 @@ public class DocCommentHighlightingTest extends BaseUITestCase {
}
protected List<Position> findRangesColored(RGB rgb) {
- List<Position> result = new ArrayList<Position>();
+ List<Position> result = new ArrayList<>();
IEditorPart p = get();
ISourceViewer vw = ((CEditor) p).getViewer();
Accessor a = new Accessor(vw, TextViewer.class);
@@ -166,7 +166,7 @@ public class DocCommentHighlightingTest extends BaseUITestCase {
}
private List<Position> mkPositions(int[][] raw) {
- List<Position> result = new ArrayList<Position>();
+ List<Position> result = new ArrayList<>();
for (int i = 0; i < raw.length; i++) {
Assert.assertEquals(2, raw[i].length);
result.add(new Position(raw[i][0], raw[i][1]));

Back to the top