spring-projects / spring-framework

Spring Framework
https://spring.io/projects/spring-framework
Apache License 2.0
56.55k stars 38.13k forks source link

AOT generates a raw type for a generic type with nested unresolved generics #33069

Closed snicoll closed 4 months ago

snicoll commented 4 months ago

Initially reported by @odrotbohm on Spring Restbucks.

There is a check in code generator for ResolvableType: https://github.com/spring-projects/spring-framework/blob/ce49354400936778b7a7a1e6ec1a373d2a1fa5cb/spring-core/src/main/java/org/springframework/aot/generate/ValueCodeGeneratorDelegates.java#L334

There have been several refinements in the core container and its type detection algorithm. I suspect that it's smarter at finding out about such unresolved generics in nested types. It unfortunately means we're taking the wrong decision now, writing the raw type instead of the type with it's top-level generic signature.

snicoll commented 4 months ago

The check was introduced by https://github.com/spring-projects/spring-framework/issues/29454