Program: 167263
Project: 167263
Buggy source:
@Override public void open() throws IOException {
  FlumeConfiguration conf=FlumeConfiguration.get();
  FileSystem hdfs;
  if (conf.getCollectorDfsCompressGzipStatus()) {
    LOG.warn("String_Node_Str" + FlumeConfiguration.COLLECTOR_DFS_COMPRESS_GZIP + "String_Node_Str"+ FlumeConfiguration.COLLECTOR_DFS_COMPRESS_CODEC+ "String_Node_Str");
    CompressionCodec gzipC=new GzipCodec();
    Compressor gzCmp=gzipC.createCompressor();
    dstPath=new Path(path + gzipC.getDefaultExtension());
    hdfs=dstPath.getFileSystem(conf);
    writer=hdfs.create(dstPath);
    writer=gzipC.createOutputStream(writer,gzCmp);
    LOG.info("String_Node_Str" + dstPath.toString());
    return;
  }
  String codecName=conf.getCollectorDfsCompressCodec();
  List<Class<? extends CompressionCodec>> codecs=CompressionCodecFactory.getCodecClasses(FlumeConfiguration.get());
  CompressionCodec codec=null;
  ArrayList<String> codecStrs=new ArrayList<String>();
  codecStrs.add("String_Node_Str");
  for (  Class<? extends CompressionCodec> cls : codecs) {
    codecStrs.add(cls.getSimpleName());
    if (cls.getSimpleName().equals(codecName)) {
      try {
        codec=cls.newInstance();
      }
 catch (      InstantiationException e) {
        LOG.error("String_Node_Str" + codec + "String_Node_Str");
      }
catch (      IllegalAccessException e) {
        LOG.error("String_Node_Str" + codec + "String_Node_Str");
      }
    }
  }
  if (codec == null) {
    if (!codecName.equals("String_Node_Str")) {
      LOG.warn("String_Node_Str" + codecName + "String_Node_Str"+ codecStrs);
    }
    dstPath=new Path(path);
    hdfs=dstPath.getFileSystem(conf);
    writer=hdfs.create(dstPath);
    LOG.info("String_Node_Str" + dstPath.toString());
    return;
  }
  Compressor cmp=codec.createCompressor();
  dstPath=new Path(path + codec.getDefaultExtension());
  hdfs=dstPath.getFileSystem(conf);
  writer=hdfs.create(dstPath);
  try {
    writer=codec.createOutputStream(writer,cmp);
  }
 catch (  NullPointerException npe) {
    LOG.error("String_Node_Str" + codec);
    throw new IOException("String_Node_Str" + codec);
  }
  LOG.info("String_Node_Str" + codec + "String_Node_Str"+ dstPath.toString());
  return;
}

Fixed version (ground truth):
@Override public void open() throws IOException {
  FlumeConfiguration conf=FlumeConfiguration.get();
  FileSystem hdfs;
  if (conf.getCollectorDfsCompressGzipStatus()) {
    LOG.warn("String_Node_Str" + FlumeConfiguration.COLLECTOR_DFS_COMPRESS_GZIP + "String_Node_Str"+ FlumeConfiguration.COLLECTOR_DFS_COMPRESS_CODEC+ "String_Node_Str");
    CompressionCodec gzipC=new GzipCodec();
    Compressor gzCmp=gzipC.createCompressor();
    dstPath=new Path(path + gzipC.getDefaultExtension());
    hdfs=dstPath.getFileSystem(conf);
    writer=hdfs.create(dstPath);
    writer=gzipC.createOutputStream(writer,gzCmp);
    LOG.info("String_Node_Str" + dstPath.toString());
    return;
  }
  String codecName=conf.getCollectorDfsCompressCodec();
  List<Class<? extends CompressionCodec>> codecs=CompressionCodecFactory.getCodecClasses(FlumeConfiguration.get());
  CompressionCodec codec=null;
  ArrayList<String> codecStrs=new ArrayList<String>();
  codecStrs.add("String_Node_Str");
  for (  Class<? extends CompressionCodec> cls : codecs) {
    codecStrs.add(cls.getSimpleName());
    if (cls.getSimpleName().equals(codecName)) {
      try {
        codec=cls.newInstance();
      }
 catch (      InstantiationException e) {
        LOG.error("String_Node_Str" + codec + "String_Node_Str");
      }
catch (      IllegalAccessException e) {
        LOG.error("String_Node_Str" + codec + "String_Node_Str");
      }
    }
  }
  if (codec == null) {
    if (!codecName.equals("String_Node_Str")) {
      LOG.warn("String_Node_Str" + codecName + "String_Node_Str"+ codecStrs);
    }
    dstPath=new Path(path);
    hdfs=dstPath.getFileSystem(conf);
    writer=hdfs.create(dstPath);
    LOG.info("String_Node_Str" + dstPath.toString());
    return;
  }
  Compressor cmp=codec.createCompressor();
  dstPath=new Path(path + codec.getDefaultExtension());
  hdfs=dstPath.getFileSystem(conf);
  writer=hdfs.create(dstPath);
  try {
    writer=codec.createOutputStream(writer,cmp);
  }
 catch (  NullPointerException npe) {
    LOG.error("String_Node_Str" + codec);
    throw new IOException("String_Node_Str" + codec);
  }
  LOG.info("String_Node_Str" + codec + "String_Node_Str"+ dstPath.toString());
}