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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Won't Fix
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_8

      Description

       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.




        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: