Skip to content

Add a warning to AnnotationReadingVisitorUtils#23408

Closed
marekkrk wants to merge 1 commit into
spring-projects:masterfrom
marekkrk:23406
Closed

Add a warning to AnnotationReadingVisitorUtils#23408
marekkrk wants to merge 1 commit into
spring-projects:masterfrom
marekkrk:23406

Conversation

@marekkrk

@marekkrk marekkrk commented Aug 2, 2019

Copy link
Copy Markdown

Closes gh-23406

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 2, 2019
@sbrannen sbrannen changed the title Added a warning to AnnotationReadingVisitorUtils. Closes 23406 Add a warning to AnnotationReadingVisitorUtils Aug 2, 2019
@sbrannen

sbrannen commented Aug 6, 2019

Copy link
Copy Markdown
Member

Catching Throwable is necessary since such code might throw a LinkageError.

As for logging the exception, that is effectively unnecessary since any attempt to access the value for that attribute later will result in an exception. For example, see AnnotationAttributes#assertNotException(String, Object).

I am therefore closing this PR.

@sbrannen sbrannen closed this Aug 6, 2019
@sbrannen

sbrannen commented Aug 6, 2019

Copy link
Copy Markdown
Member

Having said that, now that I've looked at AnnotationReadingVisitorUtils and AnnotationAttributes#assertNotException(String, Object) again, I noticed that the latter should actually check if (attributeValue instanceof Throwable) instead of if (attributeValue instanceof Exception).

@jhoeller, what do you think about making that change in AnnotationAttributes?

Reopening in order to make a decision regarding this.

@sbrannen

sbrannen commented Aug 6, 2019

Copy link
Copy Markdown
Member

Superseded by gh-23424

@sbrannen sbrannen closed this Aug 6, 2019
@sbrannen sbrannen added status: superseded An issue that has been superseded by another and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: superseded An issue that has been superseded by another

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AnnotationReadingVisitorUtils does not log a warning when it encounters an exception

3 participants