nus-yam/ex-repair huggingface dataset:
Program: 28976
Project: 28976
Buggy source:
@Test public void testLogMessageWithExceptionArgument() throws IOException {
  LOGGER.log(Level.SEVERE,ERROR_READING_TEST_CONF_FILE,new Object[]{TEST_CONF_FILE,new Exception(TEST_EXCEPTION_MESSAGE)});
  validateLogContents(ULF_LOG);
  validateLogContents(ODL_LOG);
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
@Test public void testLogMessageWithExceptionArgument() throws IOException {
  LOGGER.log(Level.SEVERE,ERROR_READING_TEST_CONF_FILE_ID,new Object[]{TEST_CONF_FILE,new Exception(TEST_EXCEPTION_MESSAGE)});
  String[] expectedContents=new String[]{CANNOT_READ_TEST_CONFIGURATION_FILE_MSG + TEST_CONF_FILE,TEST_EXCEPTION_MESSAGE};
  validateLogContents(ULF_LOG,expectedContents);
  validateLogContents(ODL_LOG,expectedContents);
  System.out.println("String_Node_Str");
}
Program: 28977
Project: 28977
Buggy source:
private void validateLogContents(String file) throws IOException {
  StringBuffer buf=new StringBuffer();
  BufferedReader reader=null;
  try {
    reader=new BufferedReader(new FileReader(file));
    String line;
    while ((line=reader.readLine()) != null) {
      buf.append(line);
      buf.append(LINE_SEP);
    }
    String contents=buf.toString();
    assertEquals("String_Node_Str" + file + "String_Node_Str",true,contents.contains("String_Node_Str" + TEST_CONF_FILE));
    assertEquals("String_Node_Str" + file + "String_Node_Str",true,contents.contains(TEST_EXCEPTION_MESSAGE));
  }
  finally {
    if (reader != null) {
      reader.close();
    }
  }
}

Fixed version (ground truth):
private String validateLogContents(String file,String[] messages) throws IOException {
  StringBuffer buf=new StringBuffer();
  BufferedReader reader=null;
  try {
    reader=new BufferedReader(new FileReader(file));
    String line;
    while ((line=reader.readLine()) != null) {
      buf.append(line);
      buf.append(LINE_SEP);
    }
    String contents=buf.toString();
    for (    String msg : messages) {
      assertEquals("String_Node_Str" + file + "String_Node_Str"+ msg,true,contents.contains(msg));
    }
    return contents;
  }
  finally {
    if (reader != null) {
      reader.close();
    }
  }
}
Program: 28978
Project: 28978
Buggy source:
@BeforeClass public static void initializeLoggingAnnotationsTest() throws Exception {
  File basePath=new File(BASE_PATH);
  basePath.mkdirs();
  uniformFormatHandler=new FileHandler(ULF_LOG);
  uniformFormatHandler.setFormatter(new UniformLogFormatter());
  odlFormatHandler=new FileHandler(ODL_LOG);
  odlFormatHandler.setFormatter(new ODLLogFormatter());
  consoleHandler=new ConsoleHandler();
  consoleHandler.setFormatter(new UniformLogFormatter());
  LOGGER.addHandler(uniformFormatHandler);
  LOGGER.addHandler(odlFormatHandler);
  LOGGER.addHandler(consoleHandler);
  LOGGER.setUseParentHandlers(false);
}

Fixed version (ground truth):
@BeforeClass public static void initializeLoggingAnnotationsTest() throws Exception {
  File basePath=new File(BASE_PATH);
  basePath.mkdirs();
  uniformFormatHandler=new FileHandler(ULF_LOG);
  uniformFormatHandler.setLevel(Level.FINE);
  uniformFormatHandler.setFormatter(new UniformLogFormatter());
  odlFormatHandler=new FileHandler(ODL_LOG);
  odlFormatHandler.setLevel(Level.FINE);
  odlFormatHandler.setFormatter(new ODLLogFormatter());
  consoleHandler=new ConsoleHandler();
  consoleHandler.setFormatter(new UniformLogFormatter());
  LOGGER.addHandler(uniformFormatHandler);
  LOGGER.addHandler(odlFormatHandler);
  LOGGER.addHandler(consoleHandler);
  LOGGER.setUseParentHandlers(false);
  LOGGER.setLevel(Level.FINE);
}
Program: 28980
Project: 28980
Buggy source:
WebXmlParser(String baseStr) throws XMLStreamException, FileNotFoundException {
  init(new File(baseStr,getXmlFileName()));
}

Fixed version (ground truth):
WebXmlParser(ReadableArchive archive) throws XMLStreamException, IOException {
  if (archive.exists(getXmlFileName())) {
    init(archive.getEntry(getXmlFileName()));
  }
}
Program: 28981
Project: 28981
Buggy source:
protected void init(File xmlFile) throws XMLStreamException, FileNotFoundException {
  InputStream input=null;
  if (xmlFile.exists()) {
    input=new FileInputStream(xmlFile);
    try {
      read(input);
    }
  finally {
      if (parser != null) {
        try {
          parser.close();
        }
 catch (        Exception ex) {
        }
      }
      if (input != null) {
        try {
          input.close();
        }
 catch (        Exception ex) {
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void init(InputStream input) throws XMLStreamException, FileNotFoundException {
  try {
    read(input);
  }
  finally {
    if (parser != null) {
      try {
        parser.close();
      }
 catch (      Exception ex) {
      }
    }
    if (input != null) {
      try {
        input.close();
      }
 catch (      Exception ex) {
      }
    }
  }
}
Program: 28982
Project: 28982
Buggy source:
ContextXmlParser(File contextXmlFile) throws XMLStreamException, FileNotFoundException {
  init(contextXmlFile);
}

Fixed version (ground truth):
ContextXmlParser(File contextXmlFile) throws XMLStreamException, FileNotFoundException {
  if (contextXmlFile.exists()) {
    init(new FileInputStream(contextXmlFile));
  }
}
Program: 28983
Project: 28983
Buggy source:
WeblogicXmlParser(String baseStr) throws XMLStreamException, FileNotFoundException {
  super(baseStr);
}

Fixed version (ground truth):
WeblogicXmlParser(ReadableArchive archive) throws XMLStreamException, IOException {
  super(archive);
}
Program: 28984
Project: 28984
Buggy source:
@Override public String getVersionIdentifier(ReadableArchive archive){
  String versionIdentifierValue=null;
  try {
    GlassFishWebXmlParser gfWebXMLParser=new GlassFishWebXmlParser(null);
    versionIdentifierValue=gfWebXMLParser.extractVersionIdentifierValue(archive);
  }
 catch (  XMLStreamException e) {
    logger.log(Level.SEVERE,e.getMessage());
  }
catch (  IOException e) {
    logger.log(Level.SEVERE,e.getMessage());
  }
  return versionIdentifierValue;
}

Fixed version (ground truth):
String getVersionIdentifier(){
  return versionIdentifier;
}
Program: 28985
Project: 28985
Buggy source:
GlassFishWebXmlParser(String baseStr) throws XMLStreamException, FileNotFoundException {
  super(baseStr);
}

Fixed version (ground truth):
GlassFishWebXmlParser(ReadableArchive archive) throws XMLStreamException, IOException {
  super(archive);
}
Program: 28986
Project: 28986
Buggy source:
SunWebXmlParser(String baseStr) throws XMLStreamException, FileNotFoundException {
  super(baseStr);
}

Fixed version (ground truth):
SunWebXmlParser(ReadableArchive archive) throws XMLStreamException, IOException {
  super(archive);
}
Program: 28987
Project: 28987
Buggy source:
private String getInstalledMqVersion() throws Exception {
  String ver=null;
  String installed_dir=System.getProperty(SystemPropertyConstants.IMQ_LIB_PROPERTY);
  String jarFile=installed_dir + File.separator + MQ_RAR;
  _rarlogger.log(Level.FINE,"String_Node_Str" + jarFile);
  JarFile jFile=null;
  try {
    if ((new File(jarFile)).exists()) {
      jFile=new JarFile(jarFile);
    }
 else {
      jFile=new JarFile(installed_dir + File.separator + "String_Node_Str"+ File.separator+ MQ_RAR);
    }
    Manifest mf=jFile.getManifest();
    ver=mf.getMainAttributes().getValue(MANIFEST_TAG);
    return ver;
  }
 catch (  Exception e) {
    _rarlogger.log(Level.WARNING,"String_Node_Str",e.getMessage() + "String_Node_Str" + jarFile);
    throw e;
  }
}

Fixed version (ground truth):
private String getInstalledMqVersion() throws Exception {
  String ver=null;
  String installed_dir=System.getProperty(SystemPropertyConstants.IMQ_LIB_PROPERTY);
  String jarFile=installed_dir + File.separator + MQ_RAR;
  _rarlogger.log(Level.FINE,"String_Node_Str" + jarFile);
  JarFile jFile=null;
  try {
    if ((new File(jarFile)).exists()) {
      jFile=new JarFile(jarFile);
    }
 else {
      jFile=new JarFile(installed_dir + File.separator + "String_Node_Str"+ File.separator+ MQ_RAR);
    }
    Manifest mf=jFile.getManifest();
    ver=mf.getMainAttributes().getValue(MANIFEST_TAG);
    return ver;
  }
 catch (  Exception e) {
    _rarlogger.log(Level.WARNING,"String_Node_Str",e.getMessage() + "String_Node_Str" + jarFile);
    throw e;
  }
 finally {
    if (jFile != null) {
      jFile.close();
    }
  }
}
Program: 28990
Project: 28990
Buggy source:
private void initializeRuntimeDependencies(){
  habitat.getService(PostStartup.class,"String_Node_Str");
  habitat.getService(PostStartup.class,"String_Node_Str");
}

Fixed version (ground truth):
private void initializeRuntimeDependencies(){
  habitat.getService(PostStartup.class,"String_Node_Str");
  habitat.getService(PostStartup.class,"String_Node_Str");
  habitat.getService(PostStartup.class,"String_Node_Str");
}
Program: 28991
Project: 28991
Buggy source:
protected void initializeHome() throws Exception {
  super.initializeHome();
  if (isRemote) {
    if (hasRemoteBusinessView) {
      theRemoteBusinessObjectImpl=instantiateRemoteBusinessObjectImpl();
      theRemoteBusinessObject=theRemoteBusinessObjectImpl.getEJBObject();
      for (      RemoteBusinessIntfInfo next : remoteBusinessIntfInfo.values()) {
        java.rmi.Remote stub=next.referenceFactory.createRemoteReference(singletonInstanceKey);
        theRemoteBusinessStubs.put(next.generatedRemoteIntf.getName(),stub);
        theRemoteBusinessObjectImpl.setStub(next.generatedRemoteIntf.getName(),stub);
      }
    }
  }
  if (isLocal) {
    if (hasLocalBusinessView) {
      theEJBLocalBusinessObjectImpl=instantiateEJBLocalBusinessObjectImpl();
    }
    if (hasOptionalLocalBusinessView) {
      theOptionalEJBLocalBusinessObjectImpl=instantiateOptionalEJBLocalBusinessObjectImpl();
    }
  }
  createBeanPool();
  registerMonitorableComponents();
}

Fixed version (ground truth):
protected void initializeHome() throws Exception {
  super.initializeHome();
  if (isRemote) {
    if (hasRemoteBusinessView) {
      theRemoteBusinessObjectImpl=instantiateRemoteBusinessObjectImpl();
      for (      RemoteBusinessIntfInfo next : remoteBusinessIntfInfo.values()) {
        java.rmi.Remote stub=next.referenceFactory.createRemoteReference(singletonInstanceKey);
        theRemoteBusinessStubs.put(next.generatedRemoteIntf.getName(),stub);
        theRemoteBusinessObjectImpl.setStub(next.generatedRemoteIntf.getName(),stub);
      }
    }
  }
  if (isLocal) {
    if (hasLocalBusinessView) {
      theEJBLocalBusinessObjectImpl=instantiateEJBLocalBusinessObjectImpl();
    }
    if (hasOptionalLocalBusinessView) {
      theOptionalEJBLocalBusinessObjectImpl=instantiateOptionalEJBLocalBusinessObjectImpl();
    }
  }
  createBeanPool();
  registerMonitorableComponents();
}
Program: 28992
Project: 28992
Buggy source:
static JndiInfo newPortableLocal(String name,Object obj){
  JndiInfo jndiInfo=new JndiInfo(name,obj);
  jndiInfo.local=true;
  jndiInfo.portable=true;
  return jndiInfo;
}

Fixed version (ground truth):
static JndiInfo newPortableLocal(String name,Object obj){
  JndiInfo jndiInfo=new JndiInfo(name,obj);
  jndiInfo.portable=true;
  return jndiInfo;
}
Program: 28993
Project: 28993
Buggy source:
static JndiInfo newPortableRemote(String name,Object obj){
  JndiInfo jndiInfo=new JndiInfo(name,obj);
  jndiInfo.local=false;
  jndiInfo.portable=true;
  jndiInfo.cosNaming=isCosNamingObject(obj);
  return jndiInfo;
}

Fixed version (ground truth):
static JndiInfo newPortableRemote(String name,Object obj){
  JndiInfo jndiInfo=new JndiInfo(name,obj);
  jndiInfo.portable=true;
  jndiInfo.cosNaming=isCosNamingObject(obj);
  return jndiInfo;
}
Program: 28994
Project: 28994
Buggy source:
static JndiInfo newNonPortableRemote(String name,Object obj){
  JndiInfo jndiInfo=new JndiInfo(name,obj);
  jndiInfo.local=false;
  jndiInfo.portable=false;
  jndiInfo.cosNaming=isCosNamingObject(obj);
  return jndiInfo;
}

Fixed version (ground truth):
static JndiInfo newNonPortableRemote(String name,Object obj){
  JndiInfo jndiInfo=new JndiInfo(name,obj);
  jndiInfo.portable=false;
  jndiInfo.cosNaming=isCosNamingObject(obj);
  return jndiInfo;
}
Program: 28995
Project: 28995
Buggy source:
public EjbFutureTask(EjbAsyncTask<V> callable,EjbAsyncInvocationManager mgr){
  super(callable);
  this.ejbAsyncTask=callable;
  this.asyncInvManager=mgr;
}

Fixed version (ground truth):
public EjbFutureTask(EjbAsyncTask<V> callable,EjbAsyncInvocationManager mgr){
  super(callable);
  this.ejbAsyncTask=callable;
}
Program: 28996
Project: 28996
Buggy source:
public boolean cancel(){
  boolean cancelled=super.cancel();
  this.classLoader=null;
  this.task=null;
  return cancelled;
}

Fixed version (ground truth):
public boolean cancel(){
  boolean cancelled=super.cancel();
  this.task=null;
  return cancelled;
}
Program: 28997
Project: 28997
Buggy source:
PeriodicTask(ClassLoader classLoader,Runnable target,EjbContainerUtil ejbContainerUtil){
  this.classLoader=classLoader;
  this.task=new AsynchronousTask(classLoader,target);
  this.ejbContainerUtil=ejbContainerUtil;
}

Fixed version (ground truth):
PeriodicTask(ClassLoader classLoader,Runnable target,EjbContainerUtil ejbContainerUtil){
  this.task=new AsynchronousTask(classLoader,target);
  this.ejbContainerUtil=ejbContainerUtil;
}
Program: 28998
Project: 28998
Buggy source:
/** 
 * TODO ??? public void appendStats(StringBuffer sbuf) { sbuf.append("\nStatelessContainer: ") .append("CreateCount=").append(statCreateCount).append("; ") .append("RemoveCount=").append(statRemoveCount).append("; ") .append("]"); }
 */
protected void doConcreteContainerShutdown(boolean appBeingUndeployed){
  try {
    if (hasRemoteHomeView) {
      remoteHomeRefFactory.destroyReference(theEJBObjectImpl.getStub(),theEJBObjectImpl.getEJBObject());
    }
    if (hasRemoteBusinessView) {
      for (      RemoteBusinessIntfInfo next : remoteBusinessIntfInfo.values()) {
        next.referenceFactory.destroyReference(theRemoteBusinessObjectImpl.getStub(next.generatedRemoteIntf.getName()),theRemoteBusinessObjectImpl.getEJBObject(next.generatedRemoteIntf.getName()));
      }
    }
    isPoolClosed=true;
    if (pool != null) {
      pool.close();
      poolProbeListener.unregister();
    }
  }
 catch (  Throwable t) {
    _logger.log(Level.FINE,"String_Node_Str",t);
  }
}

Fixed version (ground truth):
/** 
 * TODO ??? public void appendStats(StringBuffer sbuf) { sbuf.append("\nStatelessContainer: ") .append("CreateCount=").append(statCreateCount).append("; ") .append("RemoveCount=").append(statRemoveCount).append("; ") .append("]"); }
 */
protected void doConcreteContainerShutdown(boolean appBeingUndeployed){
  try {
    if (hasRemoteHomeView) {
      remoteHomeRefFactory.destroyReference(theEJBObjectImpl.getStub(),theEJBObjectImpl.getEJBObject());
    }
    if (hasRemoteBusinessView) {
      for (      RemoteBusinessIntfInfo next : remoteBusinessIntfInfo.values()) {
        next.referenceFactory.destroyReference(theRemoteBusinessObjectImpl.getStub(next.generatedRemoteIntf.getName()),theRemoteBusinessObjectImpl.getEJBObject(next.generatedRemoteIntf.getName()));
      }
    }
    if (pool != null) {
      pool.close();
      poolProbeListener.unregister();
    }
  }
 catch (  Throwable t) {
    _logger.log(Level.FINE,"String_Node_Str",t);
  }
}
Program: 28999
Project: 28999
Buggy source:
protected void initializeHome() throws Exception {
  super.initializeHome();
  if (isRemote) {
    if (hasRemoteHomeView) {
      theEJBObjectImpl=instantiateEJBObjectImpl();
      theEJBObject=(EJBObject)theEJBObjectImpl.getEJBObject();
      theEJBStub=(EJBObject)remoteHomeRefFactory.createRemoteReference(statelessInstanceKey);
      theEJBObjectImpl.setStub(theEJBStub);
    }
    if (hasRemoteBusinessView) {
      theRemoteBusinessObjectImpl=instantiateRemoteBusinessObjectImpl();
      theRemoteBusinessObject=theRemoteBusinessObjectImpl.getEJBObject();
      for (      RemoteBusinessIntfInfo next : remoteBusinessIntfInfo.values()) {
        java.rmi.Remote stub=next.referenceFactory.createRemoteReference(statelessInstanceKey);
        theRemoteBusinessStubs.put(next.generatedRemoteIntf.getName(),stub);
        theRemoteBusinessObjectImpl.setStub(next.generatedRemoteIntf.getName(),stub);
      }
    }
  }
  if (isLocal) {
    if (hasLocalHomeView) {
      theEJBLocalObjectImpl=instantiateEJBLocalObjectImpl();
    }
    if (hasLocalBusinessView) {
      theEJBLocalBusinessObjectImpl=instantiateEJBLocalBusinessObjectImpl();
    }
    if (hasOptionalLocalBusinessView) {
      theOptionalEJBLocalBusinessObjectImpl=instantiateOptionalEJBLocalBusinessObjectImpl();
    }
  }
  createBeanPool();
  registerMonitorableComponents();
}

Fixed version (ground truth):
protected void initializeHome() throws Exception {
  super.initializeHome();
  if (isRemote) {
    if (hasRemoteHomeView) {
      theEJBObjectImpl=instantiateEJBObjectImpl();
      theEJBStub=(EJBObject)remoteHomeRefFactory.createRemoteReference(statelessInstanceKey);
      theEJBObjectImpl.setStub(theEJBStub);
    }
    if (hasRemoteBusinessView) {
      theRemoteBusinessObjectImpl=instantiateRemoteBusinessObjectImpl();
      for (      RemoteBusinessIntfInfo next : remoteBusinessIntfInfo.values()) {
        java.rmi.Remote stub=next.referenceFactory.createRemoteReference(statelessInstanceKey);
        theRemoteBusinessStubs.put(next.generatedRemoteIntf.getName(),stub);
        theRemoteBusinessObjectImpl.setStub(next.generatedRemoteIntf.getName(),stub);
      }
    }
  }
  if (isLocal) {
    if (hasLocalHomeView) {
      theEJBLocalObjectImpl=instantiateEJBLocalObjectImpl();
    }
    if (hasLocalBusinessView) {
      theEJBLocalBusinessObjectImpl=instantiateEJBLocalBusinessObjectImpl();
    }
    if (hasOptionalLocalBusinessView) {
      theOptionalEJBLocalBusinessObjectImpl=instantiateOptionalEJBLocalBusinessObjectImpl();
    }
  }
  createBeanPool();
  registerMonitorableComponents();
}
Program: 29000
Project: 29000
Buggy source:
protected StatelessSessionContainer(ContainerType conType,EjbDescriptor desc,ClassLoader loader) throws Exception {
  super(conType,desc,loader);
  try {
    if (hasLocalHomeView) {
      localHomeCreateMethod=localHomeIntf.getMethod("String_Node_Str",NO_PARAMS);
    }
    if (hasRemoteHomeView) {
      homeCreateMethod=homeIntf.getMethod("String_Node_Str",NO_PARAMS);
    }
  }
 catch (  Exception ex) {
    if (_logger.isLoggable(Level.SEVERE)) {
      _logger.log(Level.SEVERE,"String_Node_Str",logParams);
      _logger.log(Level.SEVERE,"String_Node_Str",ex);
    }
    throw ex;
  }
  ejbContainer=ejbContainerUtilImpl.getEjbContainer();
  super.createCallFlowAgent(ComponentType.SLSB);
}

Fixed version (ground truth):
protected StatelessSessionContainer(ContainerType conType,EjbDescriptor desc,ClassLoader loader) throws Exception {
  super(conType,desc,loader);
  ejbContainer=ejbContainerUtilImpl.getEjbContainer();
  super.createCallFlowAgent(ComponentType.SLSB);
}
Program: 29001
Project: 29001
Buggy source:
AbstractPoolTimerTask(Object lock){
  this.lock=lock;
}

Fixed version (ground truth):
AbstractPoolTimerTask(){
}
Program: 29002
Project: 29002
Buggy source:
PoolResizeTimerTask(Object lock){
  this.lock=lock;
}

Fixed version (ground truth):
PoolResizeTimerTask(){
}
Program: 29003
Project: 29003
Buggy source:
private void buildLookupTable(Map methodMap){
  methodInfo_=new MethodInfo[numBuckets_];
  Set occupied=new HashSet();
  for (Iterator iter=methodMap.entrySet().iterator(); iter.hasNext(); ) {
    Map.Entry entry=(Map.Entry)iter.next();
    Object nextObj=entry.getKey();
    Method next=null;
    if (nextObj == null) {
      throw new IllegalStateException("String_Node_Str");
    }
 else     if (nextObj instanceof Method) {
      next=(Method)nextObj;
    }
 else {
      throw new IllegalStateException("String_Node_Str" + nextObj.getClass() + "String_Node_Str");
    }
    int bucket=getBucket(next);
    if (!occupied.contains(bucket)) {
      MethodInfo methodInfo=new MethodInfo();
      methodInfo.key=next;
      methodInfo.value=entry.getValue();
      methodInfo.declaringClass=next.getDeclaringClass();
      methodInfo_[bucket]=methodInfo;
      occupied.add(bucket);
    }
 else {
      methodInfo_[bucket]=null;
    }
  }
}

Fixed version (ground truth):
private void buildLookupTable(Map methodMap){
  methodInfo_=new MethodInfo[numBuckets_];
  Set occupied=new HashSet();
  for (Iterator iter=methodMap.entrySet().iterator(); iter.hasNext(); ) {
    Map.Entry entry=(Map.Entry)iter.next();
    Object nextObj=entry.getKey();
    Method next=null;
    if (nextObj == null) {
      throw new IllegalStateException("String_Node_Str");
    }
 else     if (nextObj instanceof Method) {
      next=(Method)nextObj;
    }
 else {
      throw new IllegalStateException("String_Node_Str" + nextObj.getClass() + "String_Node_Str");
    }
    int bucket=getBucket(next);
    if (!occupied.contains(bucket)) {
      MethodInfo methodInfo=new MethodInfo();
      methodInfo.value=entry.getValue();
      methodInfo.declaringClass=next.getDeclaringClass();
      methodInfo_[bucket]=methodInfo;
      occupied.add(bucket);
    }
 else {
      methodInfo_[bucket]=null;
    }
  }
}
Program: 29005
Project: 29005
Buggy source:
S1ASThreadPoolManager(){
  try {
    _iiopUtils=Globals.getDefaultHabitat().getService(IIOPUtils.class);
    Collection<org.glassfish.grizzly.config.dom.ThreadPool> tpCol=_iiopUtils.getAllThreadPools();
    org.glassfish.grizzly.config.dom.ThreadPool[] allThreadPools=tpCol.toArray(new org.glassfish.grizzly.config.dom.ThreadPool[tpCol.size()]);
    for (int i=0; i < allThreadPools.length; i++) {
      createThreadPools(allThreadPools[i],i);
    }
    defaultID=(String)indexToIdTable.get(Integer.valueOf(0));
  }
 catch (  NullPointerException npe) {
    _logger.log(Level.FINE,"String_Node_Str");
  }
}

Fixed version (ground truth):
S1ASThreadPoolManager(){
}
Program: 29006
Project: 29006
Buggy source:
public int compareTo(Object o){
  int otherOrder=-1;
  if (o instanceof TransactionClientInterceptor) {
    otherOrder=((TransactionClientInterceptor)o).order;
  }
  if (order < otherOrder) {
    return -1;
  }
 else   if (order == otherOrder) {
    return 0;
  }
  return 1;
}

Fixed version (ground truth):
public int compareTo(TransactionClientInterceptor o){
  int otherOrder=-1;
  if (o instanceof TransactionClientInterceptor) {
    otherOrder=((TransactionClientInterceptor)o).order;
  }
  if (order < otherOrder) {
    return -1;
  }
 else   if (order == otherOrder) {
    return 0;
  }
  return 1;
}
Program: 29007
Project: 29007
Buggy source:
protected AdminAdapter(Class<? extends Privacy> privacyClass){
  super((Set)null);
  this.privacyClass=privacyClass;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) protected AdminAdapter(Class<? extends Privacy> privacyClass){
  super((Set)null);
  this.privacyClass=privacyClass;
}
Program: 29008
Project: 29008
Buggy source:
@Override public void postConstruct(){
  events.register(this);
  epd=new AdminEndpointDecider(config,aalogger);
  addDocRoot(env.getProps().get(SystemPropertyConstants.INSTANCE_ROOT_PROPERTY) + "String_Node_Str");
  secureAdmin=domain.getSecureAdmin();
}

Fixed version (ground truth):
@Override public void postConstruct(){
  events.register(this);
  epd=new AdminEndpointDecider(config,aalogger);
  addDocRoot(env.getProps().get(SystemPropertyConstants.INSTANCE_ROOT_PROPERTY) + "String_Node_Str");
}
Program: 29013
Project: 29013
Buggy source:
public ComponentInvocation startInvocation(){
  EjbInvocation inv=container_.createEjbInvocation();
  inv.isWebService=true;
  inv.container=container_;
  inv.transactionAttribute=Container.TX_NOT_INITIALIZED;
  inv.securityPermissions=Container.SEC_NOT_INITIALIZED;
  invManager_.preInvoke(inv);
  return inv;
}

Fixed version (ground truth):
public ComponentInvocation startInvocation(){
  EjbInvocation inv=container_.createEjbInvocation();
  inv.isWebService=true;
  inv.container=container_;
  inv.transactionAttribute=Container.TX_NOT_INITIALIZED;
  invManager_.preInvoke(inv);
  return inv;
}
Program: 29015
Project: 29015
Buggy source:
private boolean afterMessageDeliveryInternal(ResourceHandle resourceHandle){
  boolean success=false;
  EjbInvocation invocation=null;
  invocation=(EjbInvocation)invocationManager.getCurrentInvocation();
  if (invocation == null) {
    _logger.log(Level.SEVERE,"String_Node_Str",new Object[]{appEJBName_,"String_Node_Str"});
  }
 else {
    try {
      if (invocation.containerStartsTx) {
        unregisterMessageBeanResource(resourceHandle);
      }
      invocationManager.postInvoke(invocation);
      postInvokeTx(invocation);
      success=true;
      ejbProbeNotifier.messageDeliveredEvent(getContainerId(),containerInfo.appName,containerInfo.modName,containerInfo.ejbName);
    }
 catch (    Throwable ce) {
      _logger.log(Level.SEVERE,"String_Node_Str",new Object[]{appEJBName_,ce.toString()});
      _logger.log(Level.SEVERE,ce.getClass().getName(),ce);
    }
 finally {
      releaseContext(invocation);
    }
    Utility.setContextClassLoader(invocation.originalContextClassLoader);
    if (invocation.exception != null) {
      if (isSystemUncheckedException(invocation.exception)) {
        success=false;
      }
      Level exLogLevel=isSystemUncheckedException(invocation.exception) ? Level.WARNING : Level.FINE;
      _logger.log(exLogLevel,"String_Node_Str",new Object[]{appEJBName_,invocation.exception.toString()});
      _logger.log(exLogLevel,invocation.exception.getClass().getName(),invocation.exception);
    }
  }
  return success;
}

Fixed version (ground truth):
private boolean afterMessageDeliveryInternal(ResourceHandle resourceHandle){
  boolean success=false;
  EjbInvocation invocation=null;
  invocation=(EjbInvocation)invocationManager.getCurrentInvocation();
  if (invocation == null) {
    _logger.log(Level.SEVERE,"String_Node_Str",new Object[]{appEJBName_,"String_Node_Str"});
  }
 else {
    try {
      if (invocation.containerStartsTx) {
        unregisterMessageBeanResource(resourceHandle);
      }
      invocationManager.postInvoke(invocation);
      postInvokeTx(invocation);
      success=true;
      ejbProbeNotifier.messageDeliveredEvent(getContainerId(),containerInfo.appName,containerInfo.modName,containerInfo.ejbName);
    }
 catch (    Throwable ce) {
      _logger.log(Level.SEVERE,"String_Node_Str",new Object[]{appEJBName_,ce.toString()});
      _logger.log(Level.SEVERE,ce.getClass().getName(),ce);
    }
 finally {
      releaseContext(invocation);
    }
    Utility.setContextClassLoader(invocation.getOriginalContextClassLoader());
    if (invocation.exception != null) {
      if (isSystemUncheckedException(invocation.exception)) {
        success=false;
      }
      Level exLogLevel=isSystemUncheckedException(invocation.exception) ? Level.WARNING : Level.FINE;
      _logger.log(exLogLevel,"String_Node_Str",new Object[]{appEJBName_,invocation.exception.toString()});
      _logger.log(exLogLevel,invocation.exception.getClass().getName(),invocation.exception);
    }
  }
  return success;
}
Program: 29016
Project: 29016
Buggy source:
private void setSourceWin32Exe() throws IOException {
  sourceWin32Exe=new File(info.libDir,SOURCE_WIN32_EXE_FILENAME);
  if (!sourceWin32Exe.isFile()) {
    InputStream in=getClass().getResourceAsStream("String_Node_Str" + SOURCE_WIN32_EXE_FILENAME);
    FileOutputStream out=new FileOutputStream(sourceWin32Exe);
    copyStream(in,out);
    trace("String_Node_Str" + sourceWin32Exe);
  }
  trace("String_Node_Str" + sourceWin32Exe);
}

Fixed version (ground truth):
private void setSourceWin32Exe() throws IOException {
  sourceWin32Exe=new File(info.libDir,SOURCE_WIN32_EXE_FILENAME);
  if (!sourceWin32Exe.isFile()) {
    InputStream in=WindowsService.class.getResourceAsStream("String_Node_Str" + SOURCE_WIN32_EXE_FILENAME);
    FileOutputStream out=new FileOutputStream(sourceWin32Exe);
    copyStream(in,out);
    trace("String_Node_Str" + sourceWin32Exe);
  }
  trace("String_Node_Str" + sourceWin32Exe);
}
Program: 29017
Project: 29017
Buggy source:
private void deleteTable(final Connection conn){
  try {
    final Statement ds=conn.createStatement();
    final String deleteTable="String_Node_Str" + PEFileLayout.EJB_TIMER_TABLE_NAME;
    ds.executeUpdate(deleteTable);
    ds.close();
  }
 catch (  final Exception e) {
  }
}

Fixed version (ground truth):
private void deleteTable(final Connection conn) throws Exception {
  final Statement ds=conn.createStatement();
  final String deleteTable="String_Node_Str" + PEFileLayout.EJB_TIMER_TABLE_NAME;
  try {
    ds.executeUpdate(deleteTable);
  }
 catch (  final Exception e) {
  }
 finally {
    ds.close();
  }
}
Program: 29018
Project: 29018
Buggy source:
private void createEjbTimerDatabaseTable(final String createStatement,final String dbDir) throws Exception {
  checkDerbyDriver();
  final String url=getDatabaseUrl(dbDir);
  final Connection conn=DriverManager.getConnection(url);
  deleteTable(conn);
  final Statement cs=conn.createStatement();
  cs.executeUpdate(createStatement);
  cs.close();
}

Fixed version (ground truth):
private void createEjbTimerDatabaseTable(final String createStatement,final String dbDir) throws Exception {
  checkDerbyDriver();
  final String url=getDatabaseUrl(dbDir);
  final Connection conn=DriverManager.getConnection(url);
  deleteTable(conn);
  final Statement cs=conn.createStatement();
  try {
    cs.executeUpdate(createStatement);
  }
  finally {
    cs.close();
  }
}
Program: 29019
Project: 29019
Buggy source:
/** 
 * This method is used to extract URI of jar entries that match a given pattern.
 * @param uri
 * @param pattern
 */
public static List<String> getJarEntries(URI uri,Pattern pattern){
  List<String> results=new ArrayList<String>();
  File file=null;
  try {
    file=new File(uri);
  }
 catch (  Exception ex) {
  }
  if (file == null || file.isDirectory()) {
    return results;
  }
  String fileName=file.getName();
  if (fileName != null && fileName.endsWith("String_Node_Str")) {
    JarFile jarFile=null;
    try {
      jarFile=new JarFile(new File(uri));
      Enumeration<JarEntry> entries=jarFile.entries();
      while (entries.hasMoreElements()) {
        JarEntry entry=(JarEntry)entries.nextElement();
        String entryName=entry.getName();
        if (pattern.matcher(entryName).matches()) {
          results.add(entryName);
        }
      }
    }
 catch (    Exception ex) {
      throw new RuntimeException(ex);
    }
 finally {
      if (jarFile != null) {
        try {
          jarFile.close();
        }
 catch (        Throwable t) {
        }
      }
    }
  }
  return results;
}

Fixed version (ground truth):
/** 
 * This method is used to extract URI of jar entries that match a given pattern.
 * @param uri
 * @param pattern
 */
public static List<String> getJarEntries(URI uri,Pattern pattern){
  List<String> results=new ArrayList<String>();
  File file=null;
  try {
    file=new File(uri);
  }
 catch (  Exception ex) {
  }
  if (file == null || file.isDirectory()) {
    return results;
  }
  String fileName=file.getName();
  if (fileName != null && fileName.endsWith("String_Node_Str")) {
    JarFile jarFile=null;
    try {
      jarFile=new JarFile(new File(uri));
      Enumeration<JarEntry> entries=jarFile.entries();
      while (entries.hasMoreElements()) {
        JarEntry entry=(JarEntry)entries.nextElement();
        String entryName=entry.getName();
        if (pattern.matcher(entryName).matches()) {
          results.add(entryName);
        }
      }
    }
 catch (    Exception ex) {
      if (logger.isLoggable(Level.WARNING)) {
        logger.log(Level.WARNING,"String_Node_Str",fileName);
      }
      throw new RuntimeException(ex);
    }
 finally {
      if (jarFile != null) {
        try {
          jarFile.close();
        }
 catch (        Throwable t) {
        }
      }
    }
  }
  return results;
}
Program: 29020
Project: 29020
Buggy source:
private void validateManifest(final String manifestPath) throws Exception {
  final File manifest=new File(manifestPath);
  final File manifestParent=manifest.getParentFile();
  final String msg=sm.getString("String_Node_Str",manifest.getParentFile().getAbsolutePath());
  if (manifestParent != null && manifestParent.isDirectory()) {
    if (info.force) {
      FileUtils.whack(manifestParent);
      if (manifestParent.isDirectory()) {
        throw new IllegalArgumentException(msg);
      }
    }
 else {
      throw new IllegalArgumentException(msg);
    }
  }
  manifest.getParentFile().mkdirs();
  if (info.trace)   printOut("String_Node_Str" + manifestPath);
}

Fixed version (ground truth):
private void validateManifest(final String manifestPath) throws Exception {
  final File manifest=new File(manifestPath);
  final File manifestParent=manifest.getParentFile();
  final String msg=sm.getString("String_Node_Str",manifest.getParentFile().getAbsolutePath());
  if (manifestParent != null && manifestParent.isDirectory()) {
    if (info.force) {
      FileUtils.whack(manifestParent);
      if (manifestParent.isDirectory()) {
        throw new IllegalArgumentException(msg);
      }
    }
 else {
      throw new IllegalArgumentException(msg);
    }
  }
  if (!manifest.getParentFile().mkdirs()) {
    if (info.trace)     printOut("String_Node_Str" + manifest.getParentFile().getAbsolutePath());
  }
  if (info.trace)   printOut("String_Node_Str" + manifestPath);
}
Program: 29021
Project: 29021
Buggy source:
private void cleanupManifest() throws RuntimeException {
  final File manifest=new File(getManifestFilePath());
  if (manifest.exists()) {
    manifest.delete();
    manifest.deleteOnExit();
    if (info.trace)     printOut("String_Node_Str" + manifest.getAbsolutePath());
  }
  final File failedServiceNode=manifest.getParentFile();
  if (failedServiceNode.exists()) {
    failedServiceNode.delete();
    failedServiceNode.deleteOnExit();
    if (info.trace)     printOut("String_Node_Str" + failedServiceNode.getAbsolutePath());
  }
}

Fixed version (ground truth):
private void cleanupManifest() throws RuntimeException {
  final File manifest=new File(getManifestFilePath());
  if (manifest.exists()) {
    if (!manifest.delete())     manifest.deleteOnExit();
    if (info.trace)     printOut("String_Node_Str" + manifest.getAbsolutePath());
  }
  final File failedServiceNode=manifest.getParentFile();
  if (failedServiceNode.exists()) {
    if (!failedServiceNode.delete())     failedServiceNode.deleteOnExit();
    if (info.trace)     printOut("String_Node_Str" + failedServiceNode.getAbsolutePath());
  }
}
Program: 29022
Project: 29022
Buggy source:
private void setSourceWin32Exe() throws IOException {
  sourceWin32Exe=new File(info.libDir,SOURCE_WIN32_EXE_FILENAME);
  if (!sourceWin32Exe.isFile()) {
    InputStream in=WindowsService.class.getResourceAsStream("String_Node_Str" + SOURCE_WIN32_EXE_FILENAME);
    FileOutputStream out=new FileOutputStream(sourceWin32Exe);
    copyStream(in,out);
    trace("String_Node_Str" + sourceWin32Exe);
  }
  trace("String_Node_Str" + sourceWin32Exe);
}

Fixed version (ground truth):
private void setSourceWin32Exe() throws IOException {
  sourceWin32Exe=new File(info.libDir,SOURCE_WIN32_EXE_FILENAME);
  if (!sourceWin32Exe.isFile()) {
    InputStream in=null;
    FileOutputStream out=null;
    try {
      in=WindowsService.class.getResourceAsStream("String_Node_Str" + SOURCE_WIN32_EXE_FILENAME);
      out=new FileOutputStream(sourceWin32Exe);
      copyStream(in,out);
      trace("String_Node_Str" + sourceWin32Exe);
    }
  finally {
      if (in != null)       in.close();
      if (out != null)       out.close();
    }
  }
  trace("String_Node_Str" + sourceWin32Exe);
}
Program: 29023
Project: 29023
Buggy source:
private static void copyStream(InputStream in,OutputStream out) throws IOException {
  byte[] buf=new byte[16384];
  int len;
  while ((len=in.read(buf)) >= 0) {
    out.write(buf,0,len);
  }
  in.close();
  out.close();
}

Fixed version (ground truth):
private static void copyStream(InputStream in,OutputStream out) throws IOException {
  byte[] buf=new byte[16384];
  int len;
  while ((len=in.read(buf)) >= 0) {
    out.write(buf,0,len);
  }
}
Program: 29024
Project: 29024
Buggy source:
@Override public final void initializeInternal(){
  try {
    getTokenMap().put(DISPLAY_NAME_TN,info.serverDirs.getServerName() + "String_Node_Str");
    setTemplateFile(TEMPLATE_FILE_NAME);
    setSourceWin32Exe();
    targetDir=new File(getServerDirs().getServerDir(),TARGET_DIR);
    targetDir.mkdirs();
    if (!targetDir.isDirectory())     throw new RuntimeException(Strings.get("String_Node_Str",targetDir));
    targetWin32Exe=new File(targetDir,info.serviceName + "String_Node_Str");
    targetXml=new File(targetDir,info.serviceName + "String_Node_Str");
  }
 catch (  IOException ex) {
    throw new RuntimeException(ex);
  }
}

Fixed version (ground truth):
@Override public final void initializeInternal(){
  try {
    getTokenMap().put(DISPLAY_NAME_TN,info.serverDirs.getServerName() + "String_Node_Str");
    setTemplateFile(TEMPLATE_FILE_NAME);
    setSourceWin32Exe();
    targetDir=new File(getServerDirs().getServerDir(),TARGET_DIR);
    if (!targetDir.isDirectory()) {
      if (!targetDir.mkdirs())       throw new RuntimeException(Strings.get("String_Node_Str",targetDir));
    }
    targetWin32Exe=new File(targetDir,info.serviceName + "String_Node_Str");
    targetXml=new File(targetDir,info.serviceName + "String_Node_Str");
  }
 catch (  IOException ex) {
    throw new RuntimeException(ex);
  }
}
Program: 29025
Project: 29025
Buggy source:
private void handlePreExisting(File targetWin32Exe,File targetXml,boolean force){
  if (targetWin32Exe.exists() || targetXml.exists()) {
    if (force) {
      targetWin32Exe.delete();
      targetXml.delete();
      handlePreExisting(targetWin32Exe,targetXml,false);
    }
 else {
      throw new RuntimeException(Strings.get("String_Node_Str",new File(targetDir,getServerDirs().getServerName() + "String_Node_Str").toString() + "String_Node_Str","String_Node_Str"));
    }
  }
}

Fixed version (ground truth):
private void handlePreExisting(File targetWin32Exe,File targetXml,boolean force){
  if (targetWin32Exe.exists() || targetXml.exists()) {
    if (force) {
      if (!targetWin32Exe.delete())       trace("String_Node_Str");
      if (!targetXml.delete())       trace("String_Node_Str");
      if (targetWin32Exe.exists() || targetXml.exists())       throw new RuntimeException(Strings.get("String_Node_Str",new File(targetDir,getServerDirs().getServerName() + "String_Node_Str").toString() + "String_Node_Str","String_Node_Str"));
    }
  }
}
Program: 29026
Project: 29026
Buggy source:
private void install() throws ProcessManagerException {
  if (info.dryRun) {
    try {
      xmlFileCopy=Strings.get("String_Node_Str") + FileUtils.readSmallFile(targetXml);
    }
 catch (    IOException ex) {
    }
    targetXml.delete();
    targetWin32Exe.delete();
  }
 else {
    ProcessManager mgr=new ProcessManager(targetWin32Exe.getPath(),"String_Node_Str");
    mgr.setEcho(false);
    mgr.execute();
    int ret=mgr.getExitValue();
    if (ret != 0)     throw new RuntimeException(Strings.get("String_Node_Str","String_Node_Str" + ret,mgr.getStdout(),mgr.getStderr()));
    trace("String_Node_Str" + mgr.getStderr());
    trace("String_Node_Str" + mgr.getStdout());
  }
}

Fixed version (ground truth):
private void install() throws ProcessManagerException {
  if (info.dryRun) {
    try {
      xmlFileCopy=Strings.get("String_Node_Str") + FileUtils.readSmallFile(targetXml);
    }
 catch (    IOException ex) {
    }
    if (!targetWin32Exe.delete())     dryRun("String_Node_Str" + targetWin32Exe);
    if (!targetXml.delete())     dryRun("String_Node_Str" + targetXml);
  }
 else {
    ProcessManager mgr=new ProcessManager(targetWin32Exe.getPath(),"String_Node_Str");
    mgr.setEcho(false);
    mgr.execute();
    int ret=mgr.getExitValue();
    if (ret != 0)     throw new RuntimeException(Strings.get("String_Node_Str","String_Node_Str" + ret,mgr.getStdout(),mgr.getStderr()));
    trace("String_Node_Str" + mgr.getStderr());
    trace("String_Node_Str" + mgr.getStdout());
  }
}
Program: 29029
Project: 29029
Buggy source:
/** 
 * Creates a new DomainConfigEntryInfo object 
 */
public DomainConfigEntryInfo(String key,String dataType,String displayText,Validator validator){
  this.key=key;
  this.dataType=dataType;
  this.displayText=displayText;
  this.validator=validator;
}

Fixed version (ground truth):
/** 
 * Creates a new DomainConfigEntryInfo object 
 */
public DomainConfigEntryInfo(String key,String dataType,Validator validator){
  this.key=key;
  this.dataType=dataType;
  this.validator=validator;
}
Program: 29030
Project: 29030
Buggy source:
public Object run(JmsAvailability param) throws PropertyVetoException, TransactionFailure {
  param.setAvailabilityEnabled(availabilityEnabled.toString());
  if (availabilityEnabled.booleanValue()) {
    param.setMessageStoreType(JDBC);
  }
 else {
    param.setConfigStoreType(configStoreType.toLowerCase());
    param.setMessageStoreType(messageStoreType.toLowerCase());
  }
  param.setDbVendor(dbvendor);
  param.setDbUsername(dbuser);
  param.setDbPassword(jmsDbPassword);
  param.setDbUrl(dburl);
  if (props != null) {
    for (    Map.Entry e : props.entrySet()) {
      Property prop=param.createChild(Property.class);
      prop.setName((String)e.getKey());
      prop.setValue((String)e.getValue());
      param.getProperty().add(prop);
    }
  }
  return param;
}

Fixed version (ground truth):
public Object run(JmsAvailability param) throws PropertyVetoException, TransactionFailure {
  param.setAvailabilityEnabled(availabilityEnabled.toString());
  if (availabilityEnabled.booleanValue()) {
    param.setMessageStoreType(JDBC);
  }
 else {
    param.setConfigStoreType(configStoreType.toLowerCase(Locale.ENGLISH));
    param.setMessageStoreType(messageStoreType.toLowerCase(Locale.ENGLISH));
  }
  param.setDbVendor(dbvendor);
  param.setDbUsername(dbuser);
  param.setDbPassword(jmsDbPassword);
  param.setDbUrl(dburl);
  if (props != null) {
    for (    Map.Entry e : props.entrySet()) {
      Property prop=param.createChild(Property.class);
      prop.setName((String)e.getKey());
      prop.setValue((String)e.getValue());
      param.getProperty().add(prop);
    }
  }
  return param;
}
Program: 29031
Project: 29031
Buggy source:
private boolean isSupportedDbVendor(){
  if (dbvendor != null) {
    return SUPPORTED_DB_VENDORS.contains(dbvendor.toLowerCase());
  }
  return false;
}

Fixed version (ground truth):
private boolean isSupportedDbVendor(){
  if (dbvendor != null) {
    return SUPPORTED_DB_VENDORS.contains(dbvendor.toLowerCase(Locale.ENGLISH));
  }
  return false;
}
Program: 29033
Project: 29033
Buggy source:
/** 
 * Returns the message along with the message from any linked exception.
 */
public String getMessage(){
  String retString=null;
  if (_message != null) {
    retString=_message;
  }
  if (linkedException != null && linkedException.getMessage() != null) {
    if (retString != null) {
      retString+=retString + "String_Node_Str" + linkedException.getMessage();
    }
 else {
      retString=linkedException.getMessage();
    }
  }
  return retString;
}

Fixed version (ground truth):
/** 
 * Returns the message along with the message from any linked exception.
 */
public String getMessage(){
  String retString=null;
  if (_message != null) {
    retString=_message;
  }
  Exception localLinkedException=linkedException;
  if (localLinkedException != null && localLinkedException.getMessage() != null) {
    if (retString != null) {
      retString+=retString + "String_Node_Str" + localLinkedException.getMessage();
    }
 else {
      retString=localLinkedException.getMessage();
    }
  }
  return retString;
}
Program: 29034
Project: 29034
Buggy source:
/** 
 * Adds a linked Exception
 * @param ex       the linked Exception
 */
public synchronized void setLinkedException(Exception ex){
  linkedException=ex;
}

Fixed version (ground truth):
/** 
 * Adds a linked Exception
 * @param ex       the linked Exception
 */
public void setLinkedException(Exception ex){
  linkedException=ex;
}
Program: 29035
Project: 29035
Buggy source:
private void handlePreExisting(boolean force){
  if (isPreExisting()) {
    if (force) {
      target.delete();
      handlePreExisting(false);
    }
 else {
      throw new RuntimeException(Strings.get("String_Node_Str",target,"String_Node_Str"));
    }
  }
}

Fixed version (ground truth):
private void handlePreExisting(boolean force){
  if (isPreExisting()) {
    if (force) {
      boolean result=target.delete();
      if (!result || isPreExisting()) {
        throw new RuntimeException(Strings.get("String_Node_Str",target,"String_Node_Str"));
      }
    }
  }
}
Program: 29036
Project: 29036
Buggy source:
public String getDomain(){
  if (domain == null) {
    Container parent=this;
    while (parent != null && !(parent instanceof StandardEngine)) {
      parent=parent.getParent();
    }
    if (parent instanceof StandardEngine) {
      domain=((StandardEngine)parent).getDomain();
    }
  }
  return domain;
}

Fixed version (ground truth):
public String getDomain(){
  if (domain == null) {
    Container parent=this;
    while (parent != null && !(parent instanceof StandardEngine)) {
      parent=parent.getParent();
    }
    if (parent != null) {
      domain=((StandardEngine)parent).getDomain();
    }
  }
  return domain;
}
Program: 29037
Project: 29037
Buggy source:
/** 
 * Switches the underlying output stream from a memory based stream to one that is backed by disk. This is the point at which we realise that too much data is being written to keep in memory, so we elect to switch to disk-based storage.
 * @exception IOException if an error occurs.
 */
protected void thresholdReached() throws IOException {
  if (prefix != null) {
    outputFile=File.createTempFile(prefix,suffix,directory);
  }
  FileOutputStream fos=new FileOutputStream(outputFile);
  memoryOutputStream.writeTo(fos);
  currentOutputStream=fos;
  memoryOutputStream=null;
}

Fixed version (ground truth):
/** 
 * Switches the underlying output stream from a memory based stream to one that is backed by disk. This is the point at which we realise that too much data is being written to keep in memory, so we elect to switch to disk-based storage.
 * @exception IOException if an error occurs.
 */
protected void thresholdReached() throws IOException {
  if (prefix != null) {
    outputFile=File.createTempFile(prefix,suffix,directory);
  }
  FileOutputStream fos=null;
  try {
    fos=new FileOutputStream(outputFile);
    memoryOutputStream.writeTo(fos);
    currentOutputStream=fos;
    memoryOutputStream=null;
  }
 catch (  IOException e) {
    if (fos != null) {
      fos.close();
    }
    throw e;
  }
}
Program: 29038
Project: 29038
Buggy source:
/** 
 * Construct an instance of this <code>RuleSet</code> with the specified matching pattern prefix.
 * @param prefix Prefix for matching pattern rules (including thetrailing slash character)
 */
public HostRuleSet(String prefix){
  super();
  this.namespaceURI=null;
  this.prefix=prefix;
}

Fixed version (ground truth):
/** 
 * Construct an instance of this <code>RuleSet</code> with the specified matching pattern prefix.
 * @param prefix Prefix for matching pattern rules (including thetrailing slash character)
 */
public HostRuleSet(String prefix){
  super();
  this.prefix=prefix;
}