deniskuzZ commented on code in PR #5924:
URL: https://github.com/apache/hive/pull/5924#discussion_r2205111085


##########
hcatalog/core/src/main/java/org/apache/hive/hcatalog/common/HCatUtil.java:
##########
@@ -335,33 +323,24 @@ public static boolean validateMorePermissive(FsAction 
first, FsAction second) {
    *         by execute permissions
    */
   public static boolean validateExecuteBitPresentIfReadOrWrite(FsAction perms) 
{
-    if ((perms == FsAction.READ) || (perms == FsAction.WRITE)
-      || (perms == FsAction.READ_WRITE)) {
-      return false;
-    }
-    return true;
+    return (perms != FsAction.READ) && (perms != FsAction.WRITE)
+        && (perms != FsAction.READ_WRITE);
   }
 
   public static 
Token<org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier>
 getJobTrackerDelegationToken(
-    Configuration conf, String userName) throws Exception {
-    // LOG.info("getJobTrackerDelegationToken("+conf+","+userName+")");
-    JobClient jcl = new JobClient(new JobConf(conf, HCatOutputFormat.class));
-    
Token<org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier>
 t = jcl
-      .getDelegationToken(new Text(userName));
-    // LOG.info("got "+t);
+        Configuration conf, String userName) throws Exception {
+    
Token<org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier>
 t;
+    try (JobClient jcl = new JobClient(new JobConf(conf, 
HCatOutputFormat.class))) {
+      t = jcl.getDelegationToken(new Text(userName));

Review Comment:
   changed



-- 
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: gitbox-unsubscr...@hive.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to