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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 8u40
    • core-libs
    • b72
    • x86
    • windows_8

        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?



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

                Created:
                Updated:
                Resolved: