-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
5.0
-
x86
-
windows_xp
FULL PRODUCT VERSION :
java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode)
A DESCRIPTION OF THE PROBLEM :
The constructor
public URL(URL context, String spec)
that creates a new URL by parsing the given spec within a specified context
does not give the expected result when the spec starts with a '?'
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
http://www.xyz.com/temp.html?val=2
ACTUAL -
http://www.xyz.com/?val=2
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
URL u=new URL("http://www.xyz.com/temp.html?val=1");
URL u2=new URL(u,"?val=2");
System.out.println(u2);
---------- END SOURCE ----------
java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode)
A DESCRIPTION OF THE PROBLEM :
The constructor
public URL(URL context, String spec)
that creates a new URL by parsing the given spec within a specified context
does not give the expected result when the spec starts with a '?'
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
http://www.xyz.com/temp.html?val=2
ACTUAL -
http://www.xyz.com/?val=2
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
URL u=new URL("http://www.xyz.com/temp.html?val=1");
URL u2=new URL(u,"?val=2");
System.out.println(u2);
---------- END SOURCE ----------