< prev index next >

src/share/classes/sun/net/spi/DefaultProxySelector.java

Print this page
rev 1388 : 6600143: Remove another 450 unnecessary casts
Reviewed-by: alanb, iris, lmalvent, bristor, peterjones, darcy, wetmore

@@ -80,13 +80,13 @@
     private static boolean hasSystemProxies = false;
     private static Properties defprops = new Properties();
 
     static {
         final String key = "java.net.useSystemProxies";
-        Boolean b = (Boolean) AccessController.doPrivileged(
-            new PrivilegedAction() {
-                public Object run() {
+        Boolean b = AccessController.doPrivileged(
+            new PrivilegedAction<Boolean>() {
+                public Boolean run() {
                     return NetProperties.getBoolean(key);
                 }});
         if (b != null && b.booleanValue()) {
             java.security.AccessController.doPrivileged(
                       new sun.security.action.LoadLibraryAction("net"));

@@ -195,13 +195,13 @@
          * This is one big doPrivileged call, but we're trying to optimize
          * the code as much as possible. Since we're checking quite a few
          * System properties it does help having only 1 call to doPrivileged.
          * Be mindful what you do in here though!
          */
-        Proxy p = (Proxy) AccessController.doPrivileged(
-            new PrivilegedAction() {
-                public Object run() {
+        Proxy p = AccessController.doPrivileged(
+            new PrivilegedAction<Proxy>() {
+                public Proxy run() {
                     int i, j;
                     String phost =  null;
                     int pport = 0;
                     String nphosts =  null;
                     InetSocketAddress saddr = null;
< prev index next >