+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
}
catch (SocketException e)
{
+ // This means simply not connected.
}
}
* 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.
* 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
*
*/
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);
}
/**
*/
public String getUserInfo ()
{
- int at = host.indexOf('@');
+ int at = (host == null) ? -1 : host.indexOf('@');
return at < 0 ? null : host.substring(0, at);
}
*/
public String getQuery ()
{
- int quest = file.indexOf('?');
+ int quest = (file == null) ? -1 : file.indexOf('?');
return quest < 0 ? null : file.substring(quest + 1, file.length());
}
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);