Currently Checkstyle returns 222 occurrences of the message
"Utility classes should not have a public or default constructor."
This is due to https://checkstyle.sourceforge.io/config_design.html#HideUtilityClassConstructor
I don't think we need to follow the "prevents calls from subclass" suggestion there.
I rather suggest to comment out the related class in checkstyle.xml:
ie <!-- <module name="HideUtilityClassConstructor"/> -->
Then should remain only 280 errors and hopefully most will be easy to fix.
At least they will be easier to spot...
Note: I'm working on something else, so I will change
tasks.checkstyleMain.maxErrors from 502 to 280 later...
Thanks: Suraj and Aditya for confirmation
(OFBIZ-11661)
Fixes a known issue with config/checkstyle/checkstyle.xml:
TreeWalker is not allowed as a parent of LineLength Please review 'Parent Module'
section for this Check in web documentation if Check is standard
Mostly manually-automated, so some changes are not perfect. I have manually
changed back excessive ones
Comments out ArrayTypeStyle checkstyle
Updates checkstyleMain.maxErrors
(OFBIZ-11428)
Setting checkstyle to use LF line endings means that a newline at the
end of a source file is correctly detected no matter whether it is
checked out with LF or CRLF line endings.
(OFBIZ-11251)
Linting [1] is a software engineering practice which make the code more
readable and maintainable by improving its consistency and avoiding
potential programming mistakes. Gradle provides a core plugin for the
‘checkstyle’ tool [2][3] which implement a linting facility for the Java
language.
The check is done with the ‘gradlew check’ command.
There are currently a lot reported errors that will need to be fixed
incrementally in the future. We ensure that new errors will not be
introduced by defining a global threshold of “allowed” errors
corresponding to the sum of errors found in the framework and in the
official plugins.
[1] https://en.wikipedia.org/wiki/Lint_(software)
[2] https://checkstyle.org/
[3] https://docs.gradle.org/current/userguide/checkstyle_plugin.html
Thanks: Taher Alkhateeb and Jacques Le Roux for their feedback
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1868597 13f79535-47bb-0310-9956-ffa450edef68