From 3ebb998e6fd4db2150c4c60f0977b2b4ca3d39fa Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Wed, 20 Nov 2002 16:19:08 +0000 Subject: 2002-11-20 Michael Koch * java/io/FileInputStream.java (getChannel): New method. * java/io/FileOutputStream.java (getChannel): New method. * java/net/ServerSocket.java (bind): Removed duplicate code and called another bind method instead. * java/nio/channels/SelectionKey.java (isValid): Removed wrong exception documentation. * java/nio/channels/ServerSocketChannel.java (accept): Added exception documentation. (open): Fixed typo, added exception documentation. * java/nio/channels/spi/AbstractSelectableChannel.java (implCloseChannel): Added exception documentation. (add): Reformated. (register): Added exception documentation. From-SVN: r59307 --- libjava/java/net/ServerSocket.java | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'libjava/java/net/ServerSocket.java') diff --git a/libjava/java/net/ServerSocket.java b/libjava/java/net/ServerSocket.java index dda834e5f98..62917b6a8a5 100644 --- a/libjava/java/net/ServerSocket.java +++ b/libjava/java/net/ServerSocket.java @@ -151,6 +151,7 @@ public class ServerSocket throws IOException { this(); + if (impl == null) throw new IOException("Cannot initialize Socket implementation"); @@ -181,19 +182,7 @@ public class ServerSocket public void bind (SocketAddress endpoint) throws IOException { - if (impl == null) - throw new IOException ("Cannot initialize Socket implementation"); - - if (! (endpoint instanceof InetSocketAddress)) - throw new IllegalArgumentException ("Address type not supported"); - - InetSocketAddress tmp = (InetSocketAddress) endpoint; - - SecurityManager s = System.getSecurityManager (); - if (s != null) - s.checkListen (tmp.getPort ()); - - impl.bind (tmp.getAddress (), tmp.getPort ()); + bind (endpoint, 50); } /** -- cgit v1.2.3