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

2023-12-08 Thread Raffaello Giulietti
On Fri, 8 Dec 2023 19:50:30 GMT, Roger Riggs wrote: >> In the compact string implementation of non-latin1 (UTF16) strings the >> length is constrained by VM implementation limit on the size a byte array >> that can be allocated. To produce a useful exception the implementation >> checks the

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

2023-12-08 Thread Roger Riggs
On Fri, 8 Dec 2023 19:32:02 GMT, Raffaello Giulietti 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:

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

2023-12-08 Thread Roger Riggs
> In the compact string implementation of non-latin1 (UTF16) strings the length > is constrained by VM implementation limit on the size a byte array that can > be allocated. To produce a useful exception the implementation checks the > string size against the maximum byte array size. The