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

Textual representation of IPv6 addresses shouldn't be full-form

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 7
    • core-libs
    • x86
    • linux_ubuntu

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      The textual representation of IPv6 addresses is spec'd as "full form", rather than the more common condensed form.

        From the API:
       "For methods that return a textual representation as output value, the full form is used. Inet6Address will return the full form because it is unambiguous when used in combination with other textual data."

      Inet6Address shouldn't output addresses in full form, for the following reasons:
      - Consistency with other applications. Try typing ifconfig or ping6: :1 on your linux box. You certainly won't see 0:0:0:0:0:0:0:1.
      - Consistency with other programming language. Every library I'm aware of that deals with IPv6 addresses outputs addresses in compressed form. If we make this change, there will be no way to output the compressed form in android.
      - Consistency with user expectations. Users will be entering IPv6 addresses compressed, either because they want to save themselves the typing, or because they got them from other applications, which do compress.
      - No other application of which I am aware uses the full form in order to make it easy to parse port numbers (tty putting 0:0:0:0:0:0:0:1 into your browser and see what happens). Doing so in library code is dangerous because you have to go through contortions to remember whether the address came fom a user (i.e., via typing or copy+paste, i.e. compressed form) or from a "sanitizing" library call.

      For what it's worth, the upcoming IETF document on the matter, which has been adopted as a working group item and is on the standards track, is at http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-03#section-4 . It specifies a recommended format for printing IPv6 addresses. Inet6Address should follow this.


      REPRODUCIBILITY :
      This bug can be reproduced always.

            Unassigned Unassigned
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: