Skip to content

Collect nested generic arguments when resolving type signatures - #3531

Open
arimu1 wants to merge 1 commit into
spring-projects:mainfrom
arimu1:GH-3530
Open

Collect nested generic arguments when resolving type signatures#3531
arimu1 wants to merge 1 commit into
spring-projects:mainfrom
arimu1:GH-3530

Conversation

@arimu1

@arimu1 arimu1 commented Aug 22, 2026

Copy link
Copy Markdown
  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

DefaultAotRepositoryContext.discoverTypes() collects reachable domain types via TypeCollector.inspect(…), which delegates to TypeUtils.resolveTypesInSignature. Cycle detection used the raw Class, so a nested parameterization of a type already seen (for example V in Map<K, Map<K, V>>) was skipped. One-level Map<K, V> was collected as expected.

This change visits generic arguments using the ResolvableType signature instead of the raw class, so nested component types are included in the AOT type set used for accessor generation.

TypeCollectorUnitTests.detectsTypesNestedMoreThanOneGenericLevel fails on current main (EmptyType2 missing) and passes with this change.

Closes #3530

`TypeUtils.resolveTypesInSignature` skipped nested arguments of a raw type that was already seen, so `V` in `Map<K, Map<K, V>>` was missing from the AOT type set.

Closes spring-projects#3530

Signed-off-by: arimu1 <19286898+arimu1@users.noreply.github.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 22, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AOT accessor generation does not consider nested types more than 1 level of depth

2 participants