Clarify capacity of StringBuffer/StringBuilder near Integer.MAX_VALUE

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 13
    • Component/s: core-libs
    • None

      The specs for various constructors of StringBuffer/StringBuilder contain text like

      "The initial capacity of the string buffer is 16 plus the length of the string argument."

      From a specification perspective, this leaves open the possibility of misbehavior near Integer.MAX_VALUE.

      The spec in question would be improved by covering this situation explicitly, say by having the capacity saturate at MAX_VALUE.

            Assignee:
            Unassigned
            Reporter:
            Joe Darcy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: