nus-yam/ex-repair huggingface dataset:
Program: 82277
Project: 82277
Buggy source:
/** 
 * The way this method is called via warm up methods the likelihood of creating multiple bitsets during a race condition is very low, that's why this method is not synced.
 */
public static OpenBitSet getPrimeDocBitSet(Term primeDocTerm,IndexReader reader) throws IOException {
  Object key=reader.getCoreCacheKey();
  final Map<Object,OpenBitSet> primeDocMap=getPrimeDocMap(primeDocTerm);
  OpenBitSet bitSet=primeDocMap.get(key);
  if (bitSet == null) {
    reader.addReaderClosedListener(new ReaderClosedListener(){
      @Override public void onClose(      IndexReader reader){
        Object key=reader.getCoreCacheKey();
        LOG.debug("String_Node_Str" + primeDocMap.size() + "String_Node_Str"+ reader+ "String_Node_Str");
        primeDocMap.remove(key);
      }
    }
);
    LOG.debug("String_Node_Str" + reader + "String_Node_Str"+ primeDocMap.size()+ "String_Node_Str");
    final OpenBitSet bs=new OpenBitSet(reader.maxDoc());
    primeDocMap.put(key,bs);
    IndexSearcher searcher=new IndexSearcher(reader);
    searcher.search(new TermQuery(primeDocTerm),new Collector(){
      @Override public void setScorer(      Scorer scorer) throws IOException {
      }
      @Override public void setNextReader(      AtomicReaderContext atomicReaderContext) throws IOException {
      }
      @Override public void collect(      int doc) throws IOException {
        bs.set(doc);
      }
      @Override public boolean acceptsDocsOutOfOrder(){
        return false;
      }
    }
);
    return bs;
  }
  return bitSet;
}

Fixed version (ground truth):
/** 
 * The way this method is called via warm up methods the likelihood of creating multiple bitsets during a race condition is very low, that's why this method is not synced.
 */
public static OpenBitSet getPrimeDocBitSet(Term primeDocTerm,AtomicReader reader) throws IOException {
  Object key=reader.getCoreCacheKey();
  final Map<Object,OpenBitSet> primeDocMap=getPrimeDocMap(primeDocTerm);
  OpenBitSet bitSet=primeDocMap.get(key);
  if (bitSet == null) {
synchronized (reader) {
      reader.addReaderClosedListener(new ReaderClosedListener(){
        @Override public void onClose(        IndexReader reader){
          Object key=reader.getCoreCacheKey();
          LOG.debug("String_Node_Str" + primeDocMap.size() + "String_Node_Str"+ reader+ "String_Node_Str");
          primeDocMap.remove(key);
        }
      }
);
      LOG.debug("String_Node_Str" + reader + "String_Node_Str"+ primeDocMap.size()+ "String_Node_Str");
      final OpenBitSet bs=new OpenBitSet(reader.maxDoc());
      DocsEnum termDocsEnum=reader.termDocsEnum(primeDocTerm);
      if (termDocsEnum == null) {
        return bs;
      }
      int docFreq=reader.docFreq(primeDocTerm);
      int doc;
      int count=0;
      while ((doc=termDocsEnum.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
        bs.fastSet(doc);
        count++;
      }
      if (count == docFreq) {
        primeDocMap.put(key,bs);
      }
 else {
        LOG.info("String_Node_Str",reader,count,docFreq);
      }
      return bs;
    }
  }
  return bitSet;
}
Program: 82278
Project: 82278
Buggy source:
@Override public void run(){
  try {
    entry.getValue().process(_counts,_minimumsBeforeReturning,_running);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
 finally {
    finished.incrementAndGet();
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    entry.getValue().process(_counts,_minimumsBeforeReturning,_running);
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
    throw new RuntimeException(e);
  }
 finally {
    finished.incrementAndGet();
  }
}
Program: 82279
Project: 82279
Buggy source:
private void processInternal(ExecutorService executor) throws IOException {
  List<Entry<Object,Info>> entries=new ArrayList<Entry<Object,Info>>(_infoMap.entrySet());
  Collections.sort(entries,COMPARATOR);
  if (executor == null) {
    for (    Entry<Object,Info> e : entries) {
      if (_running.get()) {
        e.getValue().process(_counts,_minimumsBeforeReturning,_running);
      }
    }
  }
 else {
    final AtomicInteger finished=new AtomicInteger();
    for (    Entry<Object,Info> e : entries) {
      if (_running.get()) {
        final Entry<Object,Info> entry=e;
        executor.submit(new Runnable(){
          @Override public void run(){
            try {
              entry.getValue().process(_counts,_minimumsBeforeReturning,_running);
            }
 catch (            IOException e) {
              throw new RuntimeException(e);
            }
 finally {
              finished.incrementAndGet();
            }
          }
        }
);
      }
    }
    while (finished.get() < entries.size()) {
synchronized (this) {
        try {
          wait(1);
        }
 catch (        InterruptedException e) {
          throw new IOException(e);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void processInternal(ExecutorService executor) throws IOException {
  List<Entry<Object,Info>> entries=new ArrayList<Entry<Object,Info>>(_infoMap.entrySet());
  Collections.sort(entries,COMPARATOR);
  if (executor == null) {
    for (    Entry<Object,Info> e : entries) {
      if (_running.get()) {
        e.getValue().process(_counts,_minimumsBeforeReturning,_running);
      }
    }
  }
 else {
    final AtomicInteger finished=new AtomicInteger();
    for (    Entry<Object,Info> e : entries) {
      if (_running.get()) {
        final Entry<Object,Info> entry=e;
        executor.submit(new Runnable(){
          @Override public void run(){
            try {
              entry.getValue().process(_counts,_minimumsBeforeReturning,_running);
            }
 catch (            IOException e) {
              LOG.error("String_Node_Str",e);
              throw new RuntimeException(e);
            }
 finally {
              finished.incrementAndGet();
            }
          }
        }
);
      }
    }
    while (finished.get() < entries.size()) {
synchronized (this) {
        try {
          wait(1);
        }
 catch (        InterruptedException e) {
          throw new IOException(e);
        }
      }
    }
  }
}
Program: 82280
Project: 82280
Buggy source:
@Test public void testLoadingNewTypeWhenNotDefined() throws IOException {
  TableDescriptor tableDescriptor=new TableDescriptor();
  tableDescriptor.setName(name);
  tableDescriptor.setTableUri(file.toURI().toString());
  TableContext context=TableContext.create(tableDescriptor);
  FieldManager fieldManager=context.getFieldManager();
  try {
    fieldManager.addColumnDefinition("String_Node_Str","String_Node_Str",null,false,"String_Node_Str",false,null);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
}

Fixed version (ground truth):
@Test public void testLoadingNewTypeWhenNotDefined() throws IOException {
  TableDescriptor tableDescriptor=new TableDescriptor();
  tableDescriptor.setName(name);
  tableDescriptor.setTableUri(file.toURI().toString());
  TableContext context=TableContext.create(tableDescriptor);
  FieldManager fieldManager=context.getFieldManager();
  try {
    boolean result=fieldManager.addColumnDefinition("String_Node_Str","String_Node_Str",null,false,"String_Node_Str",false,null);
    fail("String_Node_Str" + result + "String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
}
Program: 82281
Project: 82281
Buggy source:
@Before public void setup(){
  TableContext.clear();
  base=new File(TMPDIR,"String_Node_Str");
  rm(base);
  file=new File(base,name);
  file.mkdirs();
}

Fixed version (ground truth):
@Before public void setup() throws IOException {
  TableContext.clear();
  TableContext.setSystemBlurConfiguration(new BlurConfiguration());
  base=new File(TMPDIR,"String_Node_Str");
  rm(base);
  file=new File(base,name);
  file.mkdirs();
}
Program: 82283
Project: 82283
Buggy source:
private void watchForClusterChanges() throws KeeperException, InterruptedException {
  _watchForClusters=new WatchChildren(_zookeeper,ZookeeperPathConstants.getClustersPath());
  _watchForClusters.watch(new OnChange(){
    @Override public void action(    List<String> children){
      for (      String cluster : new HashSet<String>(_distributedLayoutFactoryMap.keySet())) {
        if (!children.contains(cluster)) {
          _distributedLayoutFactoryMap.remove(cluster);
        }
      }
      for (      String cluster : children) {
        try {
          watchForLayoutChanges(cluster);
        }
 catch (        KeeperException e) {
          LOG.error("String_Node_Str",e);
          throw new RuntimeException(e);
        }
catch (        InterruptedException e) {
          LOG.error("String_Node_Str",e);
          throw new RuntimeException(e);
        }
      }
    }
  }
);
}

Fixed version (ground truth):
private void watchForClusterChanges() throws KeeperException, InterruptedException {
  _watchForClusters=new WatchChildren(_zookeeper,ZookeeperPathConstants.getClustersPath());
  _watchForClusters.watch(new OnChange(){
    @Override public void action(    List<String> children){
      for (      String cluster : new HashSet<String>(_distributedLayoutFactoryMap.keySet())) {
        if (!children.contains(cluster)) {
          _distributedLayoutFactoryMap.remove(cluster);
        }
      }
      for (      String cluster : children) {
        try {
          watchForLayoutChangeEvents(cluster);
        }
 catch (        KeeperException e) {
          LOG.error("String_Node_Str",e);
          throw new RuntimeException(e);
        }
catch (        InterruptedException e) {
          LOG.error("String_Node_Str",e);
          throw new RuntimeException(e);
        }
      }
    }
  }
);
}
Program: 82284
Project: 82284
Buggy source:
@Override public void action(List<String> children){
  LOG.info("String_Node_Str",cluster);
  updateLayout();
}

Fixed version (ground truth):
@Override public void action(List<String> children){
  LOG.info("String_Node_Str",cluster,table);
  updateLayout(cluster);
}
Program: 82285
Project: 82285
Buggy source:
public void init() throws KeeperException, InterruptedException {
  setupZookeeper();
  registerMyself();
  _executor=Executors.newThreadPool(CONTROLLER_THREAD_POOL,_threadCount);
  _running.set(true);
  watchForClusterChanges();
  List<String> clusterList=_clusterStatus.getClusterList(false);
  for (  String cluster : clusterList) {
    watchForLayoutChanges(cluster);
  }
  updateLayout();
  startPreconnectTimer();
}

Fixed version (ground truth):
public void init() throws KeeperException, InterruptedException {
  setupZookeeper();
  registerMyself();
  _executor=Executors.newThreadPool(CONTROLLER_THREAD_POOL,_threadCount);
  _running.set(true);
  watchForClusterChanges();
  List<String> clusterList=_clusterStatus.getClusterList(false);
  for (  String cluster : clusterList) {
    watchForLayoutChangeEvents(cluster);
    updateLayout(cluster);
  }
  startPreconnectTimer();
}
Program: 82286
Project: 82286
Buggy source:
private synchronized void updateLayout(){
  if (!_clusterStatus.isOpen()) {
    LOG.warn("String_Node_Str");
    return;
  }
  List<String> tableList=_clusterStatus.getTableList(false);
  HashMap<String,Map<String,String>> newLayout=new HashMap<String,Map<String,String>>();
  for (  String table : tableList) {
    String cluster=_clusterStatus.getCluster(false,table);
    if (cluster == null) {
      continue;
    }
    DistributedLayoutFactory distributedLayoutFactory=getDistributedLayoutFactory(cluster);
    DistributedLayout layout=distributedLayoutFactory.readCurrentLayout(table);
    if (layout != null) {
      Map<String,String> map=layout.getLayout();
      LOG.info("String_Node_Str",table,map);
      newLayout.put(table,map);
    }
 else {
      LOG.info("String_Node_Str",table);
    }
  }
  _shardServerLayout.set(newLayout);
}

Fixed version (ground truth):
private synchronized void updateLayout(String cluster){
  if (!_clusterStatus.isOpen()) {
    LOG.warn("String_Node_Str");
    return;
  }
  List<String> tableList=_clusterStatus.getTableList(false,cluster);
  HashMap<String,Map<String,String>> newLayout=new HashMap<String,Map<String,String>>();
  for (  String table : tableList) {
    watchTableLayouts(cluster,table,_watchForTableLayoutChanges);
    DistributedLayoutFactory distributedLayoutFactory=getDistributedLayoutFactory(cluster);
    DistributedLayout layout=distributedLayoutFactory.readCurrentLayout(table);
    if (layout != null) {
      Map<String,String> map=layout.getLayout();
      LOG.info("String_Node_Str",table,map);
      newLayout.put(table,map);
    }
 else {
      LOG.info("String_Node_Str",table);
    }
  }
  _shardServerLayout.set(newLayout);
}
Program: 82287
Project: 82287
Buggy source:
@Override public IndexSearcherClosable getIndexSearcher() throws IOException {
  final IndexReader indexReader;
  _indexRefreshReadLock.lock();
  try {
    indexReader=_indexReader.get();
    indexReader.incRef();
  }
  finally {
    _indexRefreshReadLock.unlock();
  }
  return new IndexSearcherClosable(indexReader,_searchThreadPool){
    private boolean _closed;
    @Override public Directory getDirectory(){
      return _directory;
    }
    @Override public synchronized void close() throws IOException {
      if (!_closed) {
        indexReader.decRef();
        _closed=true;
      }
 else {
        LOG.error("String_Node_Str",new Throwable(),this);
      }
    }
  }
;
}

Fixed version (ground truth):
@Override public IndexSearcherClosable getIndexSearcher() throws IOException {
  final IndexReader indexReader;
  _indexRefreshReadLock.lock();
  try {
    indexReader=_indexReader.get();
    indexReader.incRef();
  }
  finally {
    _indexRefreshReadLock.unlock();
  }
  if (indexReader instanceof ExitableReader) {
    ((ExitableReader)indexReader).reset();
  }
  return new IndexSearcherClosable(indexReader,_searchThreadPool){
    private boolean _closed;
    @Override public Directory getDirectory(){
      return _directory;
    }
    @Override public synchronized void close() throws IOException {
      if (!_closed) {
        indexReader.decRef();
        _closed=true;
      }
 else {
        LOG.error("String_Node_Str",new Throwable(),this);
      }
    }
  }
;
}
Program: 82288
Project: 82288
Buggy source:
@Test public void testQueryCancel() throws BlurException, TException, InterruptedException, IOException {
  final String tableName="String_Node_Str";
  createTable(tableName);
  loadTable(tableName);
  try {
    IndexManager.DEBUG_RUN_SLOW.set(true);
    final Iface client=getClient();
    final BlurQuery blurQueryRow=new BlurQuery();
    Query queryRow=new Query();
    queryRow.setQuery("String_Node_Str");
    blurQueryRow.setQuery(queryRow);
    blurQueryRow.setUseCacheIfPresent(false);
    blurQueryRow.setCacheResult(false);
    blurQueryRow.setUuid("String_Node_Str");
    final AtomicReference<BlurException> error=new AtomicReference<BlurException>();
    final AtomicBoolean fail=new AtomicBoolean();
    new Thread(new Runnable(){
      @Override public void run(){
        try {
          client.query(tableName,blurQueryRow);
          fail.set(true);
        }
 catch (        BlurException e) {
          error.set(e);
        }
catch (        TException e) {
          e.printStackTrace();
          fail.set(true);
        }
      }
    }
).start();
    Thread.sleep(500);
    client.cancelQuery(tableName,blurQueryRow.getUuid());
    BlurException blurException=pollForError(error,10,TimeUnit.SECONDS,null,fail,-1);
    if (fail.get()) {
      fail("String_Node_Str");
    }
    assertEquals(blurException.getErrorType(),ErrorType.QUERY_CANCEL);
  }
  finally {
    IndexManager.DEBUG_RUN_SLOW.set(false);
  }
}

Fixed version (ground truth):
@Test public void testQueryCancel() throws BlurException, TException, InterruptedException, IOException {
  final String tableName="String_Node_Str";
  createTable(tableName);
  loadTable(tableName);
  final Iface client=getClient();
  try {
    IndexManager.DEBUG_RUN_SLOW.set(true);
    final BlurQuery blurQueryRow=new BlurQuery();
    Query queryRow=new Query();
    queryRow.setQuery("String_Node_Str");
    blurQueryRow.setQuery(queryRow);
    blurQueryRow.setUseCacheIfPresent(false);
    blurQueryRow.setCacheResult(false);
    blurQueryRow.setUuid("String_Node_Str");
    final AtomicReference<BlurException> error=new AtomicReference<BlurException>();
    final AtomicBoolean fail=new AtomicBoolean();
    new Thread(new Runnable(){
      @Override public void run(){
        try {
          client.query(tableName,blurQueryRow);
          fail.set(true);
        }
 catch (        BlurException e) {
          error.set(e);
        }
catch (        TException e) {
          e.printStackTrace();
          fail.set(true);
        }
      }
    }
).start();
    Thread.sleep(500);
    client.cancelQuery(tableName,blurQueryRow.getUuid());
    BlurException blurException=pollForError(error,10,TimeUnit.SECONDS,null,fail,-1);
    if (fail.get()) {
      fail("String_Node_Str");
    }
    assertEquals(blurException.getErrorType(),ErrorType.QUERY_CANCEL);
  }
  finally {
    IndexManager.DEBUG_RUN_SLOW.set(false);
  }
  client.terms(tableName,"String_Node_Str","String_Node_Str",null,(short)100);
}
Program: 82289
Project: 82289
Buggy source:
public ExitableFields(Fields fields,AtomicReference<AtomicBoolean> running){
  _fields=fields;
  _running=running;
}

Fixed version (ground truth):
public ExitableFields(Fields fields,ExitObject exitObject){
  _fields=fields;
  _exitObject=exitObject;
}
Program: 82290
Project: 82290
Buggy source:
private ExitableReader(DirectoryReader in,AtomicReference<AtomicBoolean> running){
  super(in,new ExitableSubReaderWrapper(running));
  _running=running;
}

Fixed version (ground truth):
public ExitableReader(DirectoryReader in,ExitObject exitObject){
  super(in,new ExitableSubReaderWrapper(exitObject));
  _exitObject=exitObject;
}
Program: 82291
Project: 82291
Buggy source:
public ExitableSubReaderWrapper(AtomicReference<AtomicBoolean> running){
  _running=running;
}

Fixed version (ground truth):
public ExitableSubReaderWrapper(ExitObject exitObject){
  _exitObject=exitObject;
}
Program: 82292
Project: 82292
Buggy source:
public void setRunning(AtomicBoolean running){
  _running.set(running);
}

Fixed version (ground truth):
public void setRunning(AtomicBoolean running){
  _exitObject.set(running);
}
Program: 82293
Project: 82293
Buggy source:
@Override public TermsEnum iterator(TermsEnum reuse) throws IOException {
  return new ExitableTermsEnum(_terms.iterator(reuse),_running);
}

Fixed version (ground truth):
@Override public TermsEnum iterator(TermsEnum reuse) throws IOException {
  return new ExitableTermsEnum(_terms.iterator(reuse),_exitObject);
}
Program: 82294
Project: 82294
Buggy source:
@Override public Terms terms(String field) throws IOException {
  Terms terms=_fields.terms(field);
  if (terms == null) {
    return null;
  }
  return new ExitableTerms(terms,_running);
}

Fixed version (ground truth):
@Override public Terms terms(String field) throws IOException {
  Terms terms=_fields.terms(field);
  if (terms == null) {
    return null;
  }
  return new ExitableTerms(terms,_exitObject);
}
Program: 82295
Project: 82295
Buggy source:
public ExitableTerms(Terms terms,AtomicReference<AtomicBoolean> running){
  _terms=terms;
  _running=running;
}

Fixed version (ground truth):
public ExitableTerms(Terms terms,ExitObject exitObject){
  _terms=terms;
  _exitObject=exitObject;
}
Program: 82296
Project: 82296
Buggy source:
@Override public TermsEnum intersect(CompiledAutomaton compiled,BytesRef startTerm) throws IOException {
  return new ExitableTermsEnum(_terms.intersect(compiled,startTerm),_running);
}

Fixed version (ground truth):
@Override public TermsEnum intersect(CompiledAutomaton compiled,BytesRef startTerm) throws IOException {
  return new ExitableTermsEnum(_terms.intersect(compiled,startTerm),_exitObject);
}
Program: 82297
Project: 82297
Buggy source:
public ExitableFilterAtomicReader(AtomicReader in,AtomicReference<AtomicBoolean> running){
  super(in);
  _running=running;
}

Fixed version (ground truth):
public ExitableFilterAtomicReader(AtomicReader in,ExitObject exitObject){
  super(in);
  _exitObject=exitObject;
}
Program: 82298
Project: 82298
Buggy source:
public AtomicBoolean getRunning(){
  return _running.get();
}

Fixed version (ground truth):
public AtomicBoolean getRunning(){
  return _exitObject.get();
}
Program: 82299
Project: 82299
Buggy source:
public ExitableTermsEnum(TermsEnum termsEnum,AtomicReference<AtomicBoolean> running){
  _termsEnum=termsEnum;
  _running=running.get();
  _lastCheck=System.nanoTime();
  checkAndThrow();
}

Fixed version (ground truth):
public ExitableTermsEnum(TermsEnum termsEnum,ExitObject exitObject){
  _termsEnum=termsEnum;
  _running=exitObject.get();
  _lastCheck=System.nanoTime();
  checkAndThrow();
}
Program: 82300
Project: 82300
Buggy source:
@Override public Fields fields() throws IOException {
  Fields fields=super.fields();
  if (fields == null) {
    return null;
  }
  return new ExitableFields(fields,_running);
}

Fixed version (ground truth):
@Override public Fields fields() throws IOException {
  Fields fields=super.fields();
  if (fields == null) {
    return null;
  }
  return new ExitableFields(fields,_exitObject);
}
Program: 82301
Project: 82301
Buggy source:
@Override public AtomicReader wrap(AtomicReader reader){
  return new ExitableFilterAtomicReader(reader,_running);
}

Fixed version (ground truth):
@Override public AtomicReader wrap(AtomicReader reader){
  return new ExitableFilterAtomicReader(reader,_exitObject);
}
Program: 82303
Project: 82303
Buggy source:
@Override public void copy(Directory to,String src,String dest,IOContext context) throws IOException {
  if (to instanceof DirectoryDecorator) {
    copy(((DirectoryDecorator)to).getOriginalDirectory(),src,dest,context);
  }
 else   if (to instanceof HdfsDirectory) {
    if (quickMove(to,src,dest,context)) {
      return;
    }
  }
 else {
    slowCopy(to,src,dest,context);
  }
}

Fixed version (ground truth):
@Override public void copy(Directory to,String src,String dest,IOContext context) throws IOException {
  if (to instanceof DirectoryDecorator) {
    copy(((DirectoryDecorator)to).getOriginalDirectory(),src,dest,context);
  }
 else   if (to instanceof HdfsQuickMove) {
    if (quickMove(((HdfsQuickMove)to).getQuickMoveDirectory(),src,dest,context)) {
      return;
    }
  }
 else {
    slowCopy(to,src,dest,context);
  }
}
Program: 82304
Project: 82304
Buggy source:
public JoinDirectory(Directory longTermStorage,Directory shortTermStorage) throws IOException {
  lastModifiedCheck(longTermStorage);
  lastModifiedCheck(shortTermStorage);
  _longTermStorage=longTermStorage;
  _shortTermStorage=shortTermStorage;
  setLockFactory(_longTermStorage.getLockFactory());
}

Fixed version (ground truth):
public JoinDirectory(HdfsDirectory longTermStorage,Directory shortTermStorage) throws IOException {
  lastModifiedCheck(longTermStorage);
  lastModifiedCheck(shortTermStorage);
  _longTermStorage=longTermStorage;
  _shortTermStorage=shortTermStorage;
  setLockFactory(_longTermStorage.getLockFactory());
}
Program: 82305
Project: 82305
Buggy source:
private void watchForOnlineShardNodes(final String cluster){
  WatchChildren watch=new WatchChildren(_zk,ZookeeperPathConstants.getOnlineShardsPath(cluster)).watch(new OnChange(){
    @Override public void action(    List<String> children){
      _onlineShardsNodes.put(cluster,children);
    }
  }
);
  if (_onlineShardsNodesWatchers.putIfAbsent(cluster,watch) != null) {
    watch.close();
  }
}

Fixed version (ground truth):
private void watchForOnlineShardNodes(final String cluster){
  WatchChildren watch=new WatchChildren(_zk,ZookeeperPathConstants.getOnlineShardsPath(cluster));
  watch.watch(new OnChange(){
    @Override public void action(    List<String> children){
      _onlineShardsNodes.put(cluster,children);
    }
  }
);
  if (_onlineShardsNodesWatchers.putIfAbsent(cluster,watch) != null) {
    watch.close();
  }
}
Program: 82306
Project: 82306
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;
    }
    _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");
  }
}

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;
    }
  }
  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);
  }
}
Program: 82308
Project: 82308
Buggy source:
private WatchChildren watchForShardServerChanges(){
  WatchChildren watchOnlineShards=new WatchChildren(_zookeeper,ZookeeperPathConstants.getOnlineShardsPath(_cluster)).watch(new OnChange(){
    private List<String> _prevOnlineShards=new ArrayList<String>();
    @Override public void action(    List<String> onlineShards){
      List<String> oldOnlineShards=_prevOnlineShards;
      _prevOnlineShards=onlineShards;
      _layout.clear();
      LOG.info("String_Node_Str");
      boolean change=false;
      if (oldOnlineShards == null) {
        oldOnlineShards=new ArrayList<String>();
      }
      for (      String oldOnlineShard : oldOnlineShards) {
        if (!onlineShards.contains(oldOnlineShard)) {
          LOG.info("String_Node_Str",oldOnlineShard);
          change=true;
        }
      }
      for (      String onlineShard : onlineShards) {
        if (!oldOnlineShards.contains(onlineShard)) {
          LOG.info("String_Node_Str",onlineShard);
          change=true;
        }
      }
      if (change) {
        LOG.info("String_Node_Str");
      }
    }
  }
);
  return _closer.register(watchOnlineShards);
}

Fixed version (ground truth):
private WatchChildren watchForShardServerChanges(){
  WatchChildren watchOnlineShards=new WatchChildren(_zookeeper,ZookeeperPathConstants.getOnlineShardsPath(_cluster));
  watchOnlineShards.watch(new OnChange(){
    private List<String> _prevOnlineShards=new ArrayList<String>();
    @Override public void action(    List<String> onlineShards){
      List<String> oldOnlineShards=_prevOnlineShards;
      _prevOnlineShards=onlineShards;
      _layout.clear();
      LOG.info("String_Node_Str");
      boolean change=false;
      if (oldOnlineShards == null) {
        oldOnlineShards=new ArrayList<String>();
      }
      for (      String oldOnlineShard : oldOnlineShards) {
        if (!onlineShards.contains(oldOnlineShard)) {
          LOG.info("String_Node_Str",oldOnlineShard);
          change=true;
        }
      }
      for (      String onlineShard : onlineShards) {
        if (!oldOnlineShards.contains(onlineShard)) {
          LOG.info("String_Node_Str",onlineShard);
          change=true;
        }
      }
      if (change) {
        LOG.info("String_Node_Str");
      }
    }
  }
);
  return _closer.register(watchOnlineShards);
}
Program: 82309
Project: 82309
Buggy source:
private IndexReader getReader() throws CorruptIndexException, LockObtainFailedException, IOException {
  RAMDirectory directory=new RAMDirectory();
  IndexWriterConfig conf=new IndexWriterConfig(LUCENE_VERSION,new KeywordAnalyzer());
  IndexWriter writer=new IndexWriter(directory,conf);
  Document doc=new Document();
  doc.add(new Field("String_Node_Str","String_Node_Str",Store.YES,Index.NOT_ANALYZED_NO_NORMS));
  doc.add(new Field("String_Node_Str","String_Node_Str",Store.YES,Index.NOT_ANALYZED_NO_NORMS));
  Document doc1=new Document();
  doc1.add(new Field("String_Node_Str","String_Node_Str",Store.YES,Index.NOT_ANALYZED_NO_NORMS));
  writer.addDocument(doc);
  writer.addDocument(doc1);
  writer.close();
  return IndexReader.open(directory);
}

Fixed version (ground truth):
private IndexReader getReader() throws CorruptIndexException, LockObtainFailedException, IOException {
  RAMDirectory directory=new RAMDirectory();
  IndexWriterConfig conf=new IndexWriterConfig(LUCENE_VERSION,new KeywordAnalyzer());
  IndexWriter writer=new IndexWriter(directory,conf);
  Document doc=new Document();
  doc.add(new StringField("String_Node_Str","String_Node_Str",Store.YES));
  doc.add(new StringField("String_Node_Str","String_Node_Str",Store.YES));
  Document doc1=new Document();
  doc.add(new StringField("String_Node_Str","String_Node_Str",Store.YES));
  writer.addDocument(doc);
  writer.addDocument(doc1);
  writer.close();
  return DirectoryReader.open(directory);
}
Program: 82310
Project: 82310
Buggy source:
private IndexReader getReaderWithDocsHavingFamily() throws CorruptIndexException, LockObtainFailedException, IOException {
  RAMDirectory directory=new RAMDirectory();
  IndexWriterConfig conf=new IndexWriterConfig(LUCENE_VERSION,new KeywordAnalyzer());
  IndexWriter writer=new IndexWriter(directory,conf);
  Document doc=new Document();
  doc.add(new Field("String_Node_Str","String_Node_Str",Store.YES,Index.NOT_ANALYZED_NO_NORMS));
  doc.add(new Field("String_Node_Str","String_Node_Str",Store.YES,Index.NOT_ANALYZED_NO_NORMS));
  Document doc1=new Document();
  doc1.add(new Field("String_Node_Str","String_Node_Str",Store.YES,Index.NOT_ANALYZED_NO_NORMS));
  doc1.add(new Field("String_Node_Str","String_Node_Str",Store.YES,Index.NOT_ANALYZED_NO_NORMS));
  writer.addDocument(doc);
  writer.addDocument(doc1);
  writer.close();
  return IndexReader.open(directory);
}

Fixed version (ground truth):
private IndexReader getReaderWithDocsHavingFamily() throws CorruptIndexException, LockObtainFailedException, IOException {
  RAMDirectory directory=new RAMDirectory();
  IndexWriterConfig conf=new IndexWriterConfig(LUCENE_VERSION,new KeywordAnalyzer());
  IndexWriter writer=new IndexWriter(directory,conf);
  Document doc=new Document();
  doc.add(new StringField("String_Node_Str","String_Node_Str",Store.YES));
  doc.add(new StringField("String_Node_Str","String_Node_Str",Store.YES));
  Document doc1=new Document();
  doc1.add(new StringField("String_Node_Str","String_Node_Str",Store.YES));
  doc1.add(new StringField("String_Node_Str","String_Node_Str",Store.YES));
  writer.addDocument(doc);
  writer.addDocument(doc1);
  writer.close();
  return DirectoryReader.open(directory);
}
Program: 82311
Project: 82311
Buggy source:
public Tables(String cluster){
  this.cluster=cluster;
}

Fixed version (ground truth):
public Tables(String cluster){
  _cluster=cluster;
  _tablesPath=ZookeeperPathConstants.getTablesPath(cluster);
}
Program: 82312
Project: 82312
Buggy source:
@Override public List<String> getTableList(boolean useCache,String cluster){
  if (useCache) {
    Set<String> tables=_tablesPerCluster.get(cluster);
    if (tables != null) {
      return new ArrayList<String>(tables);
    }
  }
  long s=System.nanoTime();
  try {
    checkIfOpen();
    return _zk.getChildren(ZookeeperPathConstants.getTablesPath(cluster),false);
  }
 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 List<String> getTableList(boolean useCache,String cluster){
  if (useCache) {
    Set<String> tables=_tablesPerCluster.get(cluster);
    if (tables != null) {
      return new ArrayList<String>(tables);
    }
  }
  long s=System.nanoTime();
  try {
    checkIfOpen();
    String tablesPath=ZookeeperPathConstants.getTablesPath(cluster);
    return filterTables(tablesPath,_zk.getChildren(tablesPath,false));
  }
 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: 82313
Project: 82313
Buggy source:
@Override public void process(MutatableAction mutatableAction){
  throw new RuntimeException("String_Node_Str");
}

Fixed version (ground truth):
@Override public void process(IndexAction indexAction) throws IOException {
  throw new RuntimeException("String_Node_Str");
}
Program: 82314
Project: 82314
Buggy source:
public abstract void doPostRollback(BlurIndexWriter writer) throws IOException ;

Fixed version (ground truth):
public abstract void doPostRollback(IndexWriter writer) throws IOException ;
Program: 82315
Project: 82315
Buggy source:
public abstract void doPostCommit(BlurIndexWriter writer) throws IOException ;

Fixed version (ground truth):
public abstract void doPostCommit(IndexWriter writer) throws IOException ;
Program: 82316
Project: 82316
Buggy source:
public abstract void doPreRollback(BlurIndexWriter writer) throws IOException ;

Fixed version (ground truth):
public abstract void doPreRollback(IndexWriter writer) throws IOException ;
Program: 82317
Project: 82317
Buggy source:
public abstract void doPreCommit(IndexSearcherClosable indexSearcher,BlurIndexWriter writer) throws IOException ;

Fixed version (ground truth):
public abstract void doPreCommit(IndexSearcherClosable indexSearcher,IndexWriter writer) throws IOException ;
Program: 82318
Project: 82318
Buggy source:
@Override public void doPostRollback(BlurIndexWriter writer) throws IOException {
  LOG.info("String_Node_Str",_shard,_table);
  String name=_dirPath.getName();
  int lastIndexOf=name.lastIndexOf('.');
  String badRowIdsName=name.substring(0,lastIndexOf) + "String_Node_Str";
  fileSystem.rename(_dirPath,new Path(_dirPath.getParent(),badRowIdsName));
}

Fixed version (ground truth):
@Override public void doPostRollback(IndexWriter writer) throws IOException {
  LOG.info("String_Node_Str",_shard,_table);
  String name=_dirPath.getName();
  int lastIndexOf=name.lastIndexOf('.');
  String badRowIdsName=name.substring(0,lastIndexOf) + "String_Node_Str";
  fileSystem.rename(_dirPath,new Path(_dirPath.getParent(),badRowIdsName));
}
Program: 82320
Project: 82320
Buggy source:
@Override public void doPostCommit(BlurIndexWriter writer) throws IOException {
  LOG.info("String_Node_Str",_dirPath,_shard,_table);
  writer.maybeMerge();
  LOG.info("String_Node_Str",_dirPath,_shard,_table);
  fileSystem.delete(_dirPath,true);
  LOG.info("String_Node_Str",_shard,_table);
}

Fixed version (ground truth):
@Override public void doPostCommit(IndexWriter writer) throws IOException {
  LOG.info("String_Node_Str",_dirPath,_shard,_table);
  writer.maybeMerge();
  LOG.info("String_Node_Str",_dirPath,_shard,_table);
  fileSystem.delete(_dirPath,true);
  LOG.info("String_Node_Str",_shard,_table);
}
Program: 82321
Project: 82321
Buggy source:
@Override public void doPreRollback(BlurIndexWriter writer) throws IOException {
  LOG.info("String_Node_Str",_shard,_table);
}

Fixed version (ground truth):
@Override public void doPreRollback(IndexWriter writer) throws IOException {
  LOG.info("String_Node_Str",_shard,_table);
}
Program: 82322
Project: 82322
Buggy source:
@Override public void doPreCommit(IndexSearcherClosable indexSearcher,BlurIndexWriter writer) throws IOException {
}

Fixed version (ground truth):
@Override public void doPreCommit(IndexSearcherClosable indexSearcher,IndexWriter writer) throws IOException {
}
Program: 82323
Project: 82323
Buggy source:
@Override public void doPostCommit(BlurIndexWriter writer){
}

Fixed version (ground truth):
@Override public void doPostCommit(IndexWriter writer){
}
Program: 82324
Project: 82324
Buggy source:
@Override public void doPostRollback(BlurIndexWriter writer){
}

Fixed version (ground truth):
@Override public void doPostRollback(IndexWriter writer){
}
Program: 82325
Project: 82325
Buggy source:
@Override public void doPreRollback(BlurIndexWriter writer){
}

Fixed version (ground truth):
@Override public void doPreRollback(IndexWriter writer){
}
Program: 82326
Project: 82326
Buggy source:
@Override public void doPreCommit(IndexSearcherClosable indexSearcher,BlurIndexWriter writer){
}

Fixed version (ground truth):
@Override public void doPreCommit(IndexSearcherClosable indexSearcher,IndexWriter writer){
}
Program: 82327
Project: 82327
Buggy source:
private void setupWriter(Configuration configuration) throws IOException {
  TableDescriptor tableDescriptor=new TableDescriptor();
  tableDescriptor.setName("String_Node_Str");
  String uuid=UUID.randomUUID().toString();
  tableDescriptor.setTableUri(new Path(_base,"String_Node_Str").toUri().toString());
  tableDescriptor.setShardCount(2);
  TableContext tableContext=TableContext.create(tableDescriptor);
  ShardContext shardContext=ShardContext.create(tableContext,"String_Node_Str");
  Path tablePath=new Path(_base,"String_Node_Str");
  Path shardPath=new Path(tablePath,"String_Node_Str");
  String indexDirName="String_Node_Str" + uuid;
  _path=new Path(shardPath,indexDirName + "String_Node_Str");
  _fileSystem.mkdirs(_path);
  _badRowIdsPath=new Path(shardPath,indexDirName + "String_Node_Str");
  Directory commitDirectory=new HdfsDirectory(configuration,_path);
  Directory mainDirectory=new HdfsDirectory(configuration,shardPath);
  _fieldManager=tableContext.getFieldManager();
  Analyzer analyzerForIndex=_fieldManager.getAnalyzerForIndex();
  IndexWriterConfig conf=new IndexWriterConfig(LUCENE_VERSION,analyzerForIndex);
  conf.setMergePolicy(NoMergePolicy.NO_COMPOUND_FILES);
  _commitWriter=new IndexWriter(commitDirectory,conf.clone());
  _mainWriter=new IndexWriter(mainDirectory,conf.clone());
  BufferStore.initNewBuffer(128,128 * 128);
  _indexImporter=new IndexImporter(_mainWriter,new ReentrantReadWriteLock(),shardContext,TimeUnit.MINUTES,10);
}

Fixed version (ground truth):
private void setupWriter(Configuration configuration) throws IOException {
  TableDescriptor tableDescriptor=new TableDescriptor();
  tableDescriptor.setName("String_Node_Str");
  String uuid=UUID.randomUUID().toString();
  tableDescriptor.setTableUri(new Path(_base,"String_Node_Str").toUri().toString());
  tableDescriptor.setShardCount(2);
  TableContext tableContext=TableContext.create(tableDescriptor);
  ShardContext shardContext=ShardContext.create(tableContext,"String_Node_Str");
  Path tablePath=new Path(_base,"String_Node_Str");
  Path shardPath=new Path(tablePath,"String_Node_Str");
  String indexDirName="String_Node_Str" + uuid;
  _path=new Path(shardPath,indexDirName + "String_Node_Str");
  _fileSystem.mkdirs(_path);
  _badRowIdsPath=new Path(shardPath,indexDirName + "String_Node_Str");
  Directory commitDirectory=new HdfsDirectory(configuration,_path);
  Directory mainDirectory=new HdfsDirectory(configuration,shardPath);
  _fieldManager=tableContext.getFieldManager();
  Analyzer analyzerForIndex=_fieldManager.getAnalyzerForIndex();
  IndexWriterConfig conf=new IndexWriterConfig(LUCENE_VERSION,analyzerForIndex);
  conf.setMergePolicy(NoMergePolicy.NO_COMPOUND_FILES);
  _commitWriter=new IndexWriter(commitDirectory,conf.clone());
  new IndexWriter(mainDirectory,conf.clone()).close();
  _mainWriter=new IndexWriter(mainDirectory,conf.clone());
  BufferStore.initNewBuffer(128,128 * 128);
  _indexImporter=new IndexImporter(getBlurIndex(shardContext,mainDirectory),shardContext,TimeUnit.MINUTES,10);
}
Program: 82328
Project: 82328
Buggy source:
@After public void tearDown() throws IOException {
  IOUtils.closeQuietly(_mainWriter);
  IOUtils.closeQuietly(_indexImporter);
  _base.getFileSystem(configuration).delete(_base,true);
}

Fixed version (ground truth):
@After public void tearDown() throws IOException {
  IOUtils.closeQuietly(_commitWriter);
  IOUtils.closeQuietly(_mainWriter);
  IOUtils.closeQuietly(_indexImporter);
  _base.getFileSystem(configuration).delete(_base,true);
}
Program: 82329
Project: 82329
Buggy source:
protected void registerFieldTypeDefinition(String fieldName,FieldTypeDefinition fieldTypeDefinition){
  _fieldNameToDefMap.put(fieldName,fieldTypeDefinition);
  for (  String alternateFieldName : fieldTypeDefinition.getAlternateFieldNames()) {
    _fieldNameToDefMap.put(alternateFieldName,fieldTypeDefinition);
  }
  String baseFieldName=getBaseFieldName(fieldName);
  String subColumnName=getSubColumnName(fieldName);
  if (subColumnName != null) {
    Set<String> subColumnNames=_columnToSubColumn.get(baseFieldName);
    if (subColumnNames == null) {
      subColumnNames=getConcurrentSet();
      _columnToSubColumn.put(baseFieldName,subColumnNames);
    }
    subColumnNames.add(subColumnName);
  }
}

Fixed version (ground truth):
protected void registerFieldTypeDefinition(String fieldName,FieldTypeDefinition fieldTypeDefinition){
  _fieldNameToDefMap.put(fieldName,fieldTypeDefinition);
  for (  String alternateFieldName : fieldTypeDefinition.getAlternateFieldNames()) {
    _fieldNameToDefMap.put(alternateFieldName,fieldTypeDefinition);
  }
  String subColumnName=getSubColumnName(fieldName);
  if (subColumnName != null) {
    String baseFieldName=getBaseFieldName(fieldName);
    Set<String> subColumnNames=_columnToSubColumn.get(baseFieldName);
    if (subColumnNames == null) {
      subColumnNames=getConcurrentSet();
      _columnToSubColumn.put(baseFieldName,subColumnNames);
    }
    subColumnNames.add(subColumnName);
  }
}
Program: 82330
Project: 82330
Buggy source:
private String getBaseFieldName(String fieldName){
  int indexOf=fieldName.indexOf('.');
  return fieldName.substring(0,indexOf);
}

Fixed version (ground truth):
private String getBaseFieldName(String fieldName){
  return fieldName.substring(0,fieldName.lastIndexOf('.'));
}
Program: 82331
Project: 82331
Buggy source:
@Test public void testFieldManagerMultipleColumnsDifferentNames() throws IOException {
  BaseFieldManager memoryFieldManager=newFieldManager(true);
  memoryFieldManager.addColumnDefinition("String_Node_Str","String_Node_Str",null,false,"String_Node_Str",false,null);
  memoryFieldManager.addColumnDefinition("String_Node_Str","String_Node_Str",null,true,"String_Node_Str",false,null);
  Record record=new Record();
  record.setFamily("String_Node_Str");
  record.setRecordId("String_Node_Str");
  record.addToColumns(new Column("String_Node_Str","String_Node_Str"));
  record.addToColumns(new Column("String_Node_Str","String_Node_Str"));
  List<Field> fields=getFields("String_Node_Str","String_Node_Str","String_Node_Str",newFieldsNoStore(BlurConstants.FIELDS,"String_Node_Str"),newFieldsNoStore(BlurConstants.FIELDS,"String_Node_Str"),newTextField("String_Node_Str","String_Node_Str"),newTextField("String_Node_Str","String_Node_Str"),newTextFieldNoStore(BlurConstants.SUPER,"String_Node_Str"));
  int c=0;
  List<Field> fields2=memoryFieldManager.getFields("String_Node_Str",record);
  System.out.println(fields2);
  for (  Field field : fields2) {
    assertFieldEquals(fields.get(c++),field);
  }
}

Fixed version (ground truth):
@Test public void testFieldManagerMultipleColumnsDifferentNames() throws IOException {
  BaseFieldManager memoryFieldManager=newFieldManager(true);
  memoryFieldManager.addColumnDefinition("String_Node_Str","String_Node_Str",null,false,"String_Node_Str",false,null);
  memoryFieldManager.addColumnDefinition("String_Node_Str","String_Node_Str",null,true,"String_Node_Str",false,null);
  Record record=new Record();
  record.setFamily("String_Node_Str");
  record.setRecordId("String_Node_Str");
  record.addToColumns(new Column("String_Node_Str","String_Node_Str"));
  record.addToColumns(new Column("String_Node_Str","String_Node_Str"));
  List<Field> fields=getFields("String_Node_Str","String_Node_Str","String_Node_Str",newFieldsNoStore(BlurConstants.FIELDS,"String_Node_Str"),newFieldsNoStore(BlurConstants.FIELDS,"String_Node_Str"),newTextField("String_Node_Str","String_Node_Str"),newTextField("String_Node_Str","String_Node_Str"),newTextFieldNoStore(BlurConstants.SUPER,"String_Node_Str"));
  int c=0;
  List<Field> fields2=memoryFieldManager.getFields("String_Node_Str",record);
  for (  Field field : fields2) {
    assertFieldEquals(fields.get(c++),field);
  }
}
Program: 82332
Project: 82332
Buggy source:
private FileIdKey getCacheFileName(CacheDirectory directory,String fileName) throws IOException {
  long fileModified=directory.getFileModified(fileName);
  return new FileIdKey(directory.getDirectoryName(),fileName,fileModified);
}

Fixed version (ground truth):
private FileIdKey getCacheFileName(CacheDirectory directory,String fileName) throws IOException {
  if (directory.fileExists(fileName)) {
    long fileModified=directory.getFileModified(fileName);
    return new FileIdKey(directory.getDirectoryName(),fileName,fileModified);
  }
  return new FileIdKey(directory.getDirectoryName(),fileName,-1L);
}
Program: 82333
Project: 82333
Buggy source:
@Override public void close() throws IOException {
  flushInternal();
  _indexOutput.flush();
  _indexOutput.close();
  _store.putBuffer(_buffer);
}

Fixed version (ground truth):
@Override public void close() throws IOException {
  flushInternal();
  _indexOutput.flush();
  _indexOutput.close();
  _store.putBuffer(_buffer);
  _cache.fileClosedForWriting(_directory,_fileName,_fileId);
}
Program: 82334
Project: 82334
Buggy source:
@Override public long getFileModified(String name) throws IOException {
  return 0;
}

Fixed version (ground truth):
@Override public long getFileModified(String name) throws IOException {
  if (_shortTermStorage.fileExists(name)) {
    return ((LastModified)_shortTermStorage).getFileModified(name);
  }
  return ((LastModified)_longTermStorage).getFileModified(name);
}
Program: 82336
Project: 82336
Buggy source:
public abstract void process(MutatableAction mutatableAction) throws IOException ;

Fixed version (ground truth):
public abstract void process(IndexAction indexAction) throws IOException ;
Program: 82337
Project: 82337
Buggy source:
@Override public void process(MutatableAction mutatableAction) throws IOException {
  _writeLock.lock();
  waitUntilNotNull(_writer);
  BlurIndexWriter writer=_writer.get();
  IndexSearcherClosable indexSearcher=null;
  try {
    indexSearcher=getIndexSearcher();
    mutatableAction.performMutate(indexSearcher,writer);
    commit();
  }
 catch (  Exception e) {
    writer.rollback();
    openWriter();
    throw new IOException("String_Node_Str",e);
  }
 finally {
    if (indexSearcher != null) {
      indexSearcher.close();
    }
    _writeLock.unlock();
  }
}

Fixed version (ground truth):
@Override public void process(IndexAction indexAction) throws IOException {
  _writeLock.lock();
  waitUntilNotNull(_writer);
  BlurIndexWriter writer=_writer.get();
  IndexSearcherClosable indexSearcher=null;
  try {
    indexSearcher=getIndexSearcher();
    indexAction.performMutate(indexSearcher,writer);
    indexAction.doPreCommit(indexSearcher,writer);
    commit();
    indexAction.doPostCommit(writer);
  }
 catch (  Exception e) {
    indexAction.doPreRollback(writer);
    writer.rollback();
    openWriter();
    indexAction.doPostRollback(writer);
    throw new IOException("String_Node_Str",e);
  }
 finally {
    if (indexSearcher != null) {
      indexSearcher.close();
    }
    _writeLock.unlock();
  }
}