8311906: Improve robustness of String constructors with mutable array inputs

Co-authored-by: Damon Fenacci <dfenacci@openjdk.org>
Co-authored-by: Claes Redestad <redestad@openjdk.org>
Co-authored-by: Amit Kumar <amitkumar@openjdk.org>
Co-authored-by: Martin Doerr <mdoerr@openjdk.org>
Reviewed-by: rgiulietti, thartmann, redestad, dfenacci
This commit is contained in:
Roger Riggs 2023-12-04 18:28:59 +00:00
parent 316b78336c
commit 155abc576a
15 changed files with 1300 additions and 248 deletions

View file

@ -57,6 +57,10 @@ public interface Appendable {
* {@code csq}, the entire sequence may not be appended. For
* instance, if {@code csq} is a {@link java.nio.CharBuffer} then
* the subsequence to append is defined by the buffer's position and limit.
* <p>
* The contents of this {@code Appendable} are unspecified if the {@code CharSequence}
* is modified during the method call or an exception is thrown
* when accessing the {@code CharSequence}.
*
* @param csq
* The character sequence to append. If {@code csq} is
@ -81,6 +85,10 @@ public interface Appendable {
* <pre>
* out.append(csq.subSequence(start, end)) </pre>
*
* <p>
* The contents of this {@code Appendable} are unspecified if the {@code CharSequence}
* is modified during the method call or an exception is thrown
* when accessing the {@code CharSequence}.
* @param csq
* The character sequence from which a subsequence will be
* appended. If {@code csq} is {@code null}, then characters