micronaut-projects / micronaut-spring

A collection of utilities for Spring users of Micronaut
Apache License 2.0
159 stars 46 forks source link

fix: prevent ImportAnnotationVisitor walking non-visible classes #540

Closed timyates closed 4 months ago

timyates commented 4 months ago

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

sonarcloud[bot] commented 4 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
80.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud