Reintroduce FastClass
in CGLIB class names for @Configuration
classes
#31272
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
theme: aot
An issue related to Ahead-of-time processing
type: enhancement
A general enhancement
Milestone
While investigating the cause of the regression reported in #31238, I noticed that Spring Framework makes multiple attempts to create CGLIB proxy classes for
@Configuration
classes before actually instantiating the proxy instance.For example, if you run the
transactionProxyIsCreated()
test method inEnableTransactionManagementTests
and introduce tracing for proxy classes generated, you will see something similar to the following.The last line (
>>>> class ...
) denotes the actual generated class ($TxManagerConfig$$SpringCGLIB$$0
) that was used to instantiate the proxy for theTxManagerConfig
configuration class; however,$TxManagerConfig$$SpringCGLIB$$1
and$TxManagerConfig$$SpringCGLIB$$2
were also created in the interim even though they were not used in the end.In addition, all of the generated proxy classes for a given
@Configuration
class are recorded by Spring AOT and stored in a GraalVM native image.Ideally, those interim classes should not be generated. Thus, it appears that there is an issue with cache key, and this appears to be a regression.
The following can be used to track which proxy classes are loaded.
The text was updated successfully, but these errors were encountered: