Reduce nested class lookups in ClassUtils #31258
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 working on #31213, I have noticed that Framework performs more class lookups than we thought.
For example, we need to register reflection on
jakarta.inject.Inject
types; even if the type is not present on the classpath at build time, the application might try to load it at runtime anyway. If the class is not present at runtime,ClassUtils#forName
will try to load bothjakarta.inject.Inject
andjakarta.inject$Inject
.While I understand the rationale for nested classes, I think we need to consider the following proposals:
org.example.Spring.Issue
->org.example.Spring$Issue
. This could also benefit most JVM applications by reducing the amount of unnecessary lookups.Any opinion @jhoeller @snicoll ?
The text was updated successfully, but these errors were encountered: