git-code-format-maven-plugin
git-code-format-maven-plugin copied to clipboard
Fix java problems
@reda-alaoui
This branch contains quick fixes for some Java problems which were reported by my IDE (Visual Studio Code with SonarLint extension).
FYI: I didn't make any changes for the following warnings in src/main/java/com/cosium/code/format/AbstractModuleMavenGitCodeFormatMojo.java:
Rename "excludedModules" which hides the field declared at line 25. Rename "includedModules" which hides the field declared at line 22.
Local variables should not shadow class fields.
I thought about renaming these local variables to "nullSafeExcludedModules" and "nullSafeIncludedModules" respectively, because the reason to introduce these variables seems to be to have a null-safe version of the class fields, but I'm not sure if this would be better in this case, since one should always use the non-null local variables in these methods anyway, not the shadowed class fields which may be null.