RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors [v2]

Joe Darcy darcy at openjdk.org
Wed Nov 1 22:07:03 UTC 2023


On Wed, 1 Nov 2023 14:52:23 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

>> Enhance `java.math.BigInteger` constructors taking a `byte[]` argument by improving guarantees of internal invariants.
>
> Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Static Random instance.

src/java.base/share/classes/java/math/BigInteger.java line 350:

> 348:      */
> 349:     public BigInteger(byte[] val, int off, int len) {
> 350:         Objects.checkFromIndexSize(off, len, val.length);

Does this change which exception get thrown if multiple pre-conditions are violated? That is okay, but if that is the case, the issue should get a quick CSR for the behavioral change.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16449#discussion_r1379377580


More information about the core-libs-dev mailing list