[kaffe] CVS kaffe (robilad): resynced with gnu classpath: uri fix

Kaffe CVS cvs-commits at kaffe.org
Sun May 29 18:24:43 PDT 2005


PatchSet 6592 
Date: 2005/05/30 01:15:40
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
resynced with gnu classpath: uri fix

Members: 
	ChangeLog:1.4118->1.4119 
	libraries/javalib/java/net/URI.java:1.15->1.16 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4118 kaffe/ChangeLog:1.4119
--- kaffe/ChangeLog:1.4118	Mon May 30 00:40:31 2005
+++ kaffe/ChangeLog	Mon May 30 01:15:40 2005
@@ -1,6 +1,17 @@
 2005-05-30  Dalibor Topic  <robilad at kaffe.org>
 
         Resynced with GNU Classpath.
+	
+	2005-05-26  Andrew John Hughes  <gnu_andrew at member.fsf.org>
+
+	* java/net/URI.java:
+	(getURIGroup(String)): Correctly handle the difference
+	between null and undefined optional values.
+	(relativize(java.net.URI)): Corrected documentation.
+
+2005-05-30  Dalibor Topic  <robilad at kaffe.org>
+
+        Resynced with GNU Classpath.
 
 	2005-05-26  Andrew John Hughes  <gnu_andrew at member.fsf.org>
 
Index: kaffe/libraries/javalib/java/net/URI.java
diff -u kaffe/libraries/javalib/java/net/URI.java:1.15 kaffe/libraries/javalib/java/net/URI.java:1.16
--- kaffe/libraries/javalib/java/net/URI.java:1.15	Sat May 21 15:26:37 2005
+++ kaffe/libraries/javalib/java/net/URI.java	Mon May 30 01:15:43 2005
@@ -308,10 +308,46 @@
     os.writeObject(string);
   }
 
+  /**
+   * <p>
+   * Returns the string content of the specified group of the supplied
+   * matcher.  The returned value is modified according to the following:
+   * </p>
+   * <ul>
+   * <li>If the resulting string has a length greater than 0, then
+   * that string is returned.</li>
+   * <li>If a string of zero length, is matched, then the content
+   * of the preceding group is considered.  If this is also an empty
+   * string, then <code>null</code> is returned to indicate an undefined
+   * value.  Otherwise, the value is truly the empty string and this is
+   * the returned value.</li>
+   * </ul>
+   * <p>
+   * This method is used for matching against all parts of the URI
+   * that may be either undefined or empty (i.e. all those but the
+   * scheme-specific part and the path).  In each case, the preceding
+   * group is the content of the original group, along with some
+   * additional distinguishing feature.  For example, the preceding
+   * group for the query includes the preceding question mark,
+   * while that of the fragment includes the hash symbol.  The presence
+   * of these features enables disambiguation between the two cases
+   * of a completely unspecified value and a simple non-existant value.
+   * The scheme differs in that it will never return an empty string;
+   * the delimiter follows the scheme rather than preceding it, so
+   * it becomes part of the following section.  The same is true
+   * of the user information.
+   * </p>
+   *
+   * @param match the matcher, which contains the results of the URI
+   *              matched against the URI regular expression.
+   * @return either the matched content, <code>null</code> for undefined
+   *         values, or an empty string for a URI part with empty content.
+   */
   private static String getURIGroup(Matcher match, int group)
   {
     String matched = match.group(group);
-    return matched.length() == 0 ? null : matched;
+    return matched.length() == 0 
+      ? ((match.group(group - 1).length() == 0) ? null : "") : matched;
   }
 
   /**
@@ -895,8 +931,8 @@
 
   /**
    * <p>
-   * Relativizes the given URI against this URI using the following
-   * algorithm:
+   * Relativizes the given URI against this URI.  The following
+   * algorithm is used:
    * </p>
    * <ul>
    * <li>If either URI is opaque, the given URI is returned.</li>




More information about the kaffe mailing list