URL constructor URL(URL context, String spec) is giving wrong output when spec is "" on solaris 8 with merlin build42.
How to reproduce the bug:
Test with the following code on Solaris 8 with Merlin build 42.
import java.io.*;
import java.net.*;
public class TestParseURL {
public static void main(String[] arg) {
try {
String urlString = "http://a/b/c/d;p?q";
String urlspec = "";
System.out.println("url string" + urlString);
System.out.println("url spec " + urlspec);
URL context = new URL(urlString);
System.out.println("context " + context);
URL url = new URL(context , urlspec);
System.out.println("url string " + url.toString());
} catch(Exception exp) {
System.out.println(exp.getMessage());
}
}
} // End of class
Output of the above code for Merlin build 42 :
url stringhttp://a/b/c/d;p?q
url spec
context http://a/b/c/d;p?q
url string http://a/b/c/d;p
Output with JDK1.3 :
url stringhttp://a/b/c/d;p?q
url spec
context http://a/b/c/d;p?q
url string http://a/b/c/d;p?q
NOTE: When executed with merlin build 42 in the final url '?q' part is missing when spec is "".
How to reproduce the bug:
Test with the following code on Solaris 8 with Merlin build 42.
import java.io.*;
import java.net.*;
public class TestParseURL {
public static void main(String[] arg) {
try {
String urlString = "http://a/b/c/d;p?q";
String urlspec = "";
System.out.println("url string" + urlString);
System.out.println("url spec " + urlspec);
URL context = new URL(urlString);
System.out.println("context " + context);
URL url = new URL(context , urlspec);
System.out.println("url string " + url.toString());
} catch(Exception exp) {
System.out.println(exp.getMessage());
}
}
} // End of class
Output of the above code for Merlin build 42 :
url stringhttp://a/b/c/d;p?q
url spec
context http://a/b/c/d;p?q
url string http://a/b/c/d;p
Output with JDK1.3 :
url stringhttp://a/b/c/d;p?q
url spec
context http://a/b/c/d;p?q
url string http://a/b/c/d;p?q
NOTE: When executed with merlin build 42 in the final url '?q' part is missing when spec is "".
- duplicates
-
JDK-4407348 JCK13a /api/java_net/URL/descriptions.html URL0107 URL0108 sparc-s7 intel-s6
-
- Closed
-