On Wed, 6 Dec 2023 23:31:26 GMT, Roger Riggs <rri...@openjdk.org> 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 
> string size against the maximum byte array size. The exception message is 
> correct
> 
> "UTF16 String size is " + len + ", should be less than or equal to " + 
> MAX_LENGTH
> 
> The code should match the message, otherwise the exception thrown is: 
> 
> java.lang.OutOfMemoryError: Requested array size exceeds VM limit

This pull request has now been integrated.

Changeset: 4fb5c128
Author:    Roger Riggs <rri...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/4fb5c12813c6d447709d3fef690387ddab0e8dae
Stats:     118 lines in 2 files changed: 109 ins; 7 del; 2 mod

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

Reviewed-by: rgiulietti

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

PR: https://git.openjdk.org/jdk/pull/17008

Reply via email to