Skip to content

Resolve nested bean properties with generic context - #37276

Open
dlwhdgus0810 wants to merge 2 commits into
spring-projects:mainfrom
dlwhdgus0810:fix-nested-generic-enum-binding
Open

dlwhdgus0810 wants to merge 2 commits into
spring-projects:mainfrom
dlwhdgus0810:fix-nested-generic-enum-binding

Conversation

@dlwhdgus0810

@dlwhdgus0810 dlwhdgus0810 commented Sep 15, 2026

Copy link
Copy Markdown

Closes gh-27760.

Nested properties such as Filter<State>.value lose their declared enum type when binding moves into the Filter instance. 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):

  • The 12 new regression/control cases produce 10 failures on unmodified upstream and all pass with the fix.
  • Full spring-beans suite after integrating current main: 2,411 tests, no failures or errors, 9 skips.
  • DataBinderTests: 87 tests, no failures.
  • spring-beans Checkstyle checks pass. All 12 generic regression/control cases still pass after integrating the upstream PropertyPath refactor.

Coverage includes bounded and unbounded enum parameters, nested beans, list/map entries, optional values, arrays, distinct generic declarations, conversion services and runtime subclasses.

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>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 15, 2026
Retain the PropertyPath resolver and contextual generic type handling.

See spring-projectsgh-37276

Signed-off-by: Hyun Lee <dlwhdugs4147@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged or decided on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resolving generic enum types (Enum<T>) in nested bean properties

2 participants