You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/05/27 14:57:12 UTC

[GitHub] [kafka] ijuma commented on a change in pull request #10764: MINOR: make sure all fiedls of o.p.k.s.a.Action are NOT null

ijuma commented on a change in pull request #10764:
URL: https://github.com/apache/kafka/pull/10764#discussion_r640705924



##########
File path: clients/src/main/java/org/apache/kafka/server/authorizer/Action.java
##########
@@ -36,22 +36,22 @@ public Action(AclOperation operation,
                   int resourceReferenceCount,
                   boolean logIfAllowed,
                   boolean logIfDenied) {
-        this.operation = operation;
-        this.resourcePattern = resourcePattern;
+        this.operation = Objects.requireNonNull(operation, "operation can't be null");
+        this.resourcePattern = Objects.requireNonNull(resourcePattern, "resourcePattern can't be null");
         this.logIfAllowed = logIfAllowed;
         this.logIfDenied = logIfDenied;
         this.resourceReferenceCount = resourceReferenceCount;
     }
 
     /**
-     * Resource on which action is being performed.
+     * Resource on which action is being performed. never null

Review comment:
       I would include this in the sentence, "Returns a non-null resource pattern on which this action is being performed".




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

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