adoroszlai opened a new pull request, #6193: URL: https://github.com/apache/ozone/pull/6193
## What changes were proposed in this pull request? Fix findbugs warnings by making `VolumeArgs` immutable. ``` M V EI: org.apache.hadoop.ozone.client.VolumeArgs.getAcls() may expose internal representation by returning VolumeArgs.acls At VolumeArgs.java:[line 107] M V EI: org.apache.hadoop.ozone.client.VolumeArgs.getMetadata() may expose internal representation by returning VolumeArgs.metadata At VolumeArgs.java:[line 103] M V EI2: org.apache.hadoop.ozone.client.VolumeArgs$Builder.setAcls(List) may expose internal representation by storing an externally mutable object into VolumeArgs$Builder.listOfAcls At VolumeArgs.java:[line 165] ``` Findbugs complains about `get...` method even if the corresponding field is initialized using `Collections.unmodifiable...`. Two possible ways to solve the problem: 1. wrap in `unmodifiable...` in `get...` method 2. use `Immutable...` collection (from Guava) and declare the field as such This patch uses the second approach. https://issues.apache.org/jira/browse/HDDS-10322 ## How was this patch tested? ``` $ hadoop-ozone/dev-support/checks/findbugs.sh -Dspotbugs.version=4.8.3.0 $ grep -c 'client.VolumeArgs' target/findbugs/summary.txt 0 ``` CI: https://github.com/adoroszlai/ozone/actions/runs/7820568596 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
