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

Print this page

        

@@ -60,11 +60,11 @@
     /* transport package log */
     static final Log transportLog =
         Log.getLog("sun.rmi.transport.misc", "transport", Transport.logLevel);
 
     /** References the current transport when a call is being serviced */
-    private static final ThreadLocal currentTransport = new ThreadLocal();
+    private static final ThreadLocal<Transport> currentTransport = new ThreadLocal<>();
 
     /** ObjID for DGCImpl */
     private static final ObjID dgcID = new ObjID(ObjID.DGC_ID);
 
     /**

@@ -102,11 +102,11 @@
     /**
      * Returns the current transport if a call is being serviced, otherwise
      * returns null.
      **/
     static Transport currentTransport() {
-        return (Transport) currentTransport.get();
+        return currentTransport.get();
     }
 
     /**
      * Verify that the current access control context has permission to accept
      * the connection being dispatched by the current thread.  The current