commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Speakmon (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LANG-331) Fix for LANG-259 broke ValuedEnum.compareTo() on subclassed enumerations
Date Mon, 12 Nov 2007 20:56:51 GMT

    [ https://issues.apache.org/jira/browse/LANG-331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12541949
] 

Ben Speakmon commented on LANG-331:
-----------------------------------

It's just ugly in there... :(

I agree with Stephen that it was a Bad Idea; that aside, I don't see any easy way to address
this. Henri's fix will take care of compareTo(), but it also breaks equals(). My first thought
was to replace the enum classname Map with an ordinal assigned at creation time, but that'll
break serialization for 2.2/2.3 users. Argh.

It's not ideal now, but I don't know how to fix this without breaking something else. Maybe
we should push this back to 3.0 where we can have a more general discussion about the purpose
of Enum.

> Fix for LANG-259 broke ValuedEnum.compareTo() on subclassed enumerations
> ------------------------------------------------------------------------
>
>                 Key: LANG-331
>                 URL: https://issues.apache.org/jira/browse/LANG-331
>             Project: Commons Lang
>          Issue Type: Bug
>            Reporter: Michael Sclafani
>             Fix For: 2.4
>
>         Attachments: LANG-331-test.patch, LANG-331.patch
>
>
> I have a ValuedEnum abstract subclass that I further subclass to attach useful implementation
behaviors. The base class overrides getEnumClass(). The fix for LANG-259 broke compareTo()
since it compares getClass(), not getEnumClass().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message