Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build-logic/src/main/resources/substrait-pmd.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

<rule ref="category/java/codestyle.xml/UnnecessaryModifier" />
<rule ref="category/java/codestyle.xml/FieldDeclarationsShouldBeAtStartOfClass" />
<rule ref="category/java/codestyle.xml/FinalParameterInAbstractMethod" />
<rule ref="category/java/codestyle.xml/LocalVariableCouldBeFinal" />
<rule ref="category/java/codestyle.xml/MethodArgumentCouldBeFinal" />
Copy link
Member

Choose a reason for hiding this comment

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

I am definitely in favor of the first two FinalParameterInAbstractMethod and LocalVariableCouldBeFinal, but I am less convinced about introducing MethodArgumentCouldBeFinal. It looks like a lot noise is introduced in this PR by bringing in that rule. Considering that usage of final doesn't actually prevent mutation of the object, just reassignment to a new object, it doesn't seem that useful.

We also already have the immutables library to protect against mutation for the classes for which that matters.

Happy to be convinced though if there is a compelling reason to switch to using final.

<rule ref="category/java/codestyle.xml/UseExplicitTypes" />
<rule ref="category/java/bestpractices.xml/JUnit5TestShouldBePackagePrivate" />
<rule ref="category/java/bestpractices.xml/MissingOverride" />
Expand Down
Loading