2003-03-03 Michael Koch <konqueror@gmx.de>
authorMichael Koch <konqueror@gmx.de>
Mon, 3 Mar 2003 08:26:52 +0000 (08:26 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Mon, 3 Mar 2003 08:26:52 +0000 (08:26 +0000)
* 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

libjava/ChangeLog
libjava/java/net/DatagramSocket.java
libjava/java/net/Socket.java
libjava/java/net/URL.java
libjava/java/net/URLStreamHandler.java

index d76dfe7bf69e8d3a76b16e26105852ac2d2d8c42..9c55675dcbbffece92937e521f75b4a20814707f 100644 (file)
@@ -1,3 +1,17 @@
+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
index 091ebf98d1abc5eb121c87363004ed275c9af83f..81c8b3cdbf9f2daa11e09ecabe59669a6240785f 100644 (file)
@@ -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.
index 005fd0461b2e591dd3fc13ea8dc315b8ce2ecb77..a71218fe7efea7d7434650da39a3f5613ca0989d 100644 (file)
@@ -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
    *
index 98e7d5f7c3148c3442ecb3c72cc196eaf2b489f6..ba27bbef5ddbfe24eac2f6ffe0a9e64eca8258bc 100644 (file)
@@ -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());
   }
 
index d3dd3ccf0f76b23b083ac5cf32cda988cb394c43..a6db2f32a06d00344ef2568b047d77f3c2988438 100644 (file)
@@ -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);