ivandika3 commented on code in PR #6396:
URL: https://github.com/apache/ozone/pull/6396#discussion_r1531442045
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OzoneAcl.java:
##########
@@ -58,17 +59,12 @@ public class OzoneAcl {
private final AclScope aclScope;
private static final List<ACLType> EMPTY_LIST = new ArrayList<>(0);
- // TODO use varargs constructor
- public OzoneAcl(ACLIdentityType type, String name, ACLType acl, AclScope
scope) {
- this(type, name, scope, bitSetOf(acl));
- }
-
public OzoneAcl(ACLIdentityType type, String name, AclScope scope,
ACLType... acls) {
this(type, name, scope, bitSetOf(acls));
}
- public OzoneAcl(ACLIdentityType type, String name, BitSet acls, AclScope
scope) {
- this(type, name, scope, validateAndCopy(acls));
+ public OzoneAcl(ACLIdentityType type, String name, AclScope scope,
EnumSet<ACLType> acls) {
+ this(type, name, scope, bitSetOf(acls.toArray(new ACLType[0])));
Review Comment:
The reason of using `toArray(newACLType[0])` is to enforce the runtime type?
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OzoneAcl.java:
##########
@@ -58,17 +59,12 @@ public class OzoneAcl {
private final AclScope aclScope;
private static final List<ACLType> EMPTY_LIST = new ArrayList<>(0);
- // TODO use varargs constructor
- public OzoneAcl(ACLIdentityType type, String name, ACLType acl, AclScope
scope) {
- this(type, name, scope, bitSetOf(acl));
- }
-
public OzoneAcl(ACLIdentityType type, String name, AclScope scope,
ACLType... acls) {
this(type, name, scope, bitSetOf(acls));
}
- public OzoneAcl(ACLIdentityType type, String name, BitSet acls, AclScope
scope) {
- this(type, name, scope, validateAndCopy(acls));
+ public OzoneAcl(ACLIdentityType type, String name, AclScope scope,
EnumSet<ACLType> acls) {
+ this(type, name, scope, bitSetOf(acls.toArray(new ACLType[0])));
Review Comment:
The reason of using `toArray(new ACLType[0])` is to enforce the runtime type?
--
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]