Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mnhock
Copy link
Member

@mnhock mnhock commented Nov 11, 2025

Closes #219

@mnhock mnhock added this to the 1.44.0 milestone Nov 11, 2025
@mnhock mnhock self-assigned this Nov 11, 2025
@mnhock mnhock added the enhancement New feature or request label Nov 11, 2025
@mnhock mnhock linked an issue Nov 11, 2025 that may be closed by this pull request
@mnhock mnhock merged commit e5c5b80 into main Nov 11, 2025
2 checks passed
@sonarqubecloud
Copy link

@mnhock mnhock deleted the 219-add-new-rule-to-ensure-configuration-classes-are-records branch November 11, 2025 16:48
@patbaumgartner
Copy link

Hi @mnhock - Why do you think configuration classes should be records? I couldn't find anything regarding the real why in the documentation. I am asking because records are final classes and cant be extended by cglib as a cglib proxy. Therefore, one must really pay attention when using bean method-handles to reference spring beans.

Of course, I am aware that all @AutoConfigurations do implement proxyBeanMethods=false but this was a deliberate choice of the Spring Boot team, to not use bean method references. For performance reasons.

Maybe checking for proxyBeanMethods=false and not using the bean methods at all, would be a good addition.

@mnhock
Copy link
Member Author

mnhock commented Nov 11, 2025

Hi @patbaumgartner! Thank you so much to point this out! This was planned for Properties not for Configuration classes. I will change this. THANKS

@patbaumgartner
Copy link

Yay! Thanks @mnhock - I think it fits for @ConfigurationProperties without any limitation issues. :))

mnhock added a commit that referenced this pull request Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add New Rule to Ensure Configuration Classes Are Records

3 participants