[
https://issues.apache.org/jira/browse/FREEMARKER-183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17794779#comment-17794779
]
Simon commented on FREEMARKER-183:
----------------------------------
That all sounds like good stuff.
I think the following probably doesn't need to be said, especially as you were
just giving an aside, but just in case:
As I tried to demonstrate in my previous comment, for:
{{value()}} - a record component accessor method
{{doubleValue()}} - a trivial method on a record providing derived state
{{launchNukes()}} - a method probably doing something expensive and mutating
shared/persistent state
Java itself doesn't have a way of determining the difference between
{{doubleValue}} and {{launchNukes}} (whilst it knows that {{value}} is a
component).
Yes, we no longer have the convention from beans to declare something as a
property and therefore (supposedly) benign.
I would argue that the intention of records is that all of their methods should
implicitly be benign (although perhaps that's the idea for any data object,
which is really what templates should be passed).
> Add support for Java records
> ----------------------------
>
> Key: FREEMARKER-183
> URL: https://issues.apache.org/jira/browse/FREEMARKER-183
> Project: Apache Freemarker
> Issue Type: Task
> Reporter: Dániel Dékány
> Assignee: Dániel Dékány
> Priority: Major
>
> Currently we don't support records (JEP 395), which was finalized in Java 16.
> Users can extend {{DefaultObjectWrapper}} for that of course, but it should
> be supported out of the box.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)