Program: 189049
Project: 189049
Buggy source:
public void export(){
  if (args.length < 1 || args.length > 2) {
    System.err.println(args.length + "String_Node_Str");
    System.out.println(DenisTest.class.getSimpleName() + "String_Node_Str");
    System.exit(-1);
  }
  SGID sgid=Utility.parseSGID(args[0]);
  FeatureSet fSet=SWQEFactory.getQueryInterface().getLatestAtomBySGID(sgid,FeatureSet.class);
  if (fSet == null) {
    System.out.println("String_Node_Str");
    System.exit(-2);
  }
  QueryFuture<FeatureSet> future=SWQEFactory.getQueryInterface().getFeatures(0,fSet);
  BufferedWriter outputStream=null;
  try {
    if (args.length == 2) {
      outputStream=new BufferedWriter(new FileWriter(args[1]));
    }
 else {
      outputStream=new BufferedWriter(new OutputStreamWriter(System.out));
    }
    outputStream.append("String_Node_Str");
    boolean caughtNonVCF=false;
    for (    Feature feature : future.get()) {
      outputStream.append(feature.getSeqid() + "String_Node_Str" + (feature.getStart() + 1)+ "String_Node_Str");
      if (feature.getTagByKey(ImportConstants.VCF_SECOND_ID) == null) {
        outputStream.append("String_Node_Str");
      }
 else {
        outputStream.append(feature.getTagByKey(ImportConstants.VCF_SECOND_ID).getValue().toString() + "String_Node_Str");
      }
      try {
        outputStream.append(feature.getTagByKey(ImportConstants.VCF_REFERENCE_BASE).getValue().toString() + "String_Node_Str");
        outputStream.append(feature.getTagByKey(ImportConstants.VCF_CALLED_BASE).getValue().toString() + "String_Node_Str");
        outputStream.append(feature.getScore() + "String_Node_Str");
        outputStream.append(feature.getTagByKey(ImportConstants.VCF_FILTER).getValue().toString() + "String_Node_Str");
        outputStream.append(feature.getTagByKey(ImportConstants.VCF_INFO).getValue().toString());
      }
 catch (      NullPointerException npe) {
        if (!caughtNonVCF) {
          Logger.getLogger(DenisTest.class.getName()).log(Level.INFO,"String_Node_Str");
        }
        caughtNonVCF=true;
      }
      outputStream.newLine();
    }
  }
 catch (  Exception e) {
    Logger.getLogger(DenisTest.class.getName()).log(Level.SEVERE,"String_Node_Str",e);
    System.exit(-1);
  }
 finally {
    try {
      outputStream.flush();
      outputStream.close();
      SWQEFactory.getStorage().closeStorage();
    }
 catch (    IOException ex) {
      Logger.getLogger(DenisTest.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
    }
  }
}

Fixed version (ground truth):
public void export(){
  SGID sgid=Utility.parseSGID("String_Node_Str");
  FeatureSet fSet=SWQEFactory.getQueryInterface().getLatestAtomBySGID(sgid,FeatureSet.class);
  if (fSet == null) {
    System.out.println("String_Node_Str");
    System.exit(-2);
  }
  QueryFuture<FeatureSet> future=SWQEFactory.getQueryInterface().getFeaturesByAttributes(1,fSet,new RPNStack(new RPNStack.TagOccurrence("String_Node_Str")));
  BufferedWriter outputStream=null;
  try {
    if (args.length == 2) {
      outputStream=new BufferedWriter(new FileWriter(args[1]));
    }
 else {
      outputStream=new BufferedWriter(new OutputStreamWriter(System.out));
    }
    outputStream.append("String_Node_Str");
    boolean caughtNonVCF=false;
    for (    Feature feature : future.get()) {
      outputStream.append(feature.getSeqid() + "String_Node_Str" + (feature.getStart() + 1)+ "String_Node_Str");
      if (feature.getTagByKey(ImportConstants.VCF_SECOND_ID) == null) {
        outputStream.append("String_Node_Str");
      }
 else {
        outputStream.append(feature.getTagByKey(ImportConstants.VCF_SECOND_ID).getValue().toString() + "String_Node_Str");
      }
      try {
        outputStream.append(feature.getTagByKey(ImportConstants.VCF_REFERENCE_BASE).getValue().toString() + "String_Node_Str");
        outputStream.append(feature.getTagByKey(ImportConstants.VCF_CALLED_BASE).getValue().toString() + "String_Node_Str");
        outputStream.append(feature.getScore() + "String_Node_Str");
        outputStream.append(feature.getTagByKey(ImportConstants.VCF_FILTER).getValue().toString() + "String_Node_Str");
        outputStream.append(feature.getTagByKey(ImportConstants.VCF_INFO).getValue().toString());
      }
 catch (      NullPointerException npe) {
        if (!caughtNonVCF) {
          Logger.getLogger(DenisTest.class.getName()).log(Level.INFO,"String_Node_Str");
        }
        caughtNonVCF=true;
      }
      outputStream.newLine();
    }
  }
 catch (  Exception e) {
    Logger.getLogger(DenisTest.class.getName()).log(Level.SEVERE,"String_Node_Str",e);
    System.exit(-1);
  }
 finally {
    try {
      outputStream.flush();
      outputStream.close();
      SWQEFactory.getStorage().closeStorage();
    }
 catch (    IOException ex) {
      Logger.getLogger(DenisTest.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
    }
  }
}