Skip to content
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

Issue #11338: FinalClassCheck should report private classes without c… #12737

Merged
merged 1 commit into from
Jun 28, 2023

Conversation

Kevin222004
Copy link
Contributor

@Kevin222004 Kevin222004 commented Feb 11, 2023

Issue #11338: FinalClassCheck should report private classes without constructor

Diff Regression config: https://gist.githubusercontent.com/Kevin222004/2ce4726e677546482c436a000f4b01d9/raw/3faec59c1d2757c5398a5b325d32e43f12c9ca73/finalclass.xml

@Kevin222004
Copy link
Contributor Author

GitHub, generate report

@Kevin222004 Kevin222004 force-pushed the FinalClass branch 3 times, most recently from e64eed0 to 36ce8fb Compare February 11, 2023 21:23
@romani
Copy link
Member

romani commented Feb 12, 2023

@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
and to our sevntu project to fix not-Inputs https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/69b1d89_2023212857/reports/diff/sevntu-checkstyle/index.html

this bug fix is very aggressive :), as nobody noticed this or care much on this "final" in private classes.

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

if amount of violation is such massive, can we offer user some Xpath suppression to let them not be blocked to fix all code to upgrade to new version of checkstyle ?

items:

@Kevin222004
Copy link
Contributor Author

@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

@Kevin222004
Copy link
Contributor Author

@romani please look at the conversation jqno/equalsverifier#770 (comment)

@rnveach
Copy link
Member

rnveach commented Feb 14, 2023

is their any way of ci get passed of seventu.checkstyle repo to not block this pr

Edit:
Sevntu's CI is not a blocker.

@romani
Copy link
Member

romani commented Feb 16, 2023

please move all updates for "final" to separate PR and name commit as "supplemental: ...." we will merge it sooner
example 50e41f4

it will reduce size of this PR and ease review.

@romani
Copy link
Member

romani commented Feb 17, 2023

@rnveach , please help to review this PR.

@Kevin222004
Copy link
Contributor Author

if amount of violation is such massive, can we offer user some Xpath suppression to let them not be blocked to fix all code to upgrade to new version of checkstyle ?

I am really sorry I missed this. I have to study this

@romani
Copy link
Member

romani commented May 25, 2023

We are waiting for state when such conversation is resolved.

@nrmancuso
Copy link
Member

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?

@romani
Copy link
Member

romani commented May 27, 2023

@nrmancuso , please do review, looks like this item is not very critical, just clarification.

@rnveach
Copy link
Member

rnveach commented May 28, 2023

Item seeking clarification on probably either means documentation is not clear enough, or we may need a new issue.

Copy link
Member

@nrmancuso nrmancuso left a comment

Choose a reason for hiding this comment

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

Items:

Comment on lines 62 to 60
* Class is declared as {@code abstract}.
* </li>
* <li>
* Class is Super class of some Anonymous inner class.
* </li>
Copy link
Member

Choose a reason for hiding this comment

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

These also seem like obvious reasons to not place violations on a class; the compiler enforces this.

Copy link
Member

Choose a reason for hiding this comment

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

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).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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 ?

Copy link
Member

Choose a reason for hiding this comment

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

Probably, @rnveach any thoughts on this?

Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have removed the final and abstract one.

I have chnaged the sentence as Class is extended by another class in the same file

#12737 (comment)

@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)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nrmancuso @rnveach ping lets complete this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rnveach ping please continue

Copy link
Member

@nrmancuso nrmancuso left a comment

Choose a reason for hiding this comment

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

Final item from me:

@Kevin222004 Kevin222004 force-pushed the FinalClass branch 2 times, most recently from 3995712 to 52b6892 Compare June 17, 2023 16:36
@Kevin222004
Copy link
Contributor Author

@nrmancuso nrmancuso requested a review from rnveach June 17, 2023 16:44
@nrmancuso nrmancuso assigned rnveach and unassigned nrmancuso Jun 17, 2023
@nrmancuso
Copy link
Member

@rnveach please confirm you are good at #12737 (comment), I am good to merge

@Kevin222004 Kevin222004 force-pushed the FinalClass branch 3 times, most recently from fbb9cb5 to 26842e0 Compare June 23, 2023 15:47
Copy link
Member

@rnveach rnveach left a comment

Choose a reason for hiding this comment

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

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..
Copy link
Member

Choose a reason for hiding this comment

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

Double period.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@Kevin222004
Copy link
Contributor Author

Failure is not related to changes

@Kevin222004
Copy link
Contributor Author

Github, generate site

@Kevin222004
Copy link
Contributor Author

@rnveach can you Please re-run semaphore all the ci are good

@romani
Copy link
Member

romani commented Jun 28, 2023

All CIs are green. PR is ready for final review, @rnveach .

@rnveach rnveach merged commit c3c7ab8 into checkstyle:master Jun 28, 2023
110 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants