On Mon, 20 Nov 2023 17:39:19 GMT, Glavo <d...@openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/jimage/decompressor/StringSharingDecompressor.java
>>  line 94:
>> 
>>> 92:                                    int offset, long originalSize) 
>>> throws IOException {
>>> 93:         if (originalSize > Integer.MAX_VALUE) {
>>> 94:             throw new OutOfMemoryError("Required array size too large");
>> 
>> Is this the correct exception type?
>
>> Is this the correct exception type?
> 
> I'm not sure, but I think it shouldn't matter, since the exception is never 
> really thrown here for a valid jimage file.

It's common to throw `OutOfMemoryError` when a requested array size would be 
too large, either due overflow or because some other limitation (see 
`StringUTF16::newBytesFor` or `String::replace` for some examples).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16556#discussion_r1399840037

Reply via email to