Program: 82307
Project: 82307
Buggy source:
private BlurIndex openShard(String table,String shard) throws IOException {
  LOG.info("String_Node_Str",shard,table);
  TableContext tableContext=getTableContext(table);
  Path tablePath=tableContext.getTablePath();
  Path hdfsDirPath=new Path(tablePath,shard);
  BlurLockFactory lockFactory=new BlurLockFactory(_configuration,hdfsDirPath,_nodeName,BlurUtil.getPid());
  HdfsDirectory longTermStorage=new HdfsDirectory(_configuration,hdfsDirPath);
  longTermStorage.setLockFactory(lockFactory);
  Directory directory;
  URI uri=hdfsDirPath.toUri();
  String scheme=uri.getScheme();
  if (scheme != null && scheme.equals("String_Node_Str")) {
    LOG.info("String_Node_Str",shard,table);
    FastHdfsKeyValueDirectory shortTermStorage=new FastHdfsKeyValueDirectory(_configuration,new Path(hdfsDirPath,"String_Node_Str"));
    directory=new JoinDirectory(longTermStorage,shortTermStorage);
  }
 else {
    directory=longTermStorage;
  }
  ShardContext shardContext=ShardContext.create(tableContext,shard);
  Directory dir;
  TableDescriptor descriptor=tableContext.getDescriptor();
  boolean blockCacheEnabled=descriptor.isBlockCaching();
  if (blockCacheEnabled) {
    Set<String> blockCacheFileTypes=descriptor.getBlockCachingFileTypes();
    dir=_blockCacheDirectoryFactory.newDirectory(table,shard,directory,blockCacheFileTypes);
  }
 else {
    dir=directory;
  }
  BlurIndex index=tableContext.newInstanceBlurIndex(shardContext,dir,_mergeScheduler,_gc,_searchExecutor,_indexCloser,_refresher,_warmup);
  if (_clusterStatus.isReadOnly(true,_cluster,table)) {
    index=new BlurIndexReadOnly(index);
  }
  _filterCache.opening(table,shard,index);
  TableDescriptor tableDescriptor=_clusterStatus.getTableDescriptor(true,_cluster,table);
  warmUp(index,tableDescriptor,shard);
  return index;
}

Fixed version (ground truth):
private BlurIndex openShard(String table,String shard) throws IOException {
  LOG.info("String_Node_Str",shard,table);
  TableContext tableContext=getTableContext(table);
  Path tablePath=tableContext.getTablePath();
  Path hdfsDirPath=new Path(tablePath,shard);
  BlurLockFactory lockFactory=new BlurLockFactory(_configuration,hdfsDirPath,_nodeName,BlurUtil.getPid());
  HdfsDirectory longTermStorage=new HdfsDirectory(_configuration,hdfsDirPath);
  longTermStorage.setLockFactory(lockFactory);
  Directory directory;
  URI uri=hdfsDirPath.toUri();
  String scheme=uri.getScheme();
  if (scheme != null && scheme.equals("String_Node_Str")) {
    LOG.info("String_Node_Str",shard,table);
    FastHdfsKeyValueDirectory shortTermStorage=new FastHdfsKeyValueDirectory(_configuration,new Path(hdfsDirPath,"String_Node_Str"));
    directory=new JoinDirectory(longTermStorage,shortTermStorage);
  }
 else {
    directory=longTermStorage;
  }
  ShardContext shardContext=ShardContext.create(tableContext,shard);
  TableDescriptor descriptor=tableContext.getDescriptor();
  boolean blockCacheEnabled=descriptor.isBlockCaching();
  if (blockCacheEnabled) {
    Set<String> blockCacheFileTypes=descriptor.getBlockCachingFileTypes();
    directory=_blockCacheDirectoryFactory.newDirectory(table,shard,directory,blockCacheFileTypes);
  }
  BlurIndex index=tableContext.newInstanceBlurIndex(shardContext,directory,_mergeScheduler,_gc,_searchExecutor,_indexCloser,_refresher,_warmup);
  if (_clusterStatus.isReadOnly(true,_cluster,table)) {
    index=new BlurIndexReadOnly(index);
  }
  _filterCache.opening(table,shard,index);
  TableDescriptor tableDescriptor=_clusterStatus.getTableDescriptor(true,_cluster,table);
  warmUp(index,tableDescriptor,shard);
  return index;
}