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

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 22
    • Affects Version/s: 22
    • Component/s: core-libs
    • None
    • b18

      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.

            Assignee:
            Claes Redestad
            Reporter:
            Roger Riggs
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: