src/share/classes/sun/rmi/transport/ConnectionInputStream.java

Print this page

        

@@ -41,11 +41,11 @@
 
     /** indicates whether ack is required for DGC */
     private boolean dgcAckNeeded = false;
 
     /** Hashtable mapping Endpoints to lists of LiveRefs to register */
-    private Map incomingRefTable = new HashMap(5);
+    private Map<Endpoint, List<LiveRef>> incomingRefTable = new HashMap<>(5);
 
     /** identifier for gc ack*/
     private UID ackID;
 
     /**

@@ -68,14 +68,14 @@
      */
     void saveRef(LiveRef ref) {
         Endpoint ep = ref.getEndpoint();
 
         // check whether endpoint is already in the hashtable
-        List refList = (List) incomingRefTable.get(ep);
+        List<LiveRef> refList = incomingRefTable.get(ep);
 
         if (refList == null) {
-            refList = new ArrayList();
+            refList = new ArrayList<LiveRef>();
             incomingRefTable.put(ep, refList);
         }
 
         // add ref to list of refs for endpoint ep
         refList.add(ref);

@@ -87,16 +87,18 @@
      * refs with the same endpoint at once to achieve batching of
      * calls to the DGC
      */
     void registerRefs() throws IOException {
         if (!incomingRefTable.isEmpty()) {
-            Set entrySet = incomingRefTable.entrySet();
-            Iterator iter = entrySet.iterator();
+            Set<Map.Entry<Endpoint, List<LiveRef>>> entrySet =
+                    incomingRefTable.entrySet();
+            Iterator<Map.Entry<Endpoint, List<LiveRef>>> iter = 
+                    entrySet.iterator();
             while (iter.hasNext()) {
-                Map.Entry entry = (Map.Entry) iter.next();
-                Endpoint ep = (Endpoint) entry.getKey();
-                List refList = (List) entry.getValue();
+                Map.Entry<Endpoint, List<LiveRef>> entry = iter.next();
+                Endpoint ep = entry.getKey();
+                List<LiveRef> refList = entry.getValue();
                 DGCClient.registerRefs(ep, refList);
             }
         }
     }