jakartaee / expression-language

Jakarta Expression Language
https://eclipse.org/ee4j/el
Other
68 stars 49 forks source link

Enum coerced to String should use toString() #14

Closed glassfishrobot closed 3 years ago

glassfishrobot commented 14 years ago

When an Enum is coerced to a String, the spec says Enum.name() should be used. It makes more sense to use Enum.toString().

To be addressed in the el.next

Environment

Operating System: All Platform: All

Affected Versions

[current]

glassfishrobot commented 6 years ago
glassfishrobot commented 14 years ago

@glassfishrobot Commented Reported by kchung

glassfishrobot commented 14 years ago

@glassfishrobot Commented Was assigned to uel-issues

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA UEL-14

markt-asf commented 4 years ago

This is effectively an API change. As such it needs to wait until at least Jakarta EE 10.

It runs the risk of breaking existing applications. The fix would be to explicitly call name() e.g. ${ TestEnum.VALUE.name() }.

I'm wondering what the cost/benefit looks like for a typical user. I'm leaning towards just closing this although it does no harm to leave it open until work starts on Jakarta EE 10 as that givers users an opportunity to express their reasons for needing this change.

markt-asf commented 3 years ago

No-one has expressed a reason why this functionality is required in the last year so I am closing this. There is always the option to re-open the issue if a use case emerges.