commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <>
Subject Re: [lang] immutable BitSet
Date Tue, 29 Oct 2019 00:09:30 GMT

2019-10-29 0:16 UTC+01:00, Claude Warren <>:
> Having "ImmutableBitSet" inherit from "BitSet" breaks the latter's
> contract.
> no more

Yes, more, AFAICT...

> so than the ImmutableSet breaks the Set contract.

... because "Set" is an interface whose contract explicitly mentions
some operations as "optional".  Not so for the "BitSet" class.

> Yes it does but
> the pattern is well established.

There will be practical problems (e.g. if the upstream class adds a mutating
method, not yet overridden by this extension).

Immutability cannot be added after the fact.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message