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

URL is not throwinng exception for wrong URL format.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.4.0
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      beta2
    • CPU:
      sparc
    • OS:
      solaris_8
    • Verification:
      Verified

      Description

      When we dont give colon before port no , then it doesnt give port no in getPort() and it doesnt even give any exception. Its coming with merlin build 71 on Solaris 8.

      How to reproduce this:
      ----------------------

      URL u4 = new URL("http://[javasoft.eng.sun.com]9999/path1/path2/");


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

                      System.out.println("Authority : " + u4.getAuthority());
                      System.out.println("File : " + u4.getFile());
                      System.out.println("Host : " + u4.getHost());
                      System.out.println("Path : " + u4.getPath());
                      System.out.println("Port : " + u4.getPort());
                      System.out.println("DefaultPort : " + u4.getDefaultPort());
                      System.out.println("Query : " + u4.getQuery());
                      System.out.println("Protocol : " + u4.getProtocol());
                      System.out.println("Reference : " + u4.getRef());
                      System.out.println("ToString : " + u4.toString());
                      System.out.println("Toexternal form : " + u4.toExternalForm());


      Output:

      ToString u4 : http://[javasoft.eng.sun.com]9999/path1/path2/
      Authority : [javasoft.eng.sun.com]9999
      File : /path1/path2/
      Host : [javasoft.eng.sun.com]
      Path : /path1/path2/
      Port : -1
      DefaultPort : 80
      Query : null
      Protocol : http
      Reference : null



        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: