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

David Holmes dholmes at dltech.com.au
Mon Sep 5 18:32:53 EDT 2005


I wrote:
> 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.

Sorry I lost the context a little. If you retrofit your code to implement
NavigableSet then the other code will break - otherwise the other code will
still work in Java 6.

The choice really comes down to how bad you want to implement NavigableSet.

For what it is worth that instanceof test should be written the other way
regardless - always look for the most specific type first, which in this
case is your implementation class.

David Holmes



More information about the Concurrency-interest mailing list