RFR: 8311170: Simplify and modernize equals and hashCode in security area [v4]

Daniel Jeliński djelinski at openjdk.org
Wed Jul 5 19:37:54 UTC 2023


On Wed, 5 Jul 2023 18:11:41 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Pavel Rappo has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
>> 
>>  - Merge branch 'master' into 8311170
>>  - Be consistent with the rest of the change
>>  - Fix reported bugs
>>  - Add even more cases and tidy up
>>  - More cases
>>  - Initial commit
>
> 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.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14738#discussion_r1253548582



More information about the security-dev mailing list