Program: 166435
Project: 166435
Buggy source:
/** 
 * Check if user has privileges to do this action on these objects
 * @param objs
 * @param context
 * @throws HiveAuthzPluginException
 * @throws HiveAccessControlException
 */
public List<HivePrivilegeObject> filterListCmdObjects(List<HivePrivilegeObject> objs,HiveAuthzContext context) throws HiveAuthzPluginException, HiveAccessControlException {
  if (LOG.isDebugEnabled()) {
    LOG.debug(String.format("String_Node_Str",objs,context));
  }
  List<HivePrivilegeObject> ret=null;
  if (objs == null) {
    LOG.debug("String_Node_Str");
  }
 else   if (objs.isEmpty()) {
    LOG.debug("String_Node_Str");
    ret=objs;
  }
 else   if (getCurrentUserGroupInfo() == null) {
    LOG.warn("String_Node_Str");
    ret=objs;
  }
 else {
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + objs.size() + "String_Node_Str");
    }
    UserGroupInformation ugi=getCurrentUserGroupInfo();
    HiveAuthzSessionContext sessionContext=getHiveAuthzSessionContext();
    String user=ugi.getShortUserName();
    Set<String> groups=Sets.newHashSet(ugi.getGroupNames());
    if (LOG.isDebugEnabled()) {
      LOG.debug(String.format("String_Node_Str",user,groups));
    }
    if (ret == null) {
      ret=new ArrayList<HivePrivilegeObject>(objs.size());
    }
    for (    HivePrivilegeObject privilegeObject : objs) {
      if (LOG.isDebugEnabled()) {
        HivePrivObjectActionType actionType=privilegeObject.getActionType();
        HivePrivilegeObjectType objectType=privilegeObject.getType();
        String objectName=privilegeObject.getObjectName();
        String dbName=privilegeObject.getDbname();
        List<String> columns=privilegeObject.getColumns();
        List<String> partitionKeys=privilegeObject.getPartKeys();
        String commandString=context.getCommandString();
        String ipAddress=context.getIpAddress();
        final String format="String_Node_Str";
        LOG.debug(String.format(format,actionType,objectType,objectName,dbName,columns,partitionKeys,commandString,ipAddress));
      }
      RangerHiveResource resource=createHiveResource(privilegeObject);
      RangerHiveAccessRequest request=new RangerHiveAccessRequest(resource,user,groups,context,sessionContext);
      RangerAccessResult result=hivePlugin.isAccessAllowed(request);
      if (result == null) {
        LOG.error("String_Node_Str");
      }
 else       if (!result.getIsAllowed()) {
        if (!LOG.isDebugEnabled()) {
          String path=resource.getAsString(result.getServiceDef());
          LOG.debug(String.format("String_Node_Str",user,request.getHiveAccessType().name(),path));
        }
      }
 else {
        if (LOG.isDebugEnabled()) {
          LOG.debug(String.format("String_Node_Str",resource,request,result));
        }
        ret.add(privilegeObject);
      }
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug(String.format("String_Node_Str",ret == null ? 0 : ret.size()));
    LOG.debug(String.format("String_Node_Str",objs,context,ret));
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Check if user has privileges to do this action on these objects
 * @param objs
 * @param context
 * @throws HiveAuthzPluginException
 * @throws HiveAccessControlException
 */
public List<HivePrivilegeObject> filterListCmdObjects(List<HivePrivilegeObject> objs,HiveAuthzContext context) throws HiveAuthzPluginException, HiveAccessControlException {
  if (LOG.isDebugEnabled()) {
    LOG.debug(String.format("String_Node_Str",objs,context));
  }
  List<HivePrivilegeObject> ret=null;
  if (objs == null) {
    LOG.debug("String_Node_Str");
  }
 else   if (objs.isEmpty()) {
    LOG.debug("String_Node_Str");
    ret=objs;
  }
 else   if (getCurrentUserGroupInfo() == null) {
    LOG.warn("String_Node_Str");
    ret=objs;
  }
 else {
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + objs.size() + "String_Node_Str");
    }
    UserGroupInformation ugi=getCurrentUserGroupInfo();
    HiveAuthzSessionContext sessionContext=getHiveAuthzSessionContext();
    String user=ugi.getShortUserName();
    Set<String> groups=Sets.newHashSet(ugi.getGroupNames());
    if (LOG.isDebugEnabled()) {
      LOG.debug(String.format("String_Node_Str",user,groups));
    }
    if (ret == null) {
      ret=new ArrayList<HivePrivilegeObject>(objs.size());
    }
    for (    HivePrivilegeObject privilegeObject : objs) {
      if (LOG.isDebugEnabled()) {
        HivePrivObjectActionType actionType=privilegeObject.getActionType();
        HivePrivilegeObjectType objectType=privilegeObject.getType();
        String objectName=privilegeObject.getObjectName();
        String dbName=privilegeObject.getDbname();
        List<String> columns=privilegeObject.getColumns();
        List<String> partitionKeys=privilegeObject.getPartKeys();
        String commandString=context.getCommandString();
        String ipAddress=context.getIpAddress();
        final String format="String_Node_Str";
        LOG.debug(String.format(format,actionType,objectType,objectName,dbName,columns,partitionKeys,commandString,ipAddress));
      }
      RangerHiveResource resource=createHiveResource(privilegeObject);
      if (resource == null) {
        LOG.error("String_Node_Str");
      }
 else {
        RangerHiveAccessRequest request=new RangerHiveAccessRequest(resource,user,groups,context,sessionContext);
        RangerAccessResult result=hivePlugin.isAccessAllowed(request);
        if (result == null) {
          LOG.error("String_Node_Str");
        }
 else         if (!result.getIsAllowed()) {
          if (!LOG.isDebugEnabled()) {
            String path=resource.getAsString(result.getServiceDef());
            LOG.debug(String.format("String_Node_Str",user,request.getHiveAccessType().name(),path));
          }
        }
 else {
          if (LOG.isDebugEnabled()) {
            LOG.debug(String.format("String_Node_Str",resource,request,result));
          }
          ret.add(privilegeObject);
        }
      }
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug(String.format("String_Node_Str",ret == null ? 0 : ret.size()));
    LOG.debug(String.format("String_Node_Str",objs,context,ret));
  }
  return ret;
}