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

Dániel Dékány commented on FREEMARKER-183:
------------------------------------------

This is how it is at the moment: 
[https://github.com/apache/freemarker/tree/FREEMARKER-183]

Instead of solely focusing on records, I have added two new settings to 
`BeansWrapper`/`DefaultObjectWrapper`:    `ZeroArgumentNonVoidMethodPolicy 
nonRecordZeroArgumentNonVoidMethodPolicy`, and
`ZeroArgumentNonVoidMethodPolicy recordZeroArgumentNonVoidMethodPolicy`.  Then, 
if `incomplatibleImprovement` set to 2.3.33, 
`recordZeroArgumentNonVoidMethodPolicy` defaults to `BOTH_PROPERTY_AND_METHOD` 
(so then `obj.foo`, and `obj.foo()` will do the same). If someone wants to go 
for the less backward compatible but cleaner approach, they can chose 
`PROPERTY_ONLY` for the same.

> 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)

Reply via email to