RFR: 8288761: SegmentAllocator:allocate(long bytesSize) not throwing IAEx when bytesSize < 0

Maurizio Cimadamore mcimadamore at openjdk.org
Mon Jun 20 21:29:57 UTC 2022


The various SegmentAllocator subclasses do not check for the constraints mentioned in the javadoc.
This patch pulls the checks into a common routine in the Utils class, and then call that check routine from all the `allocate` implementations.

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

Commit messages:
 - Add comments in allocation check
 - Initial push

Changes: https://git.openjdk.org/jdk19/pull/50/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk19&pr=50&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8288761
  Stats: 59 lines in 5 files changed: 43 ins; 13 del; 3 mod
  Patch: https://git.openjdk.org/jdk19/pull/50.diff
  Fetch: git fetch https://git.openjdk.org/jdk19 pull/50/head:pull/50

PR: https://git.openjdk.org/jdk19/pull/50


More information about the core-libs-dev mailing list