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

Avoid repeated flattening of nested ConsStrings

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • None
    • core-libs
    • None
    • b22
    • generic
    • generic

        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);

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

                Created:
                Updated:
                Resolved: