commons-dev mailing list archives

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

2019-10-29 0:16 UTC+01:00, Claude Warren <claude@xenei.com>:
> 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.

Regards,
Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message