This is an automated email from the ASF dual-hosted git repository.

madhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
     new 522e44513 RANGER-5247: updated Ozone authorizer to replace unused 
instance member with a local variable (#606)
522e44513 is described below

commit 522e4451348091864c87d9ae7358902ac29f3f68
Author: Madhan Neethiraj <[email protected]>
AuthorDate: Sun Jul 13 15:39:13 2025 -0700

    RANGER-5247: updated Ozone authorizer to replace unused instance member 
with a local variable (#606)
---
 .../ozone/authorizer/RangerOzoneAuthorizer.java              | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/plugin-ozone/src/main/java/org/apache/ranger/authorization/ozone/authorizer/RangerOzoneAuthorizer.java
 
b/plugin-ozone/src/main/java/org/apache/ranger/authorization/ozone/authorizer/RangerOzoneAuthorizer.java
index a079b0895..c08e9c0f9 100644
--- 
a/plugin-ozone/src/main/java/org/apache/ranger/authorization/ozone/authorizer/RangerOzoneAuthorizer.java
+++ 
b/plugin-ozone/src/main/java/org/apache/ranger/authorization/ozone/authorizer/RangerOzoneAuthorizer.java
@@ -55,8 +55,6 @@ public class RangerOzoneAuthorizer implements 
IAccessAuthorizer {
 
     private static volatile RangerBasePlugin rangerPlugin;
 
-    RangerDefaultAuditHandler auditHandler;
-
     public RangerOzoneAuthorizer() {
         RangerBasePlugin plugin = rangerPlugin;
 
@@ -69,7 +67,7 @@ public RangerOzoneAuthorizer() {
 
                     plugin.init(); // this will initialize policy engine and 
policy refresher
 
-                    auditHandler = new RangerDefaultAuditHandler();
+                    RangerDefaultAuditHandler auditHandler = new 
RangerDefaultAuditHandler();
 
                     plugin.setResultProcessor(auditHandler);
 
@@ -96,7 +94,9 @@ public boolean checkAccess(IOzoneObj ozoneObject, 
RequestContext context) {
 
         LOG.debug("==> RangerOzoneAuthorizer.checkAccess with operation = {}, 
resource = {}, store type = {}, ugi = {}, ip = {}, resourceType = {}", 
operation, resource, OzoneObj.StoreType.values(), ugi, context.getIp(), 
ozoneObj.getResourceType());
 
-        if (rangerPlugin == null) {
+        RangerBasePlugin plugin = rangerPlugin;
+
+        if (plugin == null) {
             MiscUtil.logErrorMessageByInterval(LOG, "Authorizer is still not 
initialized");
 
             return false;
@@ -128,7 +128,7 @@ public boolean checkAccess(IOzoneObj ozoneObject, 
RequestContext context) {
             return false;
         }
 
-        String                  clusterName   = rangerPlugin.getClusterName();
+        String                  clusterName   = plugin.getClusterName();
         RangerAccessRequestImpl rangerRequest = new RangerAccessRequestImpl();
 
         rangerRequest.setUser(ugi.getShortUserName());
@@ -170,7 +170,7 @@ public boolean checkAccess(IOzoneObj ozoneObject, 
RequestContext context) {
         }
 
         try {
-            RangerAccessResult result = 
rangerPlugin.isAccessAllowed(rangerRequest);
+            RangerAccessResult result = plugin.isAccessAllowed(rangerRequest);
 
             if (result == null) {
                 LOG.error("Ranger Plugin returned null. Returning false");

Reply via email to