nus-yam/ex-repair huggingface dataset:
Program: 166350
Project: 166350
Buggy source:
public static KnoxClient getKnoxClient(String serviceName,Map<String,String> configs){
  KnoxClient knoxClient=null;
  LOG.debug("String_Node_Str" + serviceName + "String_Node_Str"+ configs);
  String errMsg="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  if (configs != null && !configs.isEmpty()) {
    String knoxUrl=configs.get("String_Node_Str");
    String knoxAdminUser=configs.get("String_Node_Str");
    String knoxAdminPassword=configs.get("String_Node_Str");
    knoxClient=new KnoxClient(knoxUrl,knoxAdminUser,knoxAdminPassword);
  }
 else {
    String msgDesc="String_Node_Str";
    LOG.error(msgDesc);
    HadoopException hdpException=new HadoopException(msgDesc);
    hdpException.generateResponseDataMap(false,msgDesc,msgDesc + errMsg,null,null);
    throw hdpException;
  }
  return knoxClient;
}

Fixed version (ground truth):
public static KnoxClient getKnoxClient(String serviceName,Map<String,String> configs){
  KnoxClient knoxClient=null;
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceName);
    LOG.debug("String_Node_Str" + BaseClient.getMaskedConfigMap(configs));
  }
  String errMsg="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  if (configs != null && !configs.isEmpty()) {
    String knoxUrl=configs.get("String_Node_Str");
    String knoxAdminUser=configs.get("String_Node_Str");
    String knoxAdminPassword=configs.get("String_Node_Str");
    knoxClient=new KnoxClient(knoxUrl,knoxAdminUser,knoxAdminPassword);
  }
 else {
    String msgDesc="String_Node_Str";
    LOG.error(msgDesc);
    HadoopException hdpException=new HadoopException(msgDesc);
    hdpException.generateResponseDataMap(false,msgDesc,msgDesc + errMsg,null,null);
    throw hdpException;
  }
  return knoxClient;
}
Program: 166351
Project: 166351
Buggy source:
public static KMSClient getKmsClient(String serviceName,Map<String,String> configs){
  KMSClient kmsClient=null;
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceName + "String_Node_Str"+ configs);
  }
  String errMsg=errMessage;
  if (configs == null || configs.isEmpty()) {
    String msgDesc="String_Node_Str";
    LOG.error(msgDesc);
    HadoopException hdpException=new HadoopException(msgDesc);
    hdpException.generateResponseDataMap(false,msgDesc,msgDesc + errMsg,null,null);
    throw hdpException;
  }
 else {
    String kmsUrl=configs.get("String_Node_Str");
    String kmsUserName=configs.get("String_Node_Str");
    String kmsPassWord=configs.get("String_Node_Str");
    kmsClient=new KMSClient(kmsUrl,kmsUserName,kmsPassWord);
  }
  return kmsClient;
}

Fixed version (ground truth):
public static KMSClient getKmsClient(String serviceName,Map<String,String> configs){
  KMSClient kmsClient=null;
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceName);
    LOG.debug("String_Node_Str" + BaseClient.getMaskedConfigMap(configs));
  }
  String errMsg=errMessage;
  if (configs == null || configs.isEmpty()) {
    String msgDesc="String_Node_Str";
    LOG.error(msgDesc);
    HadoopException hdpException=new HadoopException(msgDesc);
    hdpException.generateResponseDataMap(false,msgDesc,msgDesc + errMsg,null,null);
    throw hdpException;
  }
 else {
    String kmsUrl=configs.get("String_Node_Str");
    String kmsUserName=configs.get("String_Node_Str");
    String kmsPassWord=configs.get("String_Node_Str");
    kmsClient=new KMSClient(kmsUrl,kmsUserName,kmsPassWord);
  }
  return kmsClient;
}
Program: 166352
Project: 166352
Buggy source:
public void createTrxLog(List<XXTrxLog> trxLogList){
  if (trxLogList == null) {
    return;
  }
  UserSessionBase usb=ContextUtil.getCurrentUserSession();
  Long authSessionId=null;
  if (usb != null) {
    authSessionId=ContextUtil.getCurrentUserSession().getSessionId();
  }
  Long trxId=guidUtil.genLong();
  for (  XXTrxLog xTrxLog : trxLogList) {
    xTrxLog.setTransactionId(trxId.toString());
    if (authSessionId != null) {
      xTrxLog.setSessionId("String_Node_Str" + authSessionId);
    }
    xTrxLog.setSessionType("String_Node_Str");
    xTrxLog.setRequestId(trxId.toString());
    daoManager.getXXTrxLog().create(xTrxLog);
  }
}

Fixed version (ground truth):
public void createTrxLog(List<XXTrxLog> trxLogList){
  if (trxLogList == null) {
    return;
  }
  UserSessionBase usb=ContextUtil.getCurrentUserSession();
  Long authSessionId=null;
  if (usb != null) {
    authSessionId=ContextUtil.getCurrentUserSession().getSessionId();
  }
  Long trxId=guidUtil.genLong();
  for (  XXTrxLog xTrxLog : trxLogList) {
    if (xTrxLog != null) {
      if ("String_Node_Str".equalsIgnoreCase(xTrxLog.getAttributeName().trim())) {
        if (xTrxLog.getPreviousValue() != null && !xTrxLog.getPreviousValue().trim().isEmpty() && !"String_Node_Str".equalsIgnoreCase(xTrxLog.getPreviousValue().trim())) {
          xTrxLog.setPreviousValue(AppConstants.Masked_String);
        }
        if (xTrxLog.getNewValue() != null && !xTrxLog.getNewValue().trim().isEmpty() && !"String_Node_Str".equalsIgnoreCase(xTrxLog.getNewValue().trim())) {
          xTrxLog.setNewValue(AppConstants.Masked_String);
        }
      }
      xTrxLog.setTransactionId(trxId.toString());
      if (authSessionId != null) {
        xTrxLog.setSessionId("String_Node_Str" + authSessionId);
      }
      xTrxLog.setSessionType("String_Node_Str");
      xTrxLog.setRequestId(trxId.toString());
      daoManager.getXXTrxLog().create(xTrxLog);
    }
  }
}
Program: 166353
Project: 166353
Buggy source:
public void checkAdminAccess(){
  UserSessionBase sess=ContextUtil.getCurrentUserSession();
  if (sess != null) {
    if (sess != null && sess.isUserAdmin()) {
      return;
    }
  }
  throw restErrorUtil.create403RESTException("String_Node_Str" + "String_Node_Str" + (sess != null ? sess.getXXPortalUser().getId() : "String_Node_Str"));
}

Fixed version (ground truth):
public void checkAdminAccess(){
  UserSessionBase sess=ContextUtil.getCurrentUserSession();
  if (sess != null && sess.isUserAdmin()) {
    return;
  }
  throw restErrorUtil.create403RESTException("String_Node_Str" + "String_Node_Str" + (sess != null ? sess.getXXPortalUser().getId() : "String_Node_Str"));
}
Program: 166355
Project: 166355
Buggy source:
public VXUserGroupInfo createXUserGroupFromMap(VXUserGroupInfo vXUserGroupInfo){
  checkAdminAccess();
  VXUserGroupInfo vxUGInfo=new VXUserGroupInfo();
  VXUser vXUser=vXUserGroupInfo.getXuserInfo();
  vXUser=xUserService.createXUserWithOutLogin(vXUser);
  vxUGInfo.setXuserInfo(vXUser);
  List<VXGroup> vxg=new ArrayList<VXGroup>();
  for (  VXGroup vXGroup : vXUserGroupInfo.getXgroupInfo()) {
    VXGroup VvXGroup=xGroupService.createXGroupWithOutLogin(vXGroup);
    vxg.add(VvXGroup);
    VXGroupUser vXGroupUser=new VXGroupUser();
    vXGroupUser.setUserId(vXUser.getId());
    vXGroupUser.setName(VvXGroup.getName());
    vXGroupUser=xGroupUserService.createXGroupUserWithOutLogin(vXGroupUser);
  }
  vxUGInfo.setXgroupInfo(vxg);
  return vxUGInfo;
}

Fixed version (ground truth):
public VXUserGroupInfo createXUserGroupFromMap(VXUserGroupInfo vXUserGroupInfo){
  checkAdminAccess();
  VXUserGroupInfo vxUGInfo=new VXUserGroupInfo();
  VXUser vXUser=vXUserGroupInfo.getXuserInfo();
  vXUser=xUserService.createXUserWithOutLogin(vXUser);
  vxUGInfo.setXuserInfo(vXUser);
  List<VXGroup> vxg=new ArrayList<VXGroup>();
  for (  VXGroup vXGroup : vXUserGroupInfo.getXgroupInfo()) {
    VXGroup VvXGroup=xGroupService.createXGroupWithOutLogin(vXGroup);
    vxg.add(VvXGroup);
    VXGroupUser vXGroupUser=new VXGroupUser();
    vXGroupUser.setUserId(vXUser.getId());
    vXGroupUser.setName(VvXGroup.getName());
    vXGroupUser=xGroupUserService.createXGroupUserWithOutLogin(vXGroupUser);
  }
  VXPortalUser vXPortalUser=userMgr.getUserProfileByLoginId(vXUser.getName());
  if (vXPortalUser != null) {
    assignPermissionToUser(vXPortalUser,true);
  }
  vxUGInfo.setXgroupInfo(vxg);
  return vxUGInfo;
}
Program: 166358
Project: 166358
Buggy source:
@Override public void serialize(Date date,JsonGenerator gen,SerializerProvider provider) throws IOException, JsonProcessingException {
  String formattedDate=dateFormat.format(date);
  gen.writeString(formattedDate);
}

Fixed version (ground truth):
@Override public void serialize(Date date,JsonGenerator gen,SerializerProvider provider) throws IOException, JsonProcessingException {
  String formattedDate=new SimpleDateFormat(DATE_FORMAT).format(date);
  gen.writeString(formattedDate);
}
Program: 166359
Project: 166359
Buggy source:
/** 
 * constructor
 */
@SuppressWarnings("String_Node_Str") public AbstractBaseResourceService(){
  Class klass=getClass();
  ParameterizedType genericSuperclass=(ParameterizedType)klass.getGenericSuperclass();
  TypeVariable<Class<?>> var[]=klass.getTypeParameters();
  if (genericSuperclass.getActualTypeArguments()[0] instanceof Class) {
    tEntityClass=(Class<T>)genericSuperclass.getActualTypeArguments()[0];
    tViewClass=(Class<V>)genericSuperclass.getActualTypeArguments()[1];
  }
 else   if (var.length > 0) {
    tEntityClass=(Class<T>)var[0].getBounds()[0];
    tViewClass=(Class<V>)var[1].getBounds()[0];
  }
 else {
    logger.fatal("String_Node_Str",new Throwable());
  }
  if (tEntityClass != null) {
    className=tEntityClass.getName();
  }
  if (tViewClass != null) {
    viewClassName=tViewClass.getName();
  }
  countQueryStr="String_Node_Str" + tEntityClass.getName() + "String_Node_Str";
  queryStr="String_Node_Str" + className + "String_Node_Str";
  distinctCountQueryStr="String_Node_Str" + tEntityClass.getName() + "String_Node_Str";
  distinctQueryStr="String_Node_Str" + className + "String_Node_Str";
  sortFields.add(new SortField("String_Node_Str","String_Node_Str",true,SORT_ORDER.ASC));
  registerService(this);
}

Fixed version (ground truth):
/** 
 * constructor
 */
@SuppressWarnings("String_Node_Str") public AbstractBaseResourceService(){
  Class klass=getClass();
  ParameterizedType genericSuperclass=(ParameterizedType)klass.getGenericSuperclass();
  TypeVariable<Class<?>> var[]=klass.getTypeParameters();
  if (genericSuperclass.getActualTypeArguments()[0] instanceof Class) {
    tEntityClass=(Class<T>)genericSuperclass.getActualTypeArguments()[0];
    tViewClass=(Class<V>)genericSuperclass.getActualTypeArguments()[1];
  }
 else   if (var.length > 0) {
    tEntityClass=(Class<T>)var[0].getBounds()[0];
    tViewClass=(Class<V>)var[1].getBounds()[0];
  }
 else {
    logger.fatal("String_Node_Str",new Throwable());
  }
  if (tEntityClass != null) {
    className=tEntityClass.getName();
  }
  if (tViewClass != null) {
    viewClassName=tViewClass.getName();
  }
  countQueryStr="String_Node_Str" + className + "String_Node_Str";
  queryStr="String_Node_Str" + className + "String_Node_Str";
  distinctCountQueryStr="String_Node_Str" + className + "String_Node_Str";
  distinctQueryStr="String_Node_Str" + className + "String_Node_Str";
  sortFields.add(new SortField("String_Node_Str","String_Node_Str",true,SORT_ORDER.ASC));
  registerService(this);
}
Program: 166360
Project: 166360
Buggy source:
@SuppressWarnings("String_Node_Str") public RangerBaseModelService(){
  Class klass=getClass();
  ParameterizedType genericSuperclass=(ParameterizedType)klass.getGenericSuperclass();
  TypeVariable<Class<?>> var[]=klass.getTypeParameters();
  if (genericSuperclass.getActualTypeArguments()[0] instanceof Class) {
    tEntityClass=(Class<T>)genericSuperclass.getActualTypeArguments()[0];
    tViewClass=(Class<V>)genericSuperclass.getActualTypeArguments()[1];
  }
 else   if (var.length > 0) {
    tEntityClass=(Class<T>)var[0].getBounds()[0];
    tViewClass=(Class<V>)var[1].getBounds()[0];
  }
 else {
    LOG.fatal("String_Node_Str",new Throwable());
  }
  if (tEntityClass != null) {
    tClassName=tEntityClass.getName();
  }
  populateExistingBaseFields=false;
  countQueryStr="String_Node_Str" + tEntityClass.getName() + "String_Node_Str";
  queryStr="String_Node_Str" + tClassName + "String_Node_Str";
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public RangerBaseModelService(){
  Class klass=getClass();
  ParameterizedType genericSuperclass=(ParameterizedType)klass.getGenericSuperclass();
  TypeVariable<Class<?>> var[]=klass.getTypeParameters();
  if (genericSuperclass.getActualTypeArguments()[0] instanceof Class) {
    tEntityClass=(Class<T>)genericSuperclass.getActualTypeArguments()[0];
    tViewClass=(Class<V>)genericSuperclass.getActualTypeArguments()[1];
  }
 else   if (var.length > 0) {
    tEntityClass=(Class<T>)var[0].getBounds()[0];
    tViewClass=(Class<V>)var[1].getBounds()[0];
  }
 else {
    LOG.fatal("String_Node_Str",new Throwable());
  }
  if (tEntityClass != null) {
    tClassName=tEntityClass.getName();
  }
  populateExistingBaseFields=false;
  countQueryStr="String_Node_Str" + tClassName + "String_Node_Str";
  queryStr="String_Node_Str" + tClassName + "String_Node_Str";
}
Program: 166363
Project: 166363
Buggy source:
@Test public void test6populateXXToRangerResourceDef(){
  XXResourceDefDao xResourceDefDao=Mockito.mock(XXResourceDefDao.class);
  XXResourceDef resourceDefObj=new XXResourceDef();
  resourceDefObj.setAddedByUserId(Id);
  resourceDefObj.setCreateTime(new Date());
  resourceDefObj.setDefid(Id);
  resourceDefObj.setDescription("String_Node_Str");
  resourceDefObj.setId(Id);
  Mockito.when(daoManager.getXXResourceDef()).thenReturn(xResourceDefDao);
  Mockito.when(xResourceDefDao.getById(resourceDefObj.getId())).thenReturn(resourceDefObj);
  RangerResourceDef dbRangerResourceDef=rangerServiceDefService.populateXXToRangerResourceDef(resourceDefObj);
  Assert.assertNotNull(dbRangerResourceDef);
  Assert.assertEquals(dbRangerResourceDef.getName(),resourceDefObj.getName());
  Assert.assertEquals(dbRangerResourceDef.getDescription(),resourceDefObj.getDescription());
  Assert.assertEquals(dbRangerResourceDef.getType(),resourceDefObj.getType());
  Assert.assertEquals(dbRangerResourceDef.getParent(),resourceDefObj.getParent());
  Assert.assertEquals(dbRangerResourceDef.getRbKeyDescription(),resourceDefObj.getRbkeydescription());
  Mockito.verify(daoManager).getXXResourceDef();
}

Fixed version (ground truth):
@Test public void test6populateXXToRangerResourceDef(){
  XXResourceDefDao xResourceDefDao=Mockito.mock(XXResourceDefDao.class);
  XXResourceDef resourceDefObj=new XXResourceDef();
  resourceDefObj.setAddedByUserId(Id);
  resourceDefObj.setCreateTime(new Date());
  resourceDefObj.setDefid(Id);
  resourceDefObj.setDescription("String_Node_Str");
  resourceDefObj.setId(Id);
  Mockito.when(daoManager.getXXResourceDef()).thenReturn(xResourceDefDao);
  Mockito.when(xResourceDefDao.getById(resourceDefObj.getId())).thenReturn(resourceDefObj);
  RangerResourceDef dbRangerResourceDef=rangerServiceDefService.populateXXToRangerResourceDef(resourceDefObj);
  Assert.assertNotNull(dbRangerResourceDef);
  Assert.assertEquals(dbRangerResourceDef.getName(),resourceDefObj.getName());
  Assert.assertEquals(dbRangerResourceDef.getDescription(),resourceDefObj.getDescription());
  Assert.assertEquals(dbRangerResourceDef.getType(),resourceDefObj.getType());
  Assert.assertEquals(dbRangerResourceDef.getRbKeyDescription(),resourceDefObj.getRbkeydescription());
  Mockito.verify(daoManager).getXXResourceDef();
}
Program: 166364
Project: 166364
Buggy source:
public static StormClient getStormClient(String serviceName,Map<String,String> configs){
  StormClient stormClient=null;
  LOG.debug("String_Node_Str" + serviceName + "String_Node_Str"+ configs);
  String errMsg=errMessage;
  if (configs == null || configs.isEmpty()) {
    String msgDesc="String_Node_Str";
    LOG.error(msgDesc);
    HadoopException hdpException=new HadoopException(msgDesc);
    hdpException.generateResponseDataMap(false,msgDesc,msgDesc + errMsg,null,null);
    throw hdpException;
  }
 else {
    String stormUrl=configs.get("String_Node_Str");
    String stormAdminUser=configs.get("String_Node_Str");
    String stormAdminPassword=configs.get("String_Node_Str");
    stormClient=new StormClient(stormUrl,stormAdminUser,stormAdminPassword);
  }
  return stormClient;
}

Fixed version (ground truth):
public static StormClient getStormClient(String serviceName,Map<String,String> configs){
  StormClient stormClient=null;
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceName);
    LOG.debug("String_Node_Str" + BaseClient.getMaskedConfigMap(configs));
  }
  String errMsg=errMessage;
  if (configs == null || configs.isEmpty()) {
    String msgDesc="String_Node_Str";
    LOG.error(msgDesc);
    HadoopException hdpException=new HadoopException(msgDesc);
    hdpException.generateResponseDataMap(false,msgDesc,msgDesc + errMsg,null,null);
    throw hdpException;
  }
 else {
    String stormUrl=configs.get("String_Node_Str");
    String stormAdminUser=configs.get("String_Node_Str");
    String stormAdminPassword=configs.get("String_Node_Str");
    stormClient=new StormClient(stormUrl,stormAdminUser,stormAdminPassword);
  }
  return stormClient;
}
Program: 166366
Project: 166366
Buggy source:
public static boolean validateAsIP(String ipAddress,boolean ipInDotNotation){
  if (!ipInDotNotation) {
    return StringUtils.isNumeric(ipAddress);
  }
  boolean ret=false;
  try {
    byte[] bytes=InetAddress.getByName(ipAddress).getAddress();
    ret=true;
  }
 catch (  UnknownHostException exception) {
    LOG.error("String_Node_Str" + ipAddress);
  }
  return ret;
}

Fixed version (ground truth):
public static boolean validateAsIP(String ipAddress,boolean ipInDotNotation){
  if (!ipInDotNotation) {
    return StringUtils.isNumeric(ipAddress);
  }
  boolean ret=false;
  try {
    InetAddress.getByName(ipAddress).getAddress();
    ret=true;
  }
 catch (  UnknownHostException exception) {
    LOG.error("String_Node_Str" + ipAddress);
  }
  return ret;
}
Program: 166367
Project: 166367
Buggy source:
public RangerGeolocationData(final long fromIPAddress,final long toIPAddress,final String[] locationData){
  this.fromIPAddress=fromIPAddress;
  this.toIPAddress=toIPAddress;
  this.locationData=locationData;
}

Fixed version (ground truth):
private RangerGeolocationData(final long fromIPAddress,final long toIPAddress,final String[] locationData){
  this.fromIPAddress=fromIPAddress;
  this.toIPAddress=toIPAddress;
  this.locationData=locationData;
}
Program: 166368
Project: 166368
Buggy source:
@Override public int compareTo(final RangerGeolocationData other){
  int ret=Long.compare(fromIPAddress,other.fromIPAddress);
  if (ret == 0) {
    ret=Long.compare(toIPAddress,other.toIPAddress);
  }
  return ret;
}

Fixed version (ground truth):
@Override public int compareTo(final RangerGeolocationData other){
  int ret=(other == null) ? 1 : 0;
  if (ret == 0) {
    ret=Long.compare(fromIPAddress,other.fromIPAddress);
    if (ret == 0) {
      ret=Long.compare(toIPAddress,other.toIPAddress);
      if (ret == 0) {
        ret=Integer.compare(locationData.length,other.locationData.length);
        for (int i=0; ret == 0 && i < locationData.length; i++) {
          ret=stringCompareTo(locationData[i],other.locationData[i]);
        }
      }
    }
  }
  return ret;
}
Program: 166369
Project: 166369
Buggy source:
ValuePrinter(String fileName,boolean pretty){
  this.fileName=fileName;
  this.pretty=pretty;
}

Fixed version (ground truth):
ValuePrinter(String fileName){
  this.fileName=fileName;
}
Program: 166370
Project: 166370
Buggy source:
public StringBuilder toString(StringBuilder sb){
  sb.append("String_Node_Str");
  sb.append("String_Node_Str").append(getGuid()).append("String_Node_Str");
  sb.append("String_Node_Str").append(serviceName).append("String_Node_Str");
  sb.append("String_Node_Str");
  if (resourceElements != null) {
    for (    Map.Entry<String,RangerPolicy.RangerPolicyResource> e : resourceElements.entrySet()) {
      sb.append(e.getKey()).append("String_Node_Str");
      e.getValue().toString(sb);
      sb.append("String_Node_Str");
    }
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str").append(resourceSignature).append("String_Node_Str");
  sb.append("String_Node_Str");
  return sb;
}

Fixed version (ground truth):
public StringBuilder toString(StringBuilder sb){
  sb.append("String_Node_Str");
  super.toString(sb);
  sb.append("String_Node_Str").append(getGuid()).append("String_Node_Str");
  sb.append("String_Node_Str").append(serviceName).append("String_Node_Str");
  sb.append("String_Node_Str");
  if (resourceElements != null) {
    for (    Map.Entry<String,RangerPolicy.RangerPolicyResource> e : resourceElements.entrySet()) {
      sb.append(e.getKey()).append("String_Node_Str");
      e.getValue().toString(sb);
      sb.append("String_Node_Str");
    }
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str").append(resourceSignature).append("String_Node_Str");
  sb.append("String_Node_Str");
  return sb;
}
Program: 166371
Project: 166371
Buggy source:
public void setName(String name){
  this.name=name == null ? new String() : name;
}

Fixed version (ground truth):
public void setName(String name){
  this.name=name == null ? "String_Node_Str" : name;
}
Program: 166372
Project: 166372
Buggy source:
public void setSource(String source){
  this.source=source == null ? new String() : source;
}

Fixed version (ground truth):
public void setSource(String source){
  this.source=source == null ? "String_Node_Str" : source;
}
Program: 166373
Project: 166373
Buggy source:
public void setType(String type){
  this.type=type == null ? new String() : type;
}

Fixed version (ground truth):
public void setType(String type){
  this.type=type == null ? "String_Node_Str" : type;
}
Program: 166374
Project: 166374
Buggy source:
public StringBuilder toString(StringBuilder sb){
  sb.append("String_Node_Str");
  sb.append("String_Node_Str").append(resourceId).append("String_Node_Str");
  sb.append("String_Node_Str").append(tagId);
  sb.append("String_Node_Str");
  return sb;
}

Fixed version (ground truth):
public StringBuilder toString(StringBuilder sb){
  sb.append("String_Node_Str");
  super.toString(sb);
  sb.append("String_Node_Str").append(resourceId).append("String_Node_Str");
  sb.append("String_Node_Str").append(tagId);
  sb.append("String_Node_Str");
  return sb;
}
Program: 166377
Project: 166377
Buggy source:
@Override public String toString(){
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  if (_policyResource != null) {
    builder.append("String_Node_Str");
    if (_policyResource.getValues() != null) {
      List<String> values=new ArrayList<String>(_policyResource.getValues());
      Collections.sort(values);
      builder.append(values);
    }
  }
  builder.append("String_Node_Str");
  if (_policyResource.getIsExcludes() == null) {
    builder.append(Boolean.FALSE);
  }
 else {
    builder.append(_policyResource.getIsExcludes());
  }
  builder.append("String_Node_Str");
  if (_policyResource.getIsRecursive() == null) {
    builder.append(Boolean.FALSE);
  }
 else {
    builder.append(_policyResource.getIsRecursive());
  }
  builder.append("String_Node_Str");
  return builder.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  if (_policyResource != null) {
    builder.append("String_Node_Str");
    if (_policyResource.getValues() != null) {
      List<String> values=new ArrayList<String>(_policyResource.getValues());
      Collections.sort(values);
      builder.append(values);
    }
    builder.append("String_Node_Str");
    if (_policyResource.getIsExcludes() == null) {
      builder.append(Boolean.FALSE);
    }
 else {
      builder.append(_policyResource.getIsExcludes());
    }
    builder.append("String_Node_Str");
    if (_policyResource.getIsRecursive() == null) {
      builder.append(Boolean.FALSE);
    }
 else {
      builder.append(_policyResource.getIsRecursive());
    }
  }
  builder.append("String_Node_Str");
  return builder.toString();
}
Program: 166378
Project: 166378
Buggy source:
@Override public List<RangerTagResourceMap> getTagResourceMapsForResourceGuid(String resourceGuid) throws Exception {
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resourceGuid + "String_Node_Str");
  }
  SearchFilter filter=new SearchFilter();
  RangerServiceResource resource=getServiceResourceByGuid(resourceGuid);
  filter.setParam(SearchFilter.TAG_RESOURCE_ID,resource.getId().toString());
  List<RangerTagResourceMap> ret=getTagResourceMaps(filter);
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resourceGuid + "String_Node_Str"+ ret);
  }
  return ret;
}

Fixed version (ground truth):
@Override public List<RangerTagResourceMap> getTagResourceMapsForResourceGuid(String resourceGuid) throws Exception {
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resourceGuid + "String_Node_Str");
  }
  List<RangerTagResourceMap> ret=null;
  RangerServiceResource resource=getServiceResourceByGuid(resourceGuid);
  if (resource != null) {
    SearchFilter filter=new SearchFilter();
    filter.setParam(SearchFilter.TAG_RESOURCE_ID,resource.getId().toString());
    ret=getTagResourceMaps(filter);
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resourceGuid + "String_Node_Str"+ ret);
  }
  return ret;
}
Program: 166381
Project: 166381
Buggy source:
private static void retrieveUsers(LdapContext ldapContext,UserSync userSyncObj) throws Throwable {
  String msg;
  if (userSyncObj.getUserNameAttribute() == null || userSyncObj.getUserNameAttribute().isEmpty()) {
    msg="String_Node_Str";
    throw new NullArgumentException(msg);
  }
  if (userSyncObj.getUserObjClassName() == null || userSyncObj.getUserObjClassName().isEmpty()) {
    msg="String_Node_Str";
    throw new NullArgumentException(msg);
  }
  if (userSyncObj.getUserGroupMemberName() == null || userSyncObj.getUserGroupMemberName().isEmpty()) {
    msg="String_Node_Str";
    throw new NullArgumentException(msg);
  }
  if ((userSyncObj.getUserSearchBase() == null || userSyncObj.getUserSearchBase().isEmpty()) && (userSyncObj.getSearchBase() == null || userSyncObj.getSearchBase().isEmpty())) {
    msg="String_Node_Str" + "String_Node_Str";
    throw new NullArgumentException(msg);
  }
  userSyncObj.getAllUsers(ldapContext);
}

Fixed version (ground truth):
private static void retrieveUsers(LdapContext ldapContext,UserSync userSyncObj) throws Throwable {
  String msg;
  if (userSyncObj.getUserNameAttribute() == null || userSyncObj.getUserNameAttribute().isEmpty()) {
    msg="String_Node_Str";
    throw new NullArgumentException(msg);
  }
  if (userSyncObj.getUserObjClassName() == null || userSyncObj.getUserObjClassName().isEmpty()) {
    msg="String_Node_Str";
    throw new NullArgumentException(msg);
  }
  if ((userSyncObj.getUserSearchBase() == null || userSyncObj.getUserSearchBase().isEmpty()) && (userSyncObj.getSearchBase() == null || userSyncObj.getSearchBase().isEmpty())) {
    msg="String_Node_Str" + "String_Node_Str";
    throw new NullArgumentException(msg);
  }
  userSyncObj.getAllUsers(ldapContext);
}
Program: 166382
Project: 166382
Buggy source:
private static void retrieveGroups(LdapContext ldapContext,UserSync userSyncObj) throws Throwable {
  String msg;
  if (userSyncObj.getGroupNameAttrName() == null || userSyncObj.getGroupNameAttrName().isEmpty()) {
    msg="String_Node_Str";
    throw new NullArgumentException(msg);
  }
  if (userSyncObj.getGroupObjClassName() == null || userSyncObj.getGroupObjClassName().isEmpty()) {
    msg="String_Node_Str";
    throw new NullArgumentException(msg);
  }
  if (userSyncObj.getUserGroupMemberName() == null || userSyncObj.getUserGroupMemberName().isEmpty()) {
    msg="String_Node_Str";
    throw new NullArgumentException(msg);
  }
  if ((userSyncObj.getGroupSearchBase() == null || userSyncObj.getGroupSearchBase().isEmpty()) && (userSyncObj.getSearchBase() == null || userSyncObj.getSearchBase().isEmpty())) {
    msg="String_Node_Str" + "String_Node_Str";
    throw new NullArgumentException(msg);
  }
  userSyncObj.getAllGroups(ldapContext);
}

Fixed version (ground truth):
private static void retrieveGroups(LdapContext ldapContext,UserSync userSyncObj) throws Throwable {
  String msg;
  if (userSyncObj.getGroupNameAttrName() == null || userSyncObj.getGroupNameAttrName().isEmpty()) {
    msg="String_Node_Str";
    throw new NullArgumentException(msg);
  }
  if (userSyncObj.getGroupObjClassName() == null || userSyncObj.getGroupObjClassName().isEmpty()) {
    msg="String_Node_Str";
    throw new NullArgumentException(msg);
  }
  if (userSyncObj.getGroupMemberName() == null || userSyncObj.getGroupMemberName().isEmpty()) {
    msg="String_Node_Str";
    throw new NullArgumentException(msg);
  }
  if ((userSyncObj.getGroupSearchBase() == null || userSyncObj.getGroupSearchBase().isEmpty()) && (userSyncObj.getSearchBase() == null || userSyncObj.getSearchBase().isEmpty())) {
    msg="String_Node_Str" + "String_Node_Str";
    throw new NullArgumentException(msg);
  }
  userSyncObj.getAllGroups(ldapContext);
}
Program: 166386
Project: 166386
Buggy source:
public RangerPolicyList getPaginatedServicePolicies(String serviceName,SearchFilter filter) throws Exception {
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceName + "String_Node_Str");
  }
  RangerPolicyList ret=null;
  try {
    if (filter == null) {
      filter=new SearchFilter();
    }
    filter.setParam(SearchFilter.SERVICE_NAME,serviceName);
    ret=getPaginatedPolicies(filter);
  }
 catch (  Exception excp) {
    LOG.error("String_Node_Str" + serviceName + "String_Node_Str",excp);
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceName + "String_Node_Str"+ ((ret == null) ? 0 : ret.getListSize()));
  }
  return ret;
}

Fixed version (ground truth):
public RangerPolicyList getPaginatedServicePolicies(String serviceName,SearchFilter filter) throws Exception {
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceName + "String_Node_Str");
  }
  if (filter == null) {
    filter=new SearchFilter();
  }
  filter.setParam(SearchFilter.SERVICE_NAME,serviceName);
  RangerPolicyList ret=getPaginatedPolicies(filter);
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceName + "String_Node_Str"+ ((ret == null) ? 0 : ret.getListSize()));
  }
  return ret;
}
Program: 166387
Project: 166387
Buggy source:
@Override public List<RangerPolicy> getServicePolicies(String serviceName,SearchFilter filter) throws Exception {
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceName + "String_Node_Str");
  }
  List<RangerPolicy> ret=new ArrayList<RangerPolicy>();
  try {
    if (filter == null) {
      filter=new SearchFilter();
    }
    filter.setParam(SearchFilter.SERVICE_NAME,serviceName);
    ret=getPolicies(filter);
  }
 catch (  Exception excp) {
    LOG.error("String_Node_Str" + serviceName + "String_Node_Str",excp);
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceName + "String_Node_Str"+ ((ret == null) ? 0 : ret.size()));
  }
  return ret;
}

Fixed version (ground truth):
@Override public List<RangerPolicy> getServicePolicies(String serviceName,SearchFilter filter) throws Exception {
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceName + "String_Node_Str");
  }
  if (filter == null) {
    filter=new SearchFilter();
  }
  filter.setParam(SearchFilter.SERVICE_NAME,serviceName);
  List<RangerPolicy> ret=getPolicies(filter);
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceName + "String_Node_Str"+ ((ret == null) ? 0 : ret.size()));
  }
  return ret;
}
Program: 166388
Project: 166388
Buggy source:
@Test public void test32getServicePolicies() throws Exception {
  SearchFilter filter=new SearchFilter();
  filter.setParam(SearchFilter.POLICY_NAME,"String_Node_Str");
  filter.setParam(SearchFilter.SERVICE_NAME,"String_Node_Str");
  XXService xService=xService();
  XXServiceDao xServiceDao=Mockito.mock(XXServiceDao.class);
  Mockito.when(daoManager.getXXService()).thenReturn(xServiceDao);
  Mockito.when(xServiceDao.getById(Id)).thenReturn(xService);
  List<RangerPolicy> dbRangerPolicy=serviceDBStore.getServicePolicies(Id,filter);
  Assert.assertNotNull(dbRangerPolicy);
  Mockito.verify(daoManager).getXXService();
}

Fixed version (ground truth):
@Test public void test32getServicePolicies() throws Exception {
  SearchFilter filter=new SearchFilter();
  filter.setParam(SearchFilter.POLICY_NAME,"String_Node_Str");
  filter.setParam(SearchFilter.SERVICE_NAME,"String_Node_Str");
  XXService xService=xService();
  XXServiceDao xServiceDao=Mockito.mock(XXServiceDao.class);
  Mockito.when(daoManager.getXXService()).thenReturn(xServiceDao);
  Mockito.when(xServiceDao.getById(Id)).thenReturn(xService);
  thrown.expect(Exception.class);
  List<RangerPolicy> dbRangerPolicy=serviceDBStore.getServicePolicies(Id,filter);
  Mockito.verify(daoManager).getXXService();
}
Program: 166389
Project: 166389
Buggy source:
@Test public void test37getPaginatedServicePolicies() throws Exception {
  SearchFilter filter=new SearchFilter();
  filter.setParam(SearchFilter.POLICY_NAME,"String_Node_Str");
  filter.setParam(SearchFilter.SERVICE_NAME,"String_Node_Str");
  RangerService rangerService=rangerService();
  XXService xService=xService();
  XXServiceDao xServiceDao=Mockito.mock(XXServiceDao.class);
  Mockito.when(daoManager.getXXService()).thenReturn(xServiceDao);
  Mockito.when(xServiceDao.getById(Id)).thenReturn(xService);
  RangerPolicyList dbRangerPolicyList=serviceDBStore.getPaginatedServicePolicies(rangerService.getId(),filter);
  Assert.assertNull(dbRangerPolicyList);
  Mockito.verify(daoManager).getXXService();
}

Fixed version (ground truth):
@Test public void test37getPaginatedServicePolicies() throws Exception {
  SearchFilter filter=new SearchFilter();
  filter.setParam(SearchFilter.POLICY_NAME,"String_Node_Str");
  filter.setParam(SearchFilter.SERVICE_NAME,"String_Node_Str");
  RangerService rangerService=rangerService();
  XXService xService=xService();
  XXServiceDao xServiceDao=Mockito.mock(XXServiceDao.class);
  Mockito.when(daoManager.getXXService()).thenReturn(xServiceDao);
  Mockito.when(xServiceDao.getById(Id)).thenReturn(xService);
  thrown.expect(Exception.class);
  RangerPolicyList dbRangerPolicyList=serviceDBStore.getPaginatedServicePolicies(rangerService.getId(),filter);
  Mockito.verify(daoManager).getXXService();
}
Program: 166391
Project: 166391
Buggy source:
@Override public ServiceTags getServiceTagsIfUpdated(long lastKnownVersion) throws Exception {
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + lastKnownVersion + "String_Node_Str");
  }
  ServiceTags ret;
  WebResource webResource=createWebResource(RangerRESTUtils.REST_URL_GET_SERVICE_TAGS_IF_UPDATED).queryParam(RangerRESTUtils.SERVICE_NAME_PARAM,serviceName).queryParam(RangerRESTUtils.LAST_KNOWN_TAG_VERSION_PARAM,Long.toString(lastKnownVersion)).queryParam(RangerRESTUtils.REST_PARAM_PLUGIN_ID,pluginId);
  ClientResponse response=webResource.accept(RangerRESTUtils.REST_MIME_TYPE_JSON).get(ClientResponse.class);
  if (response != null && response.getStatus() == 200) {
    ret=response.getEntity(ServiceTags.class);
  }
 else {
    RESTResponse resp=RESTResponse.fromClientResponse(response);
    LOG.error("String_Node_Str" + webResource.toString() + "String_Node_Str"+ resp.toString()+ "String_Node_Str"+ serviceName+ "String_Node_Str"+ "String_Node_Str"+ lastKnownVersion);
    throw new Exception(resp.getMessage());
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + lastKnownVersion + "String_Node_Str");
  }
  return ret;
}

Fixed version (ground truth):
@Override public ServiceTags getServiceTagsIfUpdated(long lastKnownVersion) throws Exception {
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + lastKnownVersion + "String_Node_Str");
  }
  ServiceTags ret;
  WebResource webResource=createWebResource(RangerRESTUtils.REST_URL_GET_SERVICE_TAGS_IF_UPDATED + serviceName).queryParam(RangerRESTUtils.LAST_KNOWN_TAG_VERSION_PARAM,Long.toString(lastKnownVersion)).queryParam(RangerRESTUtils.REST_PARAM_PLUGIN_ID,pluginId);
  ClientResponse response=webResource.accept(RangerRESTUtils.REST_MIME_TYPE_JSON).get(ClientResponse.class);
  if (response != null && response.getStatus() == 200) {
    ret=response.getEntity(ServiceTags.class);
  }
 else {
    RESTResponse resp=RESTResponse.fromClientResponse(response);
    LOG.error("String_Node_Str" + webResource.toString() + "String_Node_Str"+ resp.toString()+ "String_Node_Str"+ serviceName+ "String_Node_Str"+ "String_Node_Str"+ lastKnownVersion);
    throw new Exception(resp.getMessage());
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + lastKnownVersion + "String_Node_Str");
  }
  return ret;
}
Program: 166392
Project: 166392
Buggy source:
@Override public void retrieveTags(){
  if (adminClient != null) {
    ServiceTags serviceTags=null;
    long savedLastKnownVersion=lastKnownVersion;
    try {
      serviceTags=adminClient.getServiceTagsIfUpdated(lastKnownVersion);
      lastKnownVersion=serviceTags.getTagVersion();
    }
 catch (    Exception exp) {
      LOG.error("String_Node_Str");
    }
    if (receiver != null && serviceTags != null) {
      if (serviceTags.getTagVersion() != null && serviceTags.getTagVersion().longValue() > savedLastKnownVersion) {
        receiver.setServiceTags(serviceTags);
      }
 else {
        if (LOG.isDebugEnabled()) {
          LOG.debug("String_Node_Str");
        }
      }
    }
 else {
      LOG.error("String_Node_Str");
    }
  }
 else {
    LOG.error("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void retrieveTags(){
  if (adminClient != null && receiver != null) {
    ServiceTags serviceTags=null;
    try {
      serviceTags=adminClient.getServiceTagsIfUpdated(lastKnownVersion);
    }
 catch (    Exception exp) {
      LOG.error("String_Node_Str",exp);
    }
    if (serviceTags != null) {
      LOG.info("String_Node_Str" + lastKnownVersion + "String_Node_Str"+ serviceTags.getTagVersion());
      lastKnownVersion=serviceTags.getTagVersion();
      receiver.setServiceTags(serviceTags);
    }
 else {
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + lastKnownVersion);
      }
    }
  }
 else {
    LOG.error("String_Node_Str");
  }
}
Program: 166393
Project: 166393
Buggy source:
private List<RangerTag> findMatchingTags(final RangerAccessResource resource,final List<RangerServiceResourceMatcher> resourceMatchers){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resource + "String_Node_Str");
  }
  List<RangerTag> ret=null;
  if (CollectionUtils.isNotEmpty(resourceMatchers)) {
    for (    RangerServiceResourceMatcher resourceMatcher : resourceMatchers) {
      RangerServiceResource serviceResource=resourceMatcher.getServiceResource();
      RangerPolicyResourceMatcher matcher=resourceMatcher.getPolicyResourceMatcher();
      boolean matchResult=matcher.isMatch(resource);
      if (matchResult) {
        if (ret == null) {
          ret=new ArrayList<RangerTag>();
        }
        ret.addAll(getTagsForServiceResource(serviceTags,serviceResource));
      }
    }
  }
  if (LOG.isDebugEnabled()) {
    if (CollectionUtils.isEmpty(ret)) {
      LOG.debug("String_Node_Str" + resource + "String_Node_Str");
    }
 else {
      LOG.debug("String_Node_Str" + resource + "String_Node_Str"+ ret.size()+ "String_Node_Str");
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resource + "String_Node_Str");
  }
  return ret;
}

Fixed version (ground truth):
private List<RangerTag> findMatchingTags(final RangerAccessResource resource,final List<RangerServiceResourceMatcher> resourceMatchers){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resource + "String_Node_Str");
  }
  List<RangerTag> ret=null;
  if (CollectionUtils.isNotEmpty(resourceMatchers)) {
    for (    RangerServiceResourceMatcher resourceMatcher : resourceMatchers) {
      boolean matchResult=resourceMatcher.isMatch(resource);
      if (matchResult) {
        if (ret == null) {
          ret=new ArrayList<RangerTag>();
        }
        ret.addAll(getTagsForServiceResource(serviceTags,resourceMatcher.getServiceResource()));
      }
    }
  }
  if (LOG.isDebugEnabled()) {
    if (CollectionUtils.isEmpty(ret)) {
      LOG.debug("String_Node_Str" + resource + "String_Node_Str");
    }
 else {
      LOG.debug("String_Node_Str" + resource + "String_Node_Str"+ ret.size()+ "String_Node_Str");
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resource + "String_Node_Str");
  }
  return ret;
}
Program: 166395
Project: 166395
Buggy source:
public static void tearDownAfterClass(String suffix) throws Exception {
  Path dirPath=new Path("String_Node_Str");
  FileSystem fs=dirPath.getFileSystem(config);
  try {
    if (fs.exists(dirPath) && fs.isDirectory(dirPath)) {
      RemoteIterator<LocatedFileStatus> files=fs.listFiles(dirPath,false);
      if (files != null) {
        while (files.hasNext()) {
          LocatedFileStatus fileStatus=files.next();
          Path path=fileStatus.getPath();
          if (fs.isFile(path) && path.getName().endsWith(suffix)) {
            fs.delete(path,true);
          }
        }
      }
    }
  }
 catch (  IOException excp) {
  }
  fs.delete(filePath,true);
}

Fixed version (ground truth):
@AfterClass public static void tearDownAfterClass() throws Exception {
  Path dirPath=new Path(tmpDir);
  FileSystem fs=dirPath.getFileSystem(config);
  try {
    if (fs.exists(dirPath) && fs.isDirectory(dirPath)) {
      RemoteIterator<LocatedFileStatus> files=fs.listFiles(dirPath,false);
      if (files != null) {
        while (files.hasNext()) {
          LocatedFileStatus fileStatus=files.next();
          Path path=fileStatus.getPath();
          if (fs.isFile(path)) {
            fs.delete(path,true);
          }
        }
      }
    }
  }
 catch (  IOException excp) {
  }
  fs.delete(filePath,true);
}
Program: 166396
Project: 166396
Buggy source:
@BeforeClass public static void setupTest() throws Exception {
  tearDownAfterClass(crcSuffix);
  tearDownAfterClass(jsonSuffix);
  FileSystem fs=filePath.getFileSystem(config);
  FSDataOutputStream outStream=fs.create(filePath,true);
  OutputStreamWriter writer=null;
  writer=new OutputStreamWriter(outStream);
  writer.write("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  writer.close();
  RangerConfiguration config=RangerConfiguration.getInstance();
  config.addResource(filePath);
  tagStore=TagFileStore.getInstance();
  tagStore.init();
  ServiceStore svcStore;
  svcStore=new ServiceFileStore();
  svcStore.init();
  tagStore.setServiceStore(svcStore);
  validator=new TagValidator();
  validator.setTagStore(tagStore);
  gsonBuilder=new GsonBuilder().setDateFormat("String_Node_Str").setPrettyPrinting().create();
  InputStream inStream=TestTagStore.class.getResourceAsStream(serviceDefJsonFile);
  InputStreamReader reader=new InputStreamReader(inStream);
  serviceDef=gsonBuilder.fromJson(reader,RangerServiceDef.class);
  service=svcStore.createService(new RangerService(serviceDef.getName(),serviceName,serviceName,null,null));
  reader.close();
  inStream.close();
}

Fixed version (ground truth):
@BeforeClass public static void setupTest() throws Exception {
  tmpDir="String_Node_Str" + System.getProperty("String_Node_Str");
  String textTemplate="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  String text=String.format(textTemplate,tmpDir,tmpDir);
  String fileName=tmpDir + "String_Node_Str";
  filePath=new Path(fileName);
  FileSystem fs=filePath.getFileSystem(config);
  FSDataOutputStream outStream=fs.create(filePath,true);
  OutputStreamWriter writer=new OutputStreamWriter(outStream);
  writer.write(text);
  writer.close();
  RangerConfiguration config=RangerConfiguration.getInstance();
  config.addResource(filePath);
  ServiceStore svcStore=new ServiceFileStore();
  svcStore.init();
  tagStore=TagFileStore.getInstance();
  tagStore.init();
  tagStore.setServiceStore(svcStore);
  validator=new TagValidator();
  validator.setTagStore(tagStore);
  gsonBuilder=new GsonBuilder().setDateFormat("String_Node_Str").setPrettyPrinting().create();
  InputStream inStream=TestTagStore.class.getResourceAsStream(serviceDefJsonFile);
  InputStreamReader reader=new InputStreamReader(inStream);
  serviceDef=gsonBuilder.fromJson(reader,RangerServiceDef.class);
  service=svcStore.createService(new RangerService(serviceDef.getName(),serviceName,serviceName,null,null));
  reader.close();
  inStream.close();
}
Program: 166398
Project: 166398
Buggy source:
@Override @SuppressWarnings("String_Node_Str") protected RangerService mapEntityToViewBean(RangerService vObj,XXServiceBase xObj){
  XXServiceDef xServiceDef=daoMgr.getXXServiceDef().getById(xObj.getType());
  XXService xTagService=xObj.getTagService() != null ? daoMgr.getXXService().getById(xObj.getTagService()) : null;
  vObj.setType(xServiceDef.getName());
  vObj.setGuid(xObj.getGuid());
  vObj.setVersion(xObj.getVersion());
  vObj.setName(xObj.getName());
  vObj.setDescription(xObj.getDescription());
  vObj.setTagService(xTagService != null ? xTagService.getName() : null);
  vObj.setPolicyVersion(xObj.getPolicyVersion());
  vObj.setPolicyUpdateTime(xObj.getPolicyUpdateTime());
  vObj.setIsEnabled(xObj.getIsenabled());
  return vObj;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") protected RangerService mapEntityToViewBean(RangerService vObj,XXServiceBase xObj){
  XXServiceDef xServiceDef=daoMgr.getXXServiceDef().getById(xObj.getType());
  XXService xTagService=xObj.getTagService() != null ? daoMgr.getXXService().getById(xObj.getTagService()) : null;
  vObj.setType(xServiceDef.getName());
  vObj.setGuid(xObj.getGuid());
  vObj.setVersion(xObj.getVersion());
  vObj.setName(xObj.getName());
  vObj.setDescription(xObj.getDescription());
  vObj.setTagService(xTagService != null ? xTagService.getName() : null);
  vObj.setPolicyVersion(xObj.getPolicyVersion());
  vObj.setTagVersion(xObj.getTagVersion());
  vObj.setPolicyUpdateTime(xObj.getPolicyUpdateTime());
  vObj.setTagUpdateTime(xObj.getTagUpdateTime());
  vObj.setIsEnabled(xObj.getIsenabled());
  return vObj;
}