Skip to main content
summaryrefslogtreecommitdiffstats
path: root/dsf
diff options
context:
space:
mode:
authorJonah Graham2015-06-11 09:13:55 -0400
committerGerrit Code Review @ Eclipse.org2015-06-11 10:53:35 -0400
commit26bef5d3212c24dca5fc5ff0816728f59c247bbf (patch)
treed9340b3027d4508a2a1e22be6aec61f414f4ad39 /dsf
parent835288f5587ab27df135f0bcb87890dd0942d534 (diff)
downloadorg.eclipse.cdt-26bef5d3212c24dca5fc5ff0816728f59c247bbf.tar.gz
org.eclipse.cdt-26bef5d3212c24dca5fc5ff0816728f59c247bbf.tar.xz
org.eclipse.cdt-26bef5d3212c24dca5fc5ff0816728f59c247bbf.zip
Bug 317173 - cleanup warnings
- Add generics for ServiceRegistration and ServiceReference (added <?>), See Bug 322007 which added generics to OSGI - Add generics for getAdapter, See Bug Bug 442021 - Fix calls to MessageFormat.format() - Cross reference some unused/commented out code for dprintf with associated @SuppressWarnings("unused") Change-Id: I4bacb3b37b69c97ab35615413f0f1f3e71aa2092 Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
Diffstat (limited to 'dsf')
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/CompositeDMContext.java5
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java7
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/DsfServicesTracker.java15
3 files changed, 15 insertions, 12 deletions
diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/CompositeDMContext.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/CompositeDMContext.java
index c2a2b4d535..c0f26c7df5 100644
--- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/CompositeDMContext.java
+++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/CompositeDMContext.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Wind River Systems and others.
+ * Copyright (c) 2007, 2015 Wind River Systems 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * Jonah Graham (Kichwa Coders) - Bug 317173 - cleanup warnings
*******************************************************************************/
package org.eclipse.cdt.dsf.datamodel;
@@ -75,7 +76,7 @@ public class CompositeDMContext implements IDMContext {
* @see #getSessionId()
*/
@Override
- public Object getAdapter(Class adapterType) {
+ public <T> T getAdapter(Class<T> adapterType) {
IDMContext[] parents = getParents();
if (parents.length > 0) {
return parents[0].getAdapter(adapterType);
diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java
index c8c0807268..7c1a458b32 100644
--- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java
+++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2010 Wind River Systems and others.
+ * Copyright (c) 2006, 2015 Wind River Systems 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * Jonah Graham (Kichwa Coders) - Bug 317173 - cleanup warnings
*******************************************************************************/
package org.eclipse.cdt.dsf.service;
@@ -41,7 +42,7 @@ abstract public class AbstractDsfService
private int fStartupNumber;
/** Registration object for this service. */
- private ServiceRegistration fRegistration;
+ private ServiceRegistration<?> fRegistration;
/** Tracker for services that this service depends on. */
private DsfServicesTracker fTracker;
@@ -264,5 +265,5 @@ abstract public class AbstractDsfService
}
/** Returns the registration object that was obtained when this service was registered */
- protected ServiceRegistration getServiceRegistration() { return fRegistration; }
+ protected ServiceRegistration<?> getServiceRegistration() { return fRegistration; }
} \ No newline at end of file
diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/DsfServicesTracker.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/DsfServicesTracker.java
index 18b28162ce..23906b0dcd 100644
--- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/DsfServicesTracker.java
+++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/DsfServicesTracker.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 Wind River Systems and others.
+ * Copyright (c) 2009, 2015 Wind River Systems 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * Jonah Graham (Kichwa Coders) - Bug 317173 - cleanup warnings
*******************************************************************************/
package org.eclipse.cdt.dsf.service;
@@ -90,8 +91,8 @@ public class DsfServicesTracker {
private final String fSessionId;
private volatile boolean fDisposed = false;
private final BundleContext fBundleContext;
- private final Map<ServiceKey,ServiceReference> fServiceReferences = new HashMap<ServiceKey,ServiceReference>();
- private final Map<ServiceReference,Object> fServices = new HashMap<ServiceReference,Object>();
+ private final Map<ServiceKey,ServiceReference<?>> fServiceReferences = new HashMap<ServiceKey,ServiceReference<?>>();
+ private final Map<ServiceReference<?>,Object> fServices = new HashMap<ServiceReference<?>,Object>();
private final String fServiceFilter;
private final ServiceListener fListner = new ServiceListener() {
@@ -127,8 +128,8 @@ public class DsfServicesTracker {
};
private void handleUnregisterEvent(ServiceEvent event) {
- for (Iterator<Map.Entry<ServiceKey, ServiceReference>> itr = fServiceReferences.entrySet().iterator(); itr.hasNext();) {
- Map.Entry<ServiceKey, ServiceReference> entry = itr.next();
+ for (Iterator<Map.Entry<ServiceKey, ServiceReference<?>>> itr = fServiceReferences.entrySet().iterator(); itr.hasNext();) {
+ Map.Entry<ServiceKey, ServiceReference<?>> entry = itr.next();
if ( entry.getValue().equals(event.getServiceReference()) ) {
itr.remove();
}
@@ -221,7 +222,7 @@ public class DsfServicesTracker {
*/
@SuppressWarnings("unchecked")
public <V> V getService(Class<V> serviceClass, String filter) {
- ServiceReference serviceRef = getServiceReference(serviceClass, filter);
+ ServiceReference<?> serviceRef = getServiceReference(serviceClass, filter);
if (serviceRef == null) {
return null;
} else {
@@ -270,7 +271,7 @@ public class DsfServicesTracker {
private void doDispose() {
try {
fBundleContext.removeServiceListener(fListner);
- for (Iterator<ServiceReference> itr = fServices.keySet().iterator(); itr.hasNext();) {
+ for (Iterator<ServiceReference<?>> itr = fServices.keySet().iterator(); itr.hasNext();) {
fBundleContext.ungetService(itr.next());
}
} catch (IllegalStateException e) {

Back to the top