Bug 541291 - Use InstanceScope.INSTANCE
Removed deprecated usage of InstanceScope constructor and obsolete
deprecation warning suppression.
Change-Id: I412b0b5d0e93379567793039e833f97e07b22655
Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
diff --git a/ui/org.eclipse.ui.trace/META-INF/MANIFEST.MF b/ui/org.eclipse.ui.trace/META-INF/MANIFEST.MF
index 4d8ebd0..5486e55 100644
--- a/ui/org.eclipse.ui.trace/META-INF/MANIFEST.MF
+++ b/ui/org.eclipse.ui.trace/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.ui.trace;singleton:=true
-Bundle-Version: 1.1.200.qualifier
+Bundle-Version: 1.1.300.qualifier
Bundle-Activator: org.eclipse.ui.trace.internal.TracingUIActivator
Bundle-Vendor: %providerName
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/ui/org.eclipse.ui.trace/pom.xml b/ui/org.eclipse.ui.trace/pom.xml
index 2f2ab0f..008681b 100644
--- a/ui/org.eclipse.ui.trace/pom.xml
+++ b/ui/org.eclipse.ui.trace/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.ui</groupId>
<artifactId>org.eclipse.ui.trace</artifactId>
- <version>1.1.200-SNAPSHOT</version>
+ <version>1.1.300-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/ui/org.eclipse.ui.trace/src/org/eclipse/ui/trace/internal/utils/PreferenceHandler.java b/ui/org.eclipse.ui.trace/src/org/eclipse/ui/trace/internal/utils/PreferenceHandler.java
index 622bf49..e2c3f3a 100644
--- a/ui/org.eclipse.ui.trace/src/org/eclipse/ui/trace/internal/utils/PreferenceHandler.java
+++ b/ui/org.eclipse.ui.trace/src/org/eclipse/ui/trace/internal/utils/PreferenceHandler.java
@@ -22,7 +22,6 @@
/**
* Tracing preference handler.
*/
-@SuppressWarnings("deprecation")
public class PreferenceHandler extends AbstractPreferenceInitializer {
@Override
@@ -37,7 +36,7 @@
* not exist.
*/
public static IEclipsePreferences getPreferences() {
- return new InstanceScope().getNode(TracingConstants.BUNDLE_ID);
+ return InstanceScope.INSTANCE.getNode(TracingConstants.BUNDLE_ID);
}
/**
@@ -48,7 +47,7 @@
* preferences.
*/
public static Map<String, String> getPreferenceProperties() {
- IEclipsePreferences tracingPrefs = new InstanceScope().getNode(TracingConstants.BUNDLE_ID);
+ IEclipsePreferences tracingPrefs = InstanceScope.INSTANCE.getNode(TracingConstants.BUNDLE_ID);
final String componentsAsString = tracingPrefs.get(TracingConstants.PREFERENCE_ENTRIES_IDENTIFIER, TracingConstants.EMPTY_STRING);
Map<String, String> options = null;
if (!componentsAsString.equals(TracingConstants.EMPTY_STRING)) {
@@ -106,7 +105,7 @@
* @return <code>true</code> if tracing is enabled in the preferences; Otherwise, <code>false</code> is returned.
*/
public static boolean isTracingEnabled() {
- final IScopeContext[] lookupOrder = new IScopeContext[] {new InstanceScope()};
+ final IScopeContext[] lookupOrder = new IScopeContext[] { InstanceScope.INSTANCE };
IPreferencesService prefService = Platform.getPreferencesService();
prefService.setDefaultLookupOrder(TracingConstants.BUNDLE_ID, null, new String[] {InstanceScope.SCOPE});
return prefService.getBoolean(TracingConstants.BUNDLE_ID, TracingConstants.PREFERENCE_ENABLEMENT_IDENTIFIER, false, lookupOrder);
@@ -118,7 +117,7 @@
* @return The maximum file count in the preference store or the value 10 if it's not defined.
*/
public static int getMaxFileCount() {
- final IScopeContext[] lookupOrder = new IScopeContext[] {new InstanceScope()};
+ final IScopeContext[] lookupOrder = new IScopeContext[] { InstanceScope.INSTANCE };
IPreferencesService prefService = Platform.getPreferencesService();
prefService.setDefaultLookupOrder(TracingConstants.BUNDLE_ID, null, new String[] {InstanceScope.SCOPE});
return prefService.getInt(TracingConstants.BUNDLE_ID, TracingConstants.PREFERENCE_MAX_FILE_COUNT_IDENTIFIER, 10, lookupOrder);
@@ -130,7 +129,7 @@
* @return The maximum file size in the preference store or the value 1000 if it's not defined.
*/
public static int getMaxFileSize() {
- final IScopeContext[] lookupOrder = new IScopeContext[] {new InstanceScope()};
+ final IScopeContext[] lookupOrder = new IScopeContext[] { InstanceScope.INSTANCE };
IPreferencesService prefService = Platform.getPreferencesService();
prefService.setDefaultLookupOrder(TracingConstants.BUNDLE_ID, null, new String[] {InstanceScope.SCOPE});
return prefService.getInt(TracingConstants.BUNDLE_ID, TracingConstants.PREFERENCE_MAX_FILE_SIZE_IDENTIFIER, 1000, lookupOrder);
@@ -142,7 +141,7 @@
* @return The file path in the preference store or the default value if it's not defined.
*/
public static String getFilePath() {
- final IScopeContext[] lookupOrder = new IScopeContext[] {new InstanceScope()};
+ final IScopeContext[] lookupOrder = new IScopeContext[] { InstanceScope.INSTANCE };
IPreferencesService prefService = Platform.getPreferencesService();
prefService.setDefaultLookupOrder(TracingConstants.BUNDLE_ID, null, new String[] {InstanceScope.SCOPE});
return prefService.getString(TracingConstants.BUNDLE_ID, TracingConstants.PREFERENCE_FILE_PATH, DebugOptionsHandler.getDebugOptions().getFile() == null ? null : DebugOptionsHandler.getDebugOptions().getFile().getAbsolutePath(), lookupOrder);
@@ -154,7 +153,7 @@
* @return The output to standard output stream selection in the preference store or the default value if it's not defined.
*/
public static String getOutputToStandardStream() {
- final IScopeContext[] lookupOrder = new IScopeContext[] {new InstanceScope()};
+ final IScopeContext[] lookupOrder = new IScopeContext[] { InstanceScope.INSTANCE };
IPreferencesService prefService = Platform.getPreferencesService();
prefService.setDefaultLookupOrder(TracingConstants.BUNDLE_ID, null, new String[] {InstanceScope.SCOPE});
return prefService.getString(TracingConstants.BUNDLE_ID, TracingConstants.PREFERENCE_OUTPUT_STANDARD_STREAM, "false", lookupOrder); //$NON-NLS-1$