7035556: DatagramSocket.java:183: warning: unreachable catch clause
authorchegar
Mon, 25 Jul 2011 14:35:13 -0700
changeset 10134 c59ce1c5c167
parent 10133 fafe5ee13fe2
child 10135 8186b3499405
7035556: DatagramSocket.java:183: warning: unreachable catch clause Summary: Remove redundant catches in bind Reviewed-by: alanb, michaelm, wetmore, chegar Contributed-by: kurchi.subhra.hazra@oracle.com
jdk/src/share/classes/java/net/DatagramSocket.java
--- a/jdk/src/share/classes/java/net/DatagramSocket.java	Fri Jul 22 21:31:12 2011 -0700
+++ b/jdk/src/share/classes/java/net/DatagramSocket.java	Mon Jul 25 14:35:13 2011 -0700
@@ -176,13 +176,7 @@
     public DatagramSocket() throws SocketException {
         // create a datagram socket.
         createImpl();
-        try {
-            bind(new InetSocketAddress(0));
-        } catch (SocketException se) {
-            throw se;
-        } catch(IOException e) {
-            throw new SocketException(e.getMessage());
-        }
+        bind(new InetSocketAddress(0));
     }
 
     /**