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

Reduce char[] copying in URLEncoder.encode(String, Charset)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 17
    • None
    • core-libs
    • None
    • b06

    Description

      Instead of allocating a copy of underlying array via charArrayWriter.toCharArray() and passing it to constructor of String

        String str = new String(charArrayWriter.toCharArray());

      we could call toString() method

        String str = charArrayWriter.toString();

      decoding existing char[] without making a copy.

      Attachments

        Issue Links

          Activity

            People

              redestad Claes Redestad
              attila Attila Szegedi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: