Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Stocker2012-12-04 23:15:44 +0000
committerRobin Stocker2012-12-04 23:15:44 +0000
commit2c60d721c80fe37daebe1d13de1f56a37e2026b0 (patch)
tree4ffa4e7adbf170a464abf5dfb9e0eaef1e7f4f46 /org.eclipse.egit.ui.test/src/org/eclipse
parentc0bcaa97ea698ca800746ba43fdbf369f9079d42 (diff)
downloadegit-2c60d721c80fe37daebe1d13de1f56a37e2026b0.tar.gz
egit-2c60d721c80fe37daebe1d13de1f56a37e2026b0.tar.xz
egit-2c60d721c80fe37daebe1d13de1f56a37e2026b0.zip
Fix generics warnings with OSGi classes
Diffstat (limited to 'org.eclipse.egit.ui.test/src/org/eclipse')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
index 5691c2bb5f..a277334210 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 SAP AG.
+ * Copyright (c) 2010, 2012 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -110,17 +110,16 @@ public class TestUtil {
public synchronized String getPluginLocalizedValue(String key,
boolean keepAmpersands) throws MissingResourceException {
if (myBundle == null) {
- ServiceTracker localizationTracker;
BundleContext context = Activator.getDefault().getBundle()
.getBundleContext();
- localizationTracker = new ServiceTracker(context,
- BundleLocalization.class.getName(), null);
+ ServiceTracker<BundleLocalization, BundleLocalization> localizationTracker =
+ new ServiceTracker<BundleLocalization, BundleLocalization>(
+ context, BundleLocalization.class, null);
localizationTracker.open();
- BundleLocalization location = (BundleLocalization) localizationTracker
- .getService();
+ BundleLocalization location = localizationTracker.getService();
if (location != null)
myBundle = location.getLocalization(Activator.getDefault()
.getBundle(), Locale.getDefault().toString());
@@ -313,8 +312,8 @@ public class TestUtil {
*/
public static void disableProxy() {
BundleContext context = Activator.getDefault().getBundle().getBundleContext();
- ServiceReference serviceReference = context.getServiceReference(IProxyService.class.getName());
- IProxyService proxyService = (IProxyService) context.getService(serviceReference);
+ ServiceReference<IProxyService> serviceReference = context.getServiceReference(IProxyService.class);
+ IProxyService proxyService = context.getService(serviceReference);
proxyService.setSystemProxiesEnabled(false);
proxyService.setProxiesEnabled(false);
}

Back to the top