Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8138614 (spec str) StringBuffer and StringBuilder methods improperly require "new" String to be returned
  3. JDK-8350042

Release Note: Relax String Creation Requirements in StringBuilder and StringBuffer

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Delivered
    • Icon: P4 P4
    • 25
    • 25
    • core-libs

      The specifications of the `substring`, `subSequence`, and `toString` methods of the `StringBuilder` and `StringBuffer` classes have been modified not to require a new `String` instance to be returned every time. This allows implementations to improve performance by returning an already-existing string, such as the empty string, when that is appropriate. In all cases, a `String` containing the expected value will be returned. However, applications should not depend on these methods to return a *new* `String` instance every time.

            smarks Stuart Marks
            smarks Stuart Marks
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: