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

toExternalForm() , toString() 's results format is not proper with IPv6 host nam

    XMLWordPrintable

    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

      Construct URL as
      new URL("http", "10:100::1234", 9999, "/index.html");
      and access toExternalForm() or toString() then output is coming as ..
      http://10:100::1234:9999/index.html

      Here we cant say whether 9999 is a port no or part of the host name.

      This is coming on Solaris 8 with build 59.

      How to reproduce it:

      Execute the below pasted test class..

      import java.net.*;

      public class TestURL {

      public static void main(String[] args) {


              try {
                 

                      URL u3 = new URL("http", "10:100::1234", 9999, "/index.html");

                      System.out.println("ToString u3 : " + u3.toString());
                      System.out.println("Toexternal form u3 : " + u3.toExternalForm());

              } catch(Exception exp) {

                      exp.printStackTrace();
              }
      }

      }// End of class

        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: