changeset 418:73d1cb15b323

Eliminate warnings
author alanb
date Tue, 22 Jul 2008 10:17:30 +0100
parents 0844644a266a
children ad89efaf5633
files src/share/classes/sun/nio/ch/DatagramSocketAdaptor.java src/share/classes/sun/nio/ch/ServerSocketAdaptor.java src/share/classes/sun/nio/ch/SocketAdaptor.java
diffstat 3 files changed, 14 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/nio/ch/DatagramSocketAdaptor.java	Tue Jul 22 09:19:38 2008 +0100
+++ b/src/share/classes/sun/nio/ch/DatagramSocketAdaptor.java	Tue Jul 22 10:17:30 2008 +0100
@@ -270,7 +270,7 @@
         return timeout;
     }
 
-    private void setBooleanOption(SocketOption name, boolean value)
+    private void setBooleanOption(SocketOption<Boolean> name, boolean value)
         throws SocketException
     {
         try {
@@ -280,7 +280,7 @@
         }
     }
 
-    private void setIntOption(SocketOption name, int value)
+    private void setIntOption(SocketOption<Integer> name, int value)
         throws SocketException
     {
         try {
@@ -290,18 +290,18 @@
         }
     }
 
-    private boolean getBooleanOption(SocketOption name) throws SocketException {
+    private boolean getBooleanOption(SocketOption<Boolean> name) throws SocketException {
         try {
-            return ((Boolean)dc.getOption(name)).booleanValue();
+            return dc.getOption(name).booleanValue();
         } catch (IOException x) {
             Net.translateToSocketException(x);
             return false;       // keep compiler happy
         }
     }
 
-    private int getIntOption(SocketOption name) throws SocketException {
+    private int getIntOption(SocketOption<Integer> name) throws SocketException {
         try {
-            return ((Integer)dc.getOption(name)).intValue();
+            return dc.getOption(name).intValue();
         } catch (IOException x) {
             Net.translateToSocketException(x);
             return -1;          // keep compiler happy
--- a/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java	Tue Jul 22 09:19:38 2008 +0100
+++ b/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java	Tue Jul 22 10:17:30 2008 +0100
@@ -181,7 +181,7 @@
 
     public boolean getReuseAddress() throws SocketException {
         try {
-            return ((Boolean)ssc.getOption(StandardSocketOption.SO_REUSEADDR)).booleanValue();
+            return ssc.getOption(StandardSocketOption.SO_REUSEADDR).booleanValue();
         } catch (IOException x) {
             Net.translateToSocketException(x);
             return false;       // Never happens
@@ -209,7 +209,7 @@
 
     public int getReceiveBufferSize() throws SocketException {
         try {
-            return ((Integer)ssc.getOption(StandardSocketOption.SO_RCVBUF)).intValue();
+            return ssc.getOption(StandardSocketOption.SO_RCVBUF).intValue();
         } catch (IOException x) {
             Net.translateToSocketException(x);
             return -1;          // Never happens
--- a/src/share/classes/sun/nio/ch/SocketAdaptor.java	Tue Jul 22 09:19:38 2008 +0100
+++ b/src/share/classes/sun/nio/ch/SocketAdaptor.java	Tue Jul 22 10:17:30 2008 +0100
@@ -279,7 +279,7 @@
         return os;
     }
 
-    private void setBooleanOption(SocketOption name, boolean value)
+    private void setBooleanOption(SocketOption<Boolean> name, boolean value)
         throws SocketException
     {
         try {
@@ -289,7 +289,7 @@
         }
     }
 
-    private void setIntOption(SocketOption name, int value)
+    private void setIntOption(SocketOption<Integer> name, int value)
         throws SocketException
     {
         try {
@@ -299,18 +299,18 @@
         }
     }
 
-    private boolean getBooleanOption(SocketOption name) throws SocketException {
+    private boolean getBooleanOption(SocketOption<Boolean> name) throws SocketException {
         try {
-            return ((Boolean)sc.getOption(name)).booleanValue();
+            return sc.getOption(name).booleanValue();
         } catch (IOException x) {
             Net.translateToSocketException(x);
             return false;       // keep compiler happy
         }
     }
 
-    private int getIntOption(SocketOption name) throws SocketException {
+    private int getIntOption(SocketOption<Integer> name) throws SocketException {
         try {
-            return ((Integer)sc.getOption(name)).intValue();
+            return sc.getOption(name).intValue();
         } catch (IOException x) {
             Net.translateToSocketException(x);
             return -1;          // keep compiler happy