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

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

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 9
    • 8u40
    • core-libs
    • b72
    • x86
    • 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

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

                Dates

                  Created:
                  Updated:
                  Resolved: