git-code-format-maven-plugin icon indicating copy to clipboard operation
git-code-format-maven-plugin copied to clipboard

Fix java problems

Open duke1995 opened this issue 3 years ago • 0 comments

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

duke1995 avatar May 26 '22 12:05 duke1995