nus-yam/ex-repair huggingface dataset:
Program: 166399
Project: 166399
Buggy source:
@Override @SuppressWarnings("String_Node_Str") protected XXServiceBase mapViewToEntityBean(RangerService vObj,XXServiceBase xObj,int OPERATION_CONTEXT){
  String guid=(StringUtils.isEmpty(vObj.getGuid())) ? guidUtil.genGUID() : vObj.getGuid();
  xObj.setGuid(guid);
  xObj.setVersion(vObj.getVersion());
  XXServiceDef xServiceDef=daoMgr.getXXServiceDef().findByName(vObj.getType());
  if (xServiceDef == null) {
    throw restErrorUtil.createRESTException("String_Node_Str" + vObj.getType(),MessageEnums.INVALID_INPUT_DATA);
  }
  Long tagServiceId=null;
  String tagServiceName=vObj.getTagService();
  if (!StringUtils.isEmpty(tagServiceName)) {
    XXService xTagService=daoMgr.getXXService().findByName(tagServiceName);
    if (xTagService == null) {
      throw restErrorUtil.createRESTException("String_Node_Str" + tagServiceName,MessageEnums.INVALID_INPUT_DATA);
    }
    tagServiceId=xTagService.getId();
  }
  xObj.setType(xServiceDef.getId());
  xObj.setName(vObj.getName());
  xObj.setTagService(tagServiceId);
  xObj.setPolicyVersion(vObj.getPolicyVersion());
  xObj.setPolicyUpdateTime(vObj.getPolicyUpdateTime());
  xObj.setDescription(vObj.getDescription());
  xObj.setIsEnabled(vObj.getIsEnabled());
  return xObj;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") protected XXServiceBase mapViewToEntityBean(RangerService vObj,XXServiceBase xObj,int OPERATION_CONTEXT){
  String guid=(StringUtils.isEmpty(vObj.getGuid())) ? guidUtil.genGUID() : vObj.getGuid();
  xObj.setGuid(guid);
  xObj.setVersion(vObj.getVersion());
  XXServiceDef xServiceDef=daoMgr.getXXServiceDef().findByName(vObj.getType());
  if (xServiceDef == null) {
    throw restErrorUtil.createRESTException("String_Node_Str" + vObj.getType(),MessageEnums.INVALID_INPUT_DATA);
  }
  Long tagServiceId=null;
  String tagServiceName=vObj.getTagService();
  if (!StringUtils.isEmpty(tagServiceName)) {
    XXService xTagService=daoMgr.getXXService().findByName(tagServiceName);
    if (xTagService == null) {
      throw restErrorUtil.createRESTException("String_Node_Str" + tagServiceName,MessageEnums.INVALID_INPUT_DATA);
    }
    tagServiceId=xTagService.getId();
  }
  xObj.setType(xServiceDef.getId());
  xObj.setName(vObj.getName());
  xObj.setTagService(tagServiceId);
  xObj.setPolicyVersion(vObj.getPolicyVersion());
  xObj.setTagVersion(vObj.getTagVersion());
  xObj.setPolicyUpdateTime(vObj.getPolicyUpdateTime());
  xObj.setTagUpdateTime(vObj.getTagUpdateTime());
  xObj.setDescription(vObj.getDescription());
  xObj.setIsEnabled(vObj.getIsEnabled());
  return xObj;
}
Program: 166400
Project: 166400
Buggy source:
public RangerAdminTagRetriever(final String serviceName,final long pollingIntervalMs,final RangerTagReceiver enricher){
  super(pollingIntervalMs);
  this.serviceName=serviceName;
  setReceiver(enricher);
  propertyPrefix=propertyPrefixPreamble + serviceName;
  this.lastTimestamp=0L;
}

Fixed version (ground truth):
public RangerAdminTagRetriever(final String serviceName,final RangerServiceDef serviceDef,final long pollingIntervalMs,final RangerTagReceiver enricher){
  super(pollingIntervalMs);
  this.serviceName=serviceName;
  setReceiver(enricher);
  propertyPrefix=propertyPrefixPreamble + serviceDef.getName();
  this.lastTimestamp=0L;
}
Program: 166401
Project: 166401
Buggy source:
@Override public void init(){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str");
  }
  super.init();
  Map<String,String> options=enricherDef != null ? enricherDef.getEnricherOptions() : null;
  String tagProviderTypeString=getOption("String_Node_Str","String_Node_Str");
  long pollingIntervalMs=getLongOption("String_Node_Str",60 * 1000);
  if (tagProviderTypeString.equals(TagProviderTypeEnum.FILESTORE_BASED_TAG_PROVIDER.toString())) {
    tagRefresher=new RangerTagFileStoreRetriever(serviceName,pollingIntervalMs,this);
    tagProviderType=TagProviderTypeEnum.FILESTORE_BASED_TAG_PROVIDER;
  }
 else   if (tagProviderTypeString.equals(TagProviderTypeEnum.RANGER_ADMIN_TAG_PROVIDER.toString())) {
    tagRefresher=new RangerAdminTagRetriever(serviceName,pollingIntervalMs,this);
    tagProviderType=TagProviderTypeEnum.RANGER_ADMIN_TAG_PROVIDER;
  }
 else   if (tagProviderTypeString.equals(TagProviderTypeEnum.EXTERNAL_SYSTEM_TAG_PROVIDER.toString())) {
    tagProviderType=TagProviderTypeEnum.EXTERNAL_SYSTEM_TAG_PROVIDER;
  }
 else {
    LOG.error("String_Node_Str");
  }
  if (tagRefresher != null) {
    tagRefresher.init(options);
    tagRefresher.retrieveTags();
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + tagProviderType);
  }
}

Fixed version (ground truth):
@Override public void init(){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str");
  }
  super.init();
  Map<String,String> options=enricherDef != null ? enricherDef.getEnricherOptions() : null;
  String tagProviderTypeString=getOption("String_Node_Str","String_Node_Str");
  long pollingIntervalMs=getLongOption("String_Node_Str",60 * 1000);
  if (tagProviderTypeString.equals(TagProviderTypeEnum.FILESTORE_BASED_TAG_PROVIDER.toString())) {
    tagRefresher=new RangerTagFileStoreRetriever(serviceName,pollingIntervalMs,this);
    tagProviderType=TagProviderTypeEnum.FILESTORE_BASED_TAG_PROVIDER;
  }
 else   if (tagProviderTypeString.equals(TagProviderTypeEnum.RANGER_ADMIN_TAG_PROVIDER.toString())) {
    tagRefresher=new RangerAdminTagRetriever(serviceName,serviceDef,pollingIntervalMs,this);
    tagProviderType=TagProviderTypeEnum.RANGER_ADMIN_TAG_PROVIDER;
  }
 else   if (tagProviderTypeString.equals(TagProviderTypeEnum.EXTERNAL_SYSTEM_TAG_PROVIDER.toString())) {
    tagProviderType=TagProviderTypeEnum.EXTERNAL_SYSTEM_TAG_PROVIDER;
  }
 else {
    LOG.error("String_Node_Str");
  }
  if (tagRefresher != null) {
    tagRefresher.init(options);
    tagRefresher.retrieveTags();
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + tagProviderType);
  }
}
Program: 166403
Project: 166403
Buggy source:
private RangerContextEnricher buildContextEnricher(RangerServiceDef.RangerContextEnricherDef enricherDef){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + enricherDef + "String_Node_Str");
  }
  RangerContextEnricher ret=null;
  String name=enricherDef != null ? enricherDef.getName() : null;
  String clsName=enricherDef != null ? enricherDef.getEnricher() : null;
  if (!StringUtils.isEmpty(clsName)) {
    try {
      @SuppressWarnings("String_Node_Str") Class<RangerContextEnricher> enricherClass=(Class<RangerContextEnricher>)Class.forName(clsName);
      ret=enricherClass.newInstance();
    }
 catch (    Exception excp) {
      LOG.error("String_Node_Str" + clsName + "String_Node_Str"+ name+ "String_Node_Str",excp);
    }
  }
  if (ret != null) {
    ret.setContextEnricherDef(enricherDef);
    ret.setContextServiceName(serviceName);
    ret.setContextServiceDef(componentServiceDef);
    ret.init();
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + enricherDef + "String_Node_Str"+ ret);
  }
  return ret;
}

Fixed version (ground truth):
private RangerContextEnricher buildContextEnricher(RangerServiceDef.RangerContextEnricherDef enricherDef){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + enricherDef + "String_Node_Str");
  }
  RangerContextEnricher ret=null;
  String name=enricherDef != null ? enricherDef.getName() : null;
  String clsName=enricherDef != null ? enricherDef.getEnricher() : null;
  if (!StringUtils.isEmpty(clsName)) {
    try {
      @SuppressWarnings("String_Node_Str") Class<RangerContextEnricher> enricherClass=(Class<RangerContextEnricher>)Class.forName(clsName);
      ret=enricherClass.newInstance();
    }
 catch (    Exception excp) {
      LOG.error("String_Node_Str" + clsName + "String_Node_Str"+ name+ "String_Node_Str",excp);
    }
  }
  if (ret != null) {
    ret.setContextEnricherDef(enricherDef);
    ret.setContextServiceName(componentServiceName);
    ret.setContextServiceDef(componentServiceDef);
    ret.init();
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + enricherDef + "String_Node_Str"+ ret);
  }
  return ret;
}
Program: 166404
Project: 166404
Buggy source:
RangerPolicyRepository(ServicePolicies.TagPolicies tagPolicies,RangerPolicyEngineOptions options,RangerServiceDef componentServiceDef){
  super();
  this.serviceName=tagPolicies.getServiceName();
  this.serviceDef=normalizeAccessTypeDefs(tagPolicies.getServiceDef(),componentServiceDef.getName());
  this.componentServiceDef=componentServiceDef;
  this.policies=Collections.unmodifiableList(normalizePolicyItemAccesses(tagPolicies.getPolicies(),componentServiceDef.getName()));
  this.policyVersion=tagPolicies.getPolicyVersion() != null ? tagPolicies.getPolicyVersion() : -1;
  this.accessAuditCache=null;
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceName);
  }
  init(options);
}

Fixed version (ground truth):
RangerPolicyRepository(ServicePolicies.TagPolicies tagPolicies,RangerPolicyEngineOptions options,RangerServiceDef componentServiceDef,String componentServiceName){
  super();
  this.serviceName=tagPolicies.getServiceName();
  this.componentServiceName=componentServiceName;
  this.serviceDef=normalizeAccessTypeDefs(tagPolicies.getServiceDef(),componentServiceDef.getName());
  this.componentServiceDef=componentServiceDef;
  this.policies=Collections.unmodifiableList(normalizePolicyItemAccesses(tagPolicies.getPolicies(),componentServiceDef.getName()));
  this.policyVersion=tagPolicies.getPolicyVersion() != null ? tagPolicies.getPolicyVersion() : -1;
  this.accessAuditCache=null;
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceName);
  }
  init(options);
}
Program: 166405
Project: 166405
Buggy source:
private static String toAccessType(int permType){
  String ret=null;
  for (  Map.Entry<String,Integer> e : mapAccessTypeToPermType.entrySet()) {
    if (e.getValue().intValue() == permType) {
      ret=e.getKey();
      break;
    }
  }
  return ret;
}

Fixed version (ground truth):
public static String toAccessType(int permType){
  String ret=null;
  for (  Map.Entry<String,Integer> e : mapAccessTypeToPermType.entrySet()) {
    if (e.getValue().intValue() == permType) {
      ret=e.getKey();
      break;
    }
  }
  return ret;
}
Program: 166408
Project: 166408
Buggy source:
public void migratePoliciesToNewSchema() throws Exception {
  logger.info("String_Node_Str");
  try {
    List<XXResource> resList=daoMgr.getXXResource().getAll();
    if (resList.size() <= 0) {
      return;
    }
    svcDBStore.setPopulateExistingBaseFields(true);
    for (    XXResource xRes : resList) {
      if (xRes.getResourceStatus() == AppConstants.STATUS_DELETED) {
        continue;
      }
      XXAsset xAsset=daoMgr.getXXAsset().getById(xRes.getAssetId());
      if (xAsset == null) {
        logger.error("String_Node_Str" + xRes.getPolicyName());
        continue;
      }
      RangerService service=svcDBStore.getServiceByName(xAsset.getName());
      if (service == null) {
        logger.error("String_Node_Str" + xRes.getPolicyName());
        continue;
      }
      XXPolicy existing=daoMgr.getXXPolicy().findByNameAndServiceId(xRes.getPolicyName(),service.getId());
      if (existing != null) {
        logger.info("String_Node_Str" + existing.getName());
        continue;
      }
      RangerPolicy policy=new RangerPolicy();
      policy=mapXResourceToPolicy(policy,xRes,service);
      policy=svcDBStore.createPolicy(policy);
      policyCounter++;
      logger.info("String_Node_Str" + policy.getName());
    }
    svcDBStore.setPopulateExistingBaseFields(false);
  }
 catch (  Exception e) {
    throw new Exception("String_Node_Str",e);
  }
  logger.info("String_Node_Str");
}

Fixed version (ground truth):
public void migratePoliciesToNewSchema() throws Exception {
  logger.info("String_Node_Str");
  try {
    List<XXResource> resList=daoMgr.getXXResource().getAll();
    if (resList.size() <= 0) {
      return;
    }
    svcDBStore.setPopulateExistingBaseFields(true);
    for (    XXResource xRes : resList) {
      if (xRes.getResourceStatus() == AppConstants.STATUS_DELETED) {
        continue;
      }
      XXAsset xAsset=daoMgr.getXXAsset().getById(xRes.getAssetId());
      if (xAsset == null) {
        logger.error("String_Node_Str" + xRes.getPolicyName());
        continue;
      }
      RangerService service=svcDBStore.getServiceByName(xAsset.getName());
      if (service == null) {
        logger.error("String_Node_Str" + xRes.getPolicyName());
        continue;
      }
      XXPolicy existing=daoMgr.getXXPolicy().findByNameAndServiceId(xRes.getPolicyName(),service.getId());
      if (existing != null) {
        logger.info("String_Node_Str" + existing.getName());
        continue;
      }
      RangerPolicy policy=new RangerPolicy();
      policy=mapXResourceToPolicy(policy,xRes,service);
      if (policy != null) {
        policy=svcDBStore.createPolicy(policy);
        policyCounter++;
        logger.info("String_Node_Str" + policy.getName());
      }
    }
    svcDBStore.setPopulateExistingBaseFields(false);
  }
 catch (  Exception e) {
    throw new Exception("String_Node_Str",e);
  }
  logger.info("String_Node_Str");
}
Program: 166409
Project: 166409
Buggy source:
@GET @Path("String_Node_Str") @Encoded public String getResourceJSON(@Context HttpServletRequest request,@PathParam("String_Node_Str") String repository){
  String epoch=request.getParameter("String_Node_Str");
  X509Certificate[] certchain=(X509Certificate[])request.getAttribute("String_Node_Str");
  String ipAddress=request.getHeader("String_Node_Str");
  boolean isSecure=request.isSecure();
  String policyCount=request.getParameter("String_Node_Str");
  String agentId=request.getParameter("String_Node_Str");
  if (ipAddress == null) {
    ipAddress=request.getRemoteAddr();
  }
  boolean httpEnabled=PropertiesUtil.getBooleanProperty("String_Node_Str",true);
  RangerService service=serviceREST.getServiceByName(repository);
  List<RangerPolicy> policies=serviceREST.getServicePolicies(repository,request).getPolicies();
  long policyUpdTime=(service != null && service.getPolicyUpdateTime() != null) ? service.getPolicyUpdateTime().getTime() : 0l;
  VXAsset vAsset=serviceUtil.toVXAsset(service);
  List<VXResource> vResourceList=new ArrayList<VXResource>();
  if (policies != null) {
    for (    RangerPolicy policy : policies) {
      vResourceList.add(serviceUtil.toVXResource(policy,service));
    }
  }
  String file=assetMgr.getLatestRepoPolicy(vAsset,vResourceList,policyUpdTime,certchain,httpEnabled,epoch,ipAddress,isSecure,policyCount,agentId);
  return file;
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Encoded public String getResourceJSON(@Context HttpServletRequest request,@PathParam("String_Node_Str") String repository){
  String epoch=request.getParameter("String_Node_Str");
  X509Certificate[] certchain=(X509Certificate[])request.getAttribute("String_Node_Str");
  String ipAddress=request.getHeader("String_Node_Str");
  boolean isSecure=request.isSecure();
  String policyCount=request.getParameter("String_Node_Str");
  String agentId=request.getParameter("String_Node_Str");
  Long lastKnowPolicyVersion=new Long(-1);
  if (ipAddress == null) {
    ipAddress=request.getRemoteAddr();
  }
  boolean httpEnabled=PropertiesUtil.getBooleanProperty("String_Node_Str",true);
  ServicePolicies servicePolicies=null;
  try {
    servicePolicies=serviceREST.getServicePoliciesIfUpdated(repository,lastKnowPolicyVersion,agentId,request);
  }
 catch (  Exception excp) {
    logger.error("String_Node_Str" + repository,excp);
  }
  RangerService service=serviceREST.getServiceByName(repository);
  List<RangerPolicy> policies=servicePolicies != null ? servicePolicies.getPolicies() : null;
  long policyUpdTime=(servicePolicies != null && servicePolicies.getPolicyUpdateTime() != null) ? servicePolicies.getPolicyUpdateTime().getTime() : 0l;
  VXAsset vAsset=serviceUtil.toVXAsset(service);
  List<VXResource> vResourceList=new ArrayList<VXResource>();
  if (policies != null) {
    for (    RangerPolicy policy : policies) {
      vResourceList.add(serviceUtil.toVXResource(policy,service));
    }
  }
  String file=assetMgr.getLatestRepoPolicy(vAsset,vResourceList,policyUpdTime,certchain,httpEnabled,epoch,ipAddress,isSecure,policyCount,agentId);
  return file;
}
Program: 166412
Project: 166412
Buggy source:
private Map<String,RangerPolicy.RangerPolicyResource> toRangerResourceList(String resourceString,String resourceType,Boolean isExcludes,Boolean isRecursive,Map<String,RangerPolicy.RangerPolicyResource> resources){
  Map<String,RangerPolicy.RangerPolicyResource> ret=resources == null ? new HashMap<String,RangerPolicy.RangerPolicyResource>() : resources;
  if (resourceString != null) {
    RangerPolicy.RangerPolicyResource resource=ret.get(resourceType);
    if (resource == null) {
      resource=new RangerPolicy.RangerPolicyResource();
      resource.setIsExcludes(isExcludes);
      resource.setIsRecursive(isRecursive);
      ret.put(resourceType,resource);
    }
    for (    String res : resourceString.split("String_Node_Str")) {
      resource.getValues().add(res);
    }
  }
  return ret;
}

Fixed version (ground truth):
private Map<String,RangerPolicy.RangerPolicyResource> toRangerResourceList(String resourceString,String resourceType,Boolean isExcludes,Boolean isRecursive,Map<String,RangerPolicy.RangerPolicyResource> resources){
  Map<String,RangerPolicy.RangerPolicyResource> ret=resources == null ? new HashMap<String,RangerPolicy.RangerPolicyResource>() : resources;
  if (StringUtils.isNotBlank(resourceString)) {
    RangerPolicy.RangerPolicyResource resource=ret.get(resourceType);
    if (resource == null) {
      resource=new RangerPolicy.RangerPolicyResource();
      resource.setIsExcludes(isExcludes);
      resource.setIsRecursive(isRecursive);
      ret.put(resourceType,resource);
    }
    for (    String res : resourceString.split("String_Node_Str")) {
      resource.getValues().add(res);
    }
  }
  return ret;
}
Program: 166413
Project: 166413
Buggy source:
@POST @Path("String_Node_Str") @Produces({"String_Node_Str","String_Node_Str"}) public VXPolicy grantPermission(@Context HttpServletRequest request,VXPolicy vXPolicy){
  RESTResponse ret=null;
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + vXPolicy + "String_Node_Str");
  }
  if (vXPolicy != null) {
    String serviceName=vXPolicy.getRepositoryName();
    GrantRevokeRequest grantRevokeRequest=serviceUtil.toGrantRevokeRequest(vXPolicy);
    try {
      ret=serviceREST.grantAccess(serviceName,grantRevokeRequest,request);
    }
 catch (    Exception e) {
      logger.error(HttpServletResponse.SC_BAD_REQUEST + "String_Node_Str" + vXPolicy);
      throw restErrorUtil.createRESTException(HttpServletResponse.SC_BAD_REQUEST,"String_Node_Str" + e.getMessage(),true);
    }
  }
 else {
    logger.error(HttpServletResponse.SC_BAD_REQUEST + "String_Node_Str" + vXPolicy);
    throw restErrorUtil.createRESTException(HttpServletResponse.SC_BAD_REQUEST,"String_Node_Str",true);
  }
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + ret + "String_Node_Str");
  }
  return vXPolicy;
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") @Produces({"String_Node_Str","String_Node_Str"}) public VXPolicy grantPermission(@Context HttpServletRequest request,VXPolicy vXPolicy){
  RESTResponse ret=null;
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + vXPolicy + "String_Node_Str");
  }
  if (vXPolicy != null) {
    String serviceName=vXPolicy.getRepositoryName();
    GrantRevokeRequest grantRevokeRequest=serviceUtil.toGrantRevokeRequest(vXPolicy);
    try {
      ret=serviceREST.grantAccess(serviceName,grantRevokeRequest,request);
    }
 catch (    WebApplicationException excp) {
      throw excp;
    }
catch (    Throwable e) {
      logger.error(HttpServletResponse.SC_BAD_REQUEST + "String_Node_Str" + vXPolicy,e);
      throw restErrorUtil.createRESTException("String_Node_Str" + vXPolicy + "String_Node_Str"+ e.getMessage());
    }
  }
 else {
    logger.error(HttpServletResponse.SC_BAD_REQUEST + "String_Node_Str");
    throw restErrorUtil.createRESTException("String_Node_Str");
  }
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + ret + "String_Node_Str");
  }
  return vXPolicy;
}
Program: 166414
Project: 166414
Buggy source:
@POST @Path("String_Node_Str") @Produces({"String_Node_Str","String_Node_Str"}) public VXPolicy revokePermission(@Context HttpServletRequest request,VXPolicy vXPolicy){
  RESTResponse ret=null;
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + vXPolicy + "String_Node_Str");
  }
  if (vXPolicy != null) {
    String serviceName=vXPolicy.getRepositoryName();
    GrantRevokeRequest grantRevokeRequest=serviceUtil.toGrantRevokeRequest(vXPolicy);
    try {
      ret=serviceREST.revokeAccess(serviceName,grantRevokeRequest,request);
    }
 catch (    Exception e) {
      logger.error(HttpServletResponse.SC_BAD_REQUEST + "String_Node_Str" + vXPolicy);
      throw restErrorUtil.createRESTException(HttpServletResponse.SC_BAD_REQUEST,"String_Node_Str" + e.getMessage(),true);
    }
  }
 else {
    logger.error(HttpServletResponse.SC_BAD_REQUEST + "String_Node_Str" + vXPolicy);
    throw restErrorUtil.createRESTException(HttpServletResponse.SC_BAD_REQUEST,"String_Node_Str",true);
  }
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + ret + "String_Node_Str");
  }
  return vXPolicy;
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") @Produces({"String_Node_Str","String_Node_Str"}) public VXPolicy revokePermission(@Context HttpServletRequest request,VXPolicy vXPolicy){
  RESTResponse ret=null;
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + vXPolicy + "String_Node_Str");
  }
  if (vXPolicy != null) {
    String serviceName=vXPolicy.getRepositoryName();
    GrantRevokeRequest grantRevokeRequest=serviceUtil.toGrantRevokeRequest(vXPolicy);
    try {
      ret=serviceREST.revokeAccess(serviceName,grantRevokeRequest,request);
    }
 catch (    WebApplicationException excp) {
      throw excp;
    }
catch (    Throwable e) {
      logger.error(HttpServletResponse.SC_BAD_REQUEST + "String_Node_Str" + vXPolicy,e);
      throw restErrorUtil.createRESTException("String_Node_Str" + vXPolicy + "String_Node_Str"+ e.getMessage());
    }
  }
 else {
    logger.error(HttpServletResponse.SC_BAD_REQUEST + "String_Node_Str");
    throw restErrorUtil.createRESTException("String_Node_Str");
  }
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + ret + "String_Node_Str");
  }
  return vXPolicy;
}
Program: 166415
Project: 166415
Buggy source:
@GET @Path(KMSRESTConstants.KEY_RESOURCE + "String_Node_Str" + KMSRESTConstants.CURRENT_VERSION_SUB_RESOURCE) @Produces(MediaType.APPLICATION_JSON) public Response getCurrentVersion(@PathParam("String_Node_Str") final String name) throws Exception {
  UserGroupInformation user=HttpUserGroupInformation.get();
  KMSClientProvider.checkNotEmpty(name,"String_Node_Str");
  KMSWebApp.getKeyCallsMeter().mark();
  assertAccess(Type.GET,user,KMSOp.GET_CURRENT_KEY,name);
  KeyVersion keyVersion=user.doAs(new PrivilegedExceptionAction<KeyVersion>(){
    @Override public KeyVersion run() throws Exception {
      return provider.getCurrentKey(name);
    }
  }
);
  Object json=KMSServerJSONUtils.toJSON(keyVersion);
  kmsAudit.ok(user,KMSOp.GET_CURRENT_KEY,name,"String_Node_Str");
  return Response.ok().type(MediaType.APPLICATION_JSON).entity(json).build();
}

Fixed version (ground truth):
@GET @Path(KMSRESTConstants.KEY_RESOURCE + "String_Node_Str" + KMSRESTConstants.CURRENT_VERSION_SUB_RESOURCE) @Produces(MediaType.APPLICATION_JSON) public Response getCurrentVersion(@PathParam("String_Node_Str") final String name) throws Exception {
  UserGroupInformation user=HttpUserGroupInformation.get();
  KMSClientProvider.checkNotEmpty(name,"String_Node_Str");
  KMSWebApp.getKeyCallsMeter().mark();
  assertAccess(Type.GET,user,KMSOp.GET_CURRENT_KEY,name);
  KeyVersion keyVersion=user.doAs(new PrivilegedExceptionAction<KeyVersion>(){
    @Override public KeyVersion run() throws Exception {
      return provider.getCurrentKey(name);
    }
  }
);
  Object json=KMSServerJSONUtils.toJSON(keyVersion);
  if (keyVersion != null) {
    kmsAudit.ok(user,KMSOp.GET_CURRENT_KEY,name,"String_Node_Str");
    return Response.ok().type(MediaType.APPLICATION_JSON).entity(json).build();
  }
 else {
    return Response.status(404).type(MediaType.APPLICATION_JSON).entity(json).build();
  }
}
Program: 166418
Project: 166418
Buggy source:
@Override public RangerServiceDef getServiceDef(Long id) throws Exception {
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + id + "String_Node_Str");
  }
  RangerServiceDef ret=null;
  ret=serviceDefService.read(id);
  List<String> userRoleList=ContextUtil.getCurrentUserSession().getUserRoleList();
  if (userRoleList != null && !userRoleList.contains(RangerConstants.ROLE_KEY_ADMIN)) {
    if (ret != null && "String_Node_Str".equalsIgnoreCase(ret.getName())) {
      ret=null;
    }
  }
 else {
    if (ret != null && !"String_Node_Str".equalsIgnoreCase(ret.getName())) {
      ret=null;
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + id + "String_Node_Str"+ ret);
  }
  return ret;
}

Fixed version (ground truth):
@Override public RangerServiceDef getServiceDef(Long id) throws Exception {
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + id + "String_Node_Str");
  }
  RangerServiceDef ret=null;
  ret=serviceDefService.read(id);
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + id + "String_Node_Str"+ ret);
  }
  return ret;
}
Program: 166420
Project: 166420
Buggy source:
public RangerServiceServiceBase(){
  super();
  searchFields.add(new SearchField(SearchFilter.SERVICE_TYPE,"String_Node_Str",DATA_TYPE.STRING,SEARCH_TYPE.FULL,"String_Node_Str","String_Node_Str"));
  searchFields.add(new SearchField(SearchFilter.SERVICE_TYPE_ID,"String_Node_Str",DATA_TYPE.INTEGER,SEARCH_TYPE.FULL));
  searchFields.add(new SearchField(SearchFilter.SERVICE_NAME,"String_Node_Str",DATA_TYPE.STRING,SEARCH_TYPE.FULL));
  searchFields.add(new SearchField(SearchFilter.SERVICE_ID,"String_Node_Str",DATA_TYPE.INTEGER,SEARCH_TYPE.FULL));
  searchFields.add(new SearchField(SearchFilter.IS_ENABLED,"String_Node_Str",DATA_TYPE.BOOLEAN,SEARCH_TYPE.FULL));
  sortFields.add(new SortField(SearchFilter.CREATE_TIME,"String_Node_Str"));
  sortFields.add(new SortField(SearchFilter.UPDATE_TIME,"String_Node_Str"));
  sortFields.add(new SortField(SearchFilter.SERVICE_ID,"String_Node_Str"));
  sortFields.add(new SortField(SearchFilter.SERVICE_NAME,"String_Node_Str"));
}

Fixed version (ground truth):
public RangerServiceServiceBase(){
  super();
  searchFields.add(new SearchField(SearchFilter.SERVICE_TYPE,"String_Node_Str",DATA_TYPE.STRING,SEARCH_TYPE.FULL,"String_Node_Str","String_Node_Str"));
  searchFields.add(new SearchField(SearchFilter.SERVICE_TYPE_ID,"String_Node_Str",DATA_TYPE.INTEGER,SEARCH_TYPE.FULL));
  searchFields.add(new SearchField(SearchFilter.SERVICE_NAME,"String_Node_Str",DATA_TYPE.STRING,SEARCH_TYPE.FULL));
  searchFields.add(new SearchField(SearchFilter.SERVICE_ID,"String_Node_Str",DATA_TYPE.INTEGER,SEARCH_TYPE.FULL));
  searchFields.add(new SearchField(SearchFilter.IS_ENABLED,"String_Node_Str",DATA_TYPE.BOOLEAN,SEARCH_TYPE.FULL));
  sortFields.add(new SortField(SearchFilter.CREATE_TIME,"String_Node_Str"));
  sortFields.add(new SortField(SearchFilter.UPDATE_TIME,"String_Node_Str"));
  sortFields.add(new SortField(SearchFilter.SERVICE_ID,"String_Node_Str",true,SORT_ORDER.ASC));
  sortFields.add(new SortField(SearchFilter.SERVICE_NAME,"String_Node_Str"));
}
Program: 166422
Project: 166422
Buggy source:
protected static RangerResourceMatcher createResourceMatcher(RangerResourceDef resourceDef,RangerPolicyResource resource){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resourceDef + "String_Node_Str"+ resource+ "String_Node_Str");
  }
  RangerResourceMatcher ret=null;
  String resName=resourceDef != null ? resourceDef.getName() : null;
  String clsName=resourceDef != null ? resourceDef.getMatcher() : null;
  if (!StringUtils.isEmpty(clsName)) {
    try {
      @SuppressWarnings("String_Node_Str") Class<RangerResourceMatcher> matcherClass=(Class<RangerResourceMatcher>)Class.forName(clsName);
      ret=matcherClass.newInstance();
    }
 catch (    Exception excp) {
      LOG.error("String_Node_Str" + clsName + "String_Node_Str"+ resName+ "String_Node_Str",excp);
    }
  }
  if (ret == null) {
    ret=new RangerDefaultResourceMatcher();
  }
  if (ret != null) {
    ret.init(resourceDef,resource);
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resourceDef + "String_Node_Str"+ resource+ "String_Node_Str"+ ret);
  }
  return ret;
}

Fixed version (ground truth):
protected static RangerResourceMatcher createResourceMatcher(RangerResourceDef resourceDef,RangerPolicyResource resource){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resourceDef + "String_Node_Str"+ resource+ "String_Node_Str");
  }
  RangerResourceMatcher ret=null;
  if (resourceDef != null) {
    String resName=resourceDef.getName();
    String clsName=resourceDef.getMatcher();
    if (!StringUtils.isEmpty(clsName)) {
      try {
        @SuppressWarnings("String_Node_Str") Class<RangerResourceMatcher> matcherClass=(Class<RangerResourceMatcher>)Class.forName(clsName);
        ret=matcherClass.newInstance();
      }
 catch (      Exception excp) {
        LOG.error("String_Node_Str" + clsName + "String_Node_Str"+ resName+ "String_Node_Str",excp);
      }
    }
    if (ret == null) {
      ret=new RangerDefaultResourceMatcher();
    }
    if (ret != null) {
      ret.init(resourceDef,resource);
    }
  }
 else {
    LOG.error("String_Node_Str");
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resourceDef + "String_Node_Str"+ resource+ "String_Node_Str"+ ret);
  }
  return ret;
}
Program: 166424
Project: 166424
Buggy source:
private boolean isAccessAllowed(INode inode,INodeAttributes inodeAttribs,FsAction access,String user,Set<String> groups,String fsOwner,String superGroup,RangerHdfsPlugin plugin,RangerHdfsAuditHandler auditHandler){
  boolean ret=false;
  String path=inode != null ? inode.getFullPathName() : null;
  String pathOwner=inodeAttribs != null ? inodeAttribs.getUserName() : null;
  if (pathOwner == null && inode != null) {
    pathOwner=inode.getUserName();
  }
  if (RangerHadoopConstants.HDFS_ROOT_FOLDER_PATH_ALT.equals(path)) {
    path=RangerHadoopConstants.HDFS_ROOT_FOLDER_PATH;
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + path + "String_Node_Str"+ access+ "String_Node_Str"+ user+ "String_Node_Str");
  }
  Set<String> accessTypes=access2ActionListMapper.get(access);
  if (accessTypes == null) {
    LOG.warn("String_Node_Str" + path + "String_Node_Str"+ access+ "String_Node_Str"+ user+ "String_Node_Str"+ access);
    accessTypes=access2ActionListMapper.get(FsAction.NONE);
  }
  for (  String accessType : accessTypes) {
    RangerHdfsAccessRequest request=new RangerHdfsAccessRequest(path,pathOwner,access,accessType,user,groups);
    RangerAccessResult result=plugin.isAccessAllowed(request,auditHandler);
    ret=result.getIsAllowed();
    if (!ret) {
      break;
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + path + "String_Node_Str"+ access+ "String_Node_Str"+ user+ "String_Node_Str"+ ret);
  }
  return ret;
}

Fixed version (ground truth):
private boolean isAccessAllowed(INode inode,INodeAttributes inodeAttribs,FsAction access,String user,Set<String> groups,String fsOwner,String superGroup,RangerHdfsPlugin plugin,RangerHdfsAuditHandler auditHandler){
  boolean ret=false;
  String path=inode != null ? inode.getFullPathName() : null;
  String pathOwner=inodeAttribs != null ? inodeAttribs.getUserName() : null;
  if (pathOwner == null && inode != null) {
    pathOwner=inode.getUserName();
  }
  if (RangerHadoopConstants.HDFS_ROOT_FOLDER_PATH_ALT.equals(path)) {
    path=RangerHadoopConstants.HDFS_ROOT_FOLDER_PATH;
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + path + "String_Node_Str"+ access+ "String_Node_Str"+ user+ "String_Node_Str");
  }
  Set<String> accessTypes=access2ActionListMapper.get(access);
  if (accessTypes == null) {
    LOG.warn("String_Node_Str" + path + "String_Node_Str"+ access+ "String_Node_Str"+ user+ "String_Node_Str"+ access);
    accessTypes=access2ActionListMapper.get(FsAction.NONE);
  }
  for (  String accessType : accessTypes) {
    RangerHdfsAccessRequest request=new RangerHdfsAccessRequest(path,pathOwner,access,accessType,user,groups);
    RangerAccessResult result=plugin.isAccessAllowed(request,auditHandler);
    if (result == null) {
      LOG.error("String_Node_Str");
    }
 else {
      ret=result.getIsAllowed();
      if (!ret) {
        break;
      }
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + path + "String_Node_Str"+ access+ "String_Node_Str"+ user+ "String_Node_Str"+ ret);
  }
  return ret;
}
Program: 166428
Project: 166428
Buggy source:
public VXResponse validateConfig(RangerService service,ServiceStore svcStore) throws Exception {
  VXResponse ret=new VXResponse();
  RangerBaseService svc=getRangerServiceByService(service,svcStore);
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + svc + "String_Node_Str");
  }
  if (svc != null) {
    ClassLoader clsLoader=Thread.currentThread().getContextClassLoader();
    try {
      Thread.currentThread().setContextClassLoader(svc.getClass().getClassLoader());
      HashMap<String,Object> responseData=svc.validateConfig();
      ret=generateResponseForTestConn(responseData,"String_Node_Str");
    }
 catch (    Exception e) {
      String msg="String_Node_Str" + svc.getServiceName();
      HashMap<String,Object> respData=new HashMap<String,Object>();
      String message="String_Node_Str";
      if (e instanceof HadoopException) {
        respData=((HadoopException)e).responseData;
        message=(respData != null && respData.get("String_Node_Str") != null) ? respData.get("String_Node_Str").toString() : msg;
      }
      ret=generateResponseForTestConn(respData,message);
      LOG.error("String_Node_Str" + e);
    }
 finally {
      Thread.currentThread().setContextClassLoader(clsLoader);
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + ret + "String_Node_Str");
  }
  return ret;
}

Fixed version (ground truth):
public VXResponse validateConfig(RangerService service,ServiceStore svcStore) throws Exception {
  VXResponse ret=new VXResponse();
  RangerBaseService svc=getRangerServiceByService(service,svcStore);
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + svc + "String_Node_Str");
  }
  if (svc != null) {
    ClassLoader clsLoader=Thread.currentThread().getContextClassLoader();
    try {
      Thread.currentThread().setContextClassLoader(svc.getClass().getClassLoader());
      HashMap<String,Object> responseData=svc.validateConfig();
      ret=generateResponseForTestConn(responseData,"String_Node_Str");
    }
 catch (    Exception e) {
      String msg="String_Node_Str" + svc.getServiceName();
      HashMap<String,Object> respData=new HashMap<String,Object>();
      if (e instanceof HadoopException) {
        respData=((HadoopException)e).responseData;
      }
      ret=generateResponseForTestConn(respData,msg);
      LOG.error("String_Node_Str" + e);
    }
 finally {
      Thread.currentThread().setContextClassLoader(clsLoader);
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + ret + "String_Node_Str");
  }
  return ret;
}
Program: 166429
Project: 166429
Buggy source:
private VXResponse generateResponseForTestConn(HashMap<String,Object> responseData,String msg){
  VXResponse vXResponse=new VXResponse();
  Long objId=(responseData.get("String_Node_Str") != null) ? Long.parseLong(responseData.get("String_Node_Str").toString()) : null;
  boolean connectivityStatus=(responseData.get("String_Node_Str") != null) ? Boolean.parseBoolean(responseData.get("String_Node_Str").toString()) : false;
  int statusCode=(connectivityStatus) ? VXResponse.STATUS_SUCCESS : VXResponse.STATUS_ERROR;
  String message=(responseData.get("String_Node_Str") != null) ? responseData.get("String_Node_Str").toString() : msg;
  String description=(responseData.get("String_Node_Str") != null) ? responseData.get("String_Node_Str").toString() : msg;
  String fieldName=(responseData.get("String_Node_Str") != null) ? responseData.get("String_Node_Str").toString() : null;
  VXMessage vXMsg=new VXMessage();
  List<VXMessage> vXMsgList=new ArrayList<VXMessage>();
  vXMsg.setFieldName(fieldName);
  vXMsg.setMessage(message);
  vXMsg.setObjectId(objId);
  vXMsgList.add(vXMsg);
  vXResponse.setMessageList(vXMsgList);
  vXResponse.setMsgDesc(description);
  vXResponse.setStatusCode(statusCode);
  return vXResponse;
}

Fixed version (ground truth):
private VXResponse generateResponseForTestConn(HashMap<String,Object> responseData,String msg){
  VXResponse vXResponse=new VXResponse();
  Long objId=null;
  boolean connectivityStatus=false;
  int statusCode=VXResponse.STATUS_ERROR;
  String message=msg;
  String description=msg;
  String fieldName=null;
  if (responseData != null) {
    if (responseData.get("String_Node_Str") != null) {
      objId=Long.parseLong(responseData.get("String_Node_Str").toString());
    }
    if (responseData.get("String_Node_Str") != null) {
      connectivityStatus=Boolean.parseBoolean(responseData.get("String_Node_Str").toString());
    }
    if (connectivityStatus) {
      statusCode=VXResponse.STATUS_SUCCESS;
    }
    if (responseData.get("String_Node_Str") != null) {
      message=responseData.get("String_Node_Str").toString();
    }
    if (responseData.get("String_Node_Str") != null) {
      description=responseData.get("String_Node_Str").toString();
    }
    if (responseData.get("String_Node_Str") != null) {
      fieldName=responseData.get("String_Node_Str").toString();
    }
  }
  VXMessage vXMsg=new VXMessage();
  List<VXMessage> vXMsgList=new ArrayList<VXMessage>();
  vXMsg.setFieldName(fieldName);
  vXMsg.setMessage(message);
  vXMsg.setObjectId(objId);
  vXMsgList.add(vXMsg);
  vXResponse.setMessageList(vXMsgList);
  vXResponse.setMsgDesc(description);
  vXResponse.setStatusCode(statusCode);
  return vXResponse;
}
Program: 166431
Project: 166431
Buggy source:
protected static RangerResourceMatcher createResourceMatcher(RangerResourceDef resourceDef,RangerPolicyResource resource){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resourceDef + "String_Node_Str"+ resource+ "String_Node_Str");
  }
  RangerResourceMatcher ret=null;
  String resName=resourceDef != null ? resourceDef.getName() : null;
  String clsName=resourceDef != null ? resourceDef.getMatcher() : null;
  if (!StringUtils.isEmpty(clsName)) {
    try {
      @SuppressWarnings("String_Node_Str") Class<RangerResourceMatcher> matcherClass=(Class<RangerResourceMatcher>)Class.forName(clsName);
      ret=matcherClass.newInstance();
    }
 catch (    Exception excp) {
      LOG.error("String_Node_Str" + clsName + "String_Node_Str"+ resName+ "String_Node_Str",excp);
    }
  }
  if (ret == null) {
    ret=new RangerDefaultResourceMatcher();
  }
  if (ret != null) {
    ret.init(resourceDef,resource);
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resourceDef + "String_Node_Str"+ resource+ "String_Node_Str"+ ret);
  }
  return ret;
}

Fixed version (ground truth):
protected static RangerResourceMatcher createResourceMatcher(RangerResourceDef resourceDef,RangerPolicyResource resource){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resourceDef + "String_Node_Str"+ resource+ "String_Node_Str");
  }
  RangerResourceMatcher ret=null;
  if (resourceDef != null) {
    String resName=resourceDef.getName();
    String clsName=resourceDef.getMatcher();
    if (!StringUtils.isEmpty(clsName)) {
      try {
        @SuppressWarnings("String_Node_Str") Class<RangerResourceMatcher> matcherClass=(Class<RangerResourceMatcher>)Class.forName(clsName);
        ret=matcherClass.newInstance();
      }
 catch (      Exception excp) {
        LOG.error("String_Node_Str" + clsName + "String_Node_Str"+ resName+ "String_Node_Str",excp);
      }
    }
    if (ret == null) {
      ret=new RangerDefaultResourceMatcher();
    }
    if (ret != null) {
      ret.init(resourceDef,resource);
    }
  }
 else {
    LOG.error("String_Node_Str");
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resourceDef + "String_Node_Str"+ resource+ "String_Node_Str"+ ret);
  }
  return ret;
}
Program: 166433
Project: 166433
Buggy source:
private boolean isAccessAllowed(INode inode,INodeAttributes inodeAttribs,FsAction access,String user,Set<String> groups,String fsOwner,String superGroup,RangerHdfsPlugin plugin,RangerHdfsAuditHandler auditHandler){
  boolean ret=false;
  String path=inode != null ? inode.getFullPathName() : null;
  String pathOwner=inodeAttribs != null ? inodeAttribs.getUserName() : null;
  if (pathOwner == null && inode != null) {
    pathOwner=inode.getUserName();
  }
  if (RangerHadoopConstants.HDFS_ROOT_FOLDER_PATH_ALT.equals(path)) {
    path=RangerHadoopConstants.HDFS_ROOT_FOLDER_PATH;
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + path + "String_Node_Str"+ access+ "String_Node_Str"+ user+ "String_Node_Str");
  }
  Set<String> accessTypes=access2ActionListMapper.get(access);
  if (accessTypes == null) {
    LOG.warn("String_Node_Str" + path + "String_Node_Str"+ access+ "String_Node_Str"+ user+ "String_Node_Str"+ access);
    accessTypes=access2ActionListMapper.get(FsAction.NONE);
  }
  for (  String accessType : accessTypes) {
    RangerHdfsAccessRequest request=new RangerHdfsAccessRequest(path,pathOwner,access,accessType,user,groups);
    RangerAccessResult result=plugin.isAccessAllowed(request,auditHandler);
    ret=result.getIsAllowed();
    if (!ret) {
      break;
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + path + "String_Node_Str"+ access+ "String_Node_Str"+ user+ "String_Node_Str"+ ret);
  }
  return ret;
}

Fixed version (ground truth):
private boolean isAccessAllowed(INode inode,INodeAttributes inodeAttribs,FsAction access,String user,Set<String> groups,String fsOwner,String superGroup,RangerHdfsPlugin plugin,RangerHdfsAuditHandler auditHandler){
  boolean ret=false;
  String path=inode != null ? inode.getFullPathName() : null;
  String pathOwner=inodeAttribs != null ? inodeAttribs.getUserName() : null;
  if (pathOwner == null && inode != null) {
    pathOwner=inode.getUserName();
  }
  if (RangerHadoopConstants.HDFS_ROOT_FOLDER_PATH_ALT.equals(path)) {
    path=RangerHadoopConstants.HDFS_ROOT_FOLDER_PATH;
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + path + "String_Node_Str"+ access+ "String_Node_Str"+ user+ "String_Node_Str");
  }
  Set<String> accessTypes=access2ActionListMapper.get(access);
  if (accessTypes == null) {
    LOG.warn("String_Node_Str" + path + "String_Node_Str"+ access+ "String_Node_Str"+ user+ "String_Node_Str"+ access);
    accessTypes=access2ActionListMapper.get(FsAction.NONE);
  }
  for (  String accessType : accessTypes) {
    RangerHdfsAccessRequest request=new RangerHdfsAccessRequest(path,pathOwner,access,accessType,user,groups);
    RangerAccessResult result=plugin.isAccessAllowed(request,auditHandler);
    if (result == null) {
      LOG.error("String_Node_Str");
    }
 else {
      ret=result.getIsAllowed();
      if (!ret) {
        break;
      }
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + path + "String_Node_Str"+ access+ "String_Node_Str"+ user+ "String_Node_Str"+ ret);
  }
  return ret;
}
Program: 166437
Project: 166437
Buggy source:
public VXResponse validateConfig(RangerService service,ServiceStore svcStore) throws Exception {
  VXResponse ret=new VXResponse();
  RangerBaseService svc=getRangerServiceByService(service,svcStore);
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + svc + "String_Node_Str");
  }
  if (svc != null) {
    ClassLoader clsLoader=Thread.currentThread().getContextClassLoader();
    try {
      Thread.currentThread().setContextClassLoader(svc.getClass().getClassLoader());
      HashMap<String,Object> responseData=svc.validateConfig();
      ret=generateResponseForTestConn(responseData,"String_Node_Str");
    }
 catch (    Exception e) {
      String msg="String_Node_Str" + svc.getServiceName();
      HashMap<String,Object> respData=new HashMap<String,Object>();
      String message="String_Node_Str";
      if (e instanceof HadoopException) {
        respData=((HadoopException)e).responseData;
        message=(respData != null && respData.get("String_Node_Str") != null) ? respData.get("String_Node_Str").toString() : msg;
      }
      ret=generateResponseForTestConn(respData,message);
      LOG.error("String_Node_Str" + e);
    }
 finally {
      Thread.currentThread().setContextClassLoader(clsLoader);
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + ret + "String_Node_Str");
  }
  return ret;
}

Fixed version (ground truth):
public VXResponse validateConfig(RangerService service,ServiceStore svcStore) throws Exception {
  VXResponse ret=new VXResponse();
  RangerBaseService svc=getRangerServiceByService(service,svcStore);
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + svc + "String_Node_Str");
  }
  if (svc != null) {
    ClassLoader clsLoader=Thread.currentThread().getContextClassLoader();
    try {
      Thread.currentThread().setContextClassLoader(svc.getClass().getClassLoader());
      HashMap<String,Object> responseData=svc.validateConfig();
      ret=generateResponseForTestConn(responseData,"String_Node_Str");
    }
 catch (    Exception e) {
      String msg="String_Node_Str" + svc.getServiceName();
      HashMap<String,Object> respData=new HashMap<String,Object>();
      if (e instanceof HadoopException) {
        respData=((HadoopException)e).responseData;
      }
      ret=generateResponseForTestConn(respData,msg);
      LOG.error("String_Node_Str" + e);
    }
 finally {
      Thread.currentThread().setContextClassLoader(clsLoader);
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + ret + "String_Node_Str");
  }
  return ret;
}