Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-02-07 16:42:21 +0000
committerAlexander Kurtakov2018-02-07 17:11:44 +0000
commit9f2a9d2fb6a39c9e7b82eac18746ec17de6d8148 (patch)
tree240b2d9b4857d1d8bcf87c02735b01846eb340d5 /bundles/org.eclipse.team.cvs.ui
parentd32b6ea3ad024730acd4d7d47735e773558f5e30 (diff)
downloadeclipse.platform.team-9f2a9d2fb6a39c9e7b82eac18746ec17de6d8148.tar.gz
eclipse.platform.team-9f2a9d2fb6a39c9e7b82eac18746ec17de6d8148.tar.xz
eclipse.platform.team-9f2a9d2fb6a39c9e7b82eac18746ec17de6d8148.zip
Bug 530854 - Move away of methods deprecated in Java 9
Number constructors and Class.newInstance. Some small cleanups (generification, lambdas) in surrounding code. Change-Id: I62bab4119a98a7b5df560b8c9247f79fdfa8da03 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.team.cvs.ui')
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java18
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/SelectionPropertyTester.java12
3 files changed, 13 insertions, 21 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java
index b28aa9c58..7808d2645 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
+ * Copyright (c) 2006, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -2133,7 +2133,7 @@ public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryC
if (historyPageSite instanceof WorkbenchHistoryPageSite){
IWorkbenchPart part = ((WorkbenchHistoryPageSite) historyPageSite).getPart();
if (part instanceof GenericHistoryView){
- String revisions = NLS.bind(CVSUIMessages.CVSHistoryPage_FilterOnMessage, new Object[]{Integer.valueOf(historyFilter.getMatchCount()),new Integer(before)});
+ String revisions = NLS.bind(CVSUIMessages.CVSHistoryPage_FilterOnMessage, new Object[]{Integer.valueOf(historyFilter.getMatchCount()),Integer.valueOf(before)});
String old = getName();
description = NLS.bind(CVSUIMessages.CVSHistoryPage_FilterDescription, new Object[]{file.getName(), revisions});
CVSHistoryPage.this.firePropertyChange(CVSHistoryPage.this, P_NAME, old, getName());
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
index 15a095d22..c428985d1 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -292,19 +292,17 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
fFields= new ArrayList();
final KSubstOption[] options = KSubstOption.getAllKSubstOptions();
- final ArrayList KSUBST_MODES= new ArrayList();
+ final ArrayList<KSubstOption> KSUBST_MODES= new ArrayList<>();
for (int i = 0; i < options.length; i++) {
final KSubstOption option = options[i];
if (!option.isBinary()) {
KSUBST_MODES.add(option);
}
}
- Collections.sort(KSUBST_MODES, new Comparator() {
- public int compare(Object a, Object b) {
- final String aKey = ((KSubstOption) a).getLongDisplayText();
- final String bKey = ((KSubstOption) b).getLongDisplayText();
- return aKey.compareTo(bKey);
- }
+ Collections.sort(KSUBST_MODES, (a, b) -> {
+ final String aKey = a.getLongDisplayText();
+ final String bKey = b.getLongDisplayText();
+ return aKey.compareTo(bKey);
});
KSUBST_LABELS= new String[KSUBST_MODES.size()];
@@ -462,7 +460,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
CVSUIMessages.CVSPreferencesPage_26,
IHelpContextIds.PREF_QUIET,
new String [] { CVSUIMessages.CVSPreferencesPage_27, CVSUIMessages.CVSPreferencesPage_28, CVSUIMessages.CVSPreferencesPage_29 }, //
- new Integer [] { Integer.valueOf(0), new Integer(1), new Integer(2)});
+ new Integer [] { Integer.valueOf(0), Integer.valueOf(1), Integer.valueOf(2)});
quietnessCombo.getCombo().addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
@@ -531,7 +529,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
CVSUIMessages.CVSPreferencesPage_41,
IHelpContextIds.PREF_SAVE_DIRTY_EDITORS,
YES_NO_PROMPT,
- new Integer [] { Integer.valueOf(ICVSUIConstants.OPTION_AUTOMATIC), new Integer(ICVSUIConstants.OPTION_NEVER), new Integer(ICVSUIConstants.OPTION_PROMPT)});
+ new Integer [] { Integer.valueOf(ICVSUIConstants.OPTION_AUTOMATIC), Integer.valueOf(ICVSUIConstants.OPTION_NEVER), Integer.valueOf(ICVSUIConstants.OPTION_PROMPT)});
new StringRadioButtons(
composite,
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/SelectionPropertyTester.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/SelectionPropertyTester.java
index 2b97b5f52..e85c9e011 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/SelectionPropertyTester.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/SelectionPropertyTester.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,12 +29,6 @@ public class SelectionPropertyTester extends PropertyTester {
// TODO Auto-generated constructor stub
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object,
- * java.lang.String, java.lang.Object[], java.lang.Object)
- */
public boolean test(Object receiver, String property, Object[] args,
Object expectedValue) {
@@ -62,8 +56,8 @@ public class SelectionPropertyTester extends PropertyTester {
Object invoke;
try {
- Class clazz = Class.forName((String) args[0]);
- Object instance = clazz.newInstance();
+ Class<?> clazz = Class.forName((String) args[0]);
+ Object instance = clazz.getDeclaredConstructor().newInstance();
// Field fld = clazz.getDeclaredField(SELECTION_FIELDNAME);
// fld.set(instance, (ISelection) receiver);

Back to the top