Program: 82135
Project: 82135
Buggy source:
public HdfsDirectory(Configuration configuration,Path path,SequentialReadControl sequentialReadControl,Collection<String> filesToExpose) throws IOException {
  if (sequentialReadControl == null) {
    _sequentialReadControl=new SequentialReadControl(new BlurConfiguration());
  }
 else {
    _sequentialReadControl=sequentialReadControl;
  }
  _fileSystem=path.getFileSystem(configuration);
  _path=_fileSystem.makeQualified(path);
  if (_path.toUri().getScheme().equals(HDFS_SCHEMA)) {
    _asyncClosing=true;
  }
 else {
    _asyncClosing=false;
  }
  _fileSystem.mkdirs(path);
  setLockFactory(NoLockFactory.getNoLockFactory());
synchronized (_metricsGroupMap) {
    URI uri=_fileSystem.getUri();
    MetricsGroup metricsGroup=_metricsGroupMap.get(uri);
    if (metricsGroup == null) {
      String scope=uri.toString();
      metricsGroup=createNewMetricsGroup(scope);
      _metricsGroupMap.put(uri,metricsGroup);
    }
    _metricsGroup=metricsGroup;
  }
  _hostname=InetAddress.getLocalHost().getHostName();
  LOG.info("String_Node_Str",_hostname,_path);
  _reportOnBlockLocality=reportOnBlockLocality();
  TIMER.schedule(_reportOnBlockLocality,TimeUnit.SECONDS.toMillis(30),TimeUnit.SECONDS.toMillis(30));
  if (_useCache) {
    if (filesToExpose == null) {
      FileStatus[] listStatus=_fileSystem.listStatus(_path);
      for (      FileStatus fileStatus : listStatus) {
        addToCache(fileStatus);
      }
    }
 else {
      for (      String file : filesToExpose) {
        Path filePath=getPathOrSymlinkForDelete(file);
        try {
          FileStatus fileStatus=_fileSystem.getFileStatus(filePath);
          if (fileStatus != null) {
            addToCache(fileStatus);
          }
        }
 catch (        FileNotFoundException e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
public HdfsDirectory(Configuration configuration,Path path,SequentialReadControl sequentialReadControl,Collection<String> filesToExpose) throws IOException {
  if (sequentialReadControl == null) {
    _sequentialReadControl=new SequentialReadControl(new BlurConfiguration());
  }
 else {
    _sequentialReadControl=sequentialReadControl;
  }
  _fileSystem=path.getFileSystem(configuration);
  _path=_fileSystem.makeQualified(path);
  if (_path.toUri().getScheme().equals(HDFS_SCHEMA)) {
    _asyncClosing=true;
  }
 else {
    _asyncClosing=false;
  }
  _fileSystem.mkdirs(path);
  setLockFactory(NoLockFactory.getNoLockFactory());
synchronized (_metricsGroupMap) {
    URI uri=_fileSystem.getUri();
    MetricsGroup metricsGroup=_metricsGroupMap.get(uri);
    if (metricsGroup == null) {
      String scope=uri.toString();
      metricsGroup=createNewMetricsGroup(scope);
      _metricsGroupMap.put(uri,metricsGroup);
    }
    _metricsGroup=metricsGroup;
  }
  _hostname=InetAddress.getLocalHost().getHostName();
  LOG.info("String_Node_Str",_hostname,_path);
  _reportOnBlockLocality=reportOnBlockLocality();
  TIMER.schedule(_reportOnBlockLocality,TimeUnit.SECONDS.toMillis(30),TimeUnit.SECONDS.toMillis(30));
  if (_useCache) {
    if (filesToExpose == null) {
      FileStatus[] listStatus=_fileSystem.listStatus(_path);
      for (      FileStatus fileStatus : listStatus) {
        addToCache(fileStatus);
      }
    }
 else {
      for (      String file : filesToExpose) {
        Path filePath=getPathOrSymlinkForDelete(file);
        try {
          FileStatus fileStatus=_fileSystem.getFileStatus(filePath);
          if (fileStatus != null) {
            addToCache(fileStatus);
          }
        }
 catch (        FileNotFoundException e) {
          LOG.info("String_Node_Str",file,filePath);
        }
      }
    }
  }
}