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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 17
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      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

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

                Dates

                Created:
                Updated:
                Resolved: