-
-
Notifications
You must be signed in to change notification settings - Fork 637
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
minor: make private class final with default constructor #2740
Conversation
I have given information on this changes in description. can we have your valuable feedback on this changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! This looks good to me
@danieldietrich thanks for reviewing but can give your feedback on this changes usually many people avoid this what is your opinion on this type of changes |
I'll throw in my two cents. Personally and in general, I'm a fan of declaring "effectively final" entities as explicitly |
Yes, that was also my impression. The test code does not need to be checkstyle conform. IMO people overdo checkstyle a bit in real world projects, the cost/income ratio isn't good. it leads to infinite team discussions about minor "improvements". there are rarely major or critical issues found. During the years I got more relaxed on private implementation style. The public API and the overall design are important to me. Having general rules is good. Most of the time, looking at existing code and having proper code reviews is sufficient. In the particular case of your change I also thought: "it does not hurt". Thanks. |
Thanks a lot for feedback. This is why we created this PR to get feedback. |
minor: make private class final with default constructor
This is part of checkstyle/checkstyle#12737
According to the https://docs.oracle.com/javase/specs/jls/se17/html/jls-8.html#jls-8.8.9 The default constructor has the same access modifier as the class.
and according to the check https://checkstyle.org/config_design.html#FinalClass a class that has only private constructors and has no descendant classes is declared as final.