2002-10-03 Michael Koch <konqueror@gmx.de>
* java/net/DatagramPacket.java (setLength): Fixed typo and be HTML-aware. * java/net/InetSocketAddress.java (InetSocketAddress): Correct initialization of hostname, fixed typo. (equals): Added comment about equality of InetSocketAddress objects. * java/net/ServerSocket.java (accept): Added checks. (isClosed): New stubbed method. * java/net/SocketOptions.java: Reindention. * java/net/SocketPermission (SocketPermission): Documentation fixed. From-SVN: r57776
This commit is contained in:
parent
4c9c9a3da5
commit
a8e8f5c359
6 changed files with 46 additions and 19 deletions
|
@ -57,7 +57,7 @@ public class InetSocketAddress extends SocketAddress
|
|||
* @param addr Address of the socket
|
||||
* @param port Port if the socket
|
||||
*
|
||||
* @exception IllegalArgumentException If the port number is illegal
|
||||
* @exception IllegalArgumentException If the port number is illegel
|
||||
*/
|
||||
public InetSocketAddress(InetAddress addr, int port)
|
||||
throws IllegalArgumentException
|
||||
|
@ -67,15 +67,7 @@ public class InetSocketAddress extends SocketAddress
|
|||
|
||||
this.addr = addr;
|
||||
this.port = port;
|
||||
|
||||
try
|
||||
{
|
||||
this.hostname = addr.getHostName ();
|
||||
}
|
||||
catch (UnknownHostException e)
|
||||
{
|
||||
this.hostname = "";
|
||||
}
|
||||
this.hostname = addr.getHostName ();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -140,6 +132,9 @@ public class InetSocketAddress extends SocketAddress
|
|||
*/
|
||||
public final boolean equals (Object obj)
|
||||
{
|
||||
// InetSocketAddress objects are equal when addr and port are equal.
|
||||
// The hostname may differ.
|
||||
|
||||
if (obj instanceof InetSocketAddress)
|
||||
{
|
||||
InetSocketAddress a = (InetSocketAddress) obj;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue