-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Remove extra variable #2398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove extra variable #2398
Conversation
This reverts commit 32d9512.
|
||
String substValue = processSubstitution( | ||
variable, org, cycleMap, configProps, callback, postprocessor, defaultsToEmptyString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, should be covered by https://pmd.github.io/pmd/pmd_rules_java_bestpractices.html#unusedassignment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems its currently renaming not removal.
@@ -283,7 +283,7 @@ private static String doSubstVars( | |||
} | |||
|
|||
private static String processSubstitution( | |||
String variable, | |||
final String variable, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boilerplate tradeoff naturally evolves to https://pmd.github.io/pmd/pmd_rules_java_bestpractices.html#avoidreassigningparameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I don't like final parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assuming you mean the explicit final
declaration. Params should be treated final by default
to avoid coupling, thus bugs.
Test failures might be related but unclear why it only fails on java 21 |
@@ -284,8 +283,7 @@ private static String doSubstVars( | |||
} | |||
|
|||
private static String processSubstitution( | |||
String variable, | |||
String org, | |||
final String variable, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final String variable, | |
String variable, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the final parameter, otherwise looks good.
pr title? it seems more re |
No, it's definitely removed |
yes sorry from 7 to 6 params. |
org is unclear and unneeded. Probably meant "original"? In any case, we don't need it.