Program: 146970
Project: 146970
Buggy source:
public Case parse() throws InvalidStructureException, IOException, XmlPullParserException {
  this.checkNode("String_Node_Str");
  this.nextTag("String_Node_Str");
  String caseId=parser.nextText().trim();
  this.nextTag("String_Node_Str");
  String dateModified=parser.nextText().trim();
  Date modified=DateUtils.parseDateTime(dateModified);
  boolean create=false;
  boolean update=false;
  boolean close=false;
  while (this.nextTagInBlock("String_Node_Str")) {
    String action=parser.getName().toLowerCase();
    if (action.equals("String_Node_Str")) {
      String[] data=new String[4];
      while (this.nextTagInBlock("String_Node_Str")) {
        if (parser.getName().equals("String_Node_Str")) {
          data[0]=parser.nextText().trim();
        }
 else         if (parser.getName().equals("String_Node_Str")) {
          data[1]=parser.nextText().trim();
        }
 else         if (parser.getName().equals("String_Node_Str")) {
          data[2]=parser.nextText().trim();
        }
 else         if (parser.getName().equals("String_Node_Str")) {
          data[3]=parser.nextText().trim();
        }
 else {
          throw new InvalidStructureException("String_Node_Str" + parser.getName(),parser);
        }
      }
      for (      String s : data) {
        if (s == null) {
          throw new InvalidStructureException("String_Node_Str" + caseId,parser);
        }
      }
      Case c=new Case(data[3],data[0]);
      c.setUserId(data[2]);
      c.setExternalId(data[1]);
      c.setCaseId(caseId);
      commit(c);
      create=true;
      Logger.log("String_Node_Str",c.getID() + "String_Node_Str" + PropertyUtils.trim(c.getCaseId(),12)+ "String_Node_Str"+ c.getTypeId());
    }
 else     if (action.equals("String_Node_Str")) {
      Case c=retrieve(caseId);
      if (c == null) {
        throw new InvalidStructureException("String_Node_Str" + caseId,parser);
      }
      while (this.nextTagInBlock("String_Node_Str")) {
        String key=parser.getName();
        String value=parser.nextText().trim();
        c.setProperty(key,value);
      }
      commit(c);
      update=true;
    }
 else     if (action.equals("String_Node_Str")) {
      Case c=retrieve(caseId);
      if (c == null) {
        throw new InvalidStructureException("String_Node_Str" + caseId,parser);
      }
      c.setClosed(true);
      commit(c);
      Logger.log("String_Node_Str",PropertyUtils.trim(c.getCaseId(),12));
      close=true;
    }
 else     if (action.equals("String_Node_Str")) {
      new ReferralXmlParser(parser,caseId,modified).parse();
    }
  }
  if (create) {
    tallies[0]++;
  }
 else   if (close) {
    tallies[2]++;
  }
 else   if (update) {
    tallies[1]++;
  }
  return null;
}

Fixed version (ground truth):
public Case parse() throws InvalidStructureException, IOException, XmlPullParserException {
  this.checkNode("String_Node_Str");
  this.nextTag("String_Node_Str");
  String caseId=parser.nextText().trim();
  this.nextTag("String_Node_Str");
  String dateModified=parser.nextText().trim();
  Date modified=DateUtils.parseDateTime(dateModified);
  boolean create=false;
  boolean update=false;
  boolean close=false;
  while (this.nextTagInBlock("String_Node_Str")) {
    String action=parser.getName().toLowerCase();
    if (action.equals("String_Node_Str")) {
      String[] data=new String[4];
      while (this.nextTagInBlock("String_Node_Str")) {
        if (parser.getName().equals("String_Node_Str")) {
          data[0]=parser.nextText().trim();
        }
 else         if (parser.getName().equals("String_Node_Str")) {
          data[1]=parser.nextText().trim();
        }
 else         if (parser.getName().equals("String_Node_Str")) {
          data[2]=parser.nextText().trim();
        }
 else         if (parser.getName().equals("String_Node_Str")) {
          data[3]=parser.nextText().trim();
        }
 else {
          throw new InvalidStructureException("String_Node_Str" + parser.getName(),parser);
        }
      }
      for (      String s : data) {
        if (s == null) {
          throw new InvalidStructureException("String_Node_Str" + caseId,parser);
        }
      }
      Case c=null;
      boolean overriden=false;
      if (acceptCreateOverwrites) {
        c=retrieve(caseId);
        if (c != null) {
          c.setName(data[3]);
          c.setTypeId(data[0]);
          overriden=true;
        }
      }
      if (c == null) {
        c=new Case(data[3],data[0]);
        c.setCaseId(caseId);
      }
      c.setUserId(data[2]);
      c.setExternalId(data[1]);
      commit(c);
      if (!overriden) {
        create=true;
      }
      String succesfulAction=overriden ? "String_Node_Str" : "String_Node_Str";
      Logger.log(succesfulAction,c.getID() + "String_Node_Str" + PropertyUtils.trim(c.getCaseId(),12)+ "String_Node_Str"+ c.getTypeId());
    }
 else     if (action.equals("String_Node_Str")) {
      Case c=retrieve(caseId);
      if (c == null) {
        throw new InvalidStructureException("String_Node_Str" + caseId,parser);
      }
      while (this.nextTagInBlock("String_Node_Str")) {
        String key=parser.getName();
        String value=parser.nextText().trim();
        c.setProperty(key,value);
      }
      commit(c);
      update=true;
    }
 else     if (action.equals("String_Node_Str")) {
      Case c=retrieve(caseId);
      if (c == null) {
        throw new InvalidStructureException("String_Node_Str" + caseId,parser);
      }
      c.setClosed(true);
      commit(c);
      Logger.log("String_Node_Str",PropertyUtils.trim(c.getCaseId(),12));
      close=true;
    }
 else     if (action.equals("String_Node_Str")) {
      new ReferralXmlParser(parser,caseId,modified,acceptCreateOverwrites).parse();
    }
  }
  if (create) {
    tallies[0]++;
  }
 else   if (close) {
    tallies[2]++;
  }
 else   if (update) {
    tallies[1]++;
  }
  return null;
}