Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnnotationUtils provides poor diagnostics if getDeclaredAnnotations throws an exception [SPR-12325] #16930

Closed
spring-projects-issues opened this issue Oct 13, 2014 · 3 comments
Assignees
Labels
in: core status: backported type: enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Oct 13, 2014

Andy Wilkinson opened SPR-12325 and commented

This is a follow-on from #16493, triggered by this bug report against Spring Boot.

PR showing how this could be further improved to follow.


Affects: 4.0.7, 4.1.1

Issue Links:

  • #16493 AnnotationUtils.findAnnotation fails with poor diagnostics if it encounters an Annotation that references an unloadable class
  • #16934 Regression: Commons Logging setup in AnnotationUtils causes early initialization of logging system
  • #16960 Favor more locally declared composed annotations over interface annotations in AnnotationUtils
  • #18364 Defensive error reporting when ConfigurationClassParser introspects declared methods via StandardAnnotationMetadata
  • #16962 Improve diagnostics when OrderUtils.getPriority encounters an ArrayStoreException during annotation introspection
  • #16995 Improve diagnostics when AnnotationAttributesReadingVisitor triggers an ArrayStoreException from Class.getAnnotations()
  • #17487 AnnotatedElementUtils should leniently ignore TypeNotPresentExceptions (just like AnnotationUtils)

Referenced from: commits e16f21c, 47dde91, 716916b

Backported to: 4.0.8

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 13, 2014

Andy Wilkinson commented

Hi, Juergen. Here's a pull request for the change that I think needs to be made: #660. It makes exception handling for calls to getDeclaredAnnotations consistent within AnnotationUtils.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 21, 2014

Andy Wilkinson commented

For the scenario described in this Boot issue the changed made in this commit has made the diagnostics worse as things now fail silently. This catch block that returns null without logging is the culprit. Could it be updated to also call logIntrospectionFailure?

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 21, 2014

Juergen Hoeller commented

Oops, that was a plain oversight after refactoring. To be pushed along with the fix for #16962.

Juergen

@spring-projects-issues spring-projects-issues added status: backported type: enhancement in: core labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.1.2 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core status: backported type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants