On 27/09/2010 03:39, sbrejeon wrote:
> The spec says that "If A or B is an enum, coerce both A and B to enum, apply
> operator".
> Does't it simply mean that both A and B must be coercible to enums. instead
> of if A is an enum then B must be an enum of type A, or vice versa.

No. Both must be of the same type. There are several reasons for this:
- There is no provision in the EL spec for enum to enum type conversion
via a string value
- If both A & B are enums, should both values be coerced to enum A or
enum B? One may work whilst the other fails. If the spec permitted this
then the behaviour in this case would need to be defined. It isn't.
- Section 1.17 is clear the String values must be used to trigger enum
type conversion

> Like the original creator of this post, I have a series of enums of
> different types that implement a common interface. I need to be able to
> compare them and I don't want to have to translate them to Strings.

The EL spec doesn't support what you are trying to do.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to