RFR: 8321180: Condition for non-latin1 string size too large exception is off by one [v2]

Roger Riggs rriggs at openjdk.org
Fri Dec 8 19:50:32 UTC 2023


On Fri, 8 Dec 2023 19:32:02 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/StringUTF16.java line 59:
>> 
>>> 57:         if (len >= MAX_LENGTH) {
>>> 58:             throw new OutOfMemoryError("UTF16 String size is " + len +
>>> 59:                                        ", should be less than or equal to " + MAX_LENGTH);
>> 
>> Suggestion:
>> 
>>                                        ", should be less than " + MAX_LENGTH);
>
> I second @ExE-Boss's comment.

Need to recheck.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17008#discussion_r1420965152


More information about the core-libs-dev mailing list