RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v5]

Alan Bateman alanb at openjdk.org
Wed Apr 16 10:44:50 UTC 2025


On Wed, 16 Apr 2025 10:35:10 GMT, Markus KARG <duke at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/CharSequence.java line 338:
>> 
>>> 336:      * Concurrent truncation of this character sequence can throw
>>> 337:      * {@code IndexOutOfBoundsException}. In this case, some characters, but not
>>> 338:      * all, may be already transferred.
>> 
>> Though its been absent for decades, it might be worthwhile to include a class level warning that the implementations of the interface are not known or required to be thread safe and if used concurrently by multiple threads the behavior is unpredictable.  I'd be more circumspect than trying to specify the only aberrant behavior is IndexOutOfBounds.
>
> Any quick proposals how to rephrase JavaDocs and CSR? As the CSR is already reviewed I am a bit reluctant to hold the train for this, as IMHO *masses* of classes and interfaces would need such a disclaimer, if we kick-off that ball here...

I think Roger's suggestion is for a different JBS issue / PR / CSR.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21730#discussion_r2046653580


More information about the nio-dev mailing list