-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-10325. Make BucketArgs immutable #6205
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
Conversation
|
|
||
| private static BitSet bitSetOf(ACLType... acls) { | ||
| BitSet bits = new BitSet(); | ||
| if (acls != null && acls.length > 0) { |
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.
| if (acls != null && acls.length > 0) { | |
| if (acls != null) { |
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.
What's the problem with acls.length > 0?
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.
The length > 0 is handled implicitly by the for loop, so its not really needed. I guess this is a nit - change it if there are other comments, otherwise it will do no harm.
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.
I know that it's not strictly necessary. I have two problems:
- Don't know the runtime cost of creating an iterator for the empty array in the for loop behind the scene. Maybe the compiler optimizes it away.
- Running full CI again for such a cosmetic change does not seem worth the effort. Especially when the reviewer cannot spend the extra 10 seconds to write "nit:" or something like that.
sodonnel
left a comment
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.
LGTM
kerneltime
left a comment
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.
Just one minor nit
|
Thanks @kerneltime, @sodonnel for the review. |
What changes were proposed in this pull request?
Fix findbugs warnings by making
BucketArgsimmutable. See #6193 for similar change inVolumeArgs.Also eliminate
@SuppressWarnings("parameternumber")by passing the builder to the constructor, instead of individual properties.Create new constructor in
OzoneAclto simplify instantiation with multipleACLType(avoid the need to mess withBitSet).https://issues.apache.org/jira/browse/HDDS-10325
How was this patch tested?
CI:
https://github.com/adoroszlai/ozone/actions/runs/7843743627