Issue regarding hugeLength() method of ArraysSupport class in java.internal.util package

Ananya Nayak ananyanayak102 at gmail.com
Wed Jul 27 06:25:14 UTC 2022


After analysing the method declaration carefully I realized some bugs in
the code:

 1.the if condition on seeing min length as less than 0 returns out of
memory error with a message that "required length is too large" which is
contradictory to what we are checking in the condition.

2. We should actually return the out of memory error when it exceeds the
SOFT_ARRAY_MAX_LENGTH.

3. Moreover we are returning minLength in the third condition when we
actually shouldn't because it exceeds the limit

Kindly verify this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20220727/01339c3d/attachment.htm>


More information about the core-libs-dev mailing list