summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2013-08-21 10:07:27 (EDT)
committerGerrit Code Review @ Eclipse.org2013-08-21 12:09:00 (EDT)
commit4daab3e6c100f4f5b060f35d7708ff29c483cb6a (patch)
tree48c4f5a9a83744ada7186a0184dd9c74e6797325
parentcecf4753174784bcde2b1c490733cd7e77202b9e (diff)
downloadeclipse.pde.ui-4daab3e6c100f4f5b060f35d7708ff29c483cb6a.zip
eclipse.pde.ui-4daab3e6c100f4f5b060f35d7708ff29c483cb6a.tar.gz
eclipse.pde.ui-4daab3e6c100f4f5b060f35d7708ff29c483cb6a.tar.bz2
Bug 415601 - Fix deprecation warningsrefs/changes/14/15714/3
Get rid of some easy deprecation usages. Namely: * junit.framework -> org.junit * new [Default|Instance]Scope -> [Default|Instance]Scope.INSTANCE Change-Id: I5bfa6ed6f880b8835bf224f28a5fa569da881e6a Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEPreferencesManager.java4
-rw-r--r--ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PreferenceInitializer.java7
-rw-r--r--ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/CompilerFlags.java2
-rw-r--r--ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/exports/FeatureExportOperation.java5
-rw-r--r--ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/LegacyUITestApplication.java10
-rw-r--r--ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/NonUIThreadTestApplication.java2
-rw-r--r--ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/PreferenceInitializer.java6
7 files changed, 16 insertions, 20 deletions
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEPreferencesManager.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEPreferencesManager.java
index 8086590..a85681b 100644
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEPreferencesManager.java
+++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEPreferencesManager.java
@@ -30,8 +30,8 @@ public final class PDEPreferencesManager {
* @param ID scope for the preferences
*/
public PDEPreferencesManager(String ID) {
- fInstanceScopePrefs = new InstanceScope().getNode(ID);
- fDefaultScopePrefs = new DefaultScope().getNode(ID);
+ fInstanceScopePrefs = InstanceScope.INSTANCE.getNode(ID);
+ fDefaultScopePrefs = DefaultScope.INSTANCE.getNode(ID);
}
/**
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PreferenceInitializer.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PreferenceInitializer.java
index 02d6448..5bdc1c2 100644
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PreferenceInitializer.java
+++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PreferenceInitializer.java
@@ -25,9 +25,10 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
*
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
*/
+ @Override
public void initializeDefaultPreferences() {
- IEclipsePreferences defaultPreferences = new DefaultScope().getNode(PDECore.PLUGIN_ID);
- IEclipsePreferences preferences = new InstanceScope().getNode(PDECore.PLUGIN_ID);
+ IEclipsePreferences defaultPreferences = DefaultScope.INSTANCE.getNode(PDECore.PLUGIN_ID);
+ IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(PDECore.PLUGIN_ID);
defaultPreferences.put(ICoreConstants.TARGET_MODE, ICoreConstants.VALUE_USE_THIS);
defaultPreferences.put(ICoreConstants.CHECKED_PLUGINS, ICoreConstants.VALUE_SAVED_ALL);
defaultPreferences.put(ICoreConstants.CHECKED_VERSION_PLUGINS, ICoreConstants.VALUE_SAVED_NONE);
@@ -49,7 +50,7 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
PDECore.log(bse);
}
//set defaults for compiler preferences in org.eclipse.pde pref node, not org.eclipse.pde.core
- IEclipsePreferences prefs = new DefaultScope().getNode(PDE.PLUGIN_ID);
+ IEclipsePreferences prefs = DefaultScope.INSTANCE.getNode(PDE.PLUGIN_ID);
prefs.putInt(CompilerFlags.P_UNRESOLVED_IMPORTS, CompilerFlags.ERROR);
prefs.putInt(CompilerFlags.P_UNRESOLVED_EX_POINTS, CompilerFlags.ERROR);
prefs.putInt(CompilerFlags.P_NO_REQUIRED_ATT, CompilerFlags.ERROR);
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/CompilerFlags.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/CompilerFlags.java
index 521810c..09982f5 100644
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/CompilerFlags.java
+++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/CompilerFlags.java
@@ -125,7 +125,7 @@ public class CompilerFlags {
*/
public static void save() {
try {
- new InstanceScope().getNode(PDE.PLUGIN_ID).flush();
+ InstanceScope.INSTANCE.getNode(PDE.PLUGIN_ID).flush();
} catch (BackingStoreException e) {
}
}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/exports/FeatureExportOperation.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/exports/FeatureExportOperation.java
index 0875690..bcf193a 100644
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/exports/FeatureExportOperation.java
+++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/exports/FeatureExportOperation.java
@@ -75,6 +75,7 @@ public class FeatureExportOperation extends Job {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected IStatus run(IProgressMonitor monitor) {
try {
createDestination();
@@ -472,8 +473,8 @@ public class FeatureExportOperation extends Job {
fAntBuildProperties.put(IXMLConstants.PROPERTY_JAVAC_DEBUG_INFO, "on"); //$NON-NLS-1$
fAntBuildProperties.put(IXMLConstants.PROPERTY_JAVAC_VERBOSE, "false"); //$NON-NLS-1$
- IEclipsePreferences prefs = new InstanceScope().getNode(JavaCore.PLUGIN_ID);
- IEclipsePreferences def = new DefaultScope().getNode(JavaCore.PLUGIN_ID);
+ IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(JavaCore.PLUGIN_ID);
+ IEclipsePreferences def = DefaultScope.INSTANCE.getNode(JavaCore.PLUGIN_ID);
String source = prefs.get(JavaCore.COMPILER_SOURCE, null);
if (source == null) {
source = def.get(JavaCore.COMPILER_SOURCE, null);
diff --git a/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/LegacyUITestApplication.java b/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/LegacyUITestApplication.java
index 72bd98e..d94f560 100644
--- a/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/LegacyUITestApplication.java
+++ b/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/LegacyUITestApplication.java
@@ -10,17 +10,11 @@
*******************************************************************************/
package org.eclipse.pde.internal.junit.runtime;
-import junit.framework.Assert;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IPlatformRunnable;
-import org.eclipse.core.runtime.IProduct;
-import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.*;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.testing.ITestHarness;
import org.eclipse.ui.testing.TestableObject;
+import org.junit.Assert;
/**
* A Workbench that runs a test suite specified in the
diff --git a/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/NonUIThreadTestApplication.java b/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/NonUIThreadTestApplication.java
index 682593c..2806634 100644
--- a/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/NonUIThreadTestApplication.java
+++ b/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/NonUIThreadTestApplication.java
@@ -10,10 +10,10 @@
*******************************************************************************/
package org.eclipse.pde.internal.junit.runtime;
-import junit.framework.Assert;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
+import org.junit.Assert;
/**
* A Workbench that runs a test suite specified in the
diff --git a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/PreferenceInitializer.java b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/PreferenceInitializer.java
index 14d6d02..a2084cb 100644
--- a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/PreferenceInitializer.java
+++ b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/PreferenceInitializer.java
@@ -20,7 +20,7 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
*/
public void initializeDefaultPreferences() {
- IEclipsePreferences prefs = new DefaultScope().getNode(IPDEConstants.PLUGIN_ID);
+ IEclipsePreferences prefs = DefaultScope.INSTANCE.getNode(IPDEConstants.PLUGIN_ID);
prefs.put(ILaunchingPreferenceConstants.DEFAULT_OSGI_FRAMEOWRK, OSGiFrameworkManager.DEFAULT_FRAMEWORK);
prefs.put(ILaunchingPreferenceConstants.PROP_RUNTIME_WORKSPACE_LOCATION, "${workspace_loc}/../runtime-"); //$NON-NLS-1$
prefs.putBoolean(ILaunchingPreferenceConstants.PROP_RUNTIME_WORKSPACE_LOCATION_IS_CONTAINER, true);
@@ -28,8 +28,8 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
prefs.putBoolean(ILaunchingPreferenceConstants.PROP_JUNIT_WORKSPACE_LOCATION_IS_CONTAINER, false);
// copy over instance scope prefs from UI plugin
- IEclipsePreferences oldInstancePrefs = new InstanceScope().getNode(IPDEConstants.UI_PLUGIN_ID);
- IEclipsePreferences newInstancePrefs = new InstanceScope().getNode(IPDEConstants.PLUGIN_ID);
+ IEclipsePreferences oldInstancePrefs = InstanceScope.INSTANCE.getNode(IPDEConstants.UI_PLUGIN_ID);
+ IEclipsePreferences newInstancePrefs = InstanceScope.INSTANCE.getNode(IPDEConstants.PLUGIN_ID);
String osgiFramework = oldInstancePrefs.get(ILaunchingPreferenceConstants.DEFAULT_OSGI_FRAMEOWRK, null);
if (osgiFramework != null) {