nus-yam/ex-repair huggingface dataset:
Program: 166269
Project: 166269
Buggy source:
@org.junit.AfterClass public static void cleanup() throws Exception {
  if (kafkaServer != null) {
    kafkaServer.shutdown();
  }
  if (zkServer != null) {
    zkServer.stop();
  }
  File clientKeystoreFile=new File(clientKeystorePath);
  if (clientKeystoreFile.exists()) {
    clientKeystoreFile.delete();
  }
  File serviceKeystoreFile=new File(serviceKeystorePath);
  if (serviceKeystoreFile.exists()) {
    serviceKeystoreFile.delete();
  }
  File truststoreFile=new File(truststorePath);
  if (truststoreFile.exists()) {
    truststoreFile.delete();
  }
  if (tempDir != null) {
    FileUtils.deleteDirectory(tempDir.toFile());
  }
}

Fixed version (ground truth):
@org.junit.AfterClass public static void cleanup() throws Exception {
  if (kafkaServer != null) {
    kafkaServer.shutdown();
  }
  if (zkServer != null) {
    zkServer.stop();
  }
  File clientKeystoreFile=new File(clientKeystorePath);
  if (clientKeystoreFile.exists()) {
    FileUtils.forceDelete(clientKeystoreFile);
  }
  File serviceKeystoreFile=new File(serviceKeystorePath);
  if (serviceKeystoreFile.exists()) {
    FileUtils.forceDelete(serviceKeystoreFile);
  }
  File truststoreFile=new File(truststorePath);
  if (truststoreFile.exists()) {
    FileUtils.forceDelete(truststoreFile);
  }
  if (tempDir != null) {
    FileUtils.deleteDirectory(tempDir.toFile());
  }
}
Program: 166271
Project: 166271
Buggy source:
public static String createAndStoreKey(String subjectName,String issuerName,BigInteger serial,String keystorePassword,String keystoreAlias,String keyPassword,KeyStore trustStore) throws Exception {
  KeyPairGenerator keyPairGenerator=KeyPairGenerator.getInstance("String_Node_Str");
  keyPairGenerator.initialize(2048,new SecureRandom());
  KeyPair keyPair=keyPairGenerator.generateKeyPair();
  Date currentDate=new Date();
  Date expiryDate=new Date(currentDate.getTime() + 365L * 24L * 60L* 60L* 1000L);
  X509v3CertificateBuilder certBuilder=new X509v3CertificateBuilder(new X500Name(RFC4519Style.INSTANCE,issuerName),serial,currentDate,expiryDate,new X500Name(RFC4519Style.INSTANCE,subjectName),SubjectPublicKeyInfo.getInstance(keyPair.getPublic().getEncoded()));
  ContentSigner contentSigner=new JcaContentSignerBuilder("String_Node_Str").build(keyPair.getPrivate());
  X509Certificate certificate=new JcaX509CertificateConverter().getCertificate(certBuilder.build(contentSigner));
  KeyStore keystore=KeyStore.getInstance(KeyStore.getDefaultType());
  keystore.load(null,keystorePassword.toCharArray());
  keystore.setKeyEntry(keystoreAlias,keyPair.getPrivate(),keyPassword.toCharArray(),new Certificate[]{certificate});
  File keystoreFile=File.createTempFile("String_Node_Str","String_Node_Str");
  keystore.store(new FileOutputStream(keystoreFile),keystorePassword.toCharArray());
  trustStore.setCertificateEntry(keystoreAlias,certificate);
  return keystoreFile.getPath();
}

Fixed version (ground truth):
public static String createAndStoreKey(String subjectName,String issuerName,BigInteger serial,String keystorePassword,String keystoreAlias,String keyPassword,KeyStore trustStore) throws Exception {
  KeyPairGenerator keyPairGenerator=KeyPairGenerator.getInstance("String_Node_Str");
  keyPairGenerator.initialize(2048,new SecureRandom());
  KeyPair keyPair=keyPairGenerator.generateKeyPair();
  Date currentDate=new Date();
  Date expiryDate=new Date(currentDate.getTime() + 365L * 24L * 60L* 60L* 1000L);
  X509v3CertificateBuilder certBuilder=new X509v3CertificateBuilder(new X500Name(RFC4519Style.INSTANCE,issuerName),serial,currentDate,expiryDate,new X500Name(RFC4519Style.INSTANCE,subjectName),SubjectPublicKeyInfo.getInstance(keyPair.getPublic().getEncoded()));
  ContentSigner contentSigner=new JcaContentSignerBuilder("String_Node_Str").build(keyPair.getPrivate());
  X509Certificate certificate=new JcaX509CertificateConverter().getCertificate(certBuilder.build(contentSigner));
  KeyStore keystore=KeyStore.getInstance(KeyStore.getDefaultType());
  keystore.load(null,keystorePassword.toCharArray());
  keystore.setKeyEntry(keystoreAlias,keyPair.getPrivate(),keyPassword.toCharArray(),new Certificate[]{certificate});
  File keystoreFile=File.createTempFile("String_Node_Str","String_Node_Str");
  try (OutputStream output=new FileOutputStream(keystoreFile)){
    keystore.store(output,keystorePassword.toCharArray());
  }
   trustStore.setCertificateEntry(keystoreAlias,certificate);
  return keystoreFile.getPath();
}
Program: 166272
Project: 166272
Buggy source:
private void createGenericUser(){
  VXUser genericUser=new VXUser();
  genericUser.setName(RangerPolicyEngine.USER_CURRENT);
  xUserService.createXUserWithOutLogin(genericUser);
}

Fixed version (ground truth):
private void createGenericUser(){
  VXUser genericUser=new VXUser();
  genericUser.setName(RangerPolicyEngine.USER_CURRENT);
  genericUser.setDescription(RangerPolicyEngine.USER_CURRENT);
  xUserService.createXUserWithOutLogin(genericUser);
}
Program: 166273
Project: 166273
Buggy source:
String getDataMaskName(Long dataMaskDefId){
  String ret=null;
  if (dataMaskDefId != null) {
    ret=dataMasks.get(dataMaskDefId);
    if (ret == null) {
      XXDataMaskTypeDef xDataMaskDef=daoMgr.getXXDataMaskTypeDef().getById(dataMaskDefId);
      if (xDataMaskDef != null) {
        ret=xDataMaskDef.getName();
        resourceDefs.put(dataMaskDefId,ret);
      }
    }
  }
  return ret;
}

Fixed version (ground truth):
String getDataMaskName(Long dataMaskDefId){
  String ret=null;
  if (dataMaskDefId != null) {
    ret=dataMasks.get(dataMaskDefId);
    if (ret == null) {
      XXDataMaskTypeDef xDataMaskDef=daoMgr.getXXDataMaskTypeDef().getById(dataMaskDefId);
      if (xDataMaskDef != null) {
        ret=xDataMaskDef.getName();
        dataMasks.put(dataMaskDefId,ret);
      }
    }
  }
  return ret;
}
Program: 166274
Project: 166274
Buggy source:
public void init(Properties prop,String basePropertyName);

Fixed version (ground truth):
void init(Properties prop,String basePropertyName);
Program: 166275
Project: 166275
Buggy source:
/** 
 * Name for this provider. Used only during logging. Uniqueness is not guaranteed
 */
public String getName();

Fixed version (ground truth):
/** 
 * Name for this provider. Used only during logging. Uniqueness is not guaranteed
 */
String getName();
Program: 166276
Project: 166276
Buggy source:
public void stop();

Fixed version (ground truth):
void stop();
Program: 166277
Project: 166277
Buggy source:
public void flush();

Fixed version (ground truth):
void flush();
Program: 166278
Project: 166278
Buggy source:
public boolean log(Collection<AuditEventBase> events);

Fixed version (ground truth):
boolean log(Collection<AuditEventBase> events);
Program: 166279
Project: 166279
Buggy source:
public boolean logJSON(Collection<String> events);

Fixed version (ground truth):
boolean logJSON(Collection<String> events);
Program: 166280
Project: 166280
Buggy source:
public void start();

Fixed version (ground truth):
void start();
Program: 166281
Project: 166281
Buggy source:
public void waitToComplete(long timeout);

Fixed version (ground truth):
void waitToComplete(long timeout);
Program: 166282
Project: 166282
Buggy source:
public boolean add(T log);

Fixed version (ground truth):
boolean add(T log);
Program: 166283
Project: 166283
Buggy source:
public void stop();

Fixed version (ground truth):
void stop();
Program: 166284
Project: 166284
Buggy source:
public void start(LogDestination<T> destination);

Fixed version (ground truth):
void start(LogDestination<T> destination);
Program: 166285
Project: 166285
Buggy source:
public boolean isEmpty();

Fixed version (ground truth):
boolean isEmpty();
Program: 166286
Project: 166286
Buggy source:
/** 
 * Name for the destination
 * @return
 */
public String getName();

Fixed version (ground truth):
/** 
 * Name for the destination
 * @return
 */
String getName();
Program: 166287
Project: 166287
Buggy source:
public void stop();

Fixed version (ground truth):
void stop();
Program: 166288
Project: 166288
Buggy source:
public boolean flush();

Fixed version (ground truth):
boolean flush();
Program: 166289
Project: 166289
Buggy source:
public void start();

Fixed version (ground truth):
void start();
Program: 166290
Project: 166290
Buggy source:
public boolean send(AuditEventBase[] logs) throws AuditMessageException ;

Fixed version (ground truth):
boolean send(AuditEventBase[] logs) throws AuditMessageException ;
Program: 166291
Project: 166291
Buggy source:
public boolean sendStringified(String[] logs) throws AuditMessageException ;

Fixed version (ground truth):
boolean sendStringified(String[] logs) throws AuditMessageException ;
Program: 166292
Project: 166292
Buggy source:
public abstract String getValue(String name);

Fixed version (ground truth):
String getValue(String name);
Program: 166293
Project: 166293
Buggy source:
public abstract String getOwnerUser();

Fixed version (ground truth):
String getOwnerUser();
Program: 166294
Project: 166294
Buggy source:
public RangerServiceDef getServiceDef();

Fixed version (ground truth):
RangerServiceDef getServiceDef();
Program: 166295
Project: 166295
Buggy source:
public abstract boolean exists(String name);

Fixed version (ground truth):
boolean exists(String name);
Program: 166296
Project: 166296
Buggy source:
public String getLeafName();

Fixed version (ground truth):
String getLeafName();
Program: 166297
Project: 166297
Buggy source:
public String getAsString();

Fixed version (ground truth):
String getAsString();
Program: 166298
Project: 166298
Buggy source:
public Set<String> getKeys();

Fixed version (ground truth):
Set<String> getKeys();
Program: 166299
Project: 166299
Buggy source:
public RangerAccessResource getReadOnlyCopy();

Fixed version (ground truth):
RangerAccessResource getReadOnlyCopy();
Program: 166300
Project: 166300
Buggy source:
public Map<String,String> getAsMap();

Fixed version (ground truth):
Map<String,String> getAsMap();
Program: 166301
Project: 166301
Buggy source:
boolean isCurrentFilename(String filename){
  return mBufferFilename != null && filename != null && filename.equals(mBufferFilename);
}

Fixed version (ground truth):
boolean isCurrentFilename(String filename){
  return filename != null && filename.equals(mBufferFilename);
}
Program: 166302
Project: 166302
Buggy source:
public final String getResource(){
  String ret=null;
  Object val=getRequestContext().get(RangerAccessRequestUtil.KEY_CONTEXT_RESOURCE);
  if (val != null) {
    if (val instanceof RangerAccessResource) {
      ret=((RangerAccessResource)val).getAsString();
    }
 else {
      ret=val.toString();
    }
  }
  return ret;
}

Fixed version (ground truth):
public String getResource(){
  String ret=null;
  Object val=getRequestContext().get(RangerAccessRequestUtil.KEY_CONTEXT_RESOURCE);
  if (val != null) {
    if (val instanceof RangerAccessResource) {
      ret=((RangerAccessResource)val).getAsString();
    }
 else {
      ret=val.toString();
    }
  }
  return ret;
}
Program: 166303
Project: 166303
Buggy source:
public final boolean isAccessTypeAny(){
  return accessRequest.isAccessTypeAny();
}

Fixed version (ground truth):
public boolean isAccessTypeAny(){
  return accessRequest.isAccessTypeAny();
}
Program: 166304
Project: 166304
Buggy source:
public final boolean isAccessedBefore(String attributeName){
  boolean ret=true;
  Date accessDate=getAccessTime();
  Date expiryDate=getAsDate(getAttributeValue(attributeName));
  if (expiryDate == null || accessDate.after(expiryDate)) {
    ret=false;
  }
  return ret;
}

Fixed version (ground truth):
public boolean isAccessedBefore(String attributeName){
  boolean ret=true;
  Date accessDate=getAccessTime();
  Date expiryDate=getAsDate(getAttributeValue(attributeName));
  if (expiryDate == null || accessDate.after(expiryDate)) {
    ret=false;
  }
  return ret;
}
Program: 166305
Project: 166305
Buggy source:
public final String getAttributeValue(final String attributeName){
  String ret=null;
  if (StringUtils.isNotBlank(attributeName)) {
    RangerTag tag=getCurrentTag();
    Map<String,String> attributes=null;
    if (tag != null) {
      attributes=tag.getAttributes();
    }
    if (attributes != null) {
      ret=attributes.get(attributeName);
    }
  }
  return ret;
}

Fixed version (ground truth):
public String getAttributeValue(final String attributeName){
  String ret=null;
  if (StringUtils.isNotBlank(attributeName)) {
    RangerTag tag=getCurrentTag();
    Map<String,String> attributes=null;
    if (tag != null) {
      attributes=tag.getAttributes();
    }
    if (attributes != null) {
      ret=attributes.get(attributeName);
    }
  }
  return ret;
}
Program: 166306
Project: 166306
Buggy source:
public final void setResult(final boolean result){
  this.result=result;
}

Fixed version (ground truth):
public void setResult(final boolean result){
  this.result=result;
}
Program: 166307
Project: 166307
Buggy source:
public final String getUser(){
  return accessRequest.getUser();
}

Fixed version (ground truth):
public String getUser(){
  return accessRequest.getUser();
}
Program: 166308
Project: 166308
Buggy source:
public final Map<String,String> getTagAttributes(final String tagType){
  Map<String,String> ret=null;
  if (StringUtils.isNotBlank(tagType)) {
    List<RangerTag> tagObjectList=getAllTags();
    if (CollectionUtils.isNotEmpty(tagObjectList)) {
      for (      RangerTag tag : tagObjectList) {
        if (tag.getType().equals(tagType)) {
          ret=tag.getAttributes();
          break;
        }
      }
    }
  }
  return ret;
}

Fixed version (ground truth):
public Map<String,String> getTagAttributes(final String tagType){
  Map<String,String> ret=null;
  if (StringUtils.isNotBlank(tagType)) {
    List<RangerTag> tagObjectList=getAllTags();
    if (CollectionUtils.isNotEmpty(tagObjectList)) {
      for (      RangerTag tag : tagObjectList) {
        if (tag.getType().equals(tagType)) {
          ret=tag.getAttributes();
          break;
        }
      }
    }
  }
  return ret;
}
Program: 166309
Project: 166309
Buggy source:
public final RangerTag getCurrentTag(){
  RangerTag ret=null;
  Object val=getRequestContext().get(RangerAccessRequestUtil.KEY_CONTEXT_TAG_OBJECT);
  if (val != null && val instanceof RangerTag) {
    ret=(RangerTag)val;
  }
 else {
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str");
    }
  }
  return ret;
}

Fixed version (ground truth):
public RangerTag getCurrentTag(){
  RangerTag ret=null;
  Object val=getRequestContext().get(RangerAccessRequestUtil.KEY_CONTEXT_TAG_OBJECT);
  if (val != null && val instanceof RangerTag) {
    ret=(RangerTag)val;
  }
 else {
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str");
    }
  }
  return ret;
}
Program: 166310
Project: 166310
Buggy source:
public final Set<String> getAllTagTypes(){
  Set<String> allTagTypes=null;
  List<RangerTag> tagObjectList=getAllTags();
  if (CollectionUtils.isNotEmpty(tagObjectList)) {
    for (    RangerTag tag : tagObjectList) {
      String tagType=tag.getType();
      if (allTagTypes == null) {
        allTagTypes=new HashSet<String>();
      }
      allTagTypes.add(tagType);
    }
  }
  return allTagTypes;
}

Fixed version (ground truth):
public Set<String> getAllTagTypes(){
  Set<String> allTagTypes=null;
  List<RangerTag> tagObjectList=getAllTags();
  if (CollectionUtils.isNotEmpty(tagObjectList)) {
    for (    RangerTag tag : tagObjectList) {
      String tagType=tag.getType();
      if (allTagTypes == null) {
        allTagTypes=new HashSet<String>();
      }
      allTagTypes.add(tagType);
    }
  }
  return allTagTypes;
}
Program: 166311
Project: 166311
Buggy source:
public final Date getTagAttributeAsDate(String tagType,String attributeName){
  String attrValue=getAttributeValue(tagType,attributeName);
  return getAsDate(attrValue);
}

Fixed version (ground truth):
public Date getTagAttributeAsDate(String tagType,String attributeName){
  String attrValue=getAttributeValue(tagType,attributeName);
  return getAsDate(attrValue);
}
Program: 166312
Project: 166312
Buggy source:
public final Date getAsDate(String value){
  Date ret=null;
  if (StringUtils.isNotBlank(value)) {
    SimpleDateFormat df=new SimpleDateFormat(DATETIME_FORMAT_PATTERN);
    try {
      Date expiryDate=df.parse(value);
      if (expiryDate == null) {
        LOG.error("String_Node_Str" + value + "String_Node_Str"+ DATETIME_FORMAT_PATTERN);
      }
 else {
        ret=StringUtil.getUTCDateForLocalDate(expiryDate);
      }
    }
 catch (    Exception ex) {
      LOG.error("String_Node_Str" + value + "String_Node_Str"+ ex);
    }
  }
  return ret;
}

Fixed version (ground truth):
public Date getAsDate(String value){
  Date ret=null;
  if (StringUtils.isNotBlank(value)) {
    SimpleDateFormat df=new SimpleDateFormat(DATETIME_FORMAT_PATTERN);
    try {
      Date expiryDate=df.parse(value);
      if (expiryDate == null) {
        LOG.error("String_Node_Str" + value + "String_Node_Str"+ DATETIME_FORMAT_PATTERN);
      }
 else {
        ret=StringUtil.getUTCDateForLocalDate(expiryDate);
      }
    }
 catch (    Exception ex) {
      LOG.error("String_Node_Str" + value + "String_Node_Str"+ ex);
    }
  }
  return ret;
}
Program: 166313
Project: 166313
Buggy source:
public final Date getAccessTime(){
  return accessRequest.getAccessTime();
}

Fixed version (ground truth):
public Date getAccessTime(){
  return accessRequest.getAccessTime();
}
Program: 166314
Project: 166314
Buggy source:
public final String getAction(){
  return accessRequest.getAction();
}

Fixed version (ground truth):
public String getAction(){
  return accessRequest.getAction();
}
Program: 166315
Project: 166315
Buggy source:
public final boolean isAccessedAfter(String attributeName){
  boolean ret=false;
  Date accessDate=getAccessTime();
  Date expiryDate=getAsDate(getAttributeValue(attributeName));
  if (expiryDate == null || accessDate.after(expiryDate) || accessDate.equals(expiryDate)) {
    ret=true;
  }
  return ret;
}

Fixed version (ground truth):
public boolean isAccessedAfter(String attributeName){
  boolean ret=false;
  Date accessDate=getAccessTime();
  Date expiryDate=getAsDate(getAttributeValue(attributeName));
  if (expiryDate == null || accessDate.after(expiryDate) || accessDate.equals(expiryDate)) {
    ret=true;
  }
  return ret;
}
Program: 166316
Project: 166316
Buggy source:
public final String getClientType(){
  return accessRequest.getClientType();
}

Fixed version (ground truth):
public String getClientType(){
  return accessRequest.getClientType();
}
Program: 166317
Project: 166317
Buggy source:
public final String getCurrentTagType(){
  RangerTag tagObject=getCurrentTag();
  return (tagObject != null) ? tagObject.getType() : null;
}

Fixed version (ground truth):
public String getCurrentTagType(){
  RangerTag tagObject=getCurrentTag();
  return (tagObject != null) ? tagObject.getType() : null;
}
Program: 166318
Project: 166318
Buggy source:
public final String getClientIPAddress(){
  return accessRequest.getClientIPAddress();
}

Fixed version (ground truth):
public String getClientIPAddress(){
  return accessRequest.getClientIPAddress();
}
Program: 166319
Project: 166319
Buggy source:
public final String getRequestContextAttribute(String attributeName){
  String ret=null;
  if (StringUtils.isNotBlank(attributeName)) {
    Object val=getRequestContext().get(attributeName);
    if (val != null) {
      ret=val.toString();
    }
  }
  return ret;
}

Fixed version (ground truth):
public String getRequestContextAttribute(String attributeName){
  String ret=null;
  if (StringUtils.isNotBlank(attributeName)) {
    Object val=getRequestContext().get(attributeName);
    if (val != null) {
      ret=val.toString();
    }
  }
  return ret;
}
Program: 166320
Project: 166320
Buggy source:
public final Set<String> getAttributeNames(final String tagType){
  Set<String> ret=null;
  Map<String,String> attributes=getTagAttributes(tagType);
  if (attributes != null) {
    ret=attributes.keySet();
  }
  return ret;
}

Fixed version (ground truth):
public Set<String> getAttributeNames(final String tagType){
  Set<String> ret=null;
  Map<String,String> attributes=getTagAttributes(tagType);
  if (attributes != null) {
    ret=attributes.keySet();
  }
  return ret;
}
Program: 166321
Project: 166321
Buggy source:
public final boolean getResult(){
  return result;
}

Fixed version (ground truth):
public boolean getResult(){
  return result;
}
Program: 166322
Project: 166322
Buggy source:
public final String getRequestData(){
  return accessRequest.getRequestData();
}

Fixed version (ground truth):
public String getRequestData(){
  return accessRequest.getRequestData();
}
Program: 166323
Project: 166323
Buggy source:
public final Map<String,Object> getRequestContext(){
  return accessRequest.getContext();
}

Fixed version (ground truth):
public Map<String,Object> getRequestContext(){
  return accessRequest.getContext();
}
Program: 166324
Project: 166324
Buggy source:
public final Set<String> getUserGroups(){
  return accessRequest.getUserGroups();
}

Fixed version (ground truth):
public Set<String> getUserGroups(){
  return accessRequest.getUserGroups();
}
Program: 166325
Project: 166325
Buggy source:
public final String getSessionId(){
  return accessRequest.getSessionId();
}

Fixed version (ground truth):
public String getSessionId(){
  return accessRequest.getSessionId();
}
Program: 166326
Project: 166326
Buggy source:
public final boolean isAccessTypeDelegatedAdmin(){
  return accessRequest.isAccessTypeDelegatedAdmin();
}

Fixed version (ground truth):
public boolean isAccessTypeDelegatedAdmin(){
  return accessRequest.isAccessTypeDelegatedAdmin();
}
Program: 166331
Project: 166331
Buggy source:
@Test public void test_isValid_happyPath() throws Exception {
  Object[][] serviceDefInput=new Object[][]{{"String_Node_Str",true},{"String_Node_Str",true},{"String_Node_Str",false},{"String_Node_Str",false},{"String_Node_Str",true}};
  List<RangerServiceConfigDef> configDefs=_utils.createServiceConditionDefs(serviceDefInput);
  RangerServiceDef serviceDef=mock(RangerServiceDef.class);
  when(serviceDef.getConfigs()).thenReturn(configDefs);
  RangerService service=mock(RangerService.class);
  when(service.getName()).thenReturn("String_Node_Str");
  when(service.getType()).thenReturn("String_Node_Str");
  String[] configs=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  Map<String,String> configMap=_utils.createMap(configs);
  when(service.getConfigs()).thenReturn(configMap);
  when(_store.getServiceByName("String_Node_Str")).thenReturn(null);
  when(_store.getServiceDefByName("String_Node_Str")).thenReturn(serviceDef);
  assertTrue(_validator.isValid(service,Action.CREATE,_failures));
  when(service.getId()).thenReturn(7L);
  RangerService existingService=mock(RangerService.class);
  when(existingService.getId()).thenReturn(new Long(7L));
  when(_store.getService(7L)).thenReturn(existingService);
  when(_store.getServiceByName("String_Node_Str")).thenReturn(existingService);
  assertTrue(_validator.isValid(service,Action.UPDATE,_failures));
  when(_store.getServiceByName("String_Node_Str")).thenReturn(null);
  assertTrue(_validator.isValid(service,Action.UPDATE,_failures));
}

Fixed version (ground truth):
@Test public void test_isValid_happyPath() throws Exception {
  Object[][] serviceDefInput=new Object[][]{{"String_Node_Str",true},{"String_Node_Str",true},{"String_Node_Str",false},{"String_Node_Str",false},{"String_Node_Str",true}};
  List<RangerServiceConfigDef> configDefs=_utils.createServiceConditionDefs(serviceDefInput);
  RangerServiceDef serviceDef=mock(RangerServiceDef.class);
  when(serviceDef.getConfigs()).thenReturn(configDefs);
  RangerService service=mock(RangerService.class);
  when(service.getName()).thenReturn("String_Node_Str");
  when(service.getType()).thenReturn("String_Node_Str");
  String[] configs=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  Map<String,String> configMap=_utils.createMap(configs);
  when(service.getConfigs()).thenReturn(configMap);
  when(_store.getServiceByName("String_Node_Str")).thenReturn(null);
  when(_store.getServiceDefByName("String_Node_Str")).thenReturn(serviceDef);
  assertTrue(_validator.isValid(service,Action.CREATE,_failures));
  when(service.getId()).thenReturn(7L);
  RangerService existingService=mock(RangerService.class);
  when(existingService.getId()).thenReturn(Long.valueOf(7L));
  when(_store.getService(7L)).thenReturn(existingService);
  when(_store.getServiceByName("String_Node_Str")).thenReturn(existingService);
  assertTrue(_validator.isValid(service,Action.UPDATE,_failures));
  when(_store.getServiceByName("String_Node_Str")).thenReturn(null);
  assertTrue(_validator.isValid(service,Action.UPDATE,_failures));
}
Program: 166332
Project: 166332
Buggy source:
synchronized private PrintWriter getLogFileStream() throws Throwable {
  closeFileIfNeeded();
  if (logWriter == null) {
    Date currentTime=new Date();
    String fileName=MiscUtil.replaceTokens(logFileNameFormat,currentTime.getTime());
    String parentFolder=MiscUtil.replaceTokens(logFolder,currentTime.getTime());
    Configuration conf=createConfiguration();
    String fullPath=parentFolder + org.apache.hadoop.fs.Path.SEPARATOR + fileName;
    String defaultPath=fullPath;
    URI uri=URI.create(fullPath);
    FileSystem fileSystem=FileSystem.get(uri,conf);
    Path hdfPath=new Path(fullPath);
    logger.info("String_Node_Str" + fullPath + "String_Node_Str"+ MiscUtil.getUGILoginUser());
    int i=0;
    while (fileSystem.exists(hdfPath)) {
      i++;
      int lastDot=defaultPath.lastIndexOf('.');
      String baseName=defaultPath.substring(0,lastDot);
      String extension=defaultPath.substring(lastDot);
      fullPath=baseName + "String_Node_Str" + i+ extension;
      hdfPath=new Path(fullPath);
      logger.info("String_Node_Str" + fullPath);
    }
    logger.info("String_Node_Str" + fullPath);
    createParents(hdfPath,fileSystem);
    logger.info("String_Node_Str" + fullPath);
    FSDataOutputStream ostream=fileSystem.create(hdfPath);
    logWriter=new PrintWriter(ostream);
    fileCreateTime=new Date();
    currentFileName=fullPath;
  }
  return logWriter;
}

Fixed version (ground truth):
synchronized private PrintWriter getLogFileStream() throws Throwable {
  closeFileIfNeeded();
  if (logWriter == null) {
    Date currentTime=new Date();
    String fileName=MiscUtil.replaceTokens(logFileNameFormat,currentTime.getTime());
    String parentFolder=MiscUtil.replaceTokens(logFolder,currentTime.getTime());
    Configuration conf=createConfiguration();
    String fullPath=parentFolder + Path.SEPARATOR + fileName;
    String defaultPath=fullPath;
    URI uri=URI.create(fullPath);
    FileSystem fileSystem=FileSystem.get(uri,conf);
    Path hdfPath=new Path(fullPath);
    logger.info("String_Node_Str" + fullPath + "String_Node_Str"+ MiscUtil.getUGILoginUser());
    int i=0;
    while (fileSystem.exists(hdfPath)) {
      i++;
      int lastDot=defaultPath.lastIndexOf('.');
      String baseName=defaultPath.substring(0,lastDot);
      String extension=defaultPath.substring(lastDot);
      fullPath=baseName + "String_Node_Str" + i+ extension;
      hdfPath=new Path(fullPath);
      logger.info("String_Node_Str" + fullPath);
    }
    logger.info("String_Node_Str" + fullPath);
    createParents(hdfPath,fileSystem);
    logger.info("String_Node_Str" + fullPath);
    FSDataOutputStream ostream=fileSystem.create(hdfPath);
    logWriter=new PrintWriter(ostream);
    fileCreateTime=new Date();
    currentFileName=fullPath;
  }
  return logWriter;
}
Program: 166333
Project: 166333
Buggy source:
/** 
 * @param userName
 * @return
 */
static public Set<String> getGroupsForRequestUser(String userName){
  if (userName == null) {
    return null;
  }
  try {
    UserGroupInformation ugi=UserGroupInformation.createRemoteUser(userName);
    String groups[]=ugi.getGroupNames();
    if (groups != null && groups.length > 0) {
      java.util.Set<String> groupsSet=new java.util.HashSet<String>();
      for (int i=0; i < groups.length; i++) {
        groupsSet.add(groups[i]);
      }
      return groupsSet;
    }
  }
 catch (  Throwable e) {
    logErrorMessageByInterval(logger,"String_Node_Str" + userName,e);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param userName
 * @return
 */
static public Set<String> getGroupsForRequestUser(String userName){
  if (userName == null) {
    return null;
  }
  try {
    UserGroupInformation ugi=UserGroupInformation.createRemoteUser(userName);
    String groups[]=ugi.getGroupNames();
    if (groups != null && groups.length > 0) {
      Set<String> groupsSet=new java.util.HashSet<String>();
      for (int i=0; i < groups.length; i++) {
        groupsSet.add(groups[i]);
      }
      return groupsSet;
    }
  }
 catch (  Throwable e) {
    logErrorMessageByInterval(logger,"String_Node_Str" + userName,e);
  }
  return null;
}
Program: 166334
Project: 166334
Buggy source:
public static UserGroupInformation createUGIFromSubject(Subject subject) throws IOException {
  logger.info("String_Node_Str" + (subject == null ? "String_Node_Str" : "String_Node_Str"));
  UserGroupInformation ugi=null;
  if (subject != null) {
    logger.info("String_Node_Str" + subject.getPrincipals().size());
    java.util.Set<Principal> principals=subject.getPrincipals();
    for (    Principal principal : principals) {
      logger.info("String_Node_Str" + principal.getName());
    }
    try {
      UserGroupInformation.getLoginUser();
      logger.info("String_Node_Str" + UserGroupInformation.getLoginUser());
    }
 catch (    Throwable t) {
      logger.error(t);
    }
    ugi=UserGroupInformation.getUGIFromSubject(subject);
    logger.info("String_Node_Str" + ugi.getUserName() + "String_Node_Str"+ ugi);
  }
 else {
    logger.info("String_Node_Str");
  }
  return ugi;
}

Fixed version (ground truth):
public static UserGroupInformation createUGIFromSubject(Subject subject) throws IOException {
  logger.info("String_Node_Str" + (subject == null ? "String_Node_Str" : "String_Node_Str"));
  UserGroupInformation ugi=null;
  if (subject != null) {
    logger.info("String_Node_Str" + subject.getPrincipals().size());
    Set<Principal> principals=subject.getPrincipals();
    for (    Principal principal : principals) {
      logger.info("String_Node_Str" + principal.getName());
    }
    try {
      UserGroupInformation.getLoginUser();
      logger.info("String_Node_Str" + UserGroupInformation.getLoginUser());
    }
 catch (    Throwable t) {
      logger.error(t);
    }
    ugi=UserGroupInformation.getUGIFromSubject(subject);
    logger.info("String_Node_Str" + ugi.getUserName() + "String_Node_Str"+ ugi);
  }
 else {
    logger.info("String_Node_Str");
  }
  return ugi;
}
Program: 166336
Project: 166336
Buggy source:
private InputStream getFileInputStream(String path) throws FileNotFoundException {
  InputStream ret=null;
  File f=new File(path);
  if (f.exists()) {
    ret=new FileInputStream(f);
  }
 else {
    ret=getClass().getResourceAsStream(path);
    if (ret == null) {
      if (!path.startsWith("String_Node_Str")) {
        ret=getClass().getResourceAsStream("String_Node_Str" + path);
      }
    }
    if (ret == null) {
      ret=ClassLoader.getSystemClassLoader().getResourceAsStream(path);
      if (ret == null) {
        if (!path.startsWith("String_Node_Str")) {
          ret=ClassLoader.getSystemResourceAsStream("String_Node_Str" + path);
        }
      }
    }
  }
  return ret;
}

Fixed version (ground truth):
private InputStream getFileInputStream(String path) throws FileNotFoundException {
  InputStream ret=null;
  File f=new File(path);
  if (f.exists()) {
    ret=new FileInputStream(f);
  }
 else {
    ret=PolicyMgrUserGroupBuilder.class.getResourceAsStream(path);
    if (ret == null) {
      if (!path.startsWith("String_Node_Str")) {
        ret=getClass().getResourceAsStream("String_Node_Str" + path);
      }
    }
    if (ret == null) {
      ret=ClassLoader.getSystemClassLoader().getResourceAsStream(path);
      if (ret == null) {
        if (!path.startsWith("String_Node_Str")) {
          ret=ClassLoader.getSystemResourceAsStream("String_Node_Str" + path);
        }
      }
    }
  }
  return ret;
}
Program: 166337
Project: 166337
Buggy source:
@Override public void onLogoutSuccess(HttpServletRequest request,HttpServletResponse response,Authentication authentication) throws IOException, ServletException {
  response.setContentType("String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  String jsonStr="String_Node_Str";
  try {
    VXResponse vXResponse=new VXResponse();
    vXResponse.setStatusCode(HttpServletResponse.SC_OK);
    vXResponse.setMsgDesc("String_Node_Str");
    jsonStr=jsonUtil.writeObjectAsString(vXResponse);
    response.setStatus(HttpServletResponse.SC_OK);
    response.getWriter().write(jsonStr);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + jsonStr);
    }
  }
 catch (  IOException e) {
    logger.info("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onLogoutSuccess(HttpServletRequest request,HttpServletResponse response,Authentication authentication) throws IOException, ServletException {
  request.getServletContext().removeAttribute(request.getRequestedSessionId());
  response.setContentType("String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  String jsonStr="String_Node_Str";
  try {
    VXResponse vXResponse=new VXResponse();
    vXResponse.setStatusCode(HttpServletResponse.SC_OK);
    vXResponse.setMsgDesc("String_Node_Str");
    jsonStr=jsonUtil.writeObjectAsString(vXResponse);
    response.setStatus(HttpServletResponse.SC_OK);
    response.getWriter().write(jsonStr);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + jsonStr);
    }
  }
 catch (  IOException e) {
    logger.info("String_Node_Str");
  }
}
Program: 166340
Project: 166340
Buggy source:
public static void main(String[] args) throws IOException {
  if (args.length == 0) {
    System.err.println("String_Node_Str");
    showUsage();
    System.exit(1);
  }
 else {
    String keyStoreFileName=args[0];
    File f=new File(keyStoreFileName);
    if (!f.exists()) {
      f.createNewFile();
    }
    String keyStoreType=(args.length == 2 ? args[1] : DEFAULT_KEYSTORE_TYPE);
    try {
      KeyStore.getInstance(keyStoreType);
    }
 catch (    KeyStoreException e) {
      System.err.println("String_Node_Str" + keyStoreType + "String_Node_Str");
      showUsage();
      System.exit(1);
    }
    new Ranger2JKSUtil().doExportKeysFromJKS(keyStoreFileName,keyStoreType);
    System.out.println("String_Node_Str" + keyStoreFileName);
    System.exit(0);
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  if (args.length == 0) {
    System.err.println("String_Node_Str");
    showUsage();
    System.exit(1);
  }
 else {
    String keyStoreFileName=args[0];
    File f=new File(keyStoreFileName);
    if (!f.exists()) {
      boolean ret=f.createNewFile();
      if (!ret) {
        System.err.println("String_Node_Str" + args[0]);
      }
    }
    String keyStoreType=(args.length == 2 ? args[1] : DEFAULT_KEYSTORE_TYPE);
    try {
      KeyStore.getInstance(keyStoreType);
    }
 catch (    KeyStoreException e) {
      System.err.println("String_Node_Str" + keyStoreType + "String_Node_Str");
      showUsage();
      System.exit(1);
    }
    new Ranger2JKSUtil().doExportKeysFromJKS(keyStoreFileName,keyStoreType);
    System.out.println("String_Node_Str" + keyStoreFileName);
    System.exit(0);
  }
}
Program: 166341
Project: 166341
Buggy source:
@Override public void engineDeleteEntry(String alias) throws KeyStoreException {
synchronized (keyEntries) {
    dbOperationDelete(convertAlias(alias));
    keyEntries.remove(convertAlias(alias));
    deltaEntries.remove(convertAlias(alias));
  }
}

Fixed version (ground truth):
@Override public void engineDeleteEntry(String alias) throws KeyStoreException {
synchronized (keyEntries) {
    dbOperationDelete(convertAlias(alias));
    keyEntries.remove(convertAlias(alias));
  }
synchronized (deltaEntries) {
    deltaEntries.remove(convertAlias(alias));
  }
}
Program: 166342
Project: 166342
Buggy source:
public void addKeyEntry(String alias,Key key,char[] password,String cipher,int bitLength,String description,int version,String attributes) throws KeyStoreException {
synchronized (deltaEntries) {
    try {
      Class<?> c=null;
      Object o=null;
      try {
        c=Class.forName("String_Node_Str");
        Constructor<?> constructor=c.getDeclaredConstructor(char[].class);
        constructor.setAccessible(true);
        o=constructor.newInstance(password);
      }
 catch (      ClassNotFoundException|NoSuchMethodException|SecurityException|InstantiationException|IllegalAccessException|IllegalArgumentException|InvocationTargetException e) {
        logger.error(e.getMessage());
        throw new KeyStoreException(e.getMessage());
      }
      SecretKeyEntry entry=new SecretKeyEntry();
      entry.date=new Date();
      Method m=c.getDeclaredMethod("String_Node_Str",Key.class);
      m.setAccessible(true);
      entry.sealedKey=(SealedObject)m.invoke(o,key);
      entry.cipher_field=cipher;
      entry.bit_length=bitLength;
      entry.description=description;
      entry.version=version;
      entry.attributes=attributes;
      deltaEntries.put(alias.toLowerCase(),entry);
      keyEntries.put(alias.toLowerCase(),entry);
    }
 catch (    Exception e) {
      logger.error(e.getMessage());
      throw new KeyStoreException(e.getMessage());
    }
  }
}

Fixed version (ground truth):
public void addKeyEntry(String alias,Key key,char[] password,String cipher,int bitLength,String description,int version,String attributes) throws KeyStoreException {
  SecretKeyEntry entry=new SecretKeyEntry();
synchronized (deltaEntries) {
    try {
      Class<?> c=null;
      Object o=null;
      try {
        c=Class.forName("String_Node_Str");
        Constructor<?> constructor=c.getDeclaredConstructor(char[].class);
        constructor.setAccessible(true);
        o=constructor.newInstance(password);
      }
 catch (      ClassNotFoundException|NoSuchMethodException|SecurityException|InstantiationException|IllegalAccessException|IllegalArgumentException|InvocationTargetException e) {
        logger.error(e.getMessage());
        throw new KeyStoreException(e.getMessage());
      }
      entry.date=new Date();
      Method m=c.getDeclaredMethod("String_Node_Str",Key.class);
      m.setAccessible(true);
      entry.sealedKey=(SealedObject)m.invoke(o,key);
      entry.cipher_field=cipher;
      entry.bit_length=bitLength;
      entry.description=description;
      entry.version=version;
      entry.attributes=attributes;
      deltaEntries.put(alias.toLowerCase(),entry);
    }
 catch (    Exception e) {
      logger.error(e.getMessage());
      throw new KeyStoreException(e.getMessage());
    }
  }
synchronized (keyEntries) {
    try {
      keyEntries.put(alias.toLowerCase(),entry);
    }
 catch (    Exception e) {
      logger.error(e.getMessage());
      throw new KeyStoreException(e.getMessage());
    }
  }
}
Program: 166343
Project: 166343
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) {
    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);
    }
  }
}

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(StringUtil.trim(xTrxLog.getAttributeName()))) {
        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: 166344
Project: 166344
Buggy source:
private boolean compareTwoPolicyName(String value,String oldValue){
  if (value == null && oldValue == null) {
    return org.apache.commons.lang.StringUtils.equals(value,oldValue);
  }
  if (value != null && oldValue != null && value.trim().isEmpty() && oldValue.trim().isEmpty()) {
    return true;
  }
  if (stringUtil.isEmpty(value) || stringUtil.isEmpty(oldValue)) {
    return false;
  }
  if (!value.equals(oldValue)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean compareTwoPolicyName(String value,String oldValue){
  return org.apache.commons.lang.StringUtils.equals(value,oldValue);
}
Program: 166345
Project: 166345
Buggy source:
public List<String> getAllRegexPatterns(String baseProperty){
  List<String> regexPatterns=new ArrayList<String>();
  if (prop != null) {
    Enumeration<?> propertyNames=prop.propertyNames();
    while (propertyNames != null && propertyNames.hasMoreElements()) {
      String propertyName=(String)propertyNames.nextElement();
      if (propertyName != null && propertyName.contains(baseProperty)) {
        regexPatterns.add(prop.getProperty(propertyName));
      }
    }
  }
  return regexPatterns;
}

Fixed version (ground truth):
public List<String> getAllRegexPatterns(String baseProperty){
  List<String> regexPatterns=new ArrayList<String>();
  if (prop != null) {
    String baseRegex=prop.getProperty(baseProperty);
    if (baseRegex == null) {
      return regexPatterns;
    }
    regexPatterns.add(baseRegex);
    int i=1;
    String nextRegex=prop.getProperty(baseProperty + "String_Node_Str" + i);
    ;
    while (nextRegex != null) {
      regexPatterns.add(nextRegex);
      i++;
      nextRegex=prop.getProperty(baseProperty + "String_Node_Str" + i);
    }
  }
  return regexPatterns;
}
Program: 166346
Project: 166346
Buggy source:
protected void populateReplacementPatterns(String baseProperty,List<String> regexPatterns){
  replacementPattern=new LinkedHashMap<String,String>();
  Pattern p=Pattern.compile("String_Node_Str");
  for (  String regexPattern : regexPatterns) {
    Matcher m=p.matcher(regexPattern);
    if (!m.matches()) {
      logger.warn("String_Node_Str" + regexPattern + "String_Node_Str");
    }
    m=m.reset();
    while (m.find()) {
      String matchPattern=m.group(1);
      String replacement=m.group(2);
      if (matchPattern != null && !matchPattern.isEmpty() && replacement != null) {
        replacementPattern.put(matchPattern,Matcher.quoteReplacement(replacement));
        if (logger.isDebugEnabled()) {
          logger.debug(baseProperty + "String_Node_Str" + matchPattern+ "String_Node_Str"+ replacement);
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void populateReplacementPatterns(String baseProperty,List<String> regexPatterns){
  replacementPattern=new LinkedHashMap<String,String>();
  Pattern p=Pattern.compile("String_Node_Str");
  for (  String regexPattern : regexPatterns) {
    Matcher m=p.matcher(regexPattern);
    if (!m.matches()) {
      logger.warn("String_Node_Str" + regexPattern + "String_Node_Str");
    }
    m=m.reset();
    while (m.find()) {
      String matchPattern=m.group(1);
      String replacement=m.group(2);
      if (matchPattern != null && !matchPattern.isEmpty() && replacement != null) {
        replacementPattern.put(matchPattern,replacement);
        if (logger.isDebugEnabled()) {
          logger.debug(baseProperty + "String_Node_Str" + matchPattern+ "String_Node_Str"+ replacement);
        }
      }
    }
  }
}
Program: 166347
Project: 166347
Buggy source:
@Test public void testTransform1(){
  userRegexPatterns.add("String_Node_Str");
  userRegexPatterns.add("String_Node_Str");
  userNameRegEx.populateReplacementPatterns(userNameBaseProperty,userRegexPatterns);
  groupRegexPatterns.add("String_Node_Str");
  groupRegexPatterns.add("String_Node_Str");
  groupNameRegEx.populateReplacementPatterns(userNameBaseProperty,groupRegexPatterns);
  assertEquals("String_Node_Str",userNameRegEx.transform("String_Node_Str"));
  assertEquals("String_Node_Str",groupNameRegEx.transform("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testTransform1(){
  userRegexPatterns.add("String_Node_Str");
  userRegexPatterns.add("String_Node_Str");
  userNameRegEx.populateReplacementPatterns(userNameBaseProperty,userRegexPatterns);
  groupRegexPatterns.add("String_Node_Str");
  groupRegexPatterns.add("String_Node_Str");
  groupRegexPatterns.add("String_Node_Str");
  groupNameRegEx.populateReplacementPatterns(userNameBaseProperty,groupRegexPatterns);
  assertEquals("String_Node_Str",userNameRegEx.transform("String_Node_Str"));
  assertEquals("String_Node_Str",groupNameRegEx.transform("String_Node_Str"));
}
Program: 166348
Project: 166348
Buggy source:
public static RangerPluginClassLoader getInstance(String pluginType,Class<?> pluginClass) throws Exception {
  RangerPluginClassLoader ret=me;
  if (ret == null) {
synchronized (RangerPluginClassLoader.class) {
      ret=me;
      if (ret == null) {
        me=ret=new RangerPluginClassLoader(pluginType,pluginClass);
      }
    }
  }
  return ret;
}

Fixed version (ground truth):
public static RangerPluginClassLoader getInstance(final String pluginType,final Class<?> pluginClass) throws Exception {
  RangerPluginClassLoader ret=me;
  if (ret == null) {
synchronized (RangerPluginClassLoader.class) {
      ret=me;
      if (ret == null) {
        me=ret=AccessController.doPrivileged(new PrivilegedExceptionAction<RangerPluginClassLoader>(){
          public RangerPluginClassLoader run() throws Exception {
            return new RangerPluginClassLoader(pluginType,pluginClass);
          }
        }
);
      }
    }
  }
  return ret;
}
Program: 166349
Project: 166349
Buggy source:
public RangerPluginClassLoader(String pluginType,Class<?> pluginClass) throws Exception {
  super(RangerPluginClassLoaderUtil.getInstance().getPluginFilesForServiceTypeAndPluginclass(pluginType,pluginClass),null);
  componentClassLoader=new MyClassLoader(Thread.currentThread().getContextClassLoader());
}

Fixed version (ground truth):
public RangerPluginClassLoader(String pluginType,Class<?> pluginClass) throws Exception {
  super(RangerPluginClassLoaderUtil.getInstance().getPluginFilesForServiceTypeAndPluginclass(pluginType,pluginClass),null);
  componentClassLoader=AccessController.doPrivileged(new PrivilegedAction<MyClassLoader>(){
    public MyClassLoader run(){
      return new MyClassLoader(Thread.currentThread().getContextClassLoader());
    }
  }
);
}