Samuel Fleischle wrote on Friday, September 14, 2007 9:19 AM:

> Hi Jörg,
> 
> thanks for your quick response and your approach to solve
> this issue. But anyway I think it should be possible to add
> these Enums to a Set without throwing a ClassCastException
> regardless of which class, anonymous inner class or whatever else the
> Enum is. 

Well, this is what is excplicitly documented in the JDK's docs for 
Comparable.compareTo(). The ValueEnum must ensure that it does not compare 
apples and oranges and two different classes imply this.

The exception was surprising for you, since the old version of CL simply did 
this, but I'd rather declare that impl of compareTo as buggy ;-)

- Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to