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

fix: prevent ImportAnnotationVisitor walking non-visible classes #540

Merged
merged 2 commits into from
Feb 13, 2024

Conversation

timyates
Copy link
Member

The ImportAnnotationVisitor would walk the spring hierarchy and cause package-private classes to have definitions created for them.

This would then fail at runtime, as Micronaut could not access these defined beans.

This fix only visits public classes to prevent this problem.

Closes #521

Added @dstepanov and @graemerocher as reviewers as although this fixes the issue, I'm not 100% sure on my understanding of the mechanisms at play here

The ImportAnnotationVisitor would walk the spring hierarchy and cause package-private classes to have definitions created for them.

This would then fail at runtime, as Micronaut could not access these defined beans.

This fix only visits public classes to prevent this problem.

Closes #521
@timyates timyates added the type: bug Something isn't working label Feb 12, 2024
@timyates timyates self-assigned this Feb 12, 2024
Copy link

sonarcloud bot commented Feb 12, 2024

@sdelamo sdelamo merged commit 6545f3b into master Feb 13, 2024
11 checks passed
@sdelamo sdelamo deleted the import-annotation-visitor-visibility branch February 13, 2024 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Unable to build SpringContext with MicronautApplicationContext as parent
4 participants