summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2013-11-15 07:10:23 (EST)
committerAlexander Kurtakov2013-11-15 07:10:23 (EST)
commit8416a6a1ddda58fb41169429fa85abf6c7275cfb (patch)
tree5cdc7991344cde9ee54cc87a4822f34b7bb88404
parentda737983183dff20ac53e3c0b91fcdae4bd700b8 (diff)
downloadrt.equinox.p2-8416a6a1ddda58fb41169429fa85abf6c7275cfb.zip
rt.equinox.p2-8416a6a1ddda58fb41169429fa85abf6c7275cfb.tar.gz
rt.equinox.p2-8416a6a1ddda58fb41169429fa85abf6c7275cfb.tar.bz2
Bug 421824 - Use *Scope.INSTANCErefs/changes/25/18425/1
*Scope constructors are deprecated and using the INSTANCE static field is recommended. Change-Id: I56de8e03818ef4abe45c9b7097cbf5ae1d92ce14 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/GarbageCollector.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreferenceInitializer.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/prefs/PreferenceInitializer.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/prefs/ProvisioningPreferencePage.java2
4 files changed, 7 insertions, 7 deletions
diff --git a/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/GarbageCollector.java b/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/GarbageCollector.java
index 5f983aa..886c4ab 100644
--- a/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/GarbageCollector.java
+++ b/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/GarbageCollector.java
@@ -122,8 +122,8 @@ public class GarbageCollector implements SynchronousProvisioningListener, IAgent
return defaultValue;
List<IEclipsePreferences> nodes = new ArrayList<IEclipsePreferences>();
// todo we should look in the instance scope as well but have to be careful that the instance location has been set
- nodes.add(new ConfigurationScope().getNode(GCActivator.ID));
- nodes.add(new DefaultScope().getNode(GCActivator.ID));
+ nodes.add(ConfigurationScope.INSTANCE.getNode(GCActivator.ID));
+ nodes.add(DefaultScope.INSTANCE.getNode(GCActivator.ID));
return Boolean.valueOf(prefService.get(key, Boolean.toString(defaultValue), nodes.toArray(new Preferences[nodes.size()]))).booleanValue();
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreferenceInitializer.java b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreferenceInitializer.java
index eeca576..4cc0bea 100644
--- a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreferenceInitializer.java
+++ b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreferenceInitializer.java
@@ -41,7 +41,7 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
try {
if (pref.keys().length == 0) {
// migrate preferences from instance scope to profile scope
- Preferences oldPref = new InstanceScope().getNode(AutomaticUpdatePlugin.PLUGIN_ID);
+ Preferences oldPref = InstanceScope.INSTANCE.getNode(AutomaticUpdatePlugin.PLUGIN_ID);
String[] keys = oldPref.keys();
for (int i = 0; i < keys.length; i++)
pref.put(keys[i], oldPref.get(keys[i], "")); //$NON-NLS-1$
@@ -163,7 +163,7 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
public void initializeDefaultPreferences() {
// initialize the default scope
- Preferences node = new DefaultScope().getNode(AutomaticUpdatePlugin.PLUGIN_ID);
+ Preferences node = DefaultScope.INSTANCE.getNode(AutomaticUpdatePlugin.PLUGIN_ID);
node.putBoolean(PreferenceConstants.PREF_AUTO_UPDATE_ENABLED, false);
node.put(PreferenceConstants.PREF_AUTO_UPDATE_SCHEDULE, PreferenceConstants.PREF_UPDATE_ON_STARTUP);
node.putBoolean(PreferenceConstants.PREF_DOWNLOAD_ONLY, false);
diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/prefs/PreferenceInitializer.java b/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/prefs/PreferenceInitializer.java
index 9a3ce6e..bf3177f 100644
--- a/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/prefs/PreferenceInitializer.java
+++ b/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/prefs/PreferenceInitializer.java
@@ -35,7 +35,7 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
try {
if (pref.keys().length == 0) {
// migrate preferences from instance scope to profile scope
- Preferences oldPref = new InstanceScope().getNode(ProvSDKUIActivator.PLUGIN_ID);
+ Preferences oldPref = InstanceScope.INSTANCE.getNode(ProvSDKUIActivator.PLUGIN_ID);
// don't migrate everything. Some of the preferences moved to
// another bundle.
pref.put(PreferenceConstants.PREF_OPEN_WIZARD_ON_ERROR_PLAN, oldPref.get(PreferenceConstants.PREF_OPEN_WIZARD_ON_ERROR_PLAN, MessageDialogWithToggle.PROMPT));
@@ -56,7 +56,7 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
*/
public void initializeDefaultPreferences() {
- Preferences node = new DefaultScope().getNode("org.eclipse.equinox.p2.ui.sdk"); //$NON-NLS-1$
+ Preferences node = DefaultScope.INSTANCE.getNode("org.eclipse.equinox.p2.ui.sdk"); //$NON-NLS-1$
// default values
node.putBoolean(PreferenceConstants.PREF_SHOW_LATEST_VERSION, true);
node.put(PreferenceConstants.PREF_OPEN_WIZARD_ON_ERROR_PLAN, MessageDialogWithToggle.PROMPT);
diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/prefs/ProvisioningPreferencePage.java b/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/prefs/ProvisioningPreferencePage.java
index 7a49f11..7f6d156 100644
--- a/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/prefs/ProvisioningPreferencePage.java
+++ b/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/prefs/ProvisioningPreferencePage.java
@@ -121,7 +121,7 @@ public class ProvisioningPreferencePage extends PreferencePage implements IWorkb
protected void performDefaults() {
super.performDefaults();
- Preferences pref = new DefaultScope().getNode(ProvSDKUIActivator.PLUGIN_ID);
+ Preferences pref = DefaultScope.INSTANCE.getNode(ProvSDKUIActivator.PLUGIN_ID);
showLatestRadio.setSelection(pref.getBoolean(PreferenceConstants.PREF_SHOW_LATEST_VERSION, false));
showAllRadio.setSelection(!pref.getBoolean(PreferenceConstants.PREF_SHOW_LATEST_VERSION, false));
String openWizard = pref.get(PreferenceConstants.PREF_OPEN_WIZARD_ON_ERROR_PLAN, ""); //$NON-NLS-1$