mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-27 09:39:04 +00:00
Prior to this commit, we used ClassUtils.resolveClassName() in TypeMappedAnnotation.adapt(...) which throws an IllegalStateException or IllegalArgumentException if a type referenced by an annotation attribute cannot be loaded. However, if such an error occurs while using the JDK's reflection APIs, a TypeNotPresentException is thrown instead. In order to align with the standard behavior of the JDK, this commit modifies TypeMappedAnnotation.adapt(...) to use ClassUtils.forName() and throw a TypeNotPresentException in such scenarios. This commit also makes similar changes in MergedAnnotationReadingVisitor and ClassFileAnnotationDelegate. Closes gh-36593