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

URL(URL context, String spec) hangs with specific input.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • core-libs
    • beta2
    • sparc
    • solaris_8
    • Verified

      URL(URL context, String spec) hangs with the following input with build 71. It shows MalformedURLException with build70 and previous builds.

      How to reproduce:

       URL contexturl1 = new URL("file:./");
       System.out.println("ToString context url : " + contexturl1.toString());
       URL u4 = new URL(contexturl1, "../images/foo.gif");

       System.out.println("ToString u4 : " + u4.toString());


        With build71 its not coming out of "URL u4 = new URL(contexturl1, "../images/foo.gif"); " line.
       

      Output with build71:

      ToString context url : file:./


      Output with build 70:

      ToString context url : file:./
      java.net.MalformedURLException: context contains relative path: file:./
              at java.net.URL.<init>(URL.java:484)
              at java.net.URL.<init>(URL.java:390)
              at TestURL1.main(TestURL1.java:113)


            ywangsunw Yingxian Wang (Inactive)
            vakellasunw Venkata Akella (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: