nus-yam/ex-repair huggingface dataset:
Program: 155482
Project: 155482
Buggy source:
private void putSharedXaStatefulHolder(final XAStatefulHolder xaStatefulHolder){
  BitronixTransaction transaction=TransactionContextHelper.currentTransaction();
  if (transaction == null) {
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + xaStatefulHolder + "String_Node_Str");
    return;
  }
  final Uid currentTxGtrid=transaction.getResourceManager().getGtrid();
  ThreadLocal threadLocal=(ThreadLocal)statefulHolderTransactionMap.get(currentTxGtrid);
  if (threadLocal == null) {
    try {
      transaction.registerSynchronization(new Synchronization(){
        public void beforeCompletion(){
        }
        public void afterCompletion(        int status){
          if (log.isDebugEnabled())           log.debug("String_Node_Str" + currentTxGtrid);
          statefulHolderTransactionMap.remove(currentTxGtrid);
        }
      }
);
    }
 catch (    Exception e) {
      return;
    }
    threadLocal=new ThreadLocal();
    threadLocal.set(xaStatefulHolder);
    statefulHolderTransactionMap.put(currentTxGtrid,threadLocal);
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + currentTxGtrid + "String_Node_Str"+ xaStatefulHolder);
  }
 else {
    threadLocal.set(xaStatefulHolder);
  }
}

Fixed version (ground truth):
private void putSharedXaStatefulHolder(final XAStatefulHolder xaStatefulHolder){
  BitronixTransaction transaction=TransactionContextHelper.currentTransaction();
  if (transaction == null) {
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + xaStatefulHolder + "String_Node_Str");
    return;
  }
  final Uid currentTxGtrid=transaction.getResourceManager().getGtrid();
  ThreadLocal threadLocal=(ThreadLocal)statefulHolderTransactionMap.get(currentTxGtrid);
  if (threadLocal == null) {
    try {
      transaction.registerSynchronization(new Synchronization(){
        public void beforeCompletion(){
        }
        public void afterCompletion(        int status){
synchronized (XAPool.this) {
            statefulHolderTransactionMap.remove(currentTxGtrid);
            if (log.isDebugEnabled())             log.debug("String_Node_Str" + currentTxGtrid);
          }
        }
      }
);
    }
 catch (    Exception e) {
      return;
    }
    threadLocal=new ThreadLocal();
    threadLocal.set(xaStatefulHolder);
    statefulHolderTransactionMap.put(currentTxGtrid,threadLocal);
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + currentTxGtrid + "String_Node_Str"+ xaStatefulHolder);
  }
 else {
    threadLocal.set(xaStatefulHolder);
  }
}
Program: 155483
Project: 155483
Buggy source:
public Object getConnectionHandle() throws Exception {
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + this);
  int oldState=getState();
  setState(STATE_ACCESSIBLE);
  if (oldState == STATE_IN_POOL) {
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + xaConnection + "String_Node_Str");
    testConnection(connection);
    applyIsolationLevel();
    applyCursorHoldabilty();
    applyLocalAutoCommit();
  }
 else {
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + xaConnection + "String_Node_Str"+ Decoder.decodeXAStatefulHolderState(oldState)+ "String_Node_Str");
  }
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + this);
  return new JdbcConnectionHandle(this,connection);
}

Fixed version (ground truth):
public Object getConnectionHandle() throws Exception {
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + this);
  int oldState=getState();
  setState(STATE_ACCESSIBLE);
  if (oldState == STATE_IN_POOL) {
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + xaConnection + "String_Node_Str");
    testConnection(connection);
    applyIsolationLevel();
    applyCursorHoldabilty();
    if (TransactionContextHelper.currentTransaction() == null) {
      applyLocalAutoCommit();
    }
 else {
      connection.setAutoCommit(true);
    }
  }
 else {
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + xaConnection + "String_Node_Str"+ Decoder.decodeXAStatefulHolderState(oldState)+ "String_Node_Str");
  }
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + this);
  return new JdbcConnectionHandle(this,connection);
}
Program: 155484
Project: 155484
Buggy source:
private void putSharedXaStatefulHolder(final XAStatefulHolder xaStatefulHolder){
  BitronixTransaction transaction=TransactionContextHelper.currentTransaction();
  if (transaction == null) {
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + xaStatefulHolder + "String_Node_Str");
    return;
  }
  final Uid currentTxGtrid=transaction.getResourceManager().getGtrid();
  ThreadLocal threadLocal=(ThreadLocal)statefulHolderTransactionMap.get(currentTxGtrid);
  if (threadLocal == null) {
    threadLocal=new ThreadLocal();
    threadLocal.set(xaStatefulHolder);
    statefulHolderTransactionMap.put(currentTxGtrid,threadLocal);
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + currentTxGtrid + "String_Node_Str"+ xaStatefulHolder);
    try {
      transaction.registerSynchronization(new Synchronization(){
        public void beforeCompletion(){
        }
        public void afterCompletion(        int status){
          if (log.isDebugEnabled())           log.debug("String_Node_Str" + currentTxGtrid);
          statefulHolderTransactionMap.remove(currentTxGtrid);
        }
      }
);
    }
 catch (    Exception e) {
      return;
    }
  }
 else {
    threadLocal.set(xaStatefulHolder);
  }
}

Fixed version (ground truth):
private void putSharedXaStatefulHolder(final XAStatefulHolder xaStatefulHolder){
  BitronixTransaction transaction=TransactionContextHelper.currentTransaction();
  if (transaction == null) {
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + xaStatefulHolder + "String_Node_Str");
    return;
  }
  final Uid currentTxGtrid=transaction.getResourceManager().getGtrid();
  ThreadLocal threadLocal=(ThreadLocal)statefulHolderTransactionMap.get(currentTxGtrid);
  if (threadLocal == null) {
    try {
      transaction.registerSynchronization(new Synchronization(){
        public void beforeCompletion(){
        }
        public void afterCompletion(        int status){
          if (log.isDebugEnabled())           log.debug("String_Node_Str" + currentTxGtrid);
          statefulHolderTransactionMap.remove(currentTxGtrid);
        }
      }
);
    }
 catch (    Exception e) {
      return;
    }
    threadLocal=new ThreadLocal();
    threadLocal.set(xaStatefulHolder);
    statefulHolderTransactionMap.put(currentTxGtrid,threadLocal);
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + currentTxGtrid + "String_Node_Str"+ xaStatefulHolder);
  }
 else {
    threadLocal.set(xaStatefulHolder);
  }
}
Program: 155485
Project: 155485
Buggy source:
private synchronized void waitForConnectionInPool() throws Exception {
  long remainingTime=bean.getAcquisitionTimeout() * 1000L;
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + inPoolSize());
  while (inPoolSize() == 0) {
    long before=System.currentTimeMillis();
    try {
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + remainingTime + "String_Node_Str");
      wait(remainingTime);
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + inPoolSize());
    }
 catch (    InterruptedException ex) {
    }
    long now=System.currentTimeMillis();
    remainingTime-=(now - before);
    if (remainingTime <= 0) {
      if (log.isDebugEnabled())       log.debug("String_Node_Str");
      if (TransactionManagerServices.isTransactionManagerRunning())       TransactionManagerServices.getTransactionManager().dumpTransactionContexts();
      throw new Exception("String_Node_Str" + bean.getUniqueName() + "String_Node_Str"+ bean.getAcquisitionTimeout()+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private synchronized void waitForConnectionInPool() throws Exception {
  long remainingTime=bean.getAcquisitionTimeout() * 1000L;
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + inPoolSize());
  while (inPoolSize() == 0) {
    long before=System.currentTimeMillis();
    try {
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + remainingTime + "String_Node_Str");
      wait(remainingTime);
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + inPoolSize());
    }
 catch (    InterruptedException ex) {
    }
    long now=System.currentTimeMillis();
    remainingTime-=(now - before);
    if (remainingTime <= 0 && inPoolSize() == 0) {
      if (log.isDebugEnabled())       log.debug("String_Node_Str");
      if (TransactionManagerServices.isTransactionManagerRunning())       TransactionManagerServices.getTransactionManager().dumpTransactionContexts();
      throw new Exception("String_Node_Str" + bean.getUniqueName() + "String_Node_Str"+ bean.getAcquisitionTimeout()+ "String_Node_Str");
    }
  }
}
Program: 155487
Project: 155487
Buggy source:
private void fireAfterCompletionEvent(){
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + synchronizationScheduler.size() + "String_Node_Str");
  Iterator it=synchronizationScheduler.iterator();
  while (it.hasNext()) {
    Synchronization synchronization=(Synchronization)it.next();
    try {
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + synchronization + "String_Node_Str"+ Decoder.decodeStatus(status));
      synchronization.afterCompletion(status);
    }
 catch (    Exception ex) {
      log.warn("String_Node_Str" + synchronization,ex);
    }
  }
  resourceManager.clearXAResourceHolderStates();
  ManagementRegistrar.unregister("String_Node_Str" + resourceManager.getGtrid());
}

Fixed version (ground truth):
private void fireAfterCompletionEvent(){
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + synchronizationScheduler.size() + "String_Node_Str");
  Iterator it=synchronizationScheduler.iterator();
  while (it.hasNext()) {
    Synchronization synchronization=(Synchronization)it.next();
    try {
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + synchronization + "String_Node_Str"+ Decoder.decodeStatus(status));
      synchronization.afterCompletion(status);
    }
 catch (    Exception ex) {
      log.warn("String_Node_Str" + synchronization,ex);
    }
  }
  ManagementRegistrar.unregister("String_Node_Str" + resourceManager.getGtrid());
}
Program: 155488
Project: 155488
Buggy source:
/** 
 * Remove this transaction's   {@link XAResourceHolderState} from all enlisted{@link bitronix.tm.resource.common.XAResourceHolder}s.
 */
public void clearXAResourceHolderStates(){
  Iterator it=resources.iterator();
  while (it.hasNext()) {
    XAResourceHolderState xaResourceHolderState=(XAResourceHolderState)it.next();
    boolean mightHaveMore=true;
    while (mightHaveMore)     mightHaveMore=xaResourceHolderState.getXAResourceHolder().removeXAResourceHolderState(xaResourceHolderState);
    it.remove();
  }
}

Fixed version (ground truth):
/** 
 * Remove this transaction's   {@link XAResourceHolderState} from all enlisted{@link bitronix.tm.resource.common.XAResourceHolder}s.
 */
public void clearXAResourceHolderStates(){
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + resources.size() + "String_Node_Str");
  Iterator it=resources.iterator();
  while (it.hasNext()) {
    XAResourceHolderState xaResourceHolderState=(XAResourceHolderState)it.next();
    boolean mightHaveMore=true;
    while (mightHaveMore) {
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + xaResourceHolderState);
      mightHaveMore=xaResourceHolderState.getXAResourceHolder().removeXAResourceHolderState(xaResourceHolderState);
    }
    it.remove();
  }
}
Program: 155489
Project: 155489
Buggy source:
public DeferredReleaseSynchronization(XAStatefulHolder xaStatefulHolder){
  this.xaStatefulHolder=xaStatefulHolder;
}

Fixed version (ground truth):
public DeferredReleaseSynchronization(BitronixTransaction transaction,XAStatefulHolder xaStatefulHolder){
  this.transaction=transaction;
  this.xaStatefulHolder=xaStatefulHolder;
}
Program: 155490
Project: 155490
Buggy source:
public void afterCompletion(int status){
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + xaStatefulHolder);
  xaStatefulHolder.setState(XAResourceHolder.STATE_IN_POOL);
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + xaStatefulHolder);
}

Fixed version (ground truth):
public void afterCompletion(int status){
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + xaStatefulHolder);
  transaction.getResourceManager().clearXAResourceHolderStates();
  xaStatefulHolder.setState(XAResourceHolder.STATE_IN_POOL);
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + xaStatefulHolder);
}
Program: 155492
Project: 155492
Buggy source:
/** 
 * Remove this transaction's   {@link XAResourceHolderState} from all enlisted{@link bitronix.tm.resource.common.XAResourceHolder}s.
 */
public void clearXAResourceHolderStates(){
  Iterator it=resources.iterator();
  while (it.hasNext()) {
    XAResourceHolderState xaResourceHolderState=(XAResourceHolderState)it.next();
    xaResourceHolderState.getXAResourceHolder().getAllXAResourceHolderStates().remove(xaResourceHolderState);
    it.remove();
  }
}

Fixed version (ground truth):
/** 
 * Remove this transaction's   {@link XAResourceHolderState} from all enlisted{@link bitronix.tm.resource.common.XAResourceHolder}s.
 */
public void clearXAResourceHolderStates(){
  Iterator it=resources.iterator();
  while (it.hasNext()) {
    XAResourceHolderState xaResourceHolderState=(XAResourceHolderState)it.next();
    boolean mightHaveMore=true;
    while (mightHaveMore)     mightHaveMore=xaResourceHolderState.getXAResourceHolder().getAllXAResourceHolderStates().remove(xaResourceHolderState);
    it.remove();
  }
}
Program: 155494
Project: 155494
Buggy source:
public void beforeCompletion(){
}

Fixed version (ground truth):
public void beforeCompletion(){
  beforeCount++;
}
Program: 155495
Project: 155495
Buggy source:
public void testMarkedRollback() throws Exception {
  btm.begin();
  btm.setRollbackOnly();
  assertEquals(Status.STATUS_MARKED_ROLLBACK,btm.getTransaction().getStatus());
  try {
    btm.commit();
    fail("String_Node_Str");
  }
 catch (  RollbackException ex) {
    assertEquals("String_Node_Str",ex.getMessage());
  }
}

Fixed version (ground truth):
public void testMarkedRollback() throws Exception {
  btm.begin();
  CountingSynchronization sync=new CountingSynchronization();
  btm.getTransaction().registerSynchronization(sync);
  btm.setRollbackOnly();
  assertEquals(Status.STATUS_MARKED_ROLLBACK,btm.getTransaction().getStatus());
  try {
    btm.commit();
    fail("String_Node_Str");
  }
 catch (  RollbackException ex) {
    assertEquals("String_Node_Str",ex.getMessage());
  }
  assertEquals(0,sync.beforeCount);
  assertEquals(1,sync.afterCount);
}
Program: 155496
Project: 155496
Buggy source:
public void afterCompletion(int i){
}

Fixed version (ground truth):
public void afterCompletion(int i){
  afterCount++;
}
Program: 155497
Project: 155497
Buggy source:
public void testTimeout() throws Exception {
  btm.setTransactionTimeout(1);
  btm.begin();
  Thread.sleep(1100);
  assertEquals(Status.STATUS_MARKED_ROLLBACK,btm.getTransaction().getStatus());
  try {
    btm.commit();
    fail("String_Node_Str");
  }
 catch (  RollbackException ex) {
    assertEquals("String_Node_Str",ex.getMessage());
  }
}

Fixed version (ground truth):
public void testTimeout() throws Exception {
  btm.setTransactionTimeout(1);
  btm.begin();
  CountingSynchronization sync=new CountingSynchronization();
  btm.getTransaction().registerSynchronization(sync);
  Thread.sleep(2000);
  assertEquals(Status.STATUS_MARKED_ROLLBACK,btm.getTransaction().getStatus());
  try {
    btm.commit();
    fail("String_Node_Str");
  }
 catch (  RollbackException ex) {
    assertEquals("String_Node_Str",ex.getMessage());
  }
  assertEquals(0,sync.beforeCount);
  assertEquals(1,sync.afterCount);
}
Program: 155499
Project: 155499
Buggy source:
public String extractServerId(){
  int serverIdLength=array.length - 8 - 4;
  return new String(array,0,serverIdLength);
}

Fixed version (ground truth):
public byte[] extractServerId(){
  int serverIdLength=array.length - 8 - 4;
  if (serverIdLength < 1)   return null;
  byte[] result=new byte[serverIdLength];
  System.arraycopy(array,0,result,0,serverIdLength);
  return result;
}
Program: 155500
Project: 155500
Buggy source:
/** 
 * Create 3 XIDs on the resource that are not in the journal -> recoverer presumes they have aborted and rolls them back.
 * @throws Exception
 */
public void testRecoverPresumedAbort() throws Exception {
  xaResource.addInDoubtXid(new MockXid(0,0,BitronixXid.FORMAT_ID));
  xaResource.addInDoubtXid(new MockXid(1,1,BitronixXid.FORMAT_ID));
  xaResource.addInDoubtXid(new MockXid(2,2,BitronixXid.FORMAT_ID));
  TransactionManagerServices.getRecoverer().run();
  assertEquals(0,TransactionManagerServices.getRecoverer().getCommittedCount());
  assertEquals(3,TransactionManagerServices.getRecoverer().getRolledbackCount());
  assertEquals(0,xaResource.recover(XAResource.TMSTARTRSCAN | XAResource.TMENDRSCAN).length);
}

Fixed version (ground truth):
/** 
 * Create 3 XIDs on the resource that are not in the journal -> recoverer presumes they have aborted and rolls them back.
 * @throws Exception
 */
public void testRecoverPresumedAbort() throws Exception {
  byte[] gtrid=UidGenerator.generateUid().getArray();
  xaResource.addInDoubtXid(new MockXid(0,gtrid,BitronixXid.FORMAT_ID));
  xaResource.addInDoubtXid(new MockXid(1,gtrid,BitronixXid.FORMAT_ID));
  xaResource.addInDoubtXid(new MockXid(2,gtrid,BitronixXid.FORMAT_ID));
  TransactionManagerServices.getRecoverer().run();
  assertEquals(0,TransactionManagerServices.getRecoverer().getCommittedCount());
  assertEquals(3,TransactionManagerServices.getRecoverer().getRolledbackCount());
  assertEquals(0,xaResource.recover(XAResource.TMSTARTRSCAN | XAResource.TMENDRSCAN).length);
}
Program: 155502
Project: 155502
Buggy source:
/** 
 * Create 3 XIDs on the resource that are in the journal -> recoverer commits them.
 * @throws Exception
 */
public void testRecoverCommitting() throws Exception {
  Xid xid0=new MockXid(0,0,BitronixXid.FORMAT_ID);
  xaResource.addInDoubtXid(xid0);
  Xid xid1=new MockXid(1,1,BitronixXid.FORMAT_ID);
  xaResource.addInDoubtXid(xid1);
  Xid xid2=new MockXid(2,2,BitronixXid.FORMAT_ID);
  xaResource.addInDoubtXid(xid2);
  Set names=new HashSet();
  names.add(pds.getUniqueName());
  journal.log(Status.STATUS_COMMITTING,new Uid(xid0.getGlobalTransactionId()),names);
  journal.log(Status.STATUS_COMMITTING,new Uid(xid1.getGlobalTransactionId()),names);
  journal.log(Status.STATUS_COMMITTING,new Uid(xid2.getGlobalTransactionId()),names);
  TransactionManagerServices.getRecoverer().run();
  assertEquals(3,TransactionManagerServices.getRecoverer().getCommittedCount());
  assertEquals(0,TransactionManagerServices.getRecoverer().getRolledbackCount());
  assertEquals(0,xaResource.recover(XAResource.TMSTARTRSCAN | XAResource.TMENDRSCAN).length);
}

Fixed version (ground truth):
/** 
 * Create 3 XIDs on the resource that are in the journal -> recoverer commits them.
 * @throws Exception
 */
public void testRecoverCommitting() throws Exception {
  Xid xid0=new MockXid(0,UidGenerator.generateUid().getArray(),BitronixXid.FORMAT_ID);
  xaResource.addInDoubtXid(xid0);
  Xid xid1=new MockXid(1,UidGenerator.generateUid().getArray(),BitronixXid.FORMAT_ID);
  xaResource.addInDoubtXid(xid1);
  Xid xid2=new MockXid(2,UidGenerator.generateUid().getArray(),BitronixXid.FORMAT_ID);
  xaResource.addInDoubtXid(xid2);
  Set names=new HashSet();
  names.add(pds.getUniqueName());
  journal.log(Status.STATUS_COMMITTING,new Uid(xid0.getGlobalTransactionId()),names);
  journal.log(Status.STATUS_COMMITTING,new Uid(xid1.getGlobalTransactionId()),names);
  journal.log(Status.STATUS_COMMITTING,new Uid(xid2.getGlobalTransactionId()),names);
  TransactionManagerServices.getRecoverer().run();
  assertEquals(3,TransactionManagerServices.getRecoverer().getCommittedCount());
  assertEquals(0,TransactionManagerServices.getRecoverer().getRolledbackCount());
  assertEquals(0,xaResource.recover(XAResource.TMSTARTRSCAN | XAResource.TMENDRSCAN).length);
}
Program: 155504
Project: 155504
Buggy source:
private Set filterParticipatingUniqueNamesInRecoveredXids(Set uniqueNames){
  Set recoveredUniqueNames=new HashSet();
  Iterator it=uniqueNames.iterator();
  while (it.hasNext()) {
    String uniqueName=(String)it.next();
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + uniqueName);
    Set recoveredXids=(Set)recoveredXidSets.get(uniqueName);
    if (recoveredXids == null) {
      log.info("String_Node_Str" + uniqueName + "String_Node_Str");
    }
 else {
      recoveredUniqueNames.add(uniqueName);
    }
  }
  return recoveredUniqueNames;
}

Fixed version (ground truth):
private Set filterParticipatingUniqueNamesInRecoveredXids(Set uniqueNames){
  Set recoveredUniqueNames=new HashSet();
  Iterator it=uniqueNames.iterator();
  while (it.hasNext()) {
    String uniqueName=(String)it.next();
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + uniqueName);
    Set recoveredXids=(Set)recoveredXidSets.get(uniqueName);
    if (recoveredXids == null) {
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + uniqueName + "String_Node_Str");
    }
 else {
      recoveredUniqueNames.add(uniqueName);
    }
  }
  return recoveredUniqueNames;
}
Program: 155506
Project: 155506
Buggy source:
private void runJobsForPosition(List resources) throws PhaseException {
  Iterator it=resources.iterator();
  List jobs=new ArrayList();
  List exceptions=new ArrayList();
  List errorResources=new ArrayList();
  while (it.hasNext()) {
    XAResourceHolderState resourceHolder=(XAResourceHolderState)it.next();
    if (!isParticipating(resourceHolder)) {
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + resourceHolder);
      continue;
    }
    Job job=createJob(resourceHolder);
    Object future=executor.submit(job);
    job.setFuture(future);
    jobs.add(job);
  }
  for (int i=0; i < jobs.size(); i++) {
    Job job=(Job)jobs.get(i);
    Object future=job.getFuture();
    while (!executor.isDone(future)) {
      executor.waitFor(future,1000L);
    }
    XAException xaException=job.getXAException();
    RuntimeException runtimeException=job.getRuntimeException();
    if (xaException != null) {
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + job + "String_Node_Str"+ Decoder.decodeXAExceptionErrorCode(xaException));
      exceptions.add(xaException);
      errorResources.add(job.getResource());
    }
 else     if (runtimeException != null) {
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + job);
      exceptions.add(runtimeException);
      errorResources.add(job.getResource());
    }
  }
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + exceptions.size() + "String_Node_Str");
  if (exceptions.size() > 0)   throw new PhaseException(exceptions,errorResources);
}

Fixed version (ground truth):
private JobsExecutionReport runJobsForPosition(List resources){
  Iterator it=resources.iterator();
  List jobs=new ArrayList();
  List exceptions=new ArrayList();
  List errorResources=new ArrayList();
  while (it.hasNext()) {
    XAResourceHolderState resourceHolder=(XAResourceHolderState)it.next();
    if (!isParticipating(resourceHolder)) {
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + resourceHolder);
      continue;
    }
    Job job=createJob(resourceHolder);
    Object future=executor.submit(job);
    job.setFuture(future);
    jobs.add(job);
  }
  for (int i=0; i < jobs.size(); i++) {
    Job job=(Job)jobs.get(i);
    Object future=job.getFuture();
    while (!executor.isDone(future)) {
      executor.waitFor(future,1000L);
    }
    XAException xaException=job.getXAException();
    RuntimeException runtimeException=job.getRuntimeException();
    if (xaException != null) {
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + job + "String_Node_Str"+ Decoder.decodeXAExceptionErrorCode(xaException));
      exceptions.add(xaException);
      errorResources.add(job.getResource());
    }
 else     if (runtimeException != null) {
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + job);
      exceptions.add(runtimeException);
      errorResources.add(job.getResource());
    }
  }
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + exceptions.size() + "String_Node_Str");
  return new JobsExecutionReport(exceptions,errorResources);
}
Program: 155508
Project: 155508
Buggy source:
/** 
 * Delist all resources that have not been closed before calling tm.commit(). This basically means calling XAResource.end() on all resource that has not been ended yet.
 * @param flag the flag to pass to XAResource.end(). Either TMSUCCESS or TMFAIL.
 */
private void delistUnclosedResources(int flag){
  List resources=resourceManager.getAllResources();
  for (int i=0; i < resources.size(); i++) {
    XAResourceHolderState xaResourceHolderState=(XAResourceHolderState)resources.get(i);
    if (!xaResourceHolderState.isEnded()) {
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + xaResourceHolderState);
      try {
        delistResource(xaResourceHolderState.getXAResource(),flag);
      }
 catch (      SystemException ex) {
        log.warn("String_Node_Str" + xaResourceHolderState,ex);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Delist all resources that have not been closed before calling tm.commit(). This basically means calling XAResource.end() on all resource that has not been ended yet.
 * @param flag the flag to pass to XAResource.end(). Either TMSUCCESS or TMFAIL.
 */
private void delistUnclosedResources(int flag){
  List resources=resourceManager.getAllResources();
  for (int i=0; i < resources.size(); i++) {
    XAResourceHolderState xaResourceHolderState=(XAResourceHolderState)resources.get(i);
    if (!xaResourceHolderState.isEnded()) {
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + xaResourceHolderState);
      try {
        delistResource(xaResourceHolderState.getXAResource(),flag);
      }
 catch (      SystemException ex) {
        log.warn("String_Node_Str" + xaResourceHolderState,ex);
      }
    }
 else     if (log.isDebugEnabled())     log.debug("String_Node_Str" + xaResourceHolderState);
  }
}
Program: 155511
Project: 155511
Buggy source:
/** 
 * Build a populated   {@link XAResourceProducer} out of a list of property pairs and the config name.
 * @param configuredName index name of the config file.
 * @param propertyPairs the properties attached to this index.
 * @return a populated {@link XAResourceProducer}.
 * @throws ResourceConfigurationException if the {@link XAResourceProducer} cannot be built.
 */
private XAResourceProducer buildXAResourceProducer(String configuredName,List propertyPairs) throws ResourceConfigurationException {
  String lastPropertyName="String_Node_Str";
  try {
    XAResourceProducer producer=createBean(configuredName,propertyPairs);
    for (int i=0; i < propertyPairs.size(); i++) {
      PropertyPair propertyPair=(PropertyPair)propertyPairs.get(i);
      lastPropertyName=propertyPair.getName();
      String propertyValue=propertyPair.getValue();
      if (lastPropertyName.endsWith(PASSWORD_PROPERTY_NAME)) {
        propertyValue=decrypt(propertyValue);
      }
      PropertyUtils.setProperty(producer,lastPropertyName,propertyValue);
    }
    if (producer.getUniqueName() == null)     throw new ResourceConfigurationException("String_Node_Str" + configuredName + "String_Node_Str");
    return producer;
  }
 catch (  ResourceConfigurationException ex) {
    throw ex;
  }
catch (  Exception ex) {
    throw new ResourceConfigurationException("String_Node_Str" + configuredName + "String_Node_Str"+ "String_Node_Str"+ lastPropertyName+ "String_Node_Str",ex);
  }
}

Fixed version (ground truth):
/** 
 * Build a populated   {@link XAResourceProducer} out of a list of property pairs and the config name.
 * @param configuredName index name of the config file.
 * @param propertyPairs the properties attached to this index.
 * @return a populated {@link XAResourceProducer}.
 * @throws ResourceConfigurationException if the {@link XAResourceProducer} cannot be built.
 */
private XAResourceProducer buildXAResourceProducer(String configuredName,List propertyPairs) throws ResourceConfigurationException {
  String lastPropertyName="String_Node_Str";
  try {
    XAResourceProducer producer=createBean(configuredName,propertyPairs);
    for (int i=0; i < propertyPairs.size(); i++) {
      PropertyPair propertyPair=(PropertyPair)propertyPairs.get(i);
      lastPropertyName=propertyPair.getName();
      String propertyValue=propertyPair.getValue();
      PropertyUtils.setProperty(producer,lastPropertyName,propertyValue);
    }
    if (producer.getUniqueName() == null)     throw new ResourceConfigurationException("String_Node_Str" + configuredName + "String_Node_Str");
    return producer;
  }
 catch (  ResourceConfigurationException ex) {
    throw ex;
  }
catch (  Exception ex) {
    throw new ResourceConfigurationException("String_Node_Str" + configuredName + "String_Node_Str"+ "String_Node_Str"+ lastPropertyName+ "String_Node_Str",ex);
  }
}
Program: 155512
Project: 155512
Buggy source:
private static Object createXAFactory(ResourceBean bean) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException {
  String className=bean.getClassName();
  if (className == null)   throw new IllegalArgumentException("String_Node_Str");
  Class xaFactoryClass=Thread.currentThread().getContextClassLoader().loadClass(className);
  Object xaFactory=xaFactoryClass.newInstance();
  Iterator it=bean.getDriverProperties().entrySet().iterator();
  while (it.hasNext()) {
    Map.Entry entry=(Map.Entry)it.next();
    String name=(String)entry.getKey();
    String value=(String)entry.getValue();
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + name + "String_Node_Str"+ value+ "String_Node_Str");
    PropertyUtils.setProperty(xaFactory,name,value);
  }
  return xaFactory;
}

Fixed version (ground truth):
private static Object createXAFactory(ResourceBean bean) throws Exception {
  String className=bean.getClassName();
  if (className == null)   throw new IllegalArgumentException("String_Node_Str");
  Class xaFactoryClass=Thread.currentThread().getContextClassLoader().loadClass(className);
  Object xaFactory=xaFactoryClass.newInstance();
  Iterator it=bean.getDriverProperties().entrySet().iterator();
  while (it.hasNext()) {
    Map.Entry entry=(Map.Entry)it.next();
    String name=(String)entry.getKey();
    String value=(String)entry.getValue();
    if (name.endsWith(PASSWORD_PROPERTY_NAME)) {
      value=decrypt(value);
    }
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + name + "String_Node_Str"+ value+ "String_Node_Str");
    PropertyUtils.setProperty(xaFactory,name,value);
  }
  return xaFactory;
}
Program: 155513
Project: 155513
Buggy source:
public void testDecryptPassword() throws Exception {
  ResourceLoader loader=new ResourceLoader();
  Properties p=new Properties();
  p.setProperty("String_Node_Str",MockXADataSource.class.getName());
  p.setProperty("String_Node_Str","String_Node_Str");
  p.setProperty("String_Node_Str","String_Node_Str");
  p.setProperty("String_Node_Str","String_Node_Str");
  p.setProperty("String_Node_Str","String_Node_Str");
  p.setProperty("String_Node_Str","String_Node_Str");
  p.setProperty("String_Node_Str","String_Node_Str");
  p.setProperty("String_Node_Str","String_Node_Str");
  p.setProperty("String_Node_Str","String_Node_Str");
  loader.initXAResourceProducers(p);
  Map dataSources=loader.getResources();
  assertEquals(1,dataSources.size());
  String uniqueName=(String)dataSources.keySet().iterator().next();
  assertEquals("String_Node_Str",uniqueName);
  PoolingDataSource pds=(PoolingDataSource)dataSources.get(uniqueName);
  assertEquals("String_Node_Str",pds.getClassName());
  assertEquals("String_Node_Str",pds.getUniqueName());
  assertEquals(123,pds.getMaxPoolSize());
  assertEquals(3,pds.getDriverProperties().size());
  assertEquals("String_Node_Str",pds.getDriverProperties().getProperty("String_Node_Str"));
}

Fixed version (ground truth):
public void testDecryptPassword() throws Exception {
  ResourceLoader loader=new ResourceLoader();
  Properties p=new Properties();
  p.setProperty("String_Node_Str",MockXADataSource.class.getName());
  p.setProperty("String_Node_Str","String_Node_Str");
  p.setProperty("String_Node_Str","String_Node_Str");
  p.setProperty("String_Node_Str","String_Node_Str");
  p.setProperty("String_Node_Str","String_Node_Str");
  p.setProperty("String_Node_Str","String_Node_Str");
  p.setProperty("String_Node_Str","String_Node_Str");
  p.setProperty("String_Node_Str","String_Node_Str");
  p.setProperty("String_Node_Str","String_Node_Str");
  loader.initXAResourceProducers(p);
  Map dataSources=loader.getResources();
  assertEquals(1,dataSources.size());
  String uniqueName=(String)dataSources.keySet().iterator().next();
  assertEquals("String_Node_Str",uniqueName);
  PoolingDataSource pds=(PoolingDataSource)dataSources.get(uniqueName);
  assertEquals("String_Node_Str",pds.getClassName());
  assertEquals("String_Node_Str",pds.getUniqueName());
  assertEquals(123,pds.getMaxPoolSize());
  assertEquals(3,pds.getDriverProperties().size());
  String decryptedPassword=(String)PropertyUtils.getProperty(getXADataSource(pds),"String_Node_Str");
  assertEquals("String_Node_Str",decryptedPassword);
}
Program: 155514
Project: 155514
Buggy source:
private static Method getGetter(Object target,String propertyName){
  String getterName="String_Node_Str" + propertyName.substring(0,1).toUpperCase() + propertyName.substring(1);
  Method[] methods=target.getClass().getMethods();
  for (int i=0; i < methods.length; i++) {
    Method method=methods[i];
    if (method.getName().equals(getterName) && !method.getReturnType().equals(void.class) && method.getParameterTypes().length == 0) {
      return method;
    }
  }
  throw new PropertyException("String_Node_Str" + propertyName + "String_Node_Str"+ target.getClass().getName()+ "String_Node_Str");
}

Fixed version (ground truth):
private static Method getGetter(Object target,String propertyName){
  String getterName="String_Node_Str" + propertyName.substring(0,1).toUpperCase() + propertyName.substring(1);
  String getterIsName="String_Node_Str" + propertyName.substring(0,1).toUpperCase() + propertyName.substring(1);
  Method[] methods=target.getClass().getMethods();
  for (int i=0; i < methods.length; i++) {
    Method method=methods[i];
    if ((method.getName().equals(getterName) || method.getName().equals(getterIsName)) && !method.getReturnType().equals(void.class) && method.getParameterTypes().length == 0) {
      return method;
    }
  }
  throw new PropertyException("String_Node_Str" + propertyName + "String_Node_Str"+ target.getClass().getName()+ "String_Node_Str");
}
Program: 155516
Project: 155516
Buggy source:
/** 
 * Recover all configured resources and fill the <code>recoveredXidSets</code> with all recovered XIDs. Step 1.
 */
private void recoverAllResources(){
  Iterator it=registeredResources.entrySet().iterator();
  while (it.hasNext()) {
    Map.Entry entry=(Map.Entry)it.next();
    String uniqueName=(String)entry.getKey();
    XAResourceProducer producer=(XAResourceProducer)entry.getValue();
    try {
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + uniqueName);
      Set xids=recover(producer);
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + xids.size() + "String_Node_Str"+ uniqueName);
      recoveredXidSets.put(uniqueName,xids);
    }
 catch (    XAException ex) {
      throw new RecoveryException("String_Node_Str" + uniqueName + "String_Node_Str"+ Decoder.decodeXAExceptionErrorCode(ex),ex);
    }
catch (    Exception ex) {
      throw new RecoveryException("String_Node_Str" + uniqueName,ex);
    }
  }
  if (log.isDebugEnabled())   log.debug(registeredResources.size() + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Recover all configured resources and fill the <code>recoveredXidSets</code> with all recovered XIDs. Step 1.
 */
private void recoverAllResources(){
  Iterator it=registeredResources.entrySet().iterator();
  while (it.hasNext()) {
    Map.Entry entry=(Map.Entry)it.next();
    String uniqueName=(String)entry.getKey();
    XAResourceProducer producer=(XAResourceProducer)entry.getValue();
    try {
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + uniqueName);
      Set xids=recover(producer);
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + xids.size() + "String_Node_Str"+ uniqueName);
      recoveredXidSets.put(uniqueName,xids);
    }
 catch (    XAException ex) {
      throw new RecoveryException("String_Node_Str" + uniqueName + "String_Node_Str"+ Decoder.decodeXAExceptionErrorCode(ex)+ "String_Node_Str",ex);
    }
catch (    Exception ex) {
      throw new RecoveryException("String_Node_Str" + uniqueName,ex);
    }
  }
  if (log.isDebugEnabled())   log.debug(registeredResources.size() + "String_Node_Str");
}
Program: 155517
Project: 155517
Buggy source:
public Xid[] recover(int flag) throws XAException {
  if (xads == null)   return new Xid[0];
  return xads.getInDoubtXids();
}

Fixed version (ground truth):
public Xid[] recover(int flag) throws XAException {
  if (recoverException != null)   throw recoverException;
  if (xads == null)   return new Xid[0];
  return xads.getInDoubtXids();
}
Program: 155518
Project: 155518
Buggy source:
/** 
 * Create 3 XIDs on the resource that are not in the journal -> recoverer presumes they have aborted and rolls them back.
 * @throws Exception
 */
public void testRecoverPresumedAbort() throws Exception {
  xaResource.addInDoubtXid(new MockXid(0,0,BitronixXid.FORMAT_ID));
  xaResource.addInDoubtXid(new MockXid(1,1,BitronixXid.FORMAT_ID));
  xaResource.addInDoubtXid(new MockXid(2,2,BitronixXid.FORMAT_ID));
  Journal journal=TransactionManagerServices.getJournal();
  journal.open();
  TransactionManagerServices.getRecoverer().run();
  journal.close();
  assertEquals(0,TransactionManagerServices.getRecoverer().getCommittedCount());
  assertEquals(3,TransactionManagerServices.getRecoverer().getRolledbackCount());
  assertEquals(0,xaResource.recover(XAResource.TMSTARTRSCAN | XAResource.TMENDRSCAN).length);
}

Fixed version (ground truth):
/** 
 * Create 3 XIDs on the resource that are not in the journal -> recoverer presumes they have aborted and rolls them back.
 * @throws Exception
 */
public void testRecoverPresumedAbort() throws Exception {
  xaResource.addInDoubtXid(new MockXid(0,0,BitronixXid.FORMAT_ID));
  xaResource.addInDoubtXid(new MockXid(1,1,BitronixXid.FORMAT_ID));
  xaResource.addInDoubtXid(new MockXid(2,2,BitronixXid.FORMAT_ID));
  TransactionManagerServices.getRecoverer().run();
  assertEquals(0,TransactionManagerServices.getRecoverer().getCommittedCount());
  assertEquals(3,TransactionManagerServices.getRecoverer().getRolledbackCount());
  assertEquals(0,xaResource.recover(XAResource.TMSTARTRSCAN | XAResource.TMENDRSCAN).length);
}
Program: 155519
Project: 155519
Buggy source:
protected void setUp() throws Exception {
  Iterator it=ResourceRegistrar.getResourcesUniqueNames().iterator();
  while (it.hasNext()) {
    String name=(String)it.next();
    ResourceRegistrar.unregister(ResourceRegistrar.get(name));
  }
  pds=new PoolingDataSource();
  pds.setClassName(MockXADataSource.class.getName());
  pds.setUniqueName("String_Node_Str");
  pds.setMaxPoolSize(3);
  pds.init();
  new File(TransactionManagerServices.getConfiguration().getLogPart1Filename()).delete();
  new File(TransactionManagerServices.getConfiguration().getLogPart2Filename()).delete();
  JdbcConnectionHandle handle=(JdbcConnectionHandle)pds.getConnection();
  xaResource=(MockXAResource)handle.getPooledConnection().getXAResource();
}

Fixed version (ground truth):
protected void setUp() throws Exception {
  Iterator it=ResourceRegistrar.getResourcesUniqueNames().iterator();
  while (it.hasNext()) {
    String name=(String)it.next();
    ResourceRegistrar.unregister(ResourceRegistrar.get(name));
  }
  pds=new PoolingDataSource();
  pds.setClassName(MockXADataSource.class.getName());
  pds.setUniqueName("String_Node_Str");
  pds.setMinPoolSize(1);
  pds.setMaxPoolSize(1);
  pds.init();
  new File(TransactionManagerServices.getConfiguration().getLogPart1Filename()).delete();
  new File(TransactionManagerServices.getConfiguration().getLogPart2Filename()).delete();
  JdbcConnectionHandle handle=(JdbcConnectionHandle)pds.getConnection();
  xaResource=(MockXAResource)handle.getPooledConnection().getXAResource();
  handle.close();
  journal=TransactionManagerServices.getJournal();
  journal.open();
}
Program: 155520
Project: 155520
Buggy source:
public void testRecoverMissingResource() throws Exception {
  Xid xid0=new MockXid(0,0,BitronixXid.FORMAT_ID);
  xaResource.addInDoubtXid(xid0);
  Set names=new HashSet();
  names.add("String_Node_Str");
  Journal journal=TransactionManagerServices.getJournal();
  journal.open();
  journal.log(Status.STATUS_COMMITTING,new Uid(xid0.getGlobalTransactionId()),names);
  TransactionManagerServices.getRecoverer().run();
  journal.close();
  assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str",TransactionManagerServices.getRecoverer().getCompletionException().getMessage());
  assertEquals(0,TransactionManagerServices.getRecoverer().getCommittedCount());
  assertEquals(0,TransactionManagerServices.getRecoverer().getRolledbackCount());
  assertEquals(1,xaResource.recover(XAResource.TMSTARTRSCAN | XAResource.TMENDRSCAN).length);
}

Fixed version (ground truth):
public void testRecoverMissingResource() throws Exception {
  Xid xid0=new MockXid(0,0,BitronixXid.FORMAT_ID);
  xaResource.addInDoubtXid(xid0);
  Set names=new HashSet();
  names.add("String_Node_Str");
  journal.log(Status.STATUS_COMMITTING,new Uid(xid0.getGlobalTransactionId()),names);
  TransactionManagerServices.getRecoverer().run();
  assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str",TransactionManagerServices.getRecoverer().getCompletionException().getMessage());
  assertEquals(0,TransactionManagerServices.getRecoverer().getCommittedCount());
  assertEquals(0,TransactionManagerServices.getRecoverer().getRolledbackCount());
  assertEquals(1,xaResource.recover(XAResource.TMSTARTRSCAN | XAResource.TMENDRSCAN).length);
}
Program: 155521
Project: 155521
Buggy source:
/** 
 * Create 3 XIDs on the resource that are in the journal -> recoverer commits them.
 * @throws Exception
 */
public void testRecoverCommitting() throws Exception {
  Xid xid0=new MockXid(0,0,BitronixXid.FORMAT_ID);
  xaResource.addInDoubtXid(xid0);
  Xid xid1=new MockXid(1,1,BitronixXid.FORMAT_ID);
  xaResource.addInDoubtXid(xid1);
  Xid xid2=new MockXid(2,2,BitronixXid.FORMAT_ID);
  xaResource.addInDoubtXid(xid2);
  Set names=new HashSet();
  names.add(pds.getUniqueName());
  Journal journal=TransactionManagerServices.getJournal();
  journal.open();
  journal.log(Status.STATUS_COMMITTING,new Uid(xid0.getGlobalTransactionId()),names);
  journal.log(Status.STATUS_COMMITTING,new Uid(xid1.getGlobalTransactionId()),names);
  journal.log(Status.STATUS_COMMITTING,new Uid(xid2.getGlobalTransactionId()),names);
  TransactionManagerServices.getRecoverer().run();
  journal.close();
  assertEquals(3,TransactionManagerServices.getRecoverer().getCommittedCount());
  assertEquals(0,TransactionManagerServices.getRecoverer().getRolledbackCount());
  assertEquals(0,xaResource.recover(XAResource.TMSTARTRSCAN | XAResource.TMENDRSCAN).length);
}

Fixed version (ground truth):
/** 
 * Create 3 XIDs on the resource that are in the journal -> recoverer commits them.
 * @throws Exception
 */
public void testRecoverCommitting() throws Exception {
  Xid xid0=new MockXid(0,0,BitronixXid.FORMAT_ID);
  xaResource.addInDoubtXid(xid0);
  Xid xid1=new MockXid(1,1,BitronixXid.FORMAT_ID);
  xaResource.addInDoubtXid(xid1);
  Xid xid2=new MockXid(2,2,BitronixXid.FORMAT_ID);
  xaResource.addInDoubtXid(xid2);
  Set names=new HashSet();
  names.add(pds.getUniqueName());
  journal.log(Status.STATUS_COMMITTING,new Uid(xid0.getGlobalTransactionId()),names);
  journal.log(Status.STATUS_COMMITTING,new Uid(xid1.getGlobalTransactionId()),names);
  journal.log(Status.STATUS_COMMITTING,new Uid(xid2.getGlobalTransactionId()),names);
  TransactionManagerServices.getRecoverer().run();
  assertEquals(3,TransactionManagerServices.getRecoverer().getCommittedCount());
  assertEquals(0,TransactionManagerServices.getRecoverer().getRolledbackCount());
  assertEquals(0,xaResource.recover(XAResource.TMSTARTRSCAN | XAResource.TMENDRSCAN).length);
}
Program: 155522
Project: 155522
Buggy source:
protected void tearDown() throws Exception {
  pds.close();
  new File(TransactionManagerServices.getConfiguration().getLogPart1Filename()).delete();
  new File(TransactionManagerServices.getConfiguration().getLogPart2Filename()).delete();
}

Fixed version (ground truth):
protected void tearDown() throws Exception {
  journal.close();
  pds.close();
  new File(TransactionManagerServices.getConfiguration().getLogPart1Filename()).delete();
  new File(TransactionManagerServices.getConfiguration().getLogPart2Filename()).delete();
}
Program: 155523
Project: 155523
Buggy source:
public JdbcConnectionHandle(JdbcPooledConnection jdbcPooledConnection,Connection connection){
  this.jdbcPooledConnection=jdbcPooledConnection;
  this.connection=connection;
}

Fixed version (ground truth):
public JdbcConnectionHandle(JdbcPooledConnection jdbcPooledConnection,Connection connection){
  this.jdbcPooledConnection=jdbcPooledConnection;
  this.delegate=connection;
}
Program: 155524
Project: 155524
Buggy source:
public void setTransactionIsolation(int level) throws SQLException {
  getConnection().setTransactionIsolation(level);
}

Fixed version (ground truth):
public void setTransactionIsolation(int level) throws SQLException {
  getDelegate().setTransactionIsolation(level);
}
Program: 155525
Project: 155525
Buggy source:
public SQLWarning getWarnings() throws SQLException {
  return getConnection().getWarnings();
}

Fixed version (ground truth):
public SQLWarning getWarnings() throws SQLException {
  return getDelegate().getWarnings();
}
Program: 155526
Project: 155526
Buggy source:
public void commit() throws SQLException {
  if (jdbcPooledConnection == null)   throw new SQLException("String_Node_Str");
  if (jdbcPooledConnection.isParticipatingInActiveGlobalTransaction())   throw new SQLException("String_Node_Str");
  getConnection().commit();
}

Fixed version (ground truth):
public void commit() throws SQLException {
  if (jdbcPooledConnection == null)   throw new SQLException("String_Node_Str");
  if (jdbcPooledConnection.isParticipatingInActiveGlobalTransaction())   throw new SQLException("String_Node_Str");
  getDelegate().commit();
}
Program: 155527
Project: 155527
Buggy source:
public int getHoldability() throws SQLException {
  return getConnection().getHoldability();
}

Fixed version (ground truth):
public int getHoldability() throws SQLException {
  return getDelegate().getHoldability();
}
Program: 155528
Project: 155528
Buggy source:
public void setCatalog(String catalog) throws SQLException {
  getConnection().setCatalog(catalog);
}

Fixed version (ground truth):
public void setCatalog(String catalog) throws SQLException {
  getDelegate().setCatalog(catalog);
}
Program: 155529
Project: 155529
Buggy source:
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
  if (jdbcPooledConnection == null)   throw new SQLException("String_Node_Str");
  if (jdbcPooledConnection.isParticipatingInActiveGlobalTransaction())   throw new SQLException("String_Node_Str");
  getConnection().releaseSavepoint(savepoint);
}

Fixed version (ground truth):
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
  if (jdbcPooledConnection == null)   throw new SQLException("String_Node_Str");
  if (jdbcPooledConnection.isParticipatingInActiveGlobalTransaction())   throw new SQLException("String_Node_Str");
  getDelegate().releaseSavepoint(savepoint);
}
Program: 155530
Project: 155530
Buggy source:
public PreparedStatement prepareStatement(String sql,String[] columnNames) throws SQLException {
  enlistResource();
  return getConnection().prepareStatement(sql,columnNames);
}

Fixed version (ground truth):
public PreparedStatement prepareStatement(String sql,String[] columnNames) throws SQLException {
  enlistResource();
  return getDelegate().prepareStatement(sql,columnNames);
}