Commit 6579ac0c by Michael Koch Committed by Michael Koch

2003-03-03 Michael Koch <konqueror@gmx.de>

	* java/net/DatagramSocket.java
	(connect): Merged comment from classpath.
	(receive): Merged documentation from classpath.
	* java/net/Socket.java
	(setSoTimeout): Clarified documentation.
	* java/net/URL.java
	(getPath): Merged from classpath.
	(getUserInfo): Merged from classpath.
	(getQuery): Merged from classpath.
	* java/net/URLStreamHandler.java
	(toExternalForm): Merged from classpath.

From-SVN: r63714
parent 6e1b3a7c
2003-03-03 Michael Koch <konqueror@gmx.de>
* java/net/DatagramSocket.java
(connect): Merged comment from classpath.
(receive): Merged documentation from classpath.
* java/net/Socket.java
(setSoTimeout): Clarified documentation.
* java/net/URL.java
(getPath): Merged from classpath.
(getUserInfo): Merged from classpath.
(getQuery): Merged from classpath.
* java/net/URLStreamHandler.java
(toExternalForm): Merged from classpath.
2003-03-02 Mark Wielaard <mark@klomp.org>
* java/util/Properties.java (load): Only skip line if the first
......
......@@ -466,6 +466,7 @@ public class DatagramSocket
}
catch (SocketException e)
{
// This means simply not connected.
}
}
......@@ -488,9 +489,9 @@ public class DatagramSocket
* will block until a packet is received from the network. On return,
* the passed in <code>DatagramPacket</code> is populated with the data
* received and all the other information about the packet.
*
* @param p The datagram packet to put the incoming data into.
*
*
* @param p A <code>DatagramPacket</code> for storing the data
*
* @exception IOException If an error occurs.
* @exception SocketTimeoutException If setSoTimeout was previously called
* and the timeout has expired.
......
......@@ -692,10 +692,10 @@ public class Socket
* this option implies that there is no timeout (ie, operations will
* block forever). On systems that have separate read and write timeout
* values, this method returns the read timeout. This
* value is in thousandths of a second (****????*****)
* value is in milliseconds.
*
* @param timeout The length of the timeout in thousandth's of a second or
* 0 if not set
* @param timeout The length of the timeout in milliseconds, or
* 0 to indicate no timeout.
*
* @exception SocketException If an error occurs or Socket not connected
*
......
......@@ -472,8 +472,8 @@ public final class URL implements Serializable
*/
public String getPath()
{
int quest = file.indexOf('?');
return quest < 0 ? file : file.substring(0, quest);
int quest = (file == null) ? -1 : file.indexOf('?');
return quest < 0 ? getFile() : file.substring(0, quest);
}
/**
......@@ -544,7 +544,7 @@ public final class URL implements Serializable
*/
public String getUserInfo ()
{
int at = host.indexOf('@');
int at = (host == null) ? -1 : host.indexOf('@');
return at < 0 ? null : host.substring(0, at);
}
......@@ -556,7 +556,7 @@ public final class URL implements Serializable
*/
public String getQuery ()
{
int quest = file.indexOf('?');
int quest = (file == null) ? -1 : file.indexOf('?');
return quest < 0 ? null : file.substring(quest + 1, file.length());
}
......
......@@ -451,8 +451,11 @@ public abstract class URLStreamHandler
int size = protocol.length() + host.length() + file.length() + 24;
StringBuffer sb = new StringBuffer(size);
sb.append(protocol);
sb.append(':');
if (protocol != null && protocol.length() > 0)
{
sb.append(protocol);
sb.append(":");
}
if (host.length() != 0)
sb.append("//").append(host);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment