[ 
https://issues.apache.org/jira/browse/SLING-12785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17952949#comment-17952949
 ] 

Eric Norman commented on SLING-12785:
-------------------------------------

If I understand the scenario correctly, this is in relation to rendering the 
string value of an enum in the output and not related to comparing equality of 
two (string or enum) values.

In that case, the enum to string coercion is somewhat ambiguous.  Maybe this 
can be solved with documentation since all the scenarios are solvable with a 
more specific expression?

For example:
 * ${enum1.KEY1}
 * ${enum1.KEY1.name}
 * ${enum1.KEY1.toString}

If there all already people using it that way it has been maybe it is not 
useful to change it now?

> Change default coercion from Enum to String to leverage toString() instead of 
> name()
> ------------------------------------------------------------------------------------
>
>                 Key: SLING-12785
>                 URL: https://issues.apache.org/jira/browse/SLING-12785
>             Project: Sling
>          Issue Type: Improvement
>          Components: HTL
>    Affects Versions: Scripting HTL Runtime 1.2.6-1.4.0
>            Reporter: Konrad Windszus
>            Priority: Major
>
> In SLING-5825 support for conversion from Enum to String was added to HTL. 
> However the implementation uses {{Enum.name()}} instead of 
> {{Enum.toString()}}. This is unusual and should be changed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to