You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "adoroszlai (via GitHub)" <gi...@apache.org> on 2024/02/07 21:31:44 UTC

[PR] HDDS-10322. Make VolumeArgs immutable [ozone]

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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-10322. Make VolumeArgs immutable [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #6193:
URL: https://github.com/apache/ozone/pull/6193#issuecomment-1934997858

   Thanks @Galsza, @smengcl for the review.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-10322. Make VolumeArgs immutable [ozone]

Posted by "Galsza (via GitHub)" <gi...@apache.org>.
Galsza commented on PR #6193:
URL: https://github.com/apache/ozone/pull/6193#issuecomment-1933618489

   Thank you Attila for the change, looking good to me


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-10322. Make VolumeArgs immutable [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #6193:
URL: https://github.com/apache/ozone/pull/6193


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org