[concurrency-interest] Navigable{Map, Set} must not inherit fromSorted{Map, Set}

David Holmes dholmes at dltech.com.au
Mon Sep 5 18:19:38 EDT 2005

> It works so i prefer not to touch it if it's possible.

But it won't work in Java 6 so you are going to have to do something
regardless and inverting the test is a simple fix.

> It seems not a good idea to have to rewrite a code because i want to
> retrofit a class.

If the retrofit is perfectly compatible with what you have then there would
be no need to rewrite things. But you are trying to retrofit something that
is incompatible with what you have. The simple solution is "don't do that".

The choice was made that a NavigableSet isA SortedSet. You have a situation
where you'd like the functionality of NavigableSet but your implementation
is not a SortedSet and doesn't want to be. Something has to give.

David Holmes

More information about the Concurrency-interest mailing list