Program: 189066
Project: 189066
Buggy source:
/** 
 * Import a set of Tag specifications into a new TagSet.
 * @param args
 * @return
 */
public static SGID mainMethod(String[] args){
  if (args.length < 1) {
    System.err.println("String_Node_Str" + args.length + "String_Node_Str");
    System.out.println(OBOImporter.class.getSimpleName() + "String_Node_Str");
    System.exit(FeatureImporter.EXIT_CODE_INVALID_ARGS);
  }
  InputStream inStream=null;
  try {
    File file=new File(args[0]);
    OboParser parser=new OboParser();
    inStream=new FileInputStream(file);
    BufferedReader oboFile=new BufferedReader(new InputStreamReader(inStream));
    File outputFile=null;
    if (args.length == 2) {
      outputFile=Utility.checkOutput(args[1]);
    }
    Ontology ontology=parser.parseOBO(oboFile,"String_Node_Str","String_Node_Str");
    Set keys=ontology.getTerms();
    Iterator iter=keys.iterator();
    Pattern p=Pattern.compile("String_Node_Str");
    CreateUpdateManager modelManager=SWQEFactory.getModelManager();
    TagSet tagSet=modelManager.buildTagSet().setName("String_Node_Str").build();
    while (iter.hasNext()) {
      Term term=(Term)iter.next();
      if (!p.matcher(term.getName()).matches()) {
        Logger.getLogger(OBOImporter.class.getName()).trace("String_Node_Str" + term.getDescription() + "String_Node_Str"+ term.getName());
        continue;
      }
      if (term.getAnnotation().containsProperty("String_Node_Str")) {
        Object property=term.getAnnotation().getProperty("String_Node_Str");
        if (property.equals(true)) {
          continue;
        }
      }
      Logger.getLogger(OBOImporter.class.getName()).trace("String_Node_Str" + term.getDescription() + "String_Node_Str"+ term.getName());
      String key1=term.getName() + "String_Node_Str" + term.getDescription();
      Logger.getLogger(OBOImporter.class.getName()).trace("String_Node_Str" + key1);
      tagSet.add(modelManager.buildTag().setKey(key1).build());
      String key2=term.getName();
      Logger.getLogger(OBOImporter.class.getName()).trace("String_Node_Str" + key2);
      tagSet.add(modelManager.buildTag().setKey(key2).build());
      List<Synonym> synonyms=parser.getSynonymMap().get(term);
      if (synonyms == null) {
        continue;
      }
      for (      Synonym syn : synonyms) {
        String key3=term.getName() + "String_Node_Str" + syn.getName();
        Logger.getLogger(OBOImporter.class.getName()).trace("String_Node_Str" + key3);
        tagSet.add(modelManager.buildTag().setKey(key3).build());
      }
    }
    Logger.getLogger(OBOImporter.class.getName()).info("String_Node_Str" + tagSet.getCount() + "String_Node_Str");
    modelManager.close();
    SWQEFactory.getStorage().closeStorage();
    System.out.println(tagSet.getCount() + "String_Node_Str");
    String outputID=tagSet.getSGID().getUuid().toString();
    System.out.println(outputID);
    Map<String,String> keyValues=new HashMap<String,String>();
    keyValues.put("String_Node_Str",outputID);
    Utility.writeKeyValueFile(outputFile,keyValues);
    return tagSet.getSGID();
  }
 catch (  ParseException ex) {
    Logger.getLogger(OBOImporter.class.getName()).fatal(null,ex);
  }
catch (  IOException ex) {
    Logger.getLogger(OBOImporter.class.getName()).fatal(null,ex);
  }
 finally {
    try {
      inStream.close();
    }
 catch (    IOException ex) {
      Logger.getLogger(OBOImporter.class.getName()).fatal(null,ex);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Import a set of Tag specifications into a new TagSet.
 * @param args
 * @return
 */
public static SGID mainMethod(String[] args){
  if (args.length < 1) {
    System.err.println("String_Node_Str" + args.length + "String_Node_Str");
    System.out.println(OBOImporter.class.getSimpleName() + "String_Node_Str" + TAG_CHAR+ "String_Node_Str");
    System.exit(FeatureImporter.EXIT_CODE_INVALID_ARGS);
  }
  Options options=new Options();
  Option option1=OptionBuilder.withArgName("String_Node_Str").withDescription("String_Node_Str").isRequired(false).hasArgs(1).create(TAG_CHAR);
  options.addOption(option1);
  String friendlyName=null;
  try {
    CommandLineParser clparser=new PosixParser();
    CommandLine cmd=clparser.parse(options,args);
    friendlyName=cmd.getOptionValue(TAG_CHAR);
    args=cmd.getArgs();
  }
 catch (  org.apache.commons.cli.ParseException ex) {
    Logger.getLogger(OBOImporter.class.getName()).info(null,ex);
  }
  InputStream inStream=null;
  try {
    File file=new File(args[0]);
    OboParser parser=new OboParser();
    inStream=new FileInputStream(file);
    BufferedReader oboFile=new BufferedReader(new InputStreamReader(inStream));
    File outputFile=null;
    if (args.length == 2) {
      outputFile=Utility.checkOutput(args[1]);
    }
    Ontology ontology=parser.parseOBO(oboFile,"String_Node_Str","String_Node_Str");
    Set keys=ontology.getTerms();
    Iterator iter=keys.iterator();
    Pattern p=Pattern.compile("String_Node_Str");
    CreateUpdateManager modelManager=SWQEFactory.getModelManager();
    TagSet tagSet;
    if (friendlyName == null) {
      tagSet=modelManager.buildTagSet().setName("String_Node_Str").build();
    }
 else {
      tagSet=modelManager.buildTagSet().setName("String_Node_Str").setFriendlyRowKey(friendlyName).build();
    }
    while (iter.hasNext()) {
      Term term=(Term)iter.next();
      if (!p.matcher(term.getName()).matches()) {
        Logger.getLogger(OBOImporter.class.getName()).trace("String_Node_Str" + term.getDescription() + "String_Node_Str"+ term.getName());
        continue;
      }
      if (term.getAnnotation().containsProperty("String_Node_Str")) {
        Object property=term.getAnnotation().getProperty("String_Node_Str");
        if (property.equals(true)) {
          continue;
        }
      }
      Logger.getLogger(OBOImporter.class.getName()).trace("String_Node_Str" + term.getDescription() + "String_Node_Str"+ term.getName());
      String key1=term.getName() + "String_Node_Str" + term.getDescription();
      Logger.getLogger(OBOImporter.class.getName()).trace("String_Node_Str" + key1);
      tagSet.add(modelManager.buildTag().setKey(key1).build());
      String key2=term.getName();
      Logger.getLogger(OBOImporter.class.getName()).trace("String_Node_Str" + key2);
      tagSet.add(modelManager.buildTag().setKey(key2).build());
      List<Synonym> synonyms=parser.getSynonymMap().get(term);
      if (synonyms == null) {
        continue;
      }
      for (      Synonym syn : synonyms) {
        String key3=term.getName() + "String_Node_Str" + syn.getName();
        Logger.getLogger(OBOImporter.class.getName()).trace("String_Node_Str" + key3);
        tagSet.add(modelManager.buildTag().setKey(key3).build());
      }
    }
    Logger.getLogger(OBOImporter.class.getName()).info("String_Node_Str" + tagSet.getCount() + "String_Node_Str");
    modelManager.close();
    SWQEFactory.getStorage().closeStorage();
    System.out.println(tagSet.getCount() + "String_Node_Str");
    String outputID=tagSet.getSGID().getRowKey();
    System.out.println(outputID);
    Map<String,String> keyValues=new HashMap<String,String>();
    keyValues.put("String_Node_Str",outputID);
    Utility.writeKeyValueFile(outputFile,keyValues);
    return tagSet.getSGID();
  }
 catch (  ParseException ex) {
    Logger.getLogger(OBOImporter.class.getName()).fatal(null,ex);
  }
catch (  IOException ex) {
    Logger.getLogger(OBOImporter.class.getName()).fatal(null,ex);
  }
 finally {
    try {
      inStream.close();
    }
 catch (    IOException ex) {
      Logger.getLogger(OBOImporter.class.getName()).fatal(null,ex);
    }
  }
  return null;
}