Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6350928

Constructor that creates a URL by parsing given spec within a specified context.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 5.0
    • core-libs
    • 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 ----------

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: