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

Avoid repeated flattening of nested ConsStrings

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Resolved In Build:
      b22
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        Currently, when a ConsString is flattened to a java.lang.String, only the top level string is generated and cached (for obvious reasons). However, if a ConsString is repeatedly concatenated with another string and then flattened we may want to generate and cache the java.lang.String representation of that partial ConsString.

        A typical use case is the following piece of code where `data` may be a constant, long ConsString.

            String(header + CRLF + data);

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                hannesw Hannes Wallnoefer
                Reporter:
                hannesw Hannes Wallnoefer
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: