HDDS-14934. Enable ConsecutiveAppendsShouldReuse rule in PMD#10008
HDDS-14934. Enable ConsecutiveAppendsShouldReuse rule in PMD#10008adoroszlai merged 5 commits intoapache:masterfrom
Conversation
Gargi-jais11
left a comment
There was a problem hiding this comment.
Thanks @ptlrs for the patch.
After you raised the PR there are many places which needs changes for .append chaining in DiskBalancerReportSubcommand. Please update this as well.
Rest LGTM.
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks @ptlrs for the patch. I would like to suggest splitting the change for BigIntegerInstantiation into a separate task. While there is only one exact violation, some other BigInteger creation can also be improved. Created HDDS-14955 for that.
…-14934-ConsecutiveAppendsShouldReuse
|
Thanks for the reviews @Gargi-jais11 @adoroszlai, I have updated the PR. Could you please take another look? |
Gargi-jais11
left a comment
There was a problem hiding this comment.
Thanks @ptlrs for updating the patch. LGTM!
|
Thanks @ptlrs for updating the patch, @Gargi-jais11 for the review. |
What changes were proposed in this pull request?
This PR enables new PMD rules:
ConsecutiveAppendsShouldReuse Consecutive calls to
StringBuffer/StringBuilder.appendshould be chained, reusing the target object. This can improve the performance by producing a smaller bytecode, reducing overhead and improving inliningWhat is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14934
How was this patch tested?
CI: https://github.com/ptlrs/ozone/actions/runs/23761982025