sevntu-checkstyle / sevntu.checkstyle

Additional Checkstyle checks, that could be added as extension to EclipseCS plugin and maven-checkstyle-plugin, Sonar checkstyle plugin, extension for CheckStyle IDEA plugin.
http://sevntu-checkstyle.github.io/sevntu.checkstyle/
190 stars 147 forks source link

minor: make private class final with default constructor #985

Closed Kevin222004 closed 1 year ago

Kevin222004 commented 1 year ago

minor: make private class final with default constructor

This is part of https://github.com/checkstyle/checkstyle/pull/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.

Kevin222004 commented 1 year ago

@romani can you please look at https://github.com/sevntu-checkstyle/sevntu.checkstyle/actions/runs/4161396149/jobs/7199330650

romani commented 1 year ago

Violation is

IllegalStateException occurred while parsing file /home/runner/work/sevntu.checkstyle/sevntu.checkstyle/sevntu-checks/.ci-temp/contribution/checkstyle-tester/src/main/java/checkstyle/src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammar/java19/InputJava19PatternsInSwitchLabels.java. 13:34: no viable alternative at input 'switch(o){caseIntegeriwheni>=': NoViableAltException

@nrmancuso , did we miss some update to exclude or bump of checkstyle?

nrmancuso commented 1 year ago

Violation is

IllegalStateException occurred while parsing file /home/runner/work/sevntu.checkstyle/sevntu.checkstyle/sevntu-checks/.ci-temp/contribution/checkstyle-tester/src/main/java/checkstyle/src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammar/java19/InputJava19PatternsInSwitchLabels.java. 13:34: no viable alternative at input 'switch(o){caseIntegeriwheni>=': NoViableAltException

@nrmancuso , did we miss some update to exclude or bump of checkstyle?

Probably in eclipse-cs

rnveach commented 1 year ago

Sevntu's regression on main repo can be ignored. Issue is because CS added new grammar and removed suppressions, but sevntu has not upgraded to CS' new grammar. Sevntu is locked to same version as eclipse-cs which has also not upgraded due to lack of updates and personnel.

romani commented 1 year ago

Eclipsecs is 3 versions behind with blockage to compile at new laptop of maintainer.

We some exclude in sevntu.

rnveach commented 1 year ago

Yes, sevntu would need some fix to make CI green but failure of no-exception (checkstyle) is not a blocker for this PR.