Program: 12607
Project: 12607
Buggy source:
/** 
 * Command line method for reading an input file and producing an output file.  <p> By default, validations on compliance and completeness are performed, and types for top-level objects are not used in URIs. <p> Options: <p>  "-t" uses types in URIs, <p> "-i" turns off completeness checking, <p> "-b" turns on best practice checking, <p> "-n" indicates a non-compliant SBOL document, <p> "-g" indicates conversion of GenBank file, <p> "-c" specifies a selected top-level component definition <p> "-o" specifies an output filename, <p> "-p" specifies the default URI prefix of the output file, <p> "-v" specifies version to use for converted objects,  <p> "-f" fail on first error, and <p> "-d" show detailed error trace.
 * @param args
 */
public static void main(String[] args){
  String fileName="String_Node_Str";
  String outputFile="String_Node_Str";
  String componentDefinitionStr="String_Node_Str";
  String URIPrefix="String_Node_Str";
  String version="String_Node_Str";
  boolean complete=true;
  boolean compliant=true;
  boolean typesInURI=false;
  boolean bestPractice=false;
  boolean keepGoing=true;
  boolean showDetail=false;
  boolean genBankIn=false;
  boolean genBankOut=false;
  int i=0;
  while (i < args.length) {
    if (args[i].equals("String_Node_Str")) {
      complete=false;
    }
 else     if (args[i].equals("String_Node_Str")) {
      typesInURI=true;
    }
 else     if (args[i].equals("String_Node_Str")) {
      bestPractice=true;
    }
 else     if (args[i].equals("String_Node_Str")) {
      compliant=false;
    }
 else     if (args[i].equals("String_Node_Str")) {
      genBankIn=true;
    }
 else     if (args[i].equals("String_Node_Str")) {
      keepGoing=false;
    }
 else     if (args[i].equals("String_Node_Str")) {
      showDetail=true;
    }
 else     if (args[i].equals("String_Node_Str")) {
      genBankOut=true;
      if (i + 1 >= args.length) {
        usage();
      }
      componentDefinitionStr=args[i + 1];
      i++;
    }
 else     if (args[i].equals("String_Node_Str")) {
      if (i + 1 >= args.length) {
        usage();
      }
      outputFile=args[i + 1];
      i++;
    }
 else     if (args[i].equals("String_Node_Str")) {
      if (i + 1 >= args.length) {
        usage();
      }
      URIPrefix=args[i + 1];
      i++;
    }
 else     if (args[i].equals("String_Node_Str")) {
      if (i + 1 >= args.length) {
        usage();
      }
      version=args[i + 1];
      i++;
    }
 else     if (fileName.equals("String_Node_Str")) {
      fileName=args[i];
    }
 else {
      usage();
    }
    i++;
  }
  if (fileName.equals("String_Node_Str"))   usage();
  try {
    SBOLDocument doc=null;
    if (genBankIn) {
      if (!URIPrefix.equals("String_Node_Str")) {
        GenBank.setURIPrefix(URIPrefix);
      }
      doc=GenBank.read(fileName);
    }
 else {
      if (!URIPrefix.equals("String_Node_Str")) {
        SBOLReader.setURIPrefix(URIPrefix);
      }
      if (!compliant) {
        SBOLReader.setCompliant(false);
      }
      SBOLReader.setTypesInURI(typesInURI);
      SBOLReader.setVersion(version);
      SBOLReader.setKeepGoing(keepGoing);
      if (SBOLReader.getSBOLVersion(fileName).equals(SBOLReader.SBOLVERSION1)) {
        System.err.println("String_Node_Str");
      }
      doc=SBOLReader.read(fileName);
      doc.setTypesInURIs(typesInURI);
    }
    validateSBOL(doc,complete,compliant,bestPractice);
    if (getNumErrors() == 0 && SBOLReader.getNumErrors() == 0) {
      if (outputFile.equals("String_Node_Str")) {
        if (genBankOut) {
          ComponentDefinition componentDefinition=doc.getComponentDefinition(URI.create(componentDefinitionStr));
          GenBank.write(componentDefinition,(System.out));
        }
 else {
          SBOLWriter.write(doc,(System.out));
        }
      }
 else {
        System.out.println("String_Node_Str");
        if (genBankOut) {
          ComponentDefinition componentDefinition=doc.getComponentDefinition(URI.create(componentDefinitionStr));
          GenBank.write(componentDefinition,outputFile);
        }
 else {
          SBOLWriter.write(doc,outputFile);
        }
      }
    }
 else {
      for (      String error : SBOLReader.getErrors()) {
        System.err.println(error);
      }
      for (      String error : getErrors()) {
        System.err.println(error);
      }
      System.err.println("String_Node_Str");
    }
  }
 catch (  Exception e) {
    if (showDetail) {
      e.printStackTrace();
    }
    System.err.println(e.getMessage() + "String_Node_Str");
  }
catch (  Throwable e) {
    if (showDetail) {
      e.printStackTrace();
    }
    System.err.println(e.getMessage() + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Command line method for reading an input file and producing an output file.  <p> By default, validations on compliance and completeness are performed, and types for top-level objects are not used in URIs. <p> Options: <p>  "-t" uses types in URIs, <p> "-i" turns off completeness checking, <p> "-b" turns on best practice checking, <p> "-n" indicates a non-compliant SBOL document, <p> "-g" indicates conversion of GenBank file, <p> "-c" specifies a selected top-level component definition <p> "-o" specifies an output filename, <p> "-p" specifies the default URI prefix of the output file, <p> "-v" specifies version to use for converted objects,  <p> "-f" fail on first error, and <p> "-d" show detailed error trace.
 * @param args
 */
public static void main(String[] args){
  String fileName="String_Node_Str";
  String outputFile="String_Node_Str";
  String componentDefinitionStr="String_Node_Str";
  String URIPrefix="String_Node_Str";
  String version="String_Node_Str";
  boolean complete=true;
  boolean compliant=true;
  boolean typesInURI=false;
  boolean bestPractice=false;
  boolean keepGoing=true;
  boolean showDetail=false;
  boolean genBankIn=false;
  boolean genBankOut=false;
  int i=0;
  while (i < args.length) {
    if (args[i].equals("String_Node_Str")) {
      complete=false;
    }
 else     if (args[i].equals("String_Node_Str")) {
      typesInURI=true;
    }
 else     if (args[i].equals("String_Node_Str")) {
      bestPractice=true;
    }
 else     if (args[i].equals("String_Node_Str")) {
      compliant=false;
    }
 else     if (args[i].equals("String_Node_Str")) {
      genBankIn=true;
    }
 else     if (args[i].equals("String_Node_Str")) {
      keepGoing=false;
    }
 else     if (args[i].equals("String_Node_Str")) {
      showDetail=true;
    }
 else     if (args[i].equals("String_Node_Str")) {
      genBankOut=true;
      if (i + 1 >= args.length) {
        usage();
      }
      componentDefinitionStr=args[i + 1];
      i++;
    }
 else     if (args[i].equals("String_Node_Str")) {
      if (i + 1 >= args.length) {
        usage();
      }
      outputFile=args[i + 1];
      i++;
    }
 else     if (args[i].equals("String_Node_Str")) {
      if (i + 1 >= args.length) {
        usage();
      }
      URIPrefix=args[i + 1];
      i++;
    }
 else     if (args[i].equals("String_Node_Str")) {
      if (i + 1 >= args.length) {
        usage();
      }
      version=args[i + 1];
      i++;
    }
 else     if (fileName.equals("String_Node_Str")) {
      fileName=args[i];
    }
 else {
      usage();
    }
    i++;
  }
  if (fileName.equals("String_Node_Str"))   usage();
  try {
    SBOLDocument doc=null;
    if (genBankIn) {
      if (!URIPrefix.equals("String_Node_Str")) {
        GenBank.setURIPrefix(URIPrefix);
      }
      doc=GenBank.read(fileName);
    }
 else {
      if (!URIPrefix.equals("String_Node_Str")) {
        SBOLReader.setURIPrefix(URIPrefix);
      }
      if (!compliant) {
        SBOLReader.setCompliant(false);
      }
      SBOLReader.setTypesInURI(typesInURI);
      SBOLReader.setVersion(version);
      SBOLReader.setKeepGoing(keepGoing);
      if (SBOLReader.getSBOLVersion(fileName).equals(SBOLReader.SBOLVERSION1)) {
        System.err.println("String_Node_Str");
      }
      doc=SBOLReader.read(fileName);
      doc.setTypesInURIs(typesInURI);
    }
    validateSBOL(doc,complete,compliant,bestPractice);
    if (getNumErrors() == 0 && SBOLReader.getNumErrors() == 0) {
      if (outputFile.equals("String_Node_Str")) {
        if (genBankOut) {
          ComponentDefinition componentDefinition=doc.getComponentDefinition(URI.create(componentDefinitionStr));
          GenBank.write(componentDefinition,(System.out));
        }
 else {
          SBOLWriter.write(doc,(System.out));
        }
      }
 else {
        System.out.println("String_Node_Str");
        if (genBankOut) {
          ComponentDefinition componentDefinition=doc.getComponentDefinition(URI.create(componentDefinitionStr));
          GenBank.write(componentDefinition,outputFile);
        }
 else {
          SBOLWriter.write(doc,outputFile);
        }
      }
    }
 else {
      if (getNumErrors() != 0) {
        for (        String error : getErrors()) {
          System.err.println(error);
        }
      }
      if (SBOLReader.getNumErrors() != 0) {
        for (        String error : SBOLReader.getErrors()) {
          System.err.println(error);
        }
      }
      System.err.println("String_Node_Str");
    }
  }
 catch (  Exception e) {
    if (showDetail) {
      e.printStackTrace();
    }
    System.err.println(e.getMessage() + "String_Node_Str");
  }
catch (  Throwable e) {
    if (showDetail) {
      e.printStackTrace();
    }
    System.err.println(e.getMessage() + "String_Node_Str");
  }
}