You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve diagnostics when OrderUtils.getPriority encounters an ArrayStoreException during annotation introspection [SPR-12357] #16962
I noticed this while testing the fix for #16930. I was running an app on Tomcat 8 (where javax.annotation.Priority is available).
OrderUtils.getPriority calls Class.getAnnotations() directly so it doesn't benefit from the recent improvements to AnnotationUtils' diagnostics. Could OrderUtils.getPriority be updated to use AnnotationUtils in a similar fashion to OrderUtils.getOrder?
We're detecting @Priority through the regular AnnotationUtils.findAnnotation method now. This has the side benefit of it being detected on a composed annotation as well (even if that's not the intended usage model of that standard annotation, it doesn't hurt for it to work along the lines of our own @Order).
hi, could it be that this change caused a regression in terms of broken jdk 6 compatibility?
i am seeing
java.lang.UnsupportedClassVersionError: javax/annotation/Priority : Unsupported major.minor version 51.0
...
at org.springframework.util.ClassUtils.forName(ClassUtils.java:249)
at org.springframework.core.annotation.OrderUtils.<clinit>(OrderUtils.java:41)
...
and the code looks like only a ClassNotFoundException is expected/caught, but not that java.lang.UnsupportedClassVersionError?
Hmm, this means that you do have the javax.annotation.Priority class on your classpath though... Is this intentional? From a Spring perspective, this is an optional dependency which should only ever be present on JDK 7+ to begin with...
That said, we should be more defensive there and catch any kind of error. Could you please create a separate JIRA issue for it?
hi i just saw that the offending javax.annotation.Priority class ships with tomcat-embed-core-8.x which clearly states that it requires jdk7+. no good idea to try run a jdk6 app on it anyway ;) - ill file the separate jira but for my part, consider it as low prio.
Activity
spring-projects-issues commentedon Oct 21, 2014
Juergen Hoeller commented
We're detecting
@Prioritythrough the regularAnnotationUtils.findAnnotationmethod now. This has the side benefit of it being detected on a composed annotation as well (even if that's not the intended usage model of that standard annotation, it doesn't hurt for it to work along the lines of our own@Order).Juergen
spring-projects-issues commentedon Dec 1, 2014
zyro commented
hi, could it be that this change caused a regression in terms of broken jdk 6 compatibility?
i am seeing
and the code looks like only a ClassNotFoundException is expected/caught, but not that java.lang.UnsupportedClassVersionError?
was testing locally with oracle jdk 1.6.0_45 x64
thanks, zyro
spring-projects-issues commentedon Dec 1, 2014
Juergen Hoeller commented
Hmm, this means that you do have the
javax.annotation.Priorityclass on your classpath though... Is this intentional? From a Spring perspective, this is an optional dependency which should only ever be present on JDK 7+ to begin with...That said, we should be more defensive there and catch any kind of error. Could you please create a separate JIRA issue for it?
Juergen
spring-projects-issues commentedon Dec 1, 2014
zyro commented
hi i just saw that the offending javax.annotation.Priority class ships with tomcat-embed-core-8.x which clearly states that it requires jdk7+. no good idea to try run a jdk6 app on it anyway ;) - ill file the separate jira but for my part, consider it as low prio.
spring-projects-issues commentedon Dec 1, 2014
zyro commented
here you go: #17095 thanks, zyro