Issue #11338: FinalClassCheck should report private classes without c…#12737
Issue #11338: FinalClassCheck should report private classes without c…#12737rnveach merged 1 commit intocheckstyle:masterfrom
Conversation
|
GitHub, generate report |
e64eed0 to
36ce8fb
Compare
|
@Kevin222004 , please send PR to our plugin to fix https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/69b1d89_2023212857/reports/diff/checkstyle-sonar/index.html this bug fix is very aggressive :), as nobody noticed this or care much on this "final" in private classes. |
src/main/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheck.java
Outdated
Show resolved
Hide resolved
...ces/com/puppycrawl/tools/checkstyle/checks/design/finalclass/InputFinalClassPrivateCtor.java
Outdated
Show resolved
Hide resolved
36ce8fb to
b97a432
Compare
|
@romani all the pr in other repo has been merged. is their any way of ci get passed of seventu.checkstyle repo to not block this pr |
|
@romani please look at the conversation jqno/equalsverifier#770 (comment) |
Edit: |
b97a432 to
8a85122
Compare
8a85122 to
305fddd
Compare
|
please move all updates for "final" to separate PR and name commit as "supplemental: ...." we will merge it sooner it will reduce size of this PR and ease review. |
|
@rnveach , please help to review this PR. |
I am really sorry I missed this. I have to study this |
305fddd to
676ddbe
Compare
|
We are waiting for state when such conversation is resolved. |
@romani to be clear, this means that we are waiting on resolution of #12737 (comment) to continue review? |
|
@nrmancuso , please do review, looks like this item is not very critical, just clarification. |
|
Item seeking clarification on probably either means documentation is not clear enough, or we may need a new issue. |
src/main/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheck.java
Outdated
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheck.java
Outdated
Show resolved
Hide resolved
| * Class is declared as {@code abstract}. | ||
| * </li> | ||
| * <li> | ||
| * Class is Super class of some Anonymous inner class. | ||
| * </li> |
There was a problem hiding this comment.
These also seem like obvious reasons to not place violations on a class; the compiler enforces this.
There was a problem hiding this comment.
Really, it seems like this whole section is unnecessary since it can be summed up as "we don't place violations on code that already meets criteria (class is final) or is not compilable", since both conditions are already implied by (a) all checks work like this, and (b) Checkstyle should not be ran on code that doesn't compile (this is already documented elsewhere).
There was a problem hiding this comment.
we don't place violations on code that already meets criteria (class is final) or is not compilable
you are right this are all the case as you mentioned above.
@nrmancuso should we remove the entire section ?
There was a problem hiding this comment.
I was the one who requested this list.
Some things weren't clear and once I asked more about one of the items, I think its like a bug. #12737 (comment)
I don't see Class is Super class of some Anonymous inner class being clear to me.
The first 2 just make sense since we started a list, but I am ok with them removed.
There was a problem hiding this comment.
I have removed the final and abstract one.
I have chnaged the sentence as Class is extended by another class in the same file
@rnveach again the purpose of
I don't see Class is Super class of some Anonymous inner class being clear to me. #12737 (comment)
is to show #12737 (comment)
There was a problem hiding this comment.
One mistake that I have made is, have blindly copy paste some names without thinking in docs which is misleading in code as well #12737 (comment)
There was a problem hiding this comment.
@nrmancuso @rnveach ping lets complete this
src/main/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheck.java
Outdated
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheck.java
Outdated
Show resolved
Hide resolved
3995712 to
52b6892
Compare
|
https://app.circleci.com/pipelines/github/checkstyle/checkstyle/18998/workflows/1895fe46-9610-451b-86dc-4c89a91bf1d3/jobs/311465 Failure is not related to changes |
|
@rnveach please confirm you are good at #12737 (comment), I am good to merge |
fbb9cb5 to
26842e0
Compare
rnveach
left a comment
There was a problem hiding this comment.
Ensure we are rebased on the latest master and once this is fixed then I think we should be good.
| * Class is Super class of some Anonymous inner class. | ||
| * </li> | ||
| * <li> | ||
| * Class is extended by another class in the same file.. |
|
Failure is not related to changes |
|
Github, generate site |
… without constructor
|
@rnveach can you Please re-run semaphore all the ci are good |
|
All CIs are green. PR is ready for final review, @rnveach . |
Issue #11338: FinalClassCheck should report private classes without constructor
Diff Regression config: https://gist.githubusercontent.com/Kevin222004/2ce4726e677546482c436a000f4b01d9/raw/3faec59c1d2757c5398a5b325d32e43f12c9ca73/finalclass.xml