You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting from 24.5, Binder officially supports Java records. However, GridEditor needs an update before developers can use them smoothly.
Since records are immutable by design, they seem to make sense primarily in buffered mode, which was originally designed to prevent changes to beans until save() is explicitly called. Using records in buffered mode today leads to exceptions when calling save() because it uses Binder API that's incompatible with records.
Describe the solution you'd like
Update buffered mode to work with Java records
Add a note in the setBuffered() JavaDoc recommending buffered mode for records
Furthermore, editItem(T item) could throw an exception requiring to enable buffered mode if item is a record. However, there is evidence that some applications are already using records in non-buffered mode with custom workarounds. The exception will break them forcing developers to rewrite potentially a significant part of the code.
Describe your motivation
Starting from 24.5, Binder officially supports Java records. However, GridEditor needs an update before developers can use them smoothly.
Since records are immutable by design, they seem to make sense primarily in buffered mode, which was originally designed to prevent changes to beans until
save()
is explicitly called. Using records in buffered mode today leads to exceptions when callingsave()
because it uses Binder API that's incompatible with records.Describe the solution you'd like
setBuffered()
JavaDoc recommending buffered mode for recordsFurthermore,
editItem(T item)
could throw an exception requiring to enable buffered mode if item is a record. However, there is evidence that some applications are already using records in non-buffered mode with custom workarounds. The exception will break them forcing developers to rewrite potentially a significant part of the code.Additional context
#6755 (comment)
The text was updated successfully, but these errors were encountered: