keith-turner commented on code in PR #3746:
URL: https://github.com/apache/accumulo/pull/3746#discussion_r1668895384


##########
core/src/main/java/org/apache/accumulo/core/security/Authorizations.java:
##########
@@ -385,4 +385,21 @@ public String serialize() {
 
     return sb.toString();
   }
+
+  /**
+   * Converts to an Accumulo Access Authorizations object.
+   *
+   * @since 3.1.0
+   */
+  public org.apache.accumulo.access.Authorizations toAccessAuthorizations() {
+    if (auths.isEmpty()) {
+      return org.apache.accumulo.access.Authorizations.of(Set.of());

Review Comment:
   Looking at the impl of `Set.of()` in my ide it does not allocate any 
objects, it always returns a statically initialized immutable empty set. Then 
with the eventual changes in accumulo-access this line will do no obj 
allocations, however it does that in a very round about way.   
   
   Should probably add a `Authorizations.of()` method to follow javas 
conventions.  Also would make it consistent w/ `AccessExpression.of()`.  If 
`Authorizations.of()` existed then this could be more straightforward.



-- 
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]

Reply via email to