On Thu, 13 Jul 2023 10:50:30 GMT, Pavel Rappo <[email protected]> wrote:
> Please review this PR to use modern APIs and language features to simplify > equals for BitSet. > > I couldn't see how to refactor hashCode using Arrays utility methods in a way > that preserves its specification. So, aside from refactoring its doc comment > and annotating it with `@Overrides`, I left it intact. TIL about toLongArray.. BitSet#equals would be more correct if it called set.toLongArray, but at a cost of an extra copy. --- I appreciate the desire to call checkInvariants; I've written some checkInvariants methods myself, but I comment out any calls to them in the production copy of the code. Optional runtime checking has not really succeeded in Java. ------------- PR Comment: https://git.openjdk.org/jdk/pull/14868#issuecomment-1642742978
