On Wed, 5 Jul 2023 19:35:23 GMT, Daniel Jeliński <[email protected]> wrote:
>> src/java.base/share/classes/sun/security/util/BitArray.java line 72:
>>
>>> 70: * specified byte array. The most significant bit of {@code a[0]}
>>> gets
>>> 71: * index zero in the BitArray. The array must be large enough to
>>> specify
>>> 72: * a value for every bit of the BitArray, i.e. {@code 8*a.length >=
>>> length}.
>>
>> The original `<=` was correct, the number of bits in the input array must be
>> less than the requested length of the BitArray. The constructors also
>> describe the length using `<=`; they all should be consistent.
>
> Are you sure? I just checked lines 91-92 and I'd say the change looks correct.
> The original `<=` was correct, the number of bits in the input array must be
> less than the requested length of the BitArray. The constructors also
> describe the length using `<=`; they all should be consistent.
Hm... My reading is that those "i.e." parts state preconditions for the
constructors to return successfully, not preconditions for them to throw an
exception.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14738#discussion_r1253635237