The ConcurrentReferenceCachingMetadataReaderFactory
type has been present since Spring Boot 1.4 and its main difference with Framework's CachingMetadataReaderFactory
is that it is also caching entries by their class names, effectively bypassing a resource loader call.
Since https://github.com/spring-projects/spring-framework/issues/33616, Spring Framework can now use the ClassFile API if a Java 24+ runtime is used. ConcurrentReferenceCachingMetadataReaderFactory
extends the ASM-powered version and will prevent the ClassFile variant from being used.
This is a problem because the ClassFile API allows Spring Boot applications to use recent Java versions (even branch builds!), especially if the bytecode version is not yet supported by our ASM arrangement.
With this issue, we should consider removing this type and maybe request an enhancement in Framework's CachingMetadataReaderFactory
if we believe the performance improvement is still worth it these days.
Comment From: philwebb
See #4993 for more background. Perhaps we can keep the shared reader but use delegation rather than extension.