fixing warnings 29/229/1
authorColin Dixon <ckd@us.ibm.com>
Thu, 11 Apr 2013 22:26:37 +0000 (15:26 -0700)
committerColin Dixon <ckd@us.ibm.com>
Tue, 23 Apr 2013 19:02:43 +0000 (14:02 -0500)
Change-Id: Iae2f073fb9733d0b1bdedd2aa05815fc25063e9a
Signed-off-by: Colin Dixon <ckd@us.ibm.com>
opendaylight/clustering/services/src/main/java/org/opendaylight/controller/clustering/services/IClusterServices.java
opendaylight/clustering/stub/src/main/java/org/opendaylight/controller/clustering/stub/internal/ClusterManagerCommon.java
opendaylight/clustering/test/src/main/java/org/opendaylight/controller/clustering/test/internal/SimpleClient.java
opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/HostTracker.java
opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/hostAware/HostNodeConnector.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/ContainerServiceDependency.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Node.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/NodeConnector.java
opendaylight/web/topology/src/main/java/org/opendaylight/controller/topology/web/Topology.java

index 031434f..68960ba 100644 (file)
@@ -118,7 +118,7 @@ public interface IClusterServices {
      *
      * @return ConcurrentHashMap to be used to modify the data structure
      */
-    ConcurrentMap<?, ?> getCache(String containerName, String cacheName);
+    ConcurrentMap<? extends Object, ? extends Object> getCache(String containerName, String cacheName);
 
     /**
      * Destroy a cachename given containerName/cachename, if doesn't exist
index 13d05bb..6fa0d6e 100644 (file)
@@ -88,7 +88,7 @@ abstract public class ClusterManagerCommon implements IClusterServicesCommon {
             CacheConfigException {
         ConcurrentMap<?, ?> res = this.caches.get(cacheName);
         if (res == null) {
-            res = new ConcurrentHashMap();
+            res = new ConcurrentHashMap<Object, Object>();
             this.caches.put(cacheName, res);
             return res;
         }
index 3e9717f..b6ab95d 100644 (file)
@@ -243,6 +243,7 @@ public class SimpleClient implements CommandProvider {
         }
     }
 
+    @SuppressWarnings("deprecation") //IGetUpdates intentionally deprecated
     public void _unlisten(CommandInterpreter ci) {
         if (this.icluster == null) {
             ci.println("\nNo Clustering services available");
@@ -370,7 +371,7 @@ public class SimpleClient implements CommandProvider {
     }
 
     public void _dumper(CommandInterpreter ci) {
-        ConcurrentMap c;
+        ConcurrentMap<Object, Object> c;
         String containerName = ci.nextArgument();
         if (containerName == null) {
             ci.println("containerName not supplied");
@@ -381,10 +382,10 @@ public class SimpleClient implements CommandProvider {
             ci.println("Cache not supplied");
             return;
         }
-        c = (ConcurrentMap) this.icluster.getCache(containerName, cacheName);
+        c = (ConcurrentMap<Object, Object>) this.icluster.getCache(containerName, cacheName);
         if (c != null) {
-            for (Object e : c.entrySet()) {
-                Map.Entry entry = (Map.Entry) e;
+            for (Map.Entry<Object, Object> e : c.entrySet()) {
+                Map.Entry<Object, Object> entry = e;
                 Object v = entry.getValue();
                 String res = "<NOT KNOWN>";
                 if (v != null) {
@@ -437,6 +438,7 @@ public class SimpleClient implements CommandProvider {
         }
     }
 
+    @SuppressWarnings("deprecation") //TODO: remove call to deprecated amIStandby
     public void _getRole(CommandInterpreter ci) {
         if (this.icluster == null) {
             ci.println("\nNo Clustering services available");
@@ -449,6 +451,7 @@ public class SimpleClient implements CommandProvider {
         ci.println("My role is: " + role);
     }
 
+    @SuppressWarnings("deprecation") //TODO: remove call to deprecated getActiveAddres
     public void _getActive(CommandInterpreter ci) {
         if (this.icluster == null) {
             ci.println("\nNo Clustering services available");
@@ -458,6 +461,7 @@ public class SimpleClient implements CommandProvider {
                 + this.icluster.getActiveAddress());
     }
 
+    @SuppressWarnings("deprecation") //TODO: remove use of deprecated listenRoleChange
     public void _listenActive(CommandInterpreter ci) {
         if (this.icluster == null) {
             ci.println("\nNo Clustering services available");
@@ -473,6 +477,7 @@ public class SimpleClient implements CommandProvider {
         ci.println("Register listenRoleChanges");
     }
 
+    @SuppressWarnings("deprecation") //TODO: remove deprecated call to unlistenRoleChange
     public void _unlistenActive(CommandInterpreter ci) {
         if (this.icluster == null) {
             ci.println("\nNo Clustering services available");
index 96b6c05..42802d3 100644 (file)
@@ -956,6 +956,7 @@ public class HostTracker implements IfIptoHost, IfHostListener,
     }
 
     private class ARPRefreshHandler extends TimerTask {
+        @SuppressWarnings("deprecation")
         public void run() {
             if ((clusterContainerService != null)
                     && !clusterContainerService.amICoordinator()) {
index 29e9dfa..f37d013 100644 (file)
@@ -46,6 +46,7 @@ public class ContainerServiceDependency implements ServiceDependency,
         this.containerName = containerName;
     }
 
+    @SuppressWarnings("rawtypes") // can't change org.apache.felix.dm.ServiceDependency
     @Override
     public ServiceDependency setService(Class serviceName) {
         this.m_dep.setService(serviceName, "(containerName="
@@ -53,6 +54,7 @@ public class ContainerServiceDependency implements ServiceDependency,
         return this;
     }
 
+    @SuppressWarnings("rawtypes") // can't change org.apache.felix.dm.ServiceDependency
     @Override
     public ServiceDependency setService(Class serviceName, String serviceFilter) {
         this.m_dep.setService(serviceName, "(&(containerName="
@@ -67,6 +69,7 @@ public class ContainerServiceDependency implements ServiceDependency,
         return this;
     }
 
+    @SuppressWarnings("rawtypes") // can't change org.apache.felix.dm.ServiceDependency
     @Override
     public ServiceDependency setService(Class serviceName,
             ServiceReference serviceReference) {
@@ -163,6 +166,7 @@ public class ContainerServiceDependency implements ServiceDependency,
                 .createCopy(), this.containerName);
     }
 
+    @SuppressWarnings("rawtypes") // can't change org.apache.felix.dm.ServiceDependency
     @Override
     public Dictionary getProperties() {
         return this.m_dep.getProperties();
@@ -193,6 +197,7 @@ public class ContainerServiceDependency implements ServiceDependency,
         return this.m_dep.isAutoConfig();
     }
 
+    @SuppressWarnings("rawtypes") // can't change org.apache.felix.dm.ServiceDependency
     @Override
     public Class getAutoConfigType() {
         return this.m_dep.getAutoConfigType();
index 206b392..5c21294 100644 (file)
@@ -53,8 +53,8 @@ public class Node implements Serializable {
      * surround.
      */
     public static final class NodeIDType {
-        private static final ConcurrentHashMap<String, Class> compatibleType =
-            new ConcurrentHashMap<String, Class>();
+        private static final ConcurrentHashMap<String, Class<? extends Object>> compatibleType =
+            new ConcurrentHashMap<String, Class<? extends Object>>();
         /**
          * Identifier for an OpenFlow node
          */
@@ -113,7 +113,7 @@ public class Node implements Serializable {
          * @return true if registered, false otherwise
          */
         public static boolean registerIDType(String type,
-                                             Class compatibleID) {
+                                             Class<? extends Object> compatibleID) {
             if (compatibleType.get(type) != null) {
                 return false;
             }  else {
index 86baaad..59a184e 100644 (file)
@@ -50,8 +50,8 @@ public class NodeConnector implements Serializable {
      */
     public static class NodeConnectorIDType {
         private static final
-        ConcurrentHashMap<String, ImmutablePair<Class, String>> compatibleType =
-            new ConcurrentHashMap<String, ImmutablePair<Class, String>>();
+        ConcurrentHashMap<String, ImmutablePair<Class<? extends Object>, String>> compatibleType =
+            new ConcurrentHashMap<String, ImmutablePair<Class<? extends Object>, String>>();
         /**
          * Represent a special port pointing toward the controller,
          * this is to send data packets toward the controller from
@@ -175,7 +175,7 @@ public class NodeConnector implements Serializable {
          * @return true if registered, false otherwise
          */
         public static boolean registerIDType(String type,
-                                             Class compatibleID,
+                                             Class<? extends Object> compatibleID,
                                              String compatibleNode) {
             if (compatibleType.get(type) != null) {
                 return false;
index 51cdcfb..285e33f 100644 (file)
@@ -259,7 +259,7 @@ public class Topology {
             }
         }
         
-        CircleLayout layout = new CircleLayout(graph);
+        CircleLayout<String,String> layout = new CircleLayout<String,String>(graph);
         layout.setSize(new Dimension(1200, 365));
         for (Map.Entry<String, Map<String, Object>> v : newNodes.entrySet()) {
             Double x = layout.transform(v.getKey()).getX();