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

Cleanup java.net.URLEncoder and URLDecoder use of file.encoding property

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 22
    • 22
    • core-libs
    • None
    • b18

    Description

      DEFAULT_ENCODING_NAME in URLEncoder and URLDecoder can be replaced with Charset.defaultCharset(), which removes unnecessary static fields and avoid looking up charset when calling URLDecoder.decode(String) and URLEncoder.encode(String).

      Since Charset.defaultCharset() is also initialized with StaticProperty.fileEncoding(), this causes no change in behavior.

      The javadoc of URLDecoder.decode(String) and URLEncoder.encode(String) say that they use the default charset, so this change is semantically consistent with the documentation.

      Attachments

        Issue Links

          Activity

            People

              redestad Claes Redestad
              rriggs Roger Riggs
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: