This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: Patch: java.net.URL


Hi list,


I commited the attached patch fo fix the documentation in java.net.URL and to 
wrap some lines according to our line-length rule.



Michael
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2362
diff -u -b -B -r1.2362 ChangeLog
--- ChangeLog	26 Nov 2003 10:41:01 -0000	1.2362
+++ ChangeLog	26 Nov 2003 11:44:57 -0000
@@ -1,5 +1,22 @@
 2003-11-26  Michael Koch  <konqueror@gmx.de>
 
+	* java/net/URL.java
+	(URL): Fixed documentation to be HTML compliant.
+	(getContent): Completed documentation.
+	(getFile): Likewise.
+	(getPath): Likewise.
+	(getAuthority): Likewise.
+	(getHost): Likewise.
+	(getDefaultPort): Likewise.
+	(getProtocol): Likewise.
+	(hashCode): Likewise.
+	(openConnection): Likewise.
+	(openStream): Likewise.
+	(set): Likewise.
+	(getURLStreamHandler): Wrapped lines to fit into our 79 chars rule.
+
+2003-11-26  Michael Koch  <konqueror@gmx.de>
+
 	* java/net/InetSocketAddress.java
 	(hostname): Made private, added documentation.
 	(addr): Likewise.
Index: java/net/URL.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/URL.java,v
retrieving revision 1.31
diff -u -b -B -r1.31 URL.java
--- java/net/URL.java	29 Oct 2003 10:53:19 -0000	1.31
+++ java/net/URL.java	26 Nov 2003 11:44:57 -0000
@@ -56,7 +56,8 @@
   * This final class represents an Internet Uniform Resource Locator (URL).
   * For details on the syntax of URL's and what they can be used for,
   * refer to RFC 1738, available from <a 
-  * href="http://ds.internic.net/rfcs/rfc1738.txt";>http://ds.internic.net/rfcs/rfc1738.txt</a>
+  * href="http://ds.internic.net/rfcs/rfc1738.txt";>
+  * http://ds.internic.net/rfcs/rfc1738.txt</a>
   * <p>
   * There are a great many protocols supported by URL's such as "http",
   * "ftp", and "file".  This object can handle any arbitrary URL for which
@@ -73,10 +74,10 @@
   * If this property is set, it is assumed to be a "|" separated list of
   * package names in which to attempt locating protocol handlers.  The
   * protocol handler is searched for by appending the string 
-  * ".<protocol>.Handler" to each packed in the list until a hander is found.
-  * If a protocol handler is not found in this list of packages, or if the
-  * property does not exist, then the default protocol handler of
-  * "gnu.java.net.<protocol>.Handler" is tried.  If this is
+  * ".&lt;protocol&gt;.Handler" to each packed in the list until a hander is
+  * found. If a protocol handler is not found in this list of packages, or if
+  * the property does not exist, then the default protocol handler of
+  * "gnu.java.net.&lt;protocol&gt;.Handler" is tried.  If this is
   * unsuccessful, a MalformedURLException is thrown.
   * <p>
   * All of the constructor methods of URL attempt to load a protocol
@@ -310,7 +311,7 @@
     this((URL) null, spec, (URLStreamHandler) null);
   }
 
-  /*
+  /**
    * This method parses a String representation of a URL within the
    * context of an existing URL.  Principally this means that any
    * fields not present the URL are inheritied from the context URL.
@@ -475,6 +476,10 @@
   /**
    * Gets the contents of this URL
    *
+   * @param classes The allow classes for the content object.
+   *
+   * @return a context object for this URL.
+   *
    * @exception IOException If an error occurs
    */
   public final Object getContent (Class[] classes) throws IOException
@@ -487,6 +492,8 @@
    * Returns the file portion of the URL.
    * Defined as <code>path[?query]</code>.
    * Returns the empty string if there is no file portion.
+   *
+   * @return The filename specified in this URL.
    */
   public String getFile()
   {
@@ -497,6 +504,8 @@
    * Returns the path of the URL. This is the part of the file before any '?'
    * character.
    *
+   * @return The path specified in this URL.
+   * 
    * @since 1.3
    */
   public String getPath()
@@ -508,6 +517,8 @@
   /**
    * Returns the authority of the URL
    * 
+   * @return The authority specified in this URL.
+   * 
    * @since 1.3
    */
   public String getAuthority()
@@ -517,6 +528,8 @@
 
   /**
    * Returns the host of the URL
+   *
+   * @return The host specified in this URL.
    */
   public String getHost()
   {
@@ -540,6 +553,8 @@
   /**
    * Returns the default port of the URL. If the StreamHandler for the URL
    * protocol does not define a default port it returns -1.
+   *
+   * @return The default port of the current protocol.
    */
   public int getDefaultPort()
   {
@@ -548,6 +563,8 @@
 
   /**
    * Returns the protocol of the URL
+   *
+   * @return The specified protocol.
    */
   public String getProtocol()
   {
@@ -591,6 +608,8 @@
 
   /**
    * Returns a hashcode computed by the URLStreamHandler of this URL
+   *
+   * @return The hashcode for this URL.
    */
   public int hashCode()
   {
@@ -606,6 +625,7 @@
    * openConnection() method of the protocol handler
    *
    * @return A URLConnection for this URL
+   *
    * @exception IOException If an error occurs
    */
   public URLConnection openConnection() throws IOException
@@ -617,6 +637,8 @@
    * Opens a connection to this URL and returns an InputStream for reading
    * from that connection
    *
+   * @return An <code>InputStream</code> for this URL.
+   * 
    * @exception IOException If an error occurs
    */
   public final InputStream openStream() throws IOException
@@ -673,6 +695,15 @@
    * that only URLStreamHandlers can modify URL fields. URLs are otherwise
    * constant.
    *
+   * @param protocol The protocol name for this URL.
+   * @param host The hostname or IP address for this URL.
+   * @param port The port number of this URL.
+   * @param authority The authority of this URL.
+   * @param userInfo The user and password (if needed) of this URL.
+   * @param path The "path" portion of this URL.
+   * @param query The query of this URL.
+   * @param ref The anchor portion of this URL.
+   *
    * @since 1.3
    */
   protected void set(String protocol, String host, int port,
@@ -800,7 +831,8 @@
 	// to it, along with the JDK specified default as a last resort.
 	// Except in very unusual environments the JDK specified one shouldn't
 	// ever be needed (or available).
-	String ph_search_path = System.getProperty ("java.protocol.handler.pkgs");
+	String ph_search_path =
+	  System.getProperty("java.protocol.handler.pkgs");
 
 	// Tack our default package on at the ends.
 	if (ph_search_path != null)
@@ -813,7 +845,8 @@
         
 	do
           {
-            String clsName = pkgPrefix.nextToken() + "." + protocol + ".Handler";
+            String clsName = (pkgPrefix.nextToken() + "."
+			      + protocol + ".Handler");
          
             try
               {
@@ -826,7 +859,8 @@
               }
             catch (Exception e)
               {
-                // Can't instantiate; handler still null, go on to next element.
+                // Can't instantiate; handler still null,
+		// go on to next element.
               }
           }
 	while ((! (ph instanceof URLStreamHandler))

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]