Skip to content

Skip scoped .class references in AddConfigurationAnnotationIfBeansPresent#1007

Merged
timtebeek merged 3 commits intomainfrom
tim/class-ref-skip
Apr 29, 2026
Merged

Skip scoped .class references in AddConfigurationAnnotationIfBeansPresent#1007
timtebeek merged 3 commits intomainfrom
tim/class-ref-skip

Conversation

@timtebeek
Copy link
Copy Markdown
Member

@timtebeek timtebeek commented Apr 23, 2026

Summary

Test plan

  • ./gradlew test --tests AddConfigurationAnnotationIfBeansPresentTest (9/9 pass)

…Present`

Convert the recipe to a `ScanningRecipe` that first collects FQNs of
classes referenced as scoped configuration via `.class` literals in
`@FeignClient`, `@EnableFeignClients`, `@LoadBalancerClient`, and
`@LoadBalancerClients`, then skips adding `@Configuration` to those
classes so their per-client/per-target scope is preserved.
Copy link
Copy Markdown

@kosmaty kosmaty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@timtebeek timtebeek marked this pull request as ready for review April 29, 2026 08:56
@timtebeek timtebeek merged commit 1ac6130 into main Apr 29, 2026
1 check passed
@timtebeek timtebeek deleted the tim/class-ref-skip branch April 29, 2026 09:03
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

"Spring Boot 2.x best practices" recipe breaks Feign clients

2 participants