Attila Doroszlai created HDDS-10515:
---------------------------------------

             Summary: Reduce OzoneAcl constructor count
                 Key: HDDS-10515
                 URL: https://issues.apache.org/jira/browse/HDDS-10515
             Project: Apache Ozone
          Issue Type: Improvement
            Reporter: Attila Doroszlai
            Assignee: Attila Doroszlai


Unify {{OzoneAcl}} constructors, using the varargs one:

{code}
  public OzoneAcl(ACLIdentityType type, String name, AclScope scope, ACLType... 
acls) {
    this(type, name, scope, bitSetOf(acls));
  }
{code}

The one with single {{ACLType}} can simply be replaced:

{code}
  public OzoneAcl(ACLIdentityType type, String name, ACLType acl, AclScope 
scope) {
    this(type, name, scope, bitSetOf(acl));
  }
{code}

Callers of the one with {{BitSet}} can be changed to work with {{EnumSet}} of 
{{ACLType}} instead of bits:

{code}
  public OzoneAcl(ACLIdentityType type, String name, BitSet acls, AclScope 
scope) {
    this(type, name, scope, validateAndCopy(acls));
  }
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to