Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2010-10-06 20:00:28 +0000
committerJohn Arthorne2010-10-06 20:00:28 +0000
commit0bbc72d38d0fe4b1c438d93dbfde91655df6fa09 (patch)
treef4e9d321197cb4700ad315ec064849bb481426c2 /bundles/org.eclipse.equinox.p2.garbagecollector/src
parentfdfa6363a847d135212385970259283890243fd0 (diff)
downloadrt.equinox.p2-0bbc72d38d0fe4b1c438d93dbfde91655df6fa09.tar.gz
rt.equinox.p2-0bbc72d38d0fe4b1c438d93dbfde91655df6fa09.tar.xz
rt.equinox.p2-0bbc72d38d0fe4b1c438d93dbfde91655df6fa09.zip
Fixed compiler warnings
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.garbagecollector/src')
-rw-r--r--bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/Application.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/GCActivator.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/GarbageCollector.java2
3 files changed, 6 insertions, 6 deletions
diff --git a/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/Application.java b/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/Application.java
index 7569f2266..8a9d5b4a4 100644
--- a/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/Application.java
+++ b/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/Application.java
@@ -56,7 +56,7 @@ public class Application implements IApplication {
}
private void initializeServices() throws ProvisionException {
- IProvisioningAgentProvider provider = (IProvisioningAgentProvider) GCActivator.getService(IProvisioningAgentProvider.SERVICE_NAME);
+ IProvisioningAgentProvider provider = GCActivator.getService(IProvisioningAgentProvider.class);
agent = provider.createAgent(null);
}
diff --git a/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/GCActivator.java b/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/GCActivator.java
index 8392aa736..60dde4517 100644
--- a/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/GCActivator.java
+++ b/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/GCActivator.java
@@ -21,18 +21,18 @@ public class GCActivator implements BundleActivator {
static BundleContext context;
- static Object getService(String name) {
- ServiceReference reference = context.getServiceReference(name);
+ static <T> T getService(Class<T> clazz) {
+ ServiceReference<T> reference = context.getServiceReference(clazz);
if (reference == null)
return null;
- Object result = context.getService(reference);
+ T result = context.getService(reference);
context.ungetService(reference);
return result;
}
public void start(BundleContext inContext) throws Exception {
GCActivator.context = inContext;
- DebugOptions debug = (DebugOptions) getService(DebugOptions.class.getName());
+ DebugOptions debug = getService(DebugOptions.class);
if (debug != null) {
CoreGarbageCollector.setDebugMode(debug.getBooleanOption(DEBUG_STRING, DEFAULT_DEBUG));
}
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 b8ba3c819..5f983aae5 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
@@ -117,7 +117,7 @@ public class GarbageCollector implements SynchronousProvisioningListener, IAgent
}
protected boolean getBooleanPreference(String key, boolean defaultValue) {
- IPreferencesService prefService = (IPreferencesService) GCActivator.getService(IPreferencesService.class.getName());
+ IPreferencesService prefService = GCActivator.getService(IPreferencesService.class);
if (prefService == null)
return defaultValue;
List<IEclipsePreferences> nodes = new ArrayList<IEclipsePreferences>();

Back to the top