While working on #20279, I noticed that annotation searches for non-public repeatable annotations fail on JDK 17 with an error similar to the following.
Failed to introspect annotations on void org.springframework.core.annotation.NestedRepeatableAnnotationsTests$MultipleRepeatableAnnotationsTests.annotatedMethod():
java.lang.IllegalAccessError: failed to access class org.springframework.core.annotation.NestedRepeatableAnnotationsTests$A from class jdk.proxy2.$Proxy12 (org.springframework.core.annotation.NestedRepeatableAnnotationsTests$A is in unnamed module of loader 'app'; jdk.proxy2.$Proxy12 is in module jdk.proxy2 of loader 'app')
The reason is that we cannot invoke the value()
method of the container annotation.
This means that we cannot "deduce" the container type of a repeatable annotation, and when that fails our annotation support then fails to find any matching repeatable annotations of the given type. An INFO message is logged like the one above, but the search algorithm otherwise silently continues without finding anything.
I also see the following on 5.3.x
with JDK 8.
Failed to introspect annotations on void org.springframework.core.annotation.NestedRepeatableAnnotationsTests$MultipleRepeatableAnnotationsTests.annotatedMethod():
java.lang.IllegalAccessError: tried to access class org.springframework.core.annotation.NestedRepeatableAnnotationsTests$A from class com.sun.proxy.$Proxy12
So it is not specific JDK 17, although the error message is slightly different.