nus-yam/ex-repair huggingface dataset:
Program: 82380
Project: 82380
Buggy source:
@Test public void runClusterIntegrationTests() throws BlurException, TException, IOException, InterruptedException, KeeperException {
  testCreateTable();
  testLoadTable();
  testForEmptySchema();
  testQueryWithSelector();
  testQueryWithFacets();
  testBatchFetch();
  testQueryCancel();
  testBackPressureViaQuery();
  testTestShardFailover();
  testTermsList();
  testCreateDisableAndRemoveTable();
  testCreateTableWithCustomType();
}

Fixed version (ground truth):
@Test public void runClusterIntegrationTests() throws BlurException, TException, IOException, InterruptedException, KeeperException {
  start("String_Node_Str");
  testCreateTable();
  start("String_Node_Str");
  testLoadTable();
  start("String_Node_Str");
  testForEmptySchema();
  start("String_Node_Str");
  testQueryWithSelector();
  start("String_Node_Str");
  testQueryWithFacets();
  start("String_Node_Str");
  testBatchFetch();
  start("String_Node_Str");
  testQueryCancel();
  start("String_Node_Str");
  testBackPressureViaQuery();
  start("String_Node_Str");
  testTestShardFailover();
  start("String_Node_Str");
  testTermsList();
  start("String_Node_Str");
  testCreateDisableAndRemoveTable();
  start("String_Node_Str");
  testCreateTableWithCustomType();
}
Program: 82382
Project: 82382
Buggy source:
@Override public void run(){
  try {
    client.query("String_Node_Str",blurQueryRow);
    fail.set(true);
  }
 catch (  BlurException e) {
    error.set(e);
  }
catch (  TException e) {
    e.printStackTrace();
    fail.set(true);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    client.query("String_Node_Str",blurQueryRow);
    fail.set(true);
  }
 catch (  BlurException e) {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    e.printStackTrace();
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    error.set(e);
  }
catch (  TException e) {
    e.printStackTrace();
    fail.set(true);
  }
}
Program: 82383
Project: 82383
Buggy source:
public void testTestShardFailover() throws BlurException, TException, InterruptedException, IOException, KeeperException {
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  Iface client=getClient();
  BlurQuery blurQuery=new BlurQuery();
  blurQuery.setUseCacheIfPresent(false);
  Query query=new Query();
  query.setQuery("String_Node_Str");
  blurQuery.setQuery(query);
  BlurResults results1=client.query("String_Node_Str",blurQuery);
  assertEquals(numberOfDocs,results1.getTotalResults());
  assertRowResults(results1);
  miniCluster.killShardServer(1);
  Thread.sleep(TimeUnit.SECONDS.toMillis(1));
  client.shardServerLayout("String_Node_Str");
  assertEquals(numberOfDocs,client.query("String_Node_Str",blurQuery).getTotalResults());
}

Fixed version (ground truth):
public void testTestShardFailover() throws BlurException, TException, InterruptedException, IOException, KeeperException {
  Iface client=getClient();
  BlurQuery blurQuery=new BlurQuery();
  blurQuery.setUseCacheIfPresent(false);
  Query query=new Query();
  query.setQuery("String_Node_Str");
  blurQuery.setQuery(query);
  BlurResults results1=client.query("String_Node_Str",blurQuery);
  assertEquals(numberOfDocs,results1.getTotalResults());
  assertRowResults(results1);
  miniCluster.killShardServer(1);
  Thread.sleep(TimeUnit.SECONDS.toMillis(1));
  client.shardServerLayout("String_Node_Str");
  assertEquals(numberOfDocs,client.query("String_Node_Str",blurQuery).getTotalResults());
}
Program: 82386
Project: 82386
Buggy source:
@Test public void runClusterIntegrationTests() throws BlurException, TException, IOException, InterruptedException, KeeperException {
  testCreateTable();
  testLoadTable();
  testForEmptySchema();
  testQueryWithSelector();
  testQueryWithFacets();
  testBatchFetch();
  testQueryCancel();
  testBackPressureViaQuery();
  testTestShardFailover();
  testTermsList();
  testCreateDisableAndRemoveTable();
  testCreateTableWithCustomType();
}

Fixed version (ground truth):
@Test public void runClusterIntegrationTests() throws BlurException, TException, IOException, InterruptedException, KeeperException {
  start("String_Node_Str");
  testCreateTable();
  start("String_Node_Str");
  testLoadTable();
  start("String_Node_Str");
  testForEmptySchema();
  start("String_Node_Str");
  testQueryWithSelector();
  start("String_Node_Str");
  testQueryWithFacets();
  start("String_Node_Str");
  testBatchFetch();
  start("String_Node_Str");
  testQueryCancel();
  start("String_Node_Str");
  testBackPressureViaQuery();
  start("String_Node_Str");
  testTestShardFailover();
  start("String_Node_Str");
  testTermsList();
  start("String_Node_Str");
  testCreateDisableAndRemoveTable();
  start("String_Node_Str");
  testCreateTableWithCustomType();
}
Program: 82388
Project: 82388
Buggy source:
@Override public void run(){
  try {
    client.query("String_Node_Str",blurQueryRow);
    fail.set(true);
  }
 catch (  BlurException e) {
    error.set(e);
  }
catch (  TException e) {
    e.printStackTrace();
    fail.set(true);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    client.query("String_Node_Str",blurQueryRow);
    fail.set(true);
  }
 catch (  BlurException e) {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    e.printStackTrace();
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    error.set(e);
  }
catch (  TException e) {
    e.printStackTrace();
    fail.set(true);
  }
}
Program: 82389
Project: 82389
Buggy source:
public void testTestShardFailover() throws BlurException, TException, InterruptedException, IOException, KeeperException {
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  Iface client=getClient();
  BlurQuery blurQuery=new BlurQuery();
  blurQuery.setUseCacheIfPresent(false);
  Query query=new Query();
  query.setQuery("String_Node_Str");
  blurQuery.setQuery(query);
  BlurResults results1=client.query("String_Node_Str",blurQuery);
  assertEquals(numberOfDocs,results1.getTotalResults());
  assertRowResults(results1);
  miniCluster.killShardServer(1);
  Thread.sleep(TimeUnit.SECONDS.toMillis(1));
  client.shardServerLayout("String_Node_Str");
  assertEquals(numberOfDocs,client.query("String_Node_Str",blurQuery).getTotalResults());
}

Fixed version (ground truth):
public void testTestShardFailover() throws BlurException, TException, InterruptedException, IOException, KeeperException {
  Iface client=getClient();
  BlurQuery blurQuery=new BlurQuery();
  blurQuery.setUseCacheIfPresent(false);
  Query query=new Query();
  query.setQuery("String_Node_Str");
  blurQuery.setQuery(query);
  BlurResults results1=client.query("String_Node_Str",blurQuery);
  assertEquals(numberOfDocs,results1.getTotalResults());
  assertRowResults(results1);
  miniCluster.killShardServer(1);
  Thread.sleep(TimeUnit.SECONDS.toMillis(1));
  client.shardServerLayout("String_Node_Str");
  assertEquals(numberOfDocs,client.query("String_Node_Str",blurQuery).getTotalResults());
}
Program: 82392
Project: 82392
Buggy source:
private void populateSelector(String table,Selector selector) throws IOException, BlurException {
  Tracer trace=Trace.trace("String_Node_Str");
  String rowId=selector.rowId;
  String recordId=selector.recordId;
  String shardName=MutationHelper.getShardName(table,rowId,getNumberOfShards(table),_blurPartitioner);
  Map<String,BlurIndex> indexes=_indexServer.getIndexes(table);
  BlurIndex blurIndex=indexes.get(shardName);
  if (blurIndex == null) {
    throw new BException("String_Node_Str" + shardName + "String_Node_Str");
  }
  IndexSearcherClosable searcher=blurIndex.getIndexSearcher();
  try {
    BooleanQuery query=new BooleanQuery();
    if (selector.recordOnly) {
      query.add(new TermQuery(new Term(RECORD_ID,recordId)),Occur.MUST);
      query.add(new TermQuery(new Term(ROW_ID,rowId)),Occur.MUST);
    }
 else {
      query.add(new TermQuery(new Term(ROW_ID,rowId)),Occur.MUST);
      query.add(new TermQuery(BlurUtil.PRIME_DOC_TERM),Occur.MUST);
    }
    TopDocs topDocs=searcher.search(query,1);
    if (topDocs.totalHits > 1) {
      if (selector.recordOnly) {
        LOG.warn("String_Node_Str" + rowId + "String_Node_Str"+ recordId+ "String_Node_Str");
      }
 else {
        LOG.warn("String_Node_Str" + rowId + "String_Node_Str");
      }
    }
    if (topDocs.totalHits == 1) {
      selector.setLocationId(shardName + "String_Node_Str" + topDocs.scoreDocs[0].doc);
    }
 else {
      selector.setLocationId(NOT_FOUND);
    }
  }
  finally {
    searcher.close();
    trace.done();
  }
}

Fixed version (ground truth):
private void populateSelector(IndexSearcherClosable searcher,String shardName,String table,Selector selector) throws IOException, BlurException {
  Tracer trace=Trace.trace("String_Node_Str");
  String rowId=selector.rowId;
  String recordId=selector.recordId;
  try {
    BooleanQuery query=new BooleanQuery();
    if (selector.recordOnly) {
      query.add(new TermQuery(new Term(RECORD_ID,recordId)),Occur.MUST);
      query.add(new TermQuery(new Term(ROW_ID,rowId)),Occur.MUST);
    }
 else {
      query.add(new TermQuery(new Term(ROW_ID,rowId)),Occur.MUST);
      query.add(new TermQuery(BlurUtil.PRIME_DOC_TERM),Occur.MUST);
    }
    TopDocs topDocs=searcher.search(query,1);
    if (topDocs.totalHits > 1) {
      if (selector.recordOnly) {
        LOG.warn("String_Node_Str" + rowId + "String_Node_Str"+ recordId+ "String_Node_Str");
      }
 else {
        LOG.warn("String_Node_Str" + rowId + "String_Node_Str");
      }
    }
    if (topDocs.totalHits == 1) {
      selector.setLocationId(shardName + "String_Node_Str" + topDocs.scoreDocs[0].doc);
    }
 else {
      selector.setLocationId(NOT_FOUND);
    }
  }
  finally {
    trace.done();
  }
}
Program: 82393
Project: 82393
Buggy source:
public Blur022StoredFieldsFormat(int chunkSize,CompressionMode compressionMode){
  _chunkSize=chunkSize;
  _compressionMode=compressionMode;
}

Fixed version (ground truth):
public Blur022StoredFieldsFormat(int chunkSize,CompressionMode compressionMode){
  _chunkSize=chunkSize;
  _compressionMode=compressionMode;
  _cache=new ConcurrentLinkedHashMap.Builder<CachedKey,BytesRef>().weigher(new Weigher<BytesRef>(){
    @Override public int weightOf(    BytesRef value){
      return value.bytes.length;
    }
  }
).maximumWeightedCapacity(capacity).build();
}
Program: 82394
Project: 82394
Buggy source:
@Override public Decompressor newDecompressor(){
  return new CachedDecompressor(_compressionMode.newDecompressor());
}

Fixed version (ground truth):
@Override public Decompressor newDecompressor(){
  return new CachedDecompressor(_compressionMode.newDecompressor(),_si,_cache);
}
Program: 82395
Project: 82395
Buggy source:
@Override public StoredFieldsReader fieldsReader(Directory directory,SegmentInfo si,FieldInfos fn,IOContext context) throws IOException {
  CompressionMode compressionMode=new CachedCompressionMode(getCompressionMode(si),directory,si);
  return new CompressingStoredFieldsReader(directory,si,SEGMENT_SUFFIX,fn,context,FORMAT_NAME,compressionMode);
}

Fixed version (ground truth):
@Override public StoredFieldsReader fieldsReader(Directory directory,SegmentInfo si,FieldInfos fn,IOContext context) throws IOException {
  CompressionMode compressionMode=new CachedCompressionMode(getCompressionMode(si),si,_cache);
  return new CompressingStoredFieldsReader(directory,si,SEGMENT_SUFFIX,fn,context,FORMAT_NAME,compressionMode);
}
Program: 82396
Project: 82396
Buggy source:
CachedCompressionMode(CompressionMode compressionMode,Directory directory,SegmentInfo si){
  _compressionMode=compressionMode;
}

Fixed version (ground truth):
CachedCompressionMode(CompressionMode compressionMode,SegmentInfo si,ConcurrentLinkedHashMap<CachedKey,BytesRef> cache){
  _compressionMode=compressionMode;
  _si=si;
  _cache=cache;
}
Program: 82397
Project: 82397
Buggy source:
public CachedDecompressor(Decompressor decompressor){
  _decompressor=decompressor;
}

Fixed version (ground truth):
public CachedDecompressor(Decompressor decompressor,SegmentInfo si,ConcurrentLinkedHashMap<CachedKey,BytesRef> cache){
  _si=si;
  _decompressor=decompressor;
  _cache=cache;
}
Program: 82398
Project: 82398
Buggy source:
@Override public void decompress(DataInput in,int originalLength,int offset,int length,BytesRef bytes) throws IOException {
  if (in instanceof IndexInput) {
    IndexInput indexInput=(IndexInput)in;
    String name=indexInput.toString();
    Entry entry=_cache.get();
    long filePointer=indexInput.getFilePointer();
    BytesRef cachedRef=entry._bytesRef;
    if (!name.equals(entry._inputName) || entry._position != filePointer) {
      cachedRef.grow(originalLength);
      _decompressor.decompress(in,originalLength,0,originalLength,cachedRef);
      entry._inputName=name;
      entry._position=filePointer;
    }
    bytes.copyBytes(cachedRef);
    bytes.offset=offset;
    bytes.length=length;
  }
 else {
    _decompressor.decompress(in,originalLength,offset,length,bytes);
  }
}

Fixed version (ground truth):
@Override public void decompress(final DataInput in,final int originalLength,final int offset,final int length,final BytesRef bytes) throws IOException {
  if (in instanceof IndexInput) {
    IndexInput indexInput=(IndexInput)in;
    String name=indexInput.toString();
    long filePointer=indexInput.getFilePointer();
    CachedKey key=new CachedKey(name,filePointer,_si);
    BytesRef cachedRef=_cache.get(key);
    if (cachedRef == null) {
      cachedRef=new BytesRef(originalLength + 7);
      _decompressor.decompress(indexInput,originalLength,0,originalLength,cachedRef);
      _cache.put(key,cachedRef);
      cachedRef.length=originalLength;
      cachedRef.offset=0;
    }
    if (bytes.bytes.length < originalLength + 7) {
      bytes.bytes=new byte[ArrayUtil.oversize(originalLength + 7,1)];
    }
    System.arraycopy(cachedRef.bytes,cachedRef.offset,bytes.bytes,0,length + offset);
    bytes.offset=offset;
    bytes.length=length;
  }
 else {
    _decompressor.decompress(in,originalLength,offset,length,bytes);
  }
}
Program: 82399
Project: 82399
Buggy source:
private void fill() throws IOException {
  _key.setBlockId(getBlockId());
  _cacheValue=get(_key);
  if (_cacheValue == null) {
    _cacheValue=_cache.newInstance(_directory,_fileName);
    long filePosition=getFilePosition();
    _indexInput.seek(filePosition);
    byte[] buffer=_store.takeBuffer(_bufferSize);
    int len=(int)Math.min(_cacheBlockSize,_fileLength - filePosition);
    int cachePosition=0;
    while (len > 0) {
      int length=Math.min(_bufferSize,len);
      _indexInput.readBytes(buffer,0,length);
      _cacheValue.write(cachePosition,buffer,0,length);
      len-=length;
      cachePosition+=length;
    }
    _store.putBuffer(buffer);
    _cache.put(_key.clone(),_cacheValue);
  }
  _blockPosition=getBlockPosition();
}

Fixed version (ground truth):
private void fill() throws IOException {
  _key.setBlockId(getBlockId());
  _cacheValue=get(_key);
  if (_cacheValue == null) {
    _cacheValue=_cache.newInstance(_directory,_fileName);
    _cacheValue.incRef();
    long filePosition=getFilePosition();
    _indexInput.seek(filePosition);
    byte[] buffer=_store.takeBuffer(_bufferSize);
    int len=(int)Math.min(_cacheBlockSize,_fileLength - filePosition);
    int cachePosition=0;
    while (len > 0) {
      int length=Math.min(_bufferSize,len);
      _indexInput.readBytes(buffer,0,length);
      _cacheValue.write(cachePosition,buffer,0,length);
      len-=length;
      cachePosition+=length;
    }
    _store.putBuffer(buffer);
    _cache.put(_key.clone(),_cacheValue);
  }
 else {
    _cacheValue.incRef();
  }
  _blockPosition=getBlockPosition();
}
Program: 82400
Project: 82400
Buggy source:
@Override public IndexInput clone(){
  ensureOpen();
  CacheIndexInput clone=(CacheIndexInput)super.clone();
  clone._key=_key.clone();
  clone._indexInput=_indexInput.clone();
  clone._quiet=_cache.shouldBeQuiet(_directory,_fileName);
  return clone;
}

Fixed version (ground truth):
@Override public IndexInput clone(){
  ensureOpen();
  CacheIndexInput clone=(CacheIndexInput)super.clone();
  clone._key=_key.clone();
  clone._indexInput=_indexInput.clone();
  clone._quiet=_cache.shouldBeQuiet(_directory,_fileName);
  if (clone._cacheValue != null) {
    clone._cacheValue.incRef();
  }
  return clone;
}
Program: 82401
Project: 82401
Buggy source:
private void releaseCache(){
  if (_cacheValue != null) {
    _cacheValue=null;
  }
}

Fixed version (ground truth):
private void releaseCache(){
  if (_cacheValue != null) {
    _cacheValue.decRef();
    _cacheValue=null;
  }
}
Program: 82402
Project: 82402
Buggy source:
private void flushInternal() throws IOException {
  int length=_cacheBlockSize - remaining();
  if (length == 0) {
    return;
  }
  CacheValue cacheValue=_cache.newInstance(_directory,_fileName);
  writeBufferToOutputStream(length);
  cacheValue.write(0,_buffer,0,length);
  long blockId=(_position - length) / _cacheBlockSize;
  cacheValue=cacheValue.trim(length);
  _cache.put(new CacheKey(_fileId,blockId),cacheValue);
  _bufferPosition=0;
}

Fixed version (ground truth):
private void flushInternal() throws IOException {
  int length=_cacheBlockSize - remaining();
  if (length == 0) {
    return;
  }
  CacheValue cacheValue=_cache.newInstance(_directory,_fileName);
  cacheValue.incRef();
  writeBufferToOutputStream(length);
  cacheValue.write(0,_buffer,0,length);
  long blockId=(_position - length) / _cacheBlockSize;
  cacheValue=cacheValue.trim(length);
  _cache.put(new CacheKey(_fileId,blockId),cacheValue);
  cacheValue.decRef();
  _bufferPosition=0;
}
Program: 82403
Project: 82403
Buggy source:
public void returnToPool(CacheValue cacheValue){
  BlockingQueue<CacheValue> blockingQueue=getPool(cacheValue.length());
  if (!blockingQueue.offer(cacheValue)) {
    _detroyed.mark();
    cacheValue.release();
  }
}

Fixed version (ground truth):
public void returnToPool(CacheValue cacheValue){
  if (cacheValue == null) {
    return;
  }
  BlockingQueue<CacheValue> blockingQueue=getPool(cacheValue.length());
  if (!blockingQueue.offer(cacheValue)) {
    _detroyed.mark();
    cacheValue.release();
  }
}
Program: 82404
Project: 82404
Buggy source:
private void populateSelector(String table,Selector selector) throws IOException, BlurException {
  Tracer trace=Trace.trace("String_Node_Str");
  String rowId=selector.rowId;
  String recordId=selector.recordId;
  String shardName=MutationHelper.getShardName(table,rowId,getNumberOfShards(table),_blurPartitioner);
  Map<String,BlurIndex> indexes=_indexServer.getIndexes(table);
  BlurIndex blurIndex=indexes.get(shardName);
  if (blurIndex == null) {
    throw new BException("String_Node_Str" + shardName + "String_Node_Str");
  }
  IndexSearcherClosable searcher=blurIndex.getIndexSearcher();
  try {
    BooleanQuery query=new BooleanQuery();
    if (selector.recordOnly) {
      query.add(new TermQuery(new Term(RECORD_ID,recordId)),Occur.MUST);
      query.add(new TermQuery(new Term(ROW_ID,rowId)),Occur.MUST);
    }
 else {
      query.add(new TermQuery(new Term(ROW_ID,rowId)),Occur.MUST);
      query.add(new TermQuery(BlurUtil.PRIME_DOC_TERM),Occur.MUST);
    }
    TopDocs topDocs=searcher.search(query,1);
    if (topDocs.totalHits > 1) {
      if (selector.recordOnly) {
        LOG.warn("String_Node_Str" + rowId + "String_Node_Str"+ recordId+ "String_Node_Str");
      }
 else {
        LOG.warn("String_Node_Str" + rowId + "String_Node_Str");
      }
    }
    if (topDocs.totalHits == 1) {
      selector.setLocationId(shardName + "String_Node_Str" + topDocs.scoreDocs[0].doc);
    }
 else {
      selector.setLocationId(NOT_FOUND);
    }
  }
  finally {
    searcher.close();
    trace.done();
  }
}

Fixed version (ground truth):
private void populateSelector(IndexSearcherClosable searcher,String shardName,String table,Selector selector) throws IOException, BlurException {
  Tracer trace=Trace.trace("String_Node_Str");
  String rowId=selector.rowId;
  String recordId=selector.recordId;
  try {
    BooleanQuery query=new BooleanQuery();
    if (selector.recordOnly) {
      query.add(new TermQuery(new Term(RECORD_ID,recordId)),Occur.MUST);
      query.add(new TermQuery(new Term(ROW_ID,rowId)),Occur.MUST);
    }
 else {
      query.add(new TermQuery(new Term(ROW_ID,rowId)),Occur.MUST);
      query.add(new TermQuery(BlurUtil.PRIME_DOC_TERM),Occur.MUST);
    }
    TopDocs topDocs=searcher.search(query,1);
    if (topDocs.totalHits > 1) {
      if (selector.recordOnly) {
        LOG.warn("String_Node_Str" + rowId + "String_Node_Str"+ recordId+ "String_Node_Str");
      }
 else {
        LOG.warn("String_Node_Str" + rowId + "String_Node_Str");
      }
    }
    if (topDocs.totalHits == 1) {
      selector.setLocationId(shardName + "String_Node_Str" + topDocs.scoreDocs[0].doc);
    }
 else {
      selector.setLocationId(NOT_FOUND);
    }
  }
  finally {
    trace.done();
  }
}
Program: 82405
Project: 82405
Buggy source:
public Blur022StoredFieldsFormat(int chunkSize,CompressionMode compressionMode){
  _chunkSize=chunkSize;
  _compressionMode=compressionMode;
}

Fixed version (ground truth):
public Blur022StoredFieldsFormat(int chunkSize,CompressionMode compressionMode){
  _chunkSize=chunkSize;
  _compressionMode=compressionMode;
  _cache=new ConcurrentLinkedHashMap.Builder<CachedKey,BytesRef>().weigher(new Weigher<BytesRef>(){
    @Override public int weightOf(    BytesRef value){
      return value.bytes.length;
    }
  }
).maximumWeightedCapacity(capacity).build();
}
Program: 82406
Project: 82406
Buggy source:
@Override public Decompressor newDecompressor(){
  return new CachedDecompressor(_compressionMode.newDecompressor());
}

Fixed version (ground truth):
@Override public Decompressor newDecompressor(){
  return new CachedDecompressor(_compressionMode.newDecompressor(),_si,_cache);
}
Program: 82407
Project: 82407
Buggy source:
@Override public StoredFieldsReader fieldsReader(Directory directory,SegmentInfo si,FieldInfos fn,IOContext context) throws IOException {
  CompressionMode compressionMode=new CachedCompressionMode(getCompressionMode(si),directory,si);
  return new CompressingStoredFieldsReader(directory,si,SEGMENT_SUFFIX,fn,context,FORMAT_NAME,compressionMode);
}

Fixed version (ground truth):
@Override public StoredFieldsReader fieldsReader(Directory directory,SegmentInfo si,FieldInfos fn,IOContext context) throws IOException {
  CompressionMode compressionMode=new CachedCompressionMode(getCompressionMode(si),si,_cache);
  return new CompressingStoredFieldsReader(directory,si,SEGMENT_SUFFIX,fn,context,FORMAT_NAME,compressionMode);
}
Program: 82408
Project: 82408
Buggy source:
CachedCompressionMode(CompressionMode compressionMode,Directory directory,SegmentInfo si){
  _compressionMode=compressionMode;
}

Fixed version (ground truth):
CachedCompressionMode(CompressionMode compressionMode,SegmentInfo si,ConcurrentLinkedHashMap<CachedKey,BytesRef> cache){
  _compressionMode=compressionMode;
  _si=si;
  _cache=cache;
}
Program: 82409
Project: 82409
Buggy source:
public CachedDecompressor(Decompressor decompressor){
  _decompressor=decompressor;
}

Fixed version (ground truth):
public CachedDecompressor(Decompressor decompressor,SegmentInfo si,ConcurrentLinkedHashMap<CachedKey,BytesRef> cache){
  _si=si;
  _decompressor=decompressor;
  _cache=cache;
}
Program: 82410
Project: 82410
Buggy source:
@Override public void decompress(DataInput in,int originalLength,int offset,int length,BytesRef bytes) throws IOException {
  if (in instanceof IndexInput) {
    IndexInput indexInput=(IndexInput)in;
    String name=indexInput.toString();
    Entry entry=_cache.get();
    long filePointer=indexInput.getFilePointer();
    BytesRef cachedRef=entry._bytesRef;
    if (!name.equals(entry._inputName) || entry._position != filePointer) {
      cachedRef.grow(originalLength);
      _decompressor.decompress(in,originalLength,0,originalLength,cachedRef);
      entry._inputName=name;
      entry._position=filePointer;
    }
    bytes.copyBytes(cachedRef);
    bytes.offset=offset;
    bytes.length=length;
  }
 else {
    _decompressor.decompress(in,originalLength,offset,length,bytes);
  }
}

Fixed version (ground truth):
@Override public void decompress(final DataInput in,final int originalLength,final int offset,final int length,final BytesRef bytes) throws IOException {
  if (in instanceof IndexInput) {
    IndexInput indexInput=(IndexInput)in;
    String name=indexInput.toString();
    long filePointer=indexInput.getFilePointer();
    CachedKey key=new CachedKey(name,filePointer,_si);
    BytesRef cachedRef=_cache.get(key);
    if (cachedRef == null) {
      cachedRef=new BytesRef(originalLength + 7);
      _decompressor.decompress(indexInput,originalLength,0,originalLength,cachedRef);
      _cache.put(key,cachedRef);
      cachedRef.length=originalLength;
      cachedRef.offset=0;
    }
    if (bytes.bytes.length < originalLength + 7) {
      bytes.bytes=new byte[ArrayUtil.oversize(originalLength + 7,1)];
    }
    System.arraycopy(cachedRef.bytes,cachedRef.offset,bytes.bytes,0,length + offset);
    bytes.offset=offset;
    bytes.length=length;
  }
 else {
    _decompressor.decompress(in,originalLength,offset,length,bytes);
  }
}
Program: 82411
Project: 82411
Buggy source:
private void fill() throws IOException {
  _key.setBlockId(getBlockId());
  _cacheValue=get(_key);
  if (_cacheValue == null) {
    _cacheValue=_cache.newInstance(_directory,_fileName);
    long filePosition=getFilePosition();
    _indexInput.seek(filePosition);
    byte[] buffer=_store.takeBuffer(_bufferSize);
    int len=(int)Math.min(_cacheBlockSize,_fileLength - filePosition);
    int cachePosition=0;
    while (len > 0) {
      int length=Math.min(_bufferSize,len);
      _indexInput.readBytes(buffer,0,length);
      _cacheValue.write(cachePosition,buffer,0,length);
      len-=length;
      cachePosition+=length;
    }
    _store.putBuffer(buffer);
    _cache.put(_key.clone(),_cacheValue);
  }
  _blockPosition=getBlockPosition();
}

Fixed version (ground truth):
private void fill() throws IOException {
  _key.setBlockId(getBlockId());
  _cacheValue=get(_key);
  if (_cacheValue == null) {
    _cacheValue=_cache.newInstance(_directory,_fileName);
    _cacheValue.incRef();
    long filePosition=getFilePosition();
    _indexInput.seek(filePosition);
    byte[] buffer=_store.takeBuffer(_bufferSize);
    int len=(int)Math.min(_cacheBlockSize,_fileLength - filePosition);
    int cachePosition=0;
    while (len > 0) {
      int length=Math.min(_bufferSize,len);
      _indexInput.readBytes(buffer,0,length);
      _cacheValue.write(cachePosition,buffer,0,length);
      len-=length;
      cachePosition+=length;
    }
    _store.putBuffer(buffer);
    _cache.put(_key.clone(),_cacheValue);
  }
 else {
    _cacheValue.incRef();
  }
  _blockPosition=getBlockPosition();
}
Program: 82412
Project: 82412
Buggy source:
@Override public IndexInput clone(){
  ensureOpen();
  CacheIndexInput clone=(CacheIndexInput)super.clone();
  clone._key=_key.clone();
  clone._indexInput=_indexInput.clone();
  clone._quiet=_cache.shouldBeQuiet(_directory,_fileName);
  return clone;
}

Fixed version (ground truth):
@Override public IndexInput clone(){
  ensureOpen();
  CacheIndexInput clone=(CacheIndexInput)super.clone();
  clone._key=_key.clone();
  clone._indexInput=_indexInput.clone();
  clone._quiet=_cache.shouldBeQuiet(_directory,_fileName);
  if (clone._cacheValue != null) {
    clone._cacheValue.incRef();
  }
  return clone;
}
Program: 82413
Project: 82413
Buggy source:
private void releaseCache(){
  if (_cacheValue != null) {
    _cacheValue=null;
  }
}

Fixed version (ground truth):
private void releaseCache(){
  if (_cacheValue != null) {
    _cacheValue.decRef();
    _cacheValue=null;
  }
}
Program: 82414
Project: 82414
Buggy source:
private void flushInternal() throws IOException {
  int length=_cacheBlockSize - remaining();
  if (length == 0) {
    return;
  }
  CacheValue cacheValue=_cache.newInstance(_directory,_fileName);
  writeBufferToOutputStream(length);
  cacheValue.write(0,_buffer,0,length);
  long blockId=(_position - length) / _cacheBlockSize;
  cacheValue=cacheValue.trim(length);
  _cache.put(new CacheKey(_fileId,blockId),cacheValue);
  _bufferPosition=0;
}

Fixed version (ground truth):
private void flushInternal() throws IOException {
  int length=_cacheBlockSize - remaining();
  if (length == 0) {
    return;
  }
  CacheValue cacheValue=_cache.newInstance(_directory,_fileName);
  cacheValue.incRef();
  writeBufferToOutputStream(length);
  cacheValue.write(0,_buffer,0,length);
  long blockId=(_position - length) / _cacheBlockSize;
  cacheValue=cacheValue.trim(length);
  _cache.put(new CacheKey(_fileId,blockId),cacheValue);
  cacheValue.decRef();
  _bufferPosition=0;
}
Program: 82415
Project: 82415
Buggy source:
public void returnToPool(CacheValue cacheValue){
  BlockingQueue<CacheValue> blockingQueue=getPool(cacheValue.length());
  if (!blockingQueue.offer(cacheValue)) {
    _detroyed.mark();
    cacheValue.release();
  }
}

Fixed version (ground truth):
public void returnToPool(CacheValue cacheValue){
  if (cacheValue == null) {
    return;
  }
  BlockingQueue<CacheValue> blockingQueue=getPool(cacheValue.length());
  if (!blockingQueue.offer(cacheValue)) {
    _detroyed.mark();
    cacheValue.release();
  }
}
Program: 82416
Project: 82416
Buggy source:
@Override public boolean isInSafeMode(boolean useCache,String cluster){
  if (useCache) {
    SafeModeCacheEntry safeModeCacheEntry=_clusterToSafeMode.get(cluster);
    if (safeModeCacheEntry != null && safeModeCacheEntry.isValid()) {
      return safeModeCacheEntry._safeMode;
    }
  }
  long s=System.nanoTime();
  try {
    checkIfOpen();
    String safemodePath=ZookeeperPathConstants.getSafemodePath(cluster);
    ZooKeeperLockManager zooKeeperLockManager=new ZooKeeperLockManager(_zk,safemodePath);
    if (zooKeeperLockManager.getNumberOfLockNodesPresent(cluster) == 0) {
      _clusterToSafeMode.put(cluster,new SafeModeCacheEntry(false));
      return false;
    }
    return true;
  }
 catch (  KeeperException e) {
    throw new RuntimeException(e);
  }
catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
 finally {
    long e=System.nanoTime();
    LOG.debug("String_Node_Str" + (e - s) / 1000000.0 + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public boolean isInSafeMode(boolean useCache,String cluster){
  if (useCache) {
    SafeModeCacheEntry safeModeCacheEntry=_clusterToSafeMode.get(cluster);
    if (safeModeCacheEntry != null && safeModeCacheEntry.isValid()) {
      return safeModeCacheEntry._safeMode;
    }
  }
  long s=System.nanoTime();
  try {
    checkIfOpen();
    String safemodePath=ZookeeperPathConstants.getSafemodePath(cluster);
    ZooKeeperLockManager zooKeeperLockManager=new ZooKeeperLockManager(_zk,safemodePath);
    if (zooKeeperLockManager.getNumberOfLockNodesPresent(cluster) == 0) {
      _clusterToSafeMode.put(cluster,new SafeModeCacheEntry(false));
      return false;
    }
    _clusterToSafeMode.put(cluster,new SafeModeCacheEntry(true));
    return true;
  }
 catch (  KeeperException e) {
    throw new RuntimeException(e);
  }
catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
 finally {
    long e=System.nanoTime();
    LOG.debug("String_Node_Str" + (e - s) / 1000000.0 + "String_Node_Str");
  }
}
Program: 82417
Project: 82417
Buggy source:
@Override public boolean isInSafeMode(boolean useCache,String cluster){
  if (useCache) {
    SafeModeCacheEntry safeModeCacheEntry=_clusterToSafeMode.get(cluster);
    if (safeModeCacheEntry != null && safeModeCacheEntry.isValid()) {
      return safeModeCacheEntry._safeMode;
    }
  }
  long s=System.nanoTime();
  try {
    checkIfOpen();
    String safemodePath=ZookeeperPathConstants.getSafemodePath(cluster);
    ZooKeeperLockManager zooKeeperLockManager=new ZooKeeperLockManager(_zk,safemodePath);
    if (zooKeeperLockManager.getNumberOfLockNodesPresent(cluster) == 0) {
      _clusterToSafeMode.put(cluster,new SafeModeCacheEntry(false));
      return false;
    }
    return true;
  }
 catch (  KeeperException e) {
    throw new RuntimeException(e);
  }
catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
 finally {
    long e=System.nanoTime();
    LOG.debug("String_Node_Str" + (e - s) / 1000000.0 + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public boolean isInSafeMode(boolean useCache,String cluster){
  if (useCache) {
    SafeModeCacheEntry safeModeCacheEntry=_clusterToSafeMode.get(cluster);
    if (safeModeCacheEntry != null && safeModeCacheEntry.isValid()) {
      return safeModeCacheEntry._safeMode;
    }
  }
  long s=System.nanoTime();
  try {
    checkIfOpen();
    String safemodePath=ZookeeperPathConstants.getSafemodePath(cluster);
    ZooKeeperLockManager zooKeeperLockManager=new ZooKeeperLockManager(_zk,safemodePath);
    if (zooKeeperLockManager.getNumberOfLockNodesPresent(cluster) == 0) {
      _clusterToSafeMode.put(cluster,new SafeModeCacheEntry(false));
      return false;
    }
    _clusterToSafeMode.put(cluster,new SafeModeCacheEntry(true));
    return true;
  }
 catch (  KeeperException e) {
    throw new RuntimeException(e);
  }
catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
 finally {
    long e=System.nanoTime();
    LOG.debug("String_Node_Str" + (e - s) / 1000000.0 + "String_Node_Str");
  }
}
Program: 82418
Project: 82418
Buggy source:
@Override public float score() throws IOException {
switch (scoreType) {
case AGGREGATE:
    return aggregateScore;
case BEST:
  return bestScore;
case CONSTANT:
return 1;
case SUPER:
double log=Math.log10(aggregateScore) + 1.0;
double avg=aggregateScore / hitsInEntity;
double pow=Math.pow(avg,SUPER_POWER_CONSTANT);
return (float)Math.pow(log + pow,1.0 / SUPER_POWER_CONSTANT);
}
throw new RuntimeException("String_Node_Str" + scoreType + "String_Node_Str");
}

Fixed version (ground truth):
@Override public float score() throws IOException {
switch (scoreType) {
case AGGREGATE:
    return aggregateScore;
case BEST:
  return bestScore;
case CONSTANT:
return 1;
case SUPER:
if (aggregateScore < 1.0) {
return aggregateScore;
}
double log=Math.log10(aggregateScore) + 1.0;
double avg=aggregateScore / hitsInEntity;
double pow=Math.pow(avg,SUPER_POWER_CONSTANT);
return (float)Math.pow(log + pow,1.0 / SUPER_POWER_CONSTANT);
}
throw new RuntimeException("String_Node_Str" + scoreType + "String_Node_Str");
}
Program: 82419
Project: 82419
Buggy source:
@Override public float score() throws IOException {
switch (scoreType) {
case AGGREGATE:
    return aggregateScore;
case BEST:
  return bestScore;
case CONSTANT:
return 1;
case SUPER:
double log=Math.log10(aggregateScore) + 1.0;
double avg=aggregateScore / hitsInEntity;
double pow=Math.pow(avg,SUPER_POWER_CONSTANT);
return (float)Math.pow(log + pow,1.0 / SUPER_POWER_CONSTANT);
}
throw new RuntimeException("String_Node_Str" + scoreType + "String_Node_Str");
}

Fixed version (ground truth):
@Override public float score() throws IOException {
switch (scoreType) {
case AGGREGATE:
    return aggregateScore;
case BEST:
  return bestScore;
case CONSTANT:
return 1;
case SUPER:
if (aggregateScore < 1.0) {
return aggregateScore;
}
double log=Math.log10(aggregateScore) + 1.0;
double avg=aggregateScore / hitsInEntity;
double pow=Math.pow(avg,SUPER_POWER_CONSTANT);
return (float)Math.pow(log + pow,1.0 / SUPER_POWER_CONSTANT);
}
throw new RuntimeException("String_Node_Str" + scoreType + "String_Node_Str");
}
Program: 82421
Project: 82421
Buggy source:
@Override public Schema schema(String table) throws BlurException, TException {
  checkTable(_cluster,table);
  resetSearchers();
  try {
    return _indexManager.schema(table);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e,"String_Node_Str",table);
    throw new BException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override public Schema schema(String table) throws BlurException, TException {
  resetSearchers();
  return super.schema(table);
}
Program: 82422
Project: 82422
Buggy source:
@Test public void runClusterIntegrationTests() throws BlurException, TException, IOException, InterruptedException, KeeperException {
  testCreateTable();
  testLoadTable();
  testQueryWithSelector();
  testBatchFetch();
  testQueryCancel();
  testBackPressureViaQuery();
  testTestShardFailover();
  testTermsList();
  testCreateDisableAndRemoveTable();
  testCreateTableWithCustomType();
}

Fixed version (ground truth):
@Test public void runClusterIntegrationTests() throws BlurException, TException, IOException, InterruptedException, KeeperException {
  testCreateTable();
  testLoadTable();
  testForEmptySchema();
  testQueryWithSelector();
  testBatchFetch();
  testQueryCancel();
  testBackPressureViaQuery();
  testTestShardFailover();
  testTermsList();
  testCreateDisableAndRemoveTable();
  testCreateTableWithCustomType();
}
Program: 82424
Project: 82424
Buggy source:
@Override public Schema schema(String table) throws BlurException, TException {
  checkTable(_cluster,table);
  resetSearchers();
  try {
    return _indexManager.schema(table);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e,"String_Node_Str",table);
    throw new BException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override public Schema schema(String table) throws BlurException, TException {
  resetSearchers();
  return super.schema(table);
}
Program: 82425
Project: 82425
Buggy source:
@Test public void runClusterIntegrationTests() throws BlurException, TException, IOException, InterruptedException, KeeperException {
  testCreateTable();
  testLoadTable();
  testQueryWithSelector();
  testBatchFetch();
  testQueryCancel();
  testBackPressureViaQuery();
  testTestShardFailover();
  testTermsList();
  testCreateDisableAndRemoveTable();
  testCreateTableWithCustomType();
}

Fixed version (ground truth):
@Test public void runClusterIntegrationTests() throws BlurException, TException, IOException, InterruptedException, KeeperException {
  testCreateTable();
  testLoadTable();
  testForEmptySchema();
  testQueryWithSelector();
  testBatchFetch();
  testQueryCancel();
  testBackPressureViaQuery();
  testTestShardFailover();
  testTermsList();
  testCreateDisableAndRemoveTable();
  testCreateTableWithCustomType();
}
Program: 82428
Project: 82428
Buggy source:
protected void cleanupOldFiles(){
  LOG.debug("String_Node_Str");
  Set<Long> validFileIds=new HashSet<Long>(_fileNameToId.values());
  for (  CacheKey key : _cacheMap.keySet()) {
    long fileId=key.getFileId();
    if (validFileIds.contains(fileId)) {
      CacheValue remove=_cacheMap.remove(key);
      if (remove != null) {
        _removals.mark();
        addToReleaseQueue(key,remove);
      }
    }
  }
}

Fixed version (ground truth):
protected void cleanupOldFiles(){
  LOG.debug("String_Node_Str");
  Set<Long> validFileIds=new HashSet<Long>(_fileNameToId.values());
  for (  CacheKey key : _cacheMap.keySet()) {
    long fileId=key.getFileId();
    if (!validFileIds.contains(fileId)) {
      CacheValue remove=_cacheMap.remove(key);
      if (remove != null) {
        _removals.mark();
        addToReleaseQueue(key,remove);
      }
    }
  }
}
Program: 82429
Project: 82429
Buggy source:
protected void cleanupOldFiles(){
  LOG.debug("String_Node_Str");
  Set<Long> validFileIds=new HashSet<Long>(_fileNameToId.values());
  for (  CacheKey key : _cacheMap.keySet()) {
    long fileId=key.getFileId();
    if (validFileIds.contains(fileId)) {
      CacheValue remove=_cacheMap.remove(key);
      if (remove != null) {
        _removals.mark();
        addToReleaseQueue(key,remove);
      }
    }
  }
}

Fixed version (ground truth):
protected void cleanupOldFiles(){
  LOG.debug("String_Node_Str");
  Set<Long> validFileIds=new HashSet<Long>(_fileNameToId.values());
  for (  CacheKey key : _cacheMap.keySet()) {
    long fileId=key.getFileId();
    if (!validFileIds.contains(fileId)) {
      CacheValue remove=_cacheMap.remove(key);
      if (remove != null) {
        _removals.mark();
        addToReleaseQueue(key,remove);
      }
    }
  }
}
Program: 82432
Project: 82432
Buggy source:
private static byte[] toBytes(Set<String> blockCachingFileTypes){
  if (blockCachingFileTypes == null || blockCachingFileTypes.isEmpty()) {
    return null;
  }
  StringBuilder builder=new StringBuilder();
  for (  String type : blockCachingFileTypes) {
    builder.append(type).append(',');
  }
  return builder.substring(0,builder.length() - 1).getBytes();
}

Fixed version (ground truth):
private static byte[] toBytes(Map<String,String> properties){
  if (properties == null || properties.isEmpty()) {
    return null;
  }
  StringBuilder builder=new StringBuilder();
  Set<Entry<String,String>> entrySet=properties.entrySet();
  for (  Entry<String,String> entry : entrySet) {
    String key=entry.getKey();
    String value=entry.getValue();
    String keyValue=key + "String_Node_Str" + value;
    builder.append(keyValue).append(',');
  }
  return builder.substring(0,builder.length() - 1).getBytes();
}
Program: 82433
Project: 82433
Buggy source:
public boolean exists() throws IOException {
  return _directory.fileExists(getFileName());
}

Fixed version (ground truth):
public boolean exists() throws IOException {
  boolean fileExists=_directory.fileExists(getFileName());
  if (fileExists) {
    int words=(_numBits / 64) + 1;
    int correctLength=words * 8;
    long length=_indexInput.length();
    if (correctLength == length) {
      return true;
    }
  }
  return false;
}
Program: 82434
Project: 82434
Buggy source:
public void create(DocIdSetIterator it) throws IOException {
  String fileName=getFileName();
  IndexOutput output=_directory.createOutput(fileName,IOContext.READ);
  int index;
  int currentWordNum=0;
  long wordValue=0;
  while ((index=it.nextDoc()) < _numBits) {
    int wordNum=index >> 6;
    if (currentWordNum > wordNum) {
      throw new IOException("String_Node_Str");
    }
    while (currentWordNum < wordNum) {
      output.writeLong(wordValue);
      currentWordNum++;
      wordValue=0;
    }
    int bit=index & 0x3f;
    long bitmask=1L << bit;
    wordValue|=bitmask;
  }
  if (_numBits > 0) {
    int totalWords=(_numBits / 64) + 1;
    while (currentWordNum < totalWords) {
      output.writeLong(wordValue);
      currentWordNum++;
      wordValue=0;
    }
  }
  output.close();
}

Fixed version (ground truth):
public void create(DocIdSetIterator it) throws IOException {
  String fileName=getFileName();
  if (_directory.fileExists(getFileName())) {
    LOG.warn("String_Node_Str",fileName,_directory);
    _directory.deleteFile(fileName);
  }
  IndexOutput output=_directory.createOutput(fileName,IOContext.READ);
  int index;
  int currentWordNum=0;
  long wordValue=0;
  while ((index=it.nextDoc()) < _numBits) {
    int wordNum=index >> 6;
    if (currentWordNum > wordNum) {
      throw new IOException("String_Node_Str");
    }
    while (currentWordNum < wordNum) {
      output.writeLong(wordValue);
      currentWordNum++;
      wordValue=0;
    }
    int bit=index & 0x3f;
    long bitmask=1L << bit;
    wordValue|=bitmask;
  }
  if (_numBits > 0) {
    int totalWords=(_numBits / 64) + 1;
    while (currentWordNum < totalWords) {
      output.writeLong(wordValue);
      currentWordNum++;
      wordValue=0;
    }
  }
  output.close();
}
Program: 82435
Project: 82435
Buggy source:
public boolean exists() throws IOException {
  return _directory.fileExists(getFileName());
}

Fixed version (ground truth):
public boolean exists() throws IOException {
  boolean fileExists=_directory.fileExists(getFileName());
  if (fileExists) {
    int words=(_numBits / 64) + 1;
    int correctLength=words * 8;
    long length=_indexInput.length();
    if (correctLength == length) {
      return true;
    }
  }
  return false;
}
Program: 82436
Project: 82436
Buggy source:
public void create(DocIdSetIterator it) throws IOException {
  String fileName=getFileName();
  IndexOutput output=_directory.createOutput(fileName,IOContext.READ);
  int index;
  int currentWordNum=0;
  long wordValue=0;
  while ((index=it.nextDoc()) < _numBits) {
    int wordNum=index >> 6;
    if (currentWordNum > wordNum) {
      throw new IOException("String_Node_Str");
    }
    while (currentWordNum < wordNum) {
      output.writeLong(wordValue);
      currentWordNum++;
      wordValue=0;
    }
    int bit=index & 0x3f;
    long bitmask=1L << bit;
    wordValue|=bitmask;
  }
  if (_numBits > 0) {
    int totalWords=(_numBits / 64) + 1;
    while (currentWordNum < totalWords) {
      output.writeLong(wordValue);
      currentWordNum++;
      wordValue=0;
    }
  }
  output.close();
}

Fixed version (ground truth):
public void create(DocIdSetIterator it) throws IOException {
  String fileName=getFileName();
  if (_directory.fileExists(getFileName())) {
    LOG.warn("String_Node_Str",fileName,_directory);
    _directory.deleteFile(fileName);
  }
  IndexOutput output=_directory.createOutput(fileName,IOContext.READ);
  int index;
  int currentWordNum=0;
  long wordValue=0;
  while ((index=it.nextDoc()) < _numBits) {
    int wordNum=index >> 6;
    if (currentWordNum > wordNum) {
      throw new IOException("String_Node_Str");
    }
    while (currentWordNum < wordNum) {
      output.writeLong(wordValue);
      currentWordNum++;
      wordValue=0;
    }
    int bit=index & 0x3f;
    long bitmask=1L << bit;
    wordValue|=bitmask;
  }
  if (_numBits > 0) {
    int totalWords=(_numBits / 64) + 1;
    while (currentWordNum < totalWords) {
      output.writeLong(wordValue);
      currentWordNum++;
      wordValue=0;
    }
  }
  output.close();
}
Program: 82437
Project: 82437
Buggy source:
@Test public void testGetTableList(){
  assertEquals(Arrays.asList(TEST),clusterStatus.getTableList(false));
}

Fixed version (ground truth):
@Test public void testGetTableList() throws KeeperException, InterruptedException {
  testGetClusterTable();
  assertEquals(Arrays.asList(TEST),clusterStatus.getTableList(false));
}
Program: 82438
Project: 82438
Buggy source:
@After public void teardown() throws InterruptedException {
  clusterStatus.close();
  zooKeeper.close();
}

Fixed version (ground truth):
@After public void teardown() throws InterruptedException, KeeperException {
  rmr(zooKeeper,"String_Node_Str");
  clusterStatus.close();
  zooKeeper.close();
}
Program: 82439
Project: 82439
Buggy source:
@Test public void testGetTableList(){
  assertEquals(Arrays.asList(TEST),clusterStatus.getTableList(false));
}

Fixed version (ground truth):
@Test public void testGetTableList() throws KeeperException, InterruptedException {
  testGetClusterTable();
  assertEquals(Arrays.asList(TEST),clusterStatus.getTableList(false));
}
Program: 82440
Project: 82440
Buggy source:
@After public void teardown() throws InterruptedException {
  clusterStatus.close();
  zooKeeper.close();
}

Fixed version (ground truth):
@After public void teardown() throws InterruptedException, KeeperException {
  rmr(zooKeeper,"String_Node_Str");
  clusterStatus.close();
  zooKeeper.close();
}
Program: 82443
Project: 82443
Buggy source:
private static byte[] toBytes(Set<String> blockCachingFileTypes){
  if (blockCachingFileTypes == null || blockCachingFileTypes.isEmpty()) {
    return null;
  }
  StringBuilder builder=new StringBuilder();
  for (  String type : blockCachingFileTypes) {
    builder.append(type).append(',');
  }
  return builder.substring(0,builder.length() - 1).getBytes();
}

Fixed version (ground truth):
private static byte[] toBytes(Map<String,String> properties){
  if (properties == null || properties.isEmpty()) {
    return null;
  }
  StringBuilder builder=new StringBuilder();
  Set<Entry<String,String>> entrySet=properties.entrySet();
  for (  Entry<String,String> entry : entrySet) {
    String key=entry.getKey();
    String value=entry.getValue();
    String keyValue=key + "String_Node_Str" + value;
    builder.append(keyValue).append(',');
  }
  return builder.substring(0,builder.length() - 1).getBytes();
}