nus-yam/ex-repair huggingface dataset:
Program: 92806
Project: 92806
Buggy source:
private int claimCapacity(final AtomicBuffer buffer,final int requiredCapacity){
  final long head=headVolatile(buffer);
  final int headIndex=(int)head & mask;
  long tail;
  int tailIndex;
  int padding;
  do {
    tail=tailVolatile(buffer);
    final int availableCapacity=capacity - (int)(tail - head);
    if (requiredCapacity > availableCapacity) {
      return INSUFFICIENT_CAPACITY;
    }
    padding=0;
    tailIndex=(int)tail & mask;
    final int bufferEndSize=capacity - tailIndex;
    if (requiredCapacity > bufferEndSize) {
      if (requiredCapacity > headIndex) {
        return INSUFFICIENT_CAPACITY;
      }
      padding=bufferEndSize;
    }
  }
 while (!buffer.compareAndSetLong(tailCounterIndex,tail,tail + requiredCapacity + padding));
  if (0 != padding) {
    writePaddingRecord(buffer,tailIndex,padding - HEADER_LENGTH);
    tailIndex=0;
  }
  return tailIndex;
}

Fixed version (ground truth):
private int claimCapacity(final AtomicBuffer buffer,final int requiredCapacity){
  final int capacity=this.capacity;
  final long head=buffer.getLongVolatile(headCounterIndex);
  final int headIndex=(int)head & mask;
  long tail;
  int tailIndex;
  int padding;
  do {
    tail=buffer.getLongVolatile(tailCounterIndex);
    final int availableCapacity=capacity - (int)(tail - head);
    if (requiredCapacity > availableCapacity) {
      return INSUFFICIENT_CAPACITY;
    }
    padding=0;
    tailIndex=(int)tail & mask;
    final int bufferEndLength=capacity - tailIndex;
    if (requiredCapacity > bufferEndLength) {
      if (requiredCapacity > headIndex) {
        return INSUFFICIENT_CAPACITY;
      }
      padding=bufferEndLength;
    }
  }
 while (!buffer.compareAndSetLong(tailCounterIndex,tail,tail + requiredCapacity + padding));
  if (0 != padding) {
    buffer.putIntOrdered(msgLengthOffset(tailIndex),-padding);
    buffer.putInt(msgTypeOffset(tailIndex),PADDING_MSG_TYPE_ID);
    buffer.putIntOrdered(msgLengthOffset(tailIndex),padding);
    tailIndex=0;
  }
  return tailIndex;
}
Program: 92807
Project: 92807
Buggy source:
/** 
 * {@inheritDoc}
 */
public int read(final MessageHandler handler,final int messageCountLimit){
  final AtomicBuffer buffer=this.buffer;
  final long tail=tailVolatile(buffer);
  final long head=headVolatile(buffer);
  final int available=(int)(tail - head);
  int messagesRead=0;
  if (available > 0) {
    final int headIndex=(int)head & mask;
    final int contiguousBlockSize=Math.min(available,capacity - headIndex);
    int bytesRead=0;
    try {
      while ((bytesRead < contiguousBlockSize) && (messagesRead < messageCountLimit)) {
        final int recordIndex=headIndex + bytesRead;
        final int msgLength=waitForMsgLengthVolatile(buffer,recordIndex);
        final int msgTypeId=msgType(buffer,recordIndex);
        bytesRead+=align(msgLength + HEADER_LENGTH,ALIGNMENT);
        if (msgTypeId != PADDING_MSG_TYPE_ID) {
          ++messagesRead;
          handler.onMessage(msgTypeId,buffer,encodedMsgOffset(recordIndex),msgLength);
        }
      }
    }
  finally {
      zeroBuffer(buffer,headIndex,bytesRead);
      headOrdered(buffer,head + bytesRead);
    }
  }
  return messagesRead;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public int read(final MessageHandler handler,final int messageCountLimit){
  int messagesRead=0;
  final AtomicBuffer buffer=this.buffer;
  final long tail=buffer.getLongVolatile(tailCounterIndex);
  final long head=buffer.getLongVolatile(headCounterIndex);
  final int available=(int)(tail - head);
  if (available > 0) {
    int bytesRead=0;
    final int headIndex=(int)head & mask;
    final int contiguousBlockLength=Math.min(available,capacity - headIndex);
    try {
      while ((bytesRead < contiguousBlockLength) && (messagesRead < messageCountLimit)) {
        final int recordIndex=headIndex + bytesRead;
        final int msgLength=buffer.getIntVolatile(msgLengthOffset(recordIndex));
        if (msgLength <= 0) {
          break;
        }
        bytesRead+=align(msgLength + HEADER_LENGTH,ALIGNMENT);
        final int msgTypeId=buffer.getInt(msgTypeOffset(recordIndex));
        if (PADDING_MSG_TYPE_ID == msgTypeId) {
          continue;
        }
        ++messagesRead;
        handler.onMessage(msgTypeId,buffer,encodedMsgOffset(recordIndex),msgLength);
      }
    }
  finally {
      buffer.setMemory(headIndex,bytesRead,(byte)0);
      buffer.putLongOrdered(headCounterIndex,head + bytesRead);
    }
  }
  return messagesRead;
}
Program: 92808
Project: 92808
Buggy source:
/** 
 * {@inheritDoc}
 */
public boolean write(final int msgTypeId,final DirectBuffer srcBuffer,final int srcIndex,final int length){
  checkMsgTypeId(msgTypeId);
  checkMsgLength(length);
  final AtomicBuffer buffer=this.buffer;
  final int requiredCapacity=align(length + HEADER_LENGTH,ALIGNMENT);
  final int recordIndex=claimCapacity(buffer,requiredCapacity);
  if (INSUFFICIENT_CAPACITY == recordIndex) {
    return false;
  }
  writeMsg(buffer,recordIndex,srcBuffer,srcIndex,length);
  msgType(buffer,recordIndex,msgTypeId);
  msgLengthOrdered(buffer,recordIndex,length);
  return true;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public boolean write(final int msgTypeId,final DirectBuffer srcBuffer,final int srcIndex,final int length){
  checkMsgTypeId(msgTypeId);
  checkMsgLength(length);
  boolean isSuccessful=false;
  final AtomicBuffer buffer=this.buffer;
  final int requiredCapacity=align(length + HEADER_LENGTH,ALIGNMENT);
  final int recordIndex=claimCapacity(buffer,requiredCapacity);
  if (INSUFFICIENT_CAPACITY != recordIndex) {
    buffer.putIntOrdered(msgLengthOffset(recordIndex),-length);
    buffer.putBytes(encodedMsgOffset(recordIndex),srcBuffer,srcIndex,length);
    buffer.putInt(msgTypeOffset(recordIndex),msgTypeId);
    buffer.putIntOrdered(msgLengthOffset(recordIndex),length);
    isSuccessful=true;
  }
  return isSuccessful;
}
Program: 92809
Project: 92809
Buggy source:
@Test public void shouldWriteToEmptyBuffer(){
  final int length=8;
  final int recordLength=align(length + HEADER_LENGTH,ALIGNMENT);
  final long tail=0L;
  final long head=0L;
  when(buffer.getLongVolatile(HEAD_COUNTER_INDEX)).thenReturn(head);
  when(buffer.getLongVolatile(TAIL_COUNTER_INDEX)).thenReturn(tail);
  when(buffer.compareAndSetLong(TAIL_COUNTER_INDEX,tail,tail + recordLength)).thenReturn(TRUE);
  final UnsafeBuffer srcBuffer=new UnsafeBuffer(new byte[1024]);
  final int srcIndex=0;
  assertTrue(ringBuffer.write(MSG_TYPE_ID,srcBuffer,srcIndex,length));
  final InOrder inOrder=inOrder(buffer);
  inOrder.verify(buffer).putBytes(encodedMsgOffset((int)tail),srcBuffer,srcIndex,length);
  inOrder.verify(buffer).putInt(msgTypeOffset((int)tail),MSG_TYPE_ID);
  inOrder.verify(buffer).putIntOrdered(msgLengthOffset((int)tail),length);
}

Fixed version (ground truth):
@Test public void shouldWriteToEmptyBuffer(){
  final int length=8;
  final int recordLength=align(length + HEADER_LENGTH,ALIGNMENT);
  final long tail=0L;
  final long head=0L;
  when(buffer.getLongVolatile(HEAD_COUNTER_INDEX)).thenReturn(head);
  when(buffer.getLongVolatile(TAIL_COUNTER_INDEX)).thenReturn(tail);
  when(buffer.compareAndSetLong(TAIL_COUNTER_INDEX,tail,tail + recordLength)).thenReturn(TRUE);
  final UnsafeBuffer srcBuffer=new UnsafeBuffer(new byte[1024]);
  final int srcIndex=0;
  assertTrue(ringBuffer.write(MSG_TYPE_ID,srcBuffer,srcIndex,length));
  final InOrder inOrder=inOrder(buffer);
  inOrder.verify(buffer).putIntOrdered(msgLengthOffset((int)tail),-length);
  inOrder.verify(buffer).putBytes(encodedMsgOffset((int)tail),srcBuffer,srcIndex,length);
  inOrder.verify(buffer).putInt(msgTypeOffset((int)tail),MSG_TYPE_ID);
  inOrder.verify(buffer).putIntOrdered(msgLengthOffset((int)tail),length);
}
Program: 92810
Project: 92810
Buggy source:
@Test public void shouldInsertPaddingRecordPlusMessageOnBufferWrap(){
  final int length=200;
  final int recordLength=align(length + HEADER_LENGTH,ALIGNMENT);
  final long tail=CAPACITY - HEADER_LENGTH;
  final long head=tail - (ALIGNMENT * 4);
  when(buffer.getLongVolatile(HEAD_COUNTER_INDEX)).thenReturn(head);
  when(buffer.getLongVolatile(TAIL_COUNTER_INDEX)).thenReturn(tail);
  when(buffer.compareAndSetLong(TAIL_COUNTER_INDEX,tail,tail + recordLength + ALIGNMENT)).thenReturn(TRUE);
  final UnsafeBuffer srcBuffer=new UnsafeBuffer(new byte[1024]);
  final int srcIndex=0;
  assertTrue(ringBuffer.write(MSG_TYPE_ID,srcBuffer,srcIndex,length));
  final InOrder inOrder=inOrder(buffer);
  inOrder.verify(buffer).putInt(msgTypeOffset((int)tail),PADDING_MSG_TYPE_ID);
  inOrder.verify(buffer).putIntOrdered(msgLengthOffset((int)tail),0);
  inOrder.verify(buffer).putBytes(encodedMsgOffset(0),srcBuffer,srcIndex,length);
  inOrder.verify(buffer).putInt(msgTypeOffset(0),MSG_TYPE_ID);
  inOrder.verify(buffer).putIntOrdered(msgLengthOffset(0),length);
}

Fixed version (ground truth):
@Test public void shouldInsertPaddingRecordPlusMessageOnBufferWrap(){
  final int length=200;
  final int recordLength=align(length + HEADER_LENGTH,ALIGNMENT);
  final long tail=CAPACITY - HEADER_LENGTH;
  final long head=tail - (ALIGNMENT * 4);
  when(buffer.getLongVolatile(HEAD_COUNTER_INDEX)).thenReturn(head);
  when(buffer.getLongVolatile(TAIL_COUNTER_INDEX)).thenReturn(tail);
  when(buffer.compareAndSetLong(TAIL_COUNTER_INDEX,tail,tail + recordLength + ALIGNMENT)).thenReturn(TRUE);
  final UnsafeBuffer srcBuffer=new UnsafeBuffer(new byte[1024]);
  final int srcIndex=0;
  assertTrue(ringBuffer.write(MSG_TYPE_ID,srcBuffer,srcIndex,length));
  final InOrder inOrder=inOrder(buffer);
  inOrder.verify(buffer).putIntOrdered(msgLengthOffset((int)tail),-HEADER_LENGTH);
  inOrder.verify(buffer).putInt(msgTypeOffset((int)tail),PADDING_MSG_TYPE_ID);
  inOrder.verify(buffer).putIntOrdered(msgLengthOffset((int)tail),HEADER_LENGTH);
  inOrder.verify(buffer).putIntOrdered(msgLengthOffset(0),-length);
  inOrder.verify(buffer).putBytes(encodedMsgOffset(0),srcBuffer,srcIndex,length);
  inOrder.verify(buffer).putInt(msgTypeOffset(0),MSG_TYPE_ID);
  inOrder.verify(buffer).putIntOrdered(msgLengthOffset(0),length);
}
Program: 92811
Project: 92811
Buggy source:
@Test public void shouldInsertPaddingRecordPlusMessageOnBufferWrapWithHeadEqualToTail(){
  final int length=200;
  final int recordLength=align(length + HEADER_LENGTH,ALIGNMENT);
  final long tail=CAPACITY - HEADER_LENGTH;
  final long head=tail;
  when(buffer.getLongVolatile(HEAD_COUNTER_INDEX)).thenReturn(head);
  when(buffer.getLongVolatile(TAIL_COUNTER_INDEX)).thenReturn(tail);
  when(buffer.compareAndSetLong(TAIL_COUNTER_INDEX,tail,tail + recordLength + ALIGNMENT)).thenReturn(TRUE);
  final UnsafeBuffer srcBuffer=new UnsafeBuffer(new byte[1024]);
  final int srcIndex=0;
  assertTrue(ringBuffer.write(MSG_TYPE_ID,srcBuffer,srcIndex,length));
  final InOrder inOrder=inOrder(buffer);
  inOrder.verify(buffer).putInt(msgTypeOffset((int)tail),PADDING_MSG_TYPE_ID);
  inOrder.verify(buffer).putIntOrdered(msgLengthOffset((int)tail),0);
  inOrder.verify(buffer).putBytes(encodedMsgOffset(0),srcBuffer,srcIndex,length);
  inOrder.verify(buffer).putInt(msgTypeOffset(0),MSG_TYPE_ID);
  inOrder.verify(buffer).putIntOrdered(msgLengthOffset(0),length);
}

Fixed version (ground truth):
@Test public void shouldInsertPaddingRecordPlusMessageOnBufferWrapWithHeadEqualToTail(){
  final int length=200;
  final int recordLength=align(length + HEADER_LENGTH,ALIGNMENT);
  final long tail=CAPACITY - HEADER_LENGTH;
  final long head=tail;
  when(buffer.getLongVolatile(HEAD_COUNTER_INDEX)).thenReturn(head);
  when(buffer.getLongVolatile(TAIL_COUNTER_INDEX)).thenReturn(tail);
  when(buffer.compareAndSetLong(TAIL_COUNTER_INDEX,tail,tail + recordLength + ALIGNMENT)).thenReturn(TRUE);
  final UnsafeBuffer srcBuffer=new UnsafeBuffer(new byte[1024]);
  final int srcIndex=0;
  assertTrue(ringBuffer.write(MSG_TYPE_ID,srcBuffer,srcIndex,length));
  final InOrder inOrder=inOrder(buffer);
  inOrder.verify(buffer).putIntOrdered(msgLengthOffset((int)tail),-HEADER_LENGTH);
  inOrder.verify(buffer).putInt(msgTypeOffset((int)tail),PADDING_MSG_TYPE_ID);
  inOrder.verify(buffer).putIntOrdered(msgLengthOffset((int)tail),HEADER_LENGTH);
  inOrder.verify(buffer).putIntOrdered(msgLengthOffset(0),-length);
  inOrder.verify(buffer).putBytes(encodedMsgOffset(0),srcBuffer,srcIndex,length);
  inOrder.verify(buffer).putInt(msgTypeOffset(0),MSG_TYPE_ID);
  inOrder.verify(buffer).putIntOrdered(msgLengthOffset(0),length);
}
Program: 92812
Project: 92812
Buggy source:
@Theory public void shouldVerifyBufferAlignment(final AtomicBuffer buffer){
  try {
    buffer.verifyAlignment();
  }
 catch (  final IllegalStateException ex) {
    fail("String_Node_Str" + ex);
  }
}

Fixed version (ground truth):
@Test public void shouldVerifyBufferAlignment(){
  final AtomicBuffer buffer=new UnsafeBuffer(ByteBuffer.allocateDirect(1024));
  try {
    buffer.verifyAlignment();
  }
 catch (  final IllegalStateException ex) {
    fail("String_Node_Str" + ex);
  }
}
Program: 92813
Project: 92813
Buggy source:
public static void main(String[] args) throws IOException {
  expandPrimitiveSpecialisedClass("String_Node_Str");
}

Fixed version (ground truth):
public static void main(final String[] args) throws IOException {
  expandPrimitiveSpecialisedClass("String_Node_Str");
}
Program: 92814
Project: 92814
Buggy source:
public String substitute(String contents){
  return contents;
}

Fixed version (ground truth):
public String substitute(final String contents){
  return contents;
}
Program: 92815
Project: 92815
Buggy source:
private static void expandPrimitiveSpecialisedClass(final String className) throws IOException {
  final Path path=Paths.get(SOURCE_DIRECTORY,PACKAGE,className + SUFFIX);
  String contents=new String(Files.readAllBytes(path),UTF_8);
  for (  Substitution substitution : substitutions) {
    contents=substitution.substitute(contents);
  }
  System.out.println(contents);
}

Fixed version (ground truth):
private static void expandPrimitiveSpecialisedClass(final String className) throws IOException {
  final Path path=Paths.get(SOURCE_DIRECTORY,PACKAGE,className + SUFFIX);
  String contents=new String(Files.readAllBytes(path),UTF_8);
  for (  Substitution substitution : SUBSTITUTIONS) {
    contents=substitution.substitute(contents);
  }
  System.out.println(contents);
}
Program: 92816
Project: 92816
Buggy source:
protected BaseExecutor(Configuration configuration,Transaction transaction){
  this.transaction=transaction;
  this.deferredLoads=new ConcurrentLinkedQueue<DeferredLoad>();
  this.localCache=new PerpetualCache("String_Node_Str");
  this.localOutputParameterCache=new PerpetualCache("String_Node_Str");
  this.closed=false;
  this.configuration=configuration;
}

Fixed version (ground truth):
protected BaseExecutor(Configuration configuration,Transaction transaction){
  this.transaction=transaction;
  this.deferredLoads=new ConcurrentLinkedQueue<DeferredLoad>();
  this.localCache=new PerpetualCache("String_Node_Str");
  this.localOutputParameterCache=new PerpetualCache("String_Node_Str");
  this.closed=false;
  this.configuration=configuration;
  this.wrapper=this;
}
Program: 92817
Project: 92817
Buggy source:
public <E>List<E> doQuery(MappedStatement ms,Object parameterObject,RowBounds rowBounds,ResultHandler resultHandler,BoundSql boundSql) throws SQLException {
  Statement stmt=null;
  try {
    flushStatements();
    Configuration configuration=ms.getConfiguration();
    StatementHandler handler=configuration.newStatementHandler(this,ms,parameterObject,rowBounds,resultHandler,boundSql);
    Connection connection=getConnection(ms.getStatementLog());
    stmt=handler.prepare(connection);
    handler.parameterize(stmt);
    return handler.<E>query(stmt,resultHandler);
  }
  finally {
    closeStatement(stmt);
  }
}

Fixed version (ground truth):
public <E>List<E> doQuery(MappedStatement ms,Object parameterObject,RowBounds rowBounds,ResultHandler resultHandler,BoundSql boundSql) throws SQLException {
  Statement stmt=null;
  try {
    flushStatements();
    Configuration configuration=ms.getConfiguration();
    StatementHandler handler=configuration.newStatementHandler(wrapper,ms,parameterObject,rowBounds,resultHandler,boundSql);
    Connection connection=getConnection(ms.getStatementLog());
    stmt=handler.prepare(connection);
    handler.parameterize(stmt);
    return handler.<E>query(stmt,resultHandler);
  }
  finally {
    closeStatement(stmt);
  }
}
Program: 92818
Project: 92818
Buggy source:
public CachingExecutor(Executor delegate){
  this.delegate=delegate;
}

Fixed version (ground truth):
public CachingExecutor(Executor delegate){
  this.delegate=delegate;
  delegate.setExecutorWrapper(this);
}
Program: 92819
Project: 92819
Buggy source:
public void deferLoad(MappedStatement ms,MetaObject resultObject,String property,CacheKey key,Class<?> targetType){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
public void deferLoad(MappedStatement ms,MetaObject resultObject,String property,CacheKey key,Class<?> targetType){
  delegate.deferLoad(ms,resultObject,property,key,targetType);
}
Program: 92820
Project: 92820
Buggy source:
public boolean isCached(MappedStatement ms,CacheKey key){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
public boolean isCached(MappedStatement ms,CacheKey key){
  return delegate.isCached(ms,key);
}
Program: 92821
Project: 92821
Buggy source:
public <E>List<E> doQuery(MappedStatement ms,Object parameter,RowBounds rowBounds,ResultHandler resultHandler,BoundSql boundSql) throws SQLException {
  Configuration configuration=ms.getConfiguration();
  StatementHandler handler=configuration.newStatementHandler(this,ms,parameter,rowBounds,resultHandler,boundSql);
  Statement stmt=prepareStatement(handler,ms.getStatementLog());
  return handler.<E>query(stmt,resultHandler);
}

Fixed version (ground truth):
public <E>List<E> doQuery(MappedStatement ms,Object parameter,RowBounds rowBounds,ResultHandler resultHandler,BoundSql boundSql) throws SQLException {
  Configuration configuration=ms.getConfiguration();
  StatementHandler handler=configuration.newStatementHandler(wrapper,ms,parameter,rowBounds,resultHandler,boundSql);
  Statement stmt=prepareStatement(handler,ms.getStatementLog());
  return handler.<E>query(stmt,resultHandler);
}
Program: 92822
Project: 92822
Buggy source:
public <E>List<E> doQuery(MappedStatement ms,Object parameter,RowBounds rowBounds,ResultHandler resultHandler,BoundSql boundSql) throws SQLException {
  Statement stmt=null;
  try {
    Configuration configuration=ms.getConfiguration();
    StatementHandler handler=configuration.newStatementHandler(this,ms,parameter,rowBounds,resultHandler,boundSql);
    stmt=prepareStatement(handler,ms.getStatementLog());
    return handler.<E>query(stmt,resultHandler);
  }
  finally {
    closeStatement(stmt);
  }
}

Fixed version (ground truth):
public <E>List<E> doQuery(MappedStatement ms,Object parameter,RowBounds rowBounds,ResultHandler resultHandler,BoundSql boundSql) throws SQLException {
  Statement stmt=null;
  try {
    Configuration configuration=ms.getConfiguration();
    StatementHandler handler=configuration.newStatementHandler(wrapper,ms,parameter,rowBounds,resultHandler,boundSql);
    stmt=prepareStatement(handler,ms.getStatementLog());
    return handler.<E>query(stmt,resultHandler);
  }
  finally {
    closeStatement(stmt);
  }
}
Program: 92823
Project: 92823
Buggy source:
public DefaultResultSetHandler(Executor executor,MappedStatement mappedStatement,ParameterHandler parameterHandler,ResultHandler resultHandler,BoundSql boundSql,RowBounds rowBounds){
  this.executor=executor;
  this.configuration=mappedStatement.getConfiguration();
  this.mappedStatement=mappedStatement;
  this.rowBounds=rowBounds;
  this.parameterHandler=parameterHandler;
  this.boundSql=boundSql;
  this.typeHandlerRegistry=configuration.getTypeHandlerRegistry();
  this.objectFactory=configuration.getObjectFactory();
  this.resultHandler=resultHandler;
  this.proxyFactory=configuration.getProxyFactory();
  this.resultExtractor=new ResultExtractor(configuration,objectFactory);
}

Fixed version (ground truth):
public DefaultResultSetHandler(Executor executor,MappedStatement mappedStatement,ParameterHandler parameterHandler,ResultHandler resultHandler,BoundSql boundSql,RowBounds rowBounds){
  this.executor=executor;
  this.configuration=mappedStatement.getConfiguration();
  this.mappedStatement=mappedStatement;
  this.rowBounds=rowBounds;
  this.parameterHandler=parameterHandler;
  this.boundSql=boundSql;
  this.typeHandlerRegistry=configuration.getTypeHandlerRegistry();
  this.objectFactory=configuration.getObjectFactory();
  this.resultHandler=resultHandler;
  this.proxyFactory=configuration.getProxyFactory();
}
Program: 92824
Project: 92824
Buggy source:
private Object getNestedQueryMappingValue(ResultSet rs,MetaObject metaResultObject,ResultMapping propertyMapping,ResultLoaderMap lazyLoader,String columnPrefix) throws SQLException {
  final String nestedQueryId=propertyMapping.getNestedQueryId();
  final String property=propertyMapping.getProperty();
  final MappedStatement nestedQuery=configuration.getMappedStatement(nestedQueryId);
  final Class<?> nestedQueryParameterType=nestedQuery.getParameterMap().getType();
  final Object nestedQueryParameterObject=prepareParameterForNestedQuery(rs,propertyMapping,nestedQueryParameterType,columnPrefix);
  Object value=NO_VALUE;
  if (nestedQueryParameterObject != null) {
    final BoundSql nestedBoundSql=nestedQuery.getBoundSql(nestedQueryParameterObject);
    final CacheKey key=executor.createCacheKey(nestedQuery,nestedQueryParameterObject,RowBounds.DEFAULT,nestedBoundSql);
    final Class<?> targetType=propertyMapping.getJavaType();
    final List<Object> nestedQueryCacheObject=getNestedQueryCacheObject(nestedQuery,key);
    if (nestedQueryCacheObject != null) {
      value=resultExtractor.extractObjectFromList(nestedQueryCacheObject,targetType);
    }
 else     if (executor.isCached(nestedQuery,key)) {
      executor.deferLoad(nestedQuery,metaResultObject,property,key,targetType);
    }
 else {
      final ResultLoader resultLoader=new ResultLoader(configuration,executor,nestedQuery,nestedQueryParameterObject,targetType,key,nestedBoundSql);
      if (configuration.isLazyLoadingEnabled()) {
        lazyLoader.addLoader(property,metaResultObject,resultLoader);
      }
 else {
        value=resultLoader.loadResult();
      }
    }
  }
  return value;
}

Fixed version (ground truth):
private Object getNestedQueryMappingValue(ResultSet rs,MetaObject metaResultObject,ResultMapping propertyMapping,ResultLoaderMap lazyLoader,String columnPrefix) throws SQLException {
  final String nestedQueryId=propertyMapping.getNestedQueryId();
  final String property=propertyMapping.getProperty();
  final MappedStatement nestedQuery=configuration.getMappedStatement(nestedQueryId);
  final Class<?> nestedQueryParameterType=nestedQuery.getParameterMap().getType();
  final Object nestedQueryParameterObject=prepareParameterForNestedQuery(rs,propertyMapping,nestedQueryParameterType,columnPrefix);
  Object value=NO_VALUE;
  if (nestedQueryParameterObject != null) {
    final BoundSql nestedBoundSql=nestedQuery.getBoundSql(nestedQueryParameterObject);
    final CacheKey key=executor.createCacheKey(nestedQuery,nestedQueryParameterObject,RowBounds.DEFAULT,nestedBoundSql);
    final Class<?> targetType=propertyMapping.getJavaType();
    if (executor.isCached(nestedQuery,key)) {
      executor.deferLoad(nestedQuery,metaResultObject,property,key,targetType);
    }
 else {
      final ResultLoader resultLoader=new ResultLoader(configuration,executor,nestedQuery,nestedQueryParameterObject,targetType,key,nestedBoundSql);
      if (configuration.isLazyLoadingEnabled()) {
        lazyLoader.addLoader(property,metaResultObject,resultLoader);
      }
 else {
        value=resultLoader.loadResult();
      }
    }
  }
  return value;
}
Program: 92825
Project: 92825
Buggy source:
private Object getNestedQueryConstructorValue(ResultSet rs,ResultMapping constructorMapping,String columnPrefix) throws SQLException {
  final String nestedQueryId=constructorMapping.getNestedQueryId();
  final MappedStatement nestedQuery=configuration.getMappedStatement(nestedQueryId);
  final Class<?> nestedQueryParameterType=nestedQuery.getParameterMap().getType();
  final Object nestedQueryParameterObject=prepareParameterForNestedQuery(rs,constructorMapping,nestedQueryParameterType,columnPrefix);
  Object value=null;
  if (nestedQueryParameterObject != null) {
    final BoundSql nestedBoundSql=nestedQuery.getBoundSql(nestedQueryParameterObject);
    final CacheKey key=executor.createCacheKey(nestedQuery,nestedQueryParameterObject,RowBounds.DEFAULT,nestedBoundSql);
    final Class<?> targetType=constructorMapping.getJavaType();
    final List<Object> nestedQueryCacheObject=getNestedQueryCacheObject(nestedQuery,key);
    if (nestedQueryCacheObject != null) {
      value=resultExtractor.extractObjectFromList(nestedQueryCacheObject,targetType);
    }
 else {
      final ResultLoader resultLoader=new ResultLoader(configuration,executor,nestedQuery,nestedQueryParameterObject,targetType,key,nestedBoundSql);
      value=resultLoader.loadResult();
    }
  }
  return value;
}

Fixed version (ground truth):
private Object getNestedQueryConstructorValue(ResultSet rs,ResultMapping constructorMapping,String columnPrefix) throws SQLException {
  final String nestedQueryId=constructorMapping.getNestedQueryId();
  final MappedStatement nestedQuery=configuration.getMappedStatement(nestedQueryId);
  final Class<?> nestedQueryParameterType=nestedQuery.getParameterMap().getType();
  final Object nestedQueryParameterObject=prepareParameterForNestedQuery(rs,constructorMapping,nestedQueryParameterType,columnPrefix);
  Object value=null;
  if (nestedQueryParameterObject != null) {
    final BoundSql nestedBoundSql=nestedQuery.getBoundSql(nestedQueryParameterObject);
    final CacheKey key=executor.createCacheKey(nestedQuery,nestedQueryParameterObject,RowBounds.DEFAULT,nestedBoundSql);
    final Class<?> targetType=constructorMapping.getJavaType();
    final ResultLoader resultLoader=new ResultLoader(configuration,executor,nestedQuery,nestedQueryParameterObject,targetType,key,nestedBoundSql);
    value=resultLoader.loadResult();
  }
  return value;
}
Program: 92826
Project: 92826
Buggy source:
@Test public void testThatNestedQueryItemsAreRetrievedFromCache() throws Exception {
  SqlSession sqlSession=sqlSessionFactory.openSession();
  final Author author;
  try {
    final AuthorMapper authorMapper=sqlSession.getMapper(AuthorMapper.class);
    author=authorMapper.selectAuthor(101);
  }
  finally {
    sqlSession.close();
  }
  sqlSession=sqlSessionFactory.openSession();
  try {
    final AuthorMapper authorMapper=sqlSession.getMapper(AuthorMapper.class);
    final BlogMapper blogMapper=sqlSession.getMapper(BlogMapper.class);
    final Author cachedAuthor=authorMapper.selectAuthor(101);
    assertThat("String_Node_Str",author,sameInstance(cachedAuthor));
    assertThat("String_Node_Str",blogMapper.selectBlog(1).getAuthor(),sameInstance(author));
    assertThat("String_Node_Str",blogMapper.selectBlogUsingConstructor(1).getAuthor(),sameInstance(author));
  }
  finally {
    sqlSession.close();
  }
}

Fixed version (ground truth):
@Test public void testThatNestedQueryItemsAreRetrievedFromCache() throws Exception {
  SqlSession sqlSession=sqlSessionFactory.openSession();
  final Author author;
  try {
    final AuthorMapper authorMapper=sqlSession.getMapper(AuthorMapper.class);
    author=authorMapper.selectAuthor(101);
    final Author cachedAuthor=authorMapper.selectAuthor(101);
    assertThat("String_Node_Str",author,sameInstance(cachedAuthor));
  }
  finally {
    sqlSession.close();
  }
  sqlSession=sqlSessionFactory.openSession();
  try {
    final BlogMapper blogMapper=sqlSession.getMapper(BlogMapper.class);
    assertThat("String_Node_Str",blogMapper.selectBlog(1).getAuthor(),sameInstance(author));
    assertThat("String_Node_Str",blogMapper.selectBlogUsingConstructor(1).getAuthor(),sameInstance(author));
  }
  finally {
    sqlSession.close();
  }
}
Program: 92827
Project: 92827
Buggy source:
public void clear(){
  delegate.clear();
  keyList.clear();
}

Fixed version (ground truth):
public void clear(){
  delegate.clear();
  keyList=new LinkedList<Object>();
}
Program: 92828
Project: 92828
Buggy source:
@Override public Object get(Object key){
  String strKey=(String)key;
  if (super.containsKey(strKey)) {
    return super.get(strKey);
  }
  if (parameterMetaObject != null) {
    Object object=parameterMetaObject.getValue(strKey);
    if (object != null) {
      super.put(strKey,object);
    }
    return object;
  }
  return null;
}

Fixed version (ground truth):
@Override public Object get(Object key){
  String strKey=(String)key;
  if (super.containsKey(strKey)) {
    return super.get(strKey);
  }
  if (parameterMetaObject != null) {
    Object object=parameterMetaObject.getValue(strKey);
    return object;
  }
  return null;
}
Program: 92829
Project: 92829
Buggy source:
/** 
 * This is the log output.  DEBUG [main] - ooo Using Connection [org.hsqldb.jdbc.JDBCConnection@5ae1a5c7] DEBUG [main] - ==>  Preparing: SELECT * FROM users WHERE name IN (?) AND id = ?  DEBUG [main] - ==> Parameters: 1(Integer), 1(Integer) There are two parameter mappings but DefaulParameterHandler maps them both to input paremeter (integer)
 */
@Test public void shouldGetAUserStatic(){
  SqlSession sqlSession=sqlSessionFactory.openSession();
  try {
    Mapper mapper=sqlSession.getMapper(Mapper.class);
    User user=mapper.getUserStatic(1);
    Assert.assertEquals("String_Node_Str",user.getName());
  }
  finally {
    sqlSession.close();
  }
}

Fixed version (ground truth):
/** 
 * This is the log output.  DEBUG [main] - ooo Using Connection [org.hsqldb.jdbc.JDBCConnection@5ae1a5c7] DEBUG [main] - ==>  Preparing: SELECT * FROM users WHERE name IN (?) AND id = ?  DEBUG [main] - ==> Parameters: 1(Integer), 1(Integer) There are two parameter mappings but DefaulParameterHandler maps them both to input paremeter (integer)
 */
@Test public void shouldGetAUserStatic(){
  SqlSession sqlSession=sqlSessionFactory.openSession();
  try {
    Mapper mapper=sqlSession.getMapper(Mapper.class);
    User user=mapper.getUserStatic(1);
    Assert.assertNotNull(user);
    Assert.assertEquals("String_Node_Str",user.getName());
  }
  finally {
    sqlSession.close();
  }
}
Program: 92830
Project: 92830
Buggy source:
@Ignore @Test public void shouldGetAUserWithIfNode(){
  SqlSession sqlSession=sqlSessionFactory.openSession();
  try {
    Mapper mapper=sqlSession.getMapper(Mapper.class);
    User user=mapper.getUserIfNode("String_Node_Str");
    Assert.assertEquals("String_Node_Str",user.getName());
  }
  finally {
    sqlSession.close();
  }
}

Fixed version (ground truth):
@Test public void shouldGetAUserWithIfNode(){
  SqlSession sqlSession=sqlSessionFactory.openSession();
  try {
    Mapper mapper=sqlSession.getMapper(Mapper.class);
    User user=mapper.getUserIfNode("String_Node_Str");
    Assert.assertEquals("String_Node_Str",user.getName());
  }
  finally {
    sqlSession.close();
  }
}
Program: 92831
Project: 92831
Buggy source:
public SqlSource createSqlSource(Configuration configuration,String script,Class<?> parameterType){
  XMLScriptBuilder builder=new XMLScriptBuilder(configuration,script);
  return builder.parseScriptNode();
}

Fixed version (ground truth):
public SqlSource createSqlSource(Configuration configuration,String script,Class<?> parameterType){
  if (script.startsWith("String_Node_Str")) {
    XMLScriptBuilder builder=new XMLScriptBuilder(configuration,script);
    return builder.parseScriptNode();
  }
 else {
    List<SqlNode> contents=new ArrayList<SqlNode>();
    contents.add(new TextSqlNode(script.toString()));
    MixedSqlNode rootSqlNode=new MixedSqlNode(contents);
    return new DynamicSqlSource(configuration,rootSqlNode);
  }
}
Program: 92832
Project: 92832
Buggy source:
public XMLScriptBuilder(Configuration configuration,String context){
  super(configuration);
  XPathParser parser=new XPathParser("String_Node_Str" + context + "String_Node_Str",false,configuration.getVariables(),new XMLMapperEntityResolver());
  this.context=parser.evalNode("String_Node_Str");
}

Fixed version (ground truth):
public XMLScriptBuilder(Configuration configuration,String context){
  super(configuration);
  XPathParser parser=new XPathParser(context,false,configuration.getVariables(),new XMLMapperEntityResolver());
  this.context=parser.evalNode("String_Node_Str");
}
Program: 92833
Project: 92833
Buggy source:
public void deferLoad(MappedStatement ms,MetaObject resultObject,String property,CacheKey key){
  if (closed)   throw new ExecutorException("String_Node_Str");
  DeferredLoad deferredLoad=new DeferredLoad(ms,resultObject,property,key,localCache,configuration);
  if (deferredLoad.canLoad()) {
    deferredLoad.load();
  }
 else {
    deferredLoads.add(new DeferredLoad(ms,resultObject,property,key,localCache,configuration));
  }
}

Fixed version (ground truth):
public void deferLoad(MappedStatement ms,MetaObject resultObject,String property,CacheKey key,Class<?> targetType){
  if (closed)   throw new ExecutorException("String_Node_Str");
  DeferredLoad deferredLoad=new DeferredLoad(ms,resultObject,property,key,localCache,configuration,targetType);
  if (deferredLoad.canLoad()) {
    deferredLoad.load();
  }
 else {
    deferredLoads.add(new DeferredLoad(ms,resultObject,property,key,localCache,configuration,targetType));
  }
}
Program: 92834
Project: 92834
Buggy source:
public void load(){
  @SuppressWarnings("String_Node_Str") List<Object> list=(List<Object>)localCache.getObject(key);
  Class<?> targetType=resultObject.getSetterType(property);
  Object value=resultExtractor.extractObjectFromList(list,targetType);
  resultObject.setValue(property,value);
}

Fixed version (ground truth):
public void load(){
  @SuppressWarnings("String_Node_Str") List<Object> list=(List<Object>)localCache.getObject(key);
  Object value=resultExtractor.extractObjectFromList(list,targetType);
  resultObject.setValue(property,value);
}
Program: 92835
Project: 92835
Buggy source:
public DeferredLoad(MappedStatement mappedStatement,MetaObject resultObject,String property,CacheKey key,PerpetualCache localCache,Configuration configuration){
  this.resultObject=resultObject;
  this.property=property;
  this.key=key;
  this.localCache=localCache;
  this.objectFactory=configuration.getObjectFactory();
  this.resultExtractor=new ResultExtractor(configuration,objectFactory);
}

Fixed version (ground truth):
public DeferredLoad(MappedStatement mappedStatement,MetaObject resultObject,String property,CacheKey key,PerpetualCache localCache,Configuration configuration,Class<?> targetType){
  this.resultObject=resultObject;
  this.property=property;
  this.key=key;
  this.localCache=localCache;
  this.objectFactory=configuration.getObjectFactory();
  this.resultExtractor=new ResultExtractor(configuration,objectFactory);
  this.targetType=targetType;
}
Program: 92836
Project: 92836
Buggy source:
public void deferLoad(MappedStatement ms,MetaObject resultObject,String property,CacheKey key){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
public void deferLoad(MappedStatement ms,MetaObject resultObject,String property,CacheKey key,Class<?> targetType){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 92837
Project: 92837
Buggy source:
void deferLoad(MappedStatement ms,MetaObject resultObject,String property,CacheKey key);

Fixed version (ground truth):
void deferLoad(MappedStatement ms,MetaObject resultObject,String property,CacheKey key,Class<?> targetType);
Program: 92839
Project: 92839
Buggy source:
public void registerAliases(String packageName,Class<?> superType){
  ResolverUtil<Class<?>> resolverUtil=new ResolverUtil<Class<?>>();
  resolverUtil.find(new ResolverUtil.IsA(superType),packageName);
  Set<Class<? extends Class<?>>> typeSet=resolverUtil.getClasses();
  for (  Class<?> type : typeSet) {
    if (!type.isAnonymousClass() && !type.isInterface()) {
      registerAlias(type);
    }
  }
}

Fixed version (ground truth):
public void registerAliases(String packageName,Class<?> superType){
  ResolverUtil<Class<?>> resolverUtil=new ResolverUtil<Class<?>>();
  resolverUtil.find(new ResolverUtil.IsA(superType),packageName);
  Set<Class<? extends Class<?>>> typeSet=resolverUtil.getClasses();
  for (  Class<?> type : typeSet) {
    if (!type.isAnonymousClass() && !type.isInterface() && !type.isMemberClass()) {
      registerAlias(type);
    }
  }
}
Program: 92840
Project: 92840
Buggy source:
@Test public void shouldSubstituteIndexWithKey() throws Exception {
  MapParam mapParam=new MapParam();
  mapParam.getMap().put("String_Node_Str",22);
  mapParam.getMap().put("String_Node_Str",222);
  int count=sqlSession.selectOne("String_Node_Str",mapParam);
  Assert.assertEquals(1,count);
}

Fixed version (ground truth):
@Test public void shouldSubstituteIndexWithKey() throws Exception {
  MapParam mapParam=new MapParam();
  mapParam.getMap().put("String_Node_Str",22);
  mapParam.getMap().put("String_Node_Str",222);
  Integer count=sqlSession.selectOne("String_Node_Str",mapParam);
  Assert.assertEquals(Integer.valueOf(1),count);
}
Program: 92841
Project: 92841
Buggy source:
private boolean databaseIdMatchesCurrent(String id,String databaseId,String requiredDatabaseId){
  if (requiredDatabaseId != null) {
    if (!requiredDatabaseId.equals(databaseId)) {
      return false;
    }
  }
 else {
    if (databaseId != null) {
      return false;
    }
    id=builderAssistant.applyCurrentNamespace(id,false);
    if (this.configuration.hasStatement(id,false)) {
      MappedStatement previous=this.configuration.getMappedStatement(id);
      if (previous.getDatabaseId() != null) {
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean databaseIdMatchesCurrent(String id,String databaseId,String requiredDatabaseId){
  if (requiredDatabaseId != null) {
    if (!requiredDatabaseId.equals(databaseId)) {
      return false;
    }
  }
 else {
    if (databaseId != null) {
      return false;
    }
    id=builderAssistant.applyCurrentNamespace(id,false);
    if (this.configuration.hasStatement(id,false)) {
      MappedStatement previous=this.configuration.getMappedStatement(id,false);
      if (previous.getDatabaseId() != null) {
        return false;
      }
    }
  }
  return true;
}
Program: 92843
Project: 92843
Buggy source:
private void printColumnHeaders(ResultSetMetaData rsmd,int columnCount) throws SQLException {
  StringBuilder row=new StringBuilder();
  row.append("String_Node_Str");
  for (int i=1; i <= columnCount; i++) {
    String colname=rsmd.getColumnName(i);
    row.append(colname);
    if (i != columnCount)     row.append("String_Node_Str");
  }
  debug(row.toString());
}

Fixed version (ground truth):
private void printColumnHeaders(ResultSetMetaData rsmd,int columnCount) throws SQLException {
  StringBuilder row=new StringBuilder();
  row.append("String_Node_Str");
  for (int i=1; i <= columnCount; i++) {
    String colname=rsmd.getColumnName(i);
    row.append(colname);
    if (i != columnCount)     row.append("String_Node_Str");
  }
  trace(row.toString());
}
Program: 92844
Project: 92844
Buggy source:
private void printColumnValues(int columnCount) throws SQLException {
  StringBuilder row=new StringBuilder();
  row.append("String_Node_Str");
  for (int i=1; i <= columnCount; i++) {
    String colname;
    try {
      colname=rs.getString(i);
    }
 catch (    SQLException e) {
      colname="String_Node_Str";
    }
    row.append(colname);
    if (i != columnCount)     row.append("String_Node_Str");
  }
  debug(row.toString());
}

Fixed version (ground truth):
private void printColumnValues(int columnCount) throws SQLException {
  StringBuilder row=new StringBuilder();
  row.append("String_Node_Str");
  for (int i=1; i <= columnCount; i++) {
    String colname;
    try {
      colname=rs.getString(i);
    }
 catch (    SQLException e) {
      colname="String_Node_Str";
    }
    row.append(colname);
    if (i != columnCount)     row.append("String_Node_Str");
  }
  trace(row.toString());
}
Program: 92845
Project: 92845
Buggy source:
private void applyPrefix(StringBuilder sql,String trimmedUppercaseSql){
  if (!prefixApplied) {
    prefixApplied=true;
    for (    String toRemove : prefixesToOverride) {
      if (trimmedUppercaseSql.startsWith(toRemove) || trimmedUppercaseSql.startsWith(toRemove.trim())) {
        sql.delete(0,toRemove.trim().length());
        break;
      }
    }
    if (prefix != null) {
      sql.insert(0,"String_Node_Str");
      sql.insert(0,prefix);
    }
  }
}

Fixed version (ground truth):
private void applyPrefix(StringBuilder sql,String trimmedUppercaseSql){
  if (!prefixApplied) {
    prefixApplied=true;
    for (    String toRemove : prefixesToOverride) {
      if (trimmedUppercaseSql.startsWith(toRemove)) {
        sql.delete(0,toRemove.trim().length());
        break;
      }
    }
    if (prefix != null) {
      sql.insert(0,"String_Node_Str");
      sql.insert(0,prefix);
    }
  }
}
Program: 92846
Project: 92846
Buggy source:
public static String getConfiguredTemplate(String templatePath,String templateProperty){
  String templateName="String_Node_Str";
  Properties migrationProperties=new Properties();
  try {
    migrationProperties.load(new FileInputStream(templatePath));
    templateName=migrationProperties.getProperty(templateProperty);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return templateName;
}

Fixed version (ground truth):
public static String getConfiguredTemplate(String templatePath,String templateProperty) throws FileNotFoundException {
  String templateName="String_Node_Str";
  Properties migrationProperties=new Properties();
  try {
    migrationProperties.load(new FileInputStream(templatePath));
    templateName=migrationProperties.getProperty(templateProperty);
  }
 catch (  FileNotFoundException e) {
    throw e;
  }
catch (  Exception e) {
    e.printStackTrace();
  }
  return templateName;
}
Program: 92847
Project: 92847
Buggy source:
public void execute(String... params){
  if (paramsEmpty(params)) {
    throw new MigrationException("String_Node_Str");
  }
  String description=params[0];
  Properties variables=new Properties();
  variables.setProperty("String_Node_Str",description);
  existingEnvironmentFile();
  String filename=getNextIDAsString() + "String_Node_Str" + description.replace(' ','_')+ "String_Node_Str";
  String migrationsHome="String_Node_Str";
  migrationsHome=System.getenv(MIGRATIONS_HOME);
  if (this.template != null) {
    copyExternalResourceTo(template,scriptFile(filename),variables);
  }
 else   if ((migrationsHome != null) && (!migrationsHome.equals("String_Node_Str"))) {
    customConfiguredTemplate=ExternalResources.getConfiguredTemplate(migrationsHome + "String_Node_Str" + MIGRATIONS_PROPERTIES,CUSTOM_NEW_COMMAND_TEMPATE_PROPERTY);
    copyExternalResourceTo(migrationsHome + "String_Node_Str" + customConfiguredTemplate,scriptFile(filename),variables);
  }
 else {
    copyResourceTo("String_Node_Str",scriptFile(filename),variables);
  }
  printStream.println("String_Node_Str");
  printStream.println();
}

Fixed version (ground truth):
public void execute(String... params){
  if (paramsEmpty(params)) {
    throw new MigrationException("String_Node_Str");
  }
  String description=params[0];
  Properties variables=new Properties();
  variables.setProperty("String_Node_Str",description);
  existingEnvironmentFile();
  String filename=getNextIDAsString() + "String_Node_Str" + description.replace(' ','_')+ "String_Node_Str";
  String migrationsHome="String_Node_Str";
  migrationsHome=System.getenv(MIGRATIONS_HOME);
  if (migrationsHome == null) {
    migrationsHome=System.getProperty(MIGRATIONS_HOME_PROPERTY);
  }
  if (this.template != null) {
    copyExternalResourceTo(template,scriptFile(filename),variables);
  }
 else   if ((migrationsHome != null) && (!migrationsHome.equals("String_Node_Str"))) {
    try {
      final String customConfiguredTemplate=ExternalResources.getConfiguredTemplate(migrationsHome + "String_Node_Str" + MIGRATIONS_PROPERTIES,CUSTOM_NEW_COMMAND_TEMPATE_PROPERTY);
      copyExternalResourceTo(migrationsHome + "String_Node_Str" + customConfiguredTemplate,scriptFile(filename),variables);
    }
 catch (    FileNotFoundException e) {
      printStream.append("String_Node_Str");
      copyDefaultTemplate(variables,filename);
    }
  }
 else {
    copyDefaultTemplate(variables,filename);
  }
  printStream.println("String_Node_Str");
  printStream.println();
}
Program: 92848
Project: 92848
Buggy source:
public List query(MappedStatement ms,Object parameter,RowBounds rowBounds,ResultHandler resultHandler) throws SQLException {
  ErrorContext.instance().resource(ms.getResource()).activity("String_Node_Str").object(ms.getId());
  if (closed)   throw new ExecutorException("String_Node_Str");
  List list;
  try {
    queryStack++;
    CacheKey key=createCacheKey(ms,parameter,rowBounds);
    final List cachedList=(List)localCache.getObject(key);
    if (cachedList != null) {
      list=cachedList;
    }
 else {
      localCache.putObject(key,EXECUTION_PLACEHOLDER);
      try {
        list=doQuery(ms,parameter,rowBounds,resultHandler);
      }
  finally {
        localCache.removeObject(key);
      }
      localCache.putObject(key,list);
    }
  }
  finally {
    queryStack--;
  }
  if (queryStack == 0) {
    for (    DeferredLoad deferredLoad : deferredLoads) {
      deferredLoad.load();
    }
  }
  return list;
}

Fixed version (ground truth):
public List query(MappedStatement ms,Object parameter,RowBounds rowBounds,ResultHandler resultHandler) throws SQLException {
  ErrorContext.instance().resource(ms.getResource()).activity("String_Node_Str").object(ms.getId());
  if (closed)   throw new ExecutorException("String_Node_Str");
  List list;
  try {
    queryStack++;
    CacheKey key=createCacheKey(ms,parameter,rowBounds);
    list=(List)localCache.getObject(key);
    if (list != null) {
      handleLocallyCachedOutputParameters(ms,key,parameter);
    }
 else {
      list=queryFromDatabase(ms,parameter,rowBounds,resultHandler,key);
    }
  }
  finally {
    queryStack--;
  }
  if (queryStack == 0) {
    for (    DeferredLoad deferredLoad : deferredLoads) {
      deferredLoad.load();
    }
  }
  return list;
}
Program: 92849
Project: 92849
Buggy source:
public void clearLocalCache(){
  if (!closed) {
    localCache.clear();
  }
}

Fixed version (ground truth):
public void clearLocalCache(){
  if (!closed) {
    localCache.clear();
    localOutputParameterCache.clear();
  }
}
Program: 92850
Project: 92850
Buggy source:
protected BaseExecutor(Configuration configuration,Transaction transaction){
  this.transaction=transaction;
  this.deferredLoads=new ConcurrentLinkedQueue<DeferredLoad>();
  this.localCache=new PerpetualCache("String_Node_Str");
  this.closed=false;
  this.configuration=configuration;
}

Fixed version (ground truth):
protected BaseExecutor(Configuration configuration,Transaction transaction){
  this.transaction=transaction;
  this.deferredLoads=new ConcurrentLinkedQueue<DeferredLoad>();
  this.localCache=new PerpetualCache("String_Node_Str");
  this.localOutputParameterCache=new PerpetualCache("String_Node_Str");
  this.closed=false;
  this.configuration=configuration;
}
Program: 92851
Project: 92851
Buggy source:
public void close(boolean forceRollback){
  try {
    try {
      rollback(forceRollback);
    }
  finally {
      if (transaction != null)       transaction.close();
    }
  }
 catch (  SQLException e) {
  }
 finally {
    transaction=null;
    deferredLoads=null;
    localCache=null;
    batchResults=null;
    closed=true;
  }
}

Fixed version (ground truth):
public void close(boolean forceRollback){
  try {
    try {
      rollback(forceRollback);
    }
  finally {
      if (transaction != null)       transaction.close();
    }
  }
 catch (  SQLException e) {
  }
 finally {
    transaction=null;
    deferredLoads=null;
    localCache=null;
    localOutputParameterCache=null;
    batchResults=null;
    closed=true;
  }
}