Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8218228 The constructor StringBuffer(CharSequence) violates spec for negatively sized argument
  3. JDK-8218884

Release Note: StringBuffer(CharSequence) and StringBuilder(CharSequence) Throw NegativeArraySizeException for Negatively Sized Argument

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: P4
    • Resolution: Delivered
    • Affects Version/s: 13
    • Fix Version/s: 13
    • Component/s: core-libs
    • Subcomponent:
    • Verification:
      Verified

      Description

      The behavior of `StringBuffer(CharSequence)` and `StringBuilder(CharSequence)` is changed for the argument reporting a negative length. The constructors were inconsistently throwing either `NegativeArraySizeException` or `IndexOutOfBoundException`. The new behavior is to always throw `NegativeArraySizeException` for any argument reporting a negative length.

        Attachments

          Activity

            People

            • Assignee:
              igerasim Ivan Gerasimov
              Reporter:
              igerasim Ivan Gerasimov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: