Repository navigation
fix: reject AI form value not matching field value type - #10619
Merged
Merged
Conversation
vaadin-review-bot
left a comment
Collaborator
There was a problem hiding this comment.
✅ Nothing to flag — the changes look good.
|
sissbruecker
self-requested a review
November 9, 2026 11:48
sissbruecker
approved these changes
Nov 9, 2026
vaadin-bot
added a commit
that referenced
this pull request
Nov 9, 2026
… 25.3) (#10620) This PR cherry-picks changes from the original PR #10619 to branch 25.3. --- > ## Description > > Follow-up to #10569 > Related to #10569 (comment) > > `FormAIController` passed the converted `fill_form` value to `setValue` without checking it against the field's value type. A field whose value type has no type mapping, such as `UUID`, is listed as a string field, so it got a `String`. The field accepted it and the app failed later with a `ClassCastException`. #10569 fixed this for number fields; this change adds a general check for all fields. > > - Added a check after conversion that compares the value with the field's `HasValue<?, V>` value type > - A value that does not match is rejected with "Field cannot be filled: its value type is not supported." and the field keeps its old value. The types are logged at debug level. > - Fields whose value type cannot be resolved, such as a generic `ComboBox<T>`, are not checked. > - Resolved parameterized value types such as `List<String>` to their raw class, so these fields are also checked. Field classification does not change. > - Added tests for a `UUID` field including the debug log, a `List` field, and a select field whose items contain `null` > > ## Type of change > > - Bugfix > Co-authored-by: Tomi Virkki <tomivirkki@users.noreply.github.com>
Collaborator
|
This ticket/PR has been released with Vaadin 25.4.0-alpha6. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Follow-up to #10569
Related to #10569 (comment)
FormAIControllerpassed the convertedfill_formvalue tosetValuewithout checking it against the field's value type. A field whose value type has no type mapping, such asUUID, is listed as a string field, so it got aString. The field accepted it and the app failed later with aClassCastException. #10569 fixed this for number fields; this change adds a general check for all fields.HasValue<?, V>value typeComboBox<T>, are not checked.List<String>to their raw class, so these fields are also checked. Field classification does not change.UUIDfield including the debug log, aListfield, and a select field whose items containnullType of change