Program: 59193
Project: 59193
Buggy source:
protected void fillMappingFile() throws ServiceException, IOException {
  String strGeneID="String_Node_Str";
  String strAccessionNumber;
  String[] strArEnzymeQueryResult=null;
  String[] strArHomeSapiensGenes=null;
  int iNumberOfGenes;
  KEGGLocator locator=new KEGGLocator();
  KEGGPortType serv=locator.getKEGGPort();
  EUtilsServiceLocator service=new EUtilsServiceLocator();
  EUtilsServiceSoap utils=service.geteUtilsServiceSoap();
  EFetchRequest parameters=new EFetchRequest();
  parameters.setDb("String_Node_Str");
  parameters.setRettype("String_Node_Str");
  EFetchResult entrezEFetchResult=null;
  iNumberOfGenes=serv.get_number_of_genes_by_organism("String_Node_Str");
  System.out.println("String_Node_Str" + iNumberOfGenes);
  strArHomeSapiensGenes=serv.get_genes_by_organism("String_Node_Str",1,iNumberOfGenes);
  for (int iGeneIndex=0; iGeneIndex < strArHomeSapiensGenes.length; iGeneIndex++) {
    strGeneID=strArHomeSapiensGenes[iGeneIndex];
    System.out.println("String_Node_Str" + strGeneID);
    strArEnzymeQueryResult=serv.get_enzymes_by_gene(strGeneID);
    strGeneID=strGeneID.substring(4);
    if (strArEnzymeQueryResult.length == 0) {
      System.out.println("String_Node_Str" + strGeneID + strDelimiter);
      mappingGeneID2EnzymeOutputStream.println(strGeneID + strDelimiter);
    }
    for (int iResultIndex=0; iResultIndex < strArEnzymeQueryResult.length; iResultIndex++) {
      System.out.println("String_Node_Str" + strGeneID + strDelimiter+ strArEnzymeQueryResult[iResultIndex]);
      mappingGeneID2EnzymeOutputStream.println(strGeneID + strDelimiter + strArEnzymeQueryResult[iResultIndex]);
    }
    parameters.setId(strGeneID);
    entrezEFetchResult=utils.run_eFetch(parameters);
    GeneCommentaryType[] geneCommentaries=entrezEFetchResult.getEntrezgeneSet().getEntrezgene(0).getEntrezgene_comments().getGeneCommentary();
    for (int iGeneCommentaryIndex=0; iGeneCommentaryIndex < geneCommentaries.length; iGeneCommentaryIndex++) {
      if (geneCommentaries[iGeneCommentaryIndex].getGeneCommentary_heading() != null && geneCommentaries[iGeneCommentaryIndex].getGeneCommentary_heading().equals("String_Node_Str")) {
        strAccessionNumber=geneCommentaries[iGeneCommentaryIndex].getGeneCommentary_comment().getGeneCommentary(0).getGeneCommentary_products().getGeneCommentary(0).getGeneCommentary_accession();
        System.out.println("String_Node_Str" + strGeneID + strDelimiter+ strAccessionNumber);
        mappingGeneID2AccessionOutputStream.println(strGeneID + strDelimiter + strAccessionNumber);
        break;
      }
    }
  }
  mappingGeneID2EnzymeOutputStream.close();
  mappingGeneID2AccessionOutputStream.close();
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
protected void fillMappingFile() throws ServiceException, IOException {
  String strGeneID="String_Node_Str";
  String strAccessionNumber="String_Node_Str";
  String[] strArEnzymeQueryResult=null;
  String[] strArHomeSapiensGenes=null;
  int iNumberOfGenes;
  GeneCommentaryType[] tmpGeneCommentaries=null;
  GeneCommentaryType[] geneCommentaries=null;
  GeneCommentaryType[] lastGeneCommentaries=null;
  KEGGLocator locator=new KEGGLocator();
  KEGGPortType serv=locator.getKEGGPort();
  EUtilsServiceLocator service=new EUtilsServiceLocator();
  EUtilsServiceSoap utils=service.geteUtilsServiceSoap();
  EFetchRequest parameters=new EFetchRequest();
  parameters.setDb("String_Node_Str");
  parameters.setRettype("String_Node_Str");
  EFetchResult entrezEFetchResult=null;
  iNumberOfGenes=serv.get_number_of_genes_by_organism("String_Node_Str");
  System.out.println("String_Node_Str" + iNumberOfGenes);
  strArHomeSapiensGenes=serv.get_genes_by_organism("String_Node_Str",1,iNumberOfGenes);
  for (int iGeneIndex=0; iGeneIndex < strArHomeSapiensGenes.length; iGeneIndex++) {
    strGeneID=strArHomeSapiensGenes[iGeneIndex];
    System.out.println("String_Node_Str" + strGeneID);
    strArEnzymeQueryResult=serv.get_enzymes_by_gene(strGeneID);
    strGeneID=strGeneID.substring(4);
    if (strArEnzymeQueryResult.length == 0) {
      System.out.println("String_Node_Str" + strGeneID + strDelimiter);
      mappingGeneID2EnzymeOutputStream.println(strGeneID + strDelimiter);
    }
    for (int iResultIndex=0; iResultIndex < strArEnzymeQueryResult.length; iResultIndex++) {
      System.out.println("String_Node_Str" + strGeneID + strDelimiter+ strArEnzymeQueryResult[iResultIndex]);
      mappingGeneID2EnzymeOutputStream.println(strGeneID + strDelimiter + strArEnzymeQueryResult[iResultIndex]);
    }
    parameters.setId(strGeneID);
    entrezEFetchResult=utils.run_eFetch(parameters);
    geneCommentaries=entrezEFetchResult.getEntrezgeneSet().getEntrezgene(0).getEntrezgene_comments().getGeneCommentary();
    for (int iGeneCommentaryIndex=0; iGeneCommentaryIndex < geneCommentaries.length; iGeneCommentaryIndex++) {
      if (geneCommentaries[iGeneCommentaryIndex].getGeneCommentary_heading() != null && geneCommentaries[iGeneCommentaryIndex].getGeneCommentary_heading().equals("String_Node_Str")) {
        tmpGeneCommentaries=geneCommentaries[iGeneCommentaryIndex].getGeneCommentary_comment().getGeneCommentary();
        for (int iTmpGeneCommentaryIndex=0; iTmpGeneCommentaryIndex < tmpGeneCommentaries.length; iTmpGeneCommentaryIndex++) {
          if (tmpGeneCommentaries[iTmpGeneCommentaryIndex].getGeneCommentary_heading() != null && tmpGeneCommentaries[iTmpGeneCommentaryIndex].getGeneCommentary_heading().equals("String_Node_Str")) {
            lastGeneCommentaries=tmpGeneCommentaries[iTmpGeneCommentaryIndex].getGeneCommentary_products().getGeneCommentary();
            for (int iLastGeneCommentaryIndex=0; iLastGeneCommentaryIndex < lastGeneCommentaries.length; iLastGeneCommentaryIndex++) {
              if (lastGeneCommentaries[iLastGeneCommentaryIndex].getGeneCommentary_heading() != null && lastGeneCommentaries[iLastGeneCommentaryIndex].getGeneCommentary_heading().equals("String_Node_Str")) {
                strAccessionNumber=lastGeneCommentaries[iLastGeneCommentaryIndex].getGeneCommentary_accession();
                break;
              }
            }
            break;
          }
        }
        System.out.println("String_Node_Str" + strGeneID + strDelimiter+ strAccessionNumber);
        mappingGeneID2AccessionOutputStream.println(strGeneID + strDelimiter + strAccessionNumber);
        break;
      }
    }
  }
  mappingGeneID2EnzymeOutputStream.close();
  mappingGeneID2AccessionOutputStream.close();
  System.out.println("String_Node_Str");
}