Skip to content

Commit

Permalink
chore: don't log missing setter message for records (#20306) (#20308)
Browse files Browse the repository at this point in the history
Java records are immutable, so they do not provide setters for their properties.
However, Flow Binder fully supports writing records by creating new instances
on demand.
This change prevents Binder from logging a useless 'missing setter' log message
for records.

Co-authored-by: Marco Collovati <marco@vaadin.com>
  • Loading branch information
vaadin-bot and mcollovati authored Oct 23, 2024
1 parent ad1ec81 commit c978262
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ private Binding<BEAN, TARGET> bind(String propertyName,
ValueProvider<BEAN, ?> getter = definition.getGetter();
Setter<BEAN, ?> setter = readOnly ? null
: definition.getSetter().orElse(null);
if (!readOnly && setter == null) {
if (!readOnly && setter == null && !binder.isRecord) {
getLogger().info(
propertyName + " does not have an accessible setter");
}
Expand Down

0 comments on commit c978262

Please sign in to comment.