Spring Framework currently shades ASM for several features:
- bytecode generation with cglib
- reading class metadata from bytecode
Our usage of ASM is not a problem these days and we tend to allow use of up-to-date JDK versions in Spring apps thanks to swift upgrades of our shaded version. Still, we should consider our options with the new ClassFile API.
Spring Framework maintains two implementations of metadata reading: one based on Class reflection (org.springframework.core.type.StandardClassMetadata) and another one based on bytecode reading with ASM (org.springframework.core.type.classreading.SimpleMetadataReaderFactory). This API does not expose any ASM type and is a good use case for the ClassFile API.
The ClassFile API JEP 457 is currently in preview mode but should be out of preview for JDK 24.
With this issue, we should:
Spring Framework currently shades ASM for several features:
Our usage of ASM is not a problem these days and we tend to allow use of up-to-date JDK versions in Spring apps thanks to swift upgrades of our shaded version. Still, we should consider our options with the new ClassFile API.
Spring Framework maintains two implementations of metadata reading: one based on
Classreflection (org.springframework.core.type.StandardClassMetadata) and another one based on bytecode reading with ASM (org.springframework.core.type.classreading.SimpleMetadataReaderFactory). This API does not expose any ASM type and is a good use case for the ClassFile API.The ClassFile API JEP 457 is currently in preview mode but should be out of preview for JDK 24.
With this issue, we should:
SimpleMetadataReaderFactorybased on ClassFile