Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/GCActivator.java')
-rw-r--r--bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/GCActivator.java8
1 files changed, 4 insertions, 4 deletions
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));
}

Back to the top