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

(str) Optimize AbstractStringBuilder.append(CharSequence, int, int) for String argument

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u40
    • Fix Version/s: 9
    • Component/s: core-libs
    • Subcomponent:
    • Resolved In Build:
      b72
    • CPU:
      x86
    • OS:
      windows_8

      Backports

        Description

        A DESCRIPTION OF THE REQUEST :
        Please add an "append substring" method to StringBuilder, with semantics similar to the already existing "append sub-char-array", append(char[], int, int).

        JUSTIFICATION :
        With the recent change to String.substring where it copies the underlying char[] rather than reusing it, it is no longer "free" to append substrings to a StringBuilder.

        Yes, perhaps the JIT eventually figures that out, but why make it do that work? And as a developer it's risky to rely on the JIT for such things - how can I be sure it will always do the right thing?



          Attachments

            Issue Links

              Activity

                People

                Assignee:
                igerasim Ivan Gerasimov
                Reporter:
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: