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

URL(protocol, host, port, file) is not throwing exception for wrong format

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P3 P3
    • None
    • 1.4.0
    • core-libs
    • sparc
    • solaris_8

       URL u4 = new URL("FTP", "10:100::1234", 9999, "index.html"); is not throwing exception. But when I get toString() of this which is
      FTP://[10:100::1234]:9999index.html then

       new URL(u4.toString()) throws MalformedURLException.

      Where as URI with similar constructor

      URI u1 = new URI("http","","10::20:10",8080,"index.html", "abcd", "xyz")

      throws " URISyntaxException: Relative path in absolute URI " exception.




            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: