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

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: 5.0
    • Component/s: 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 ----------

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

              Created:
              Updated:
              Imported:
              Indexed: