[
https://issues.apache.org/jira/browse/FREEMARKER-183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17785104#comment-17785104
]
Simon commented on FREEMARKER-183:
----------------------------------
I very much believe that the 3rd option should *not* be the default:
* When using a record you generally don't specify the accessor methods, so
when converting to a class you need to create the methods and generally in the
IDE you get it to generate the getters and setters from the fields for you. I
don't think you accidentally create record-style methods. Even if they're not
properly distinguishing about it, I still believe that they think: records look
like this and "classes" (beans) look like that.
* If I add a method like {{public String toJson()}} to a class/record then I
expect to treat it like any other FreeMarker method and if it only works when I
omit the brackets then that's confusing, potentially exacerbated by suddenly
needing a different syntax if I decide that the method should take a parameter
(e.g. a boolean in this example).
* As a breaking change, it would be breaking more than just records.
> 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)