On Thu, 19 Jan 2023 14:03:38 GMT, fabioromano1 <d...@openjdk.org> wrote:
> Libraries cannot be all things to all users. A library provides a service > that would be difficult for a majority of users to implement on their own. > Sometimes a library needs specialization for certain use cases. That is why > we use subclassing and wrappers to extend existing libraries. > > I think you will find that most BitSet users (including the JDK itself) want > basic bit operations with a minimal overhead. If there was additional > overhead, many would then roll their own versions to avoid that overhead. We > have conflicting goals. > > BitSet has served all JDK users well since JDK 1.0. I think your concerns are > valid, but better cardinality would be best implemented as a subclass > (CardinalBitSet?) of BitSet. Once constructed, you could then propose the > addition to java.util with a CSR. > > If you want to make a case for `includes(BitSet)` that should be proposed as > a separate CSR. I think it will be better to call it "NaturalsBitSet" to highlight the fact that the class represents a set of non-negative integers, am I wrong? ------------- PR: https://git.openjdk.org/jdk/pull/11837