[
https://issues.apache.org/jira/browse/FREEMARKER-183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17784328#comment-17784328
]
Dániel Dékány commented on FREEMARKER-183:
------------------------------------------
It's clear that this will have to be solved (and urgently at this point), and
also that there's no proper solution without breaking backward compatibility an
bit. So yes, it's fine that the solution will require setting incompatible
improvements.
Probably this should be a `BeansWrapper` (or just `DefaultObjectWrapper`)
setting, like "zeroArgumentMethodsAreProperties" with possible values NONE,
IN_RECORDS, ALL, and then the default of that changes depending on the
`incompatibleImprovements` of the `BeansWrapper` instance (not on the
`incompatibleImprovements` of `Configuration` the configuration). Note the by
default the `objectWrapper` setting in the `Configuration` will be a
`DefaultObjectWrapper` (which extends `BeansWrapper`) with matching
`incompatibleImprovements`, so if somebody doesn't set the `objectWrapper`
explicitly (most users don't), then increasing the `incompatibleImprovements`
of the `Configuration` will be enough. (We already have this somewhat
confusing, but IMO necessary mechanism for many other
`incompatibleImprovements`-dependent behavior.)
> 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)