Resolve nested bean properties with generic context - #37276
Open
dlwhdgus0810 wants to merge 1 commit into
Open
dlwhdgus0810 wants to merge 1 commit into
dlwhdgus0810 wants to merge 1 commit into
Conversation
Retain the declaring property type when creating nested bean wrappers, and use its generic context for property and container conversions. Preserve more specific types supplied by concrete runtime classes. Closes spring-projectsgh-27760 Signed-off-by: Hyun Lee <dlwhdugs4147@gmail.com>
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.
Closes gh-27760.
Nested properties such as
Filter<State>.valuelose their declared enum type when binding moves into theFilterinstance. Binding then stores a String or fails against the raw Enum bound.Preserve the enclosing property's generic context in nested bean wrappers and use it for property and container conversion. Keep more specific runtime-class types and keep contextual descriptors separate from shared introspection metadata. No public API is added.
Validation (JDK 25):
spring-beanssuite: 2,306 tests, no failures, 9 existing skips.DataBinderTests: 81 tests, no failures.spring-beansCheckstyle checks pass.Coverage includes bounded and unbounded enum parameters, nested beans, list/map entries, optional values, arrays, distinct generic declarations, conversion services and runtime subclasses.