nus-yam/ex-repair huggingface dataset:
Program: 146640
Project: 146640
Buggy source:
protected abstract String getHelpTextDescription();

Fixed version (ground truth):
public String getHelpTextDescription(){
  return helpTextDescription;
}
Program: 146641
Project: 146641
Buggy source:
public CliCommand(String commandName,String[] args){
  this.commandName=commandName;
  this.args=args;
  options=getOptions();
}

Fixed version (ground truth):
public CliCommand(String commandName,String helpTextDescription,String positionalArgsHelpText){
  options=getOptions();
  this.commandName=commandName;
  this.helpTextDescription=helpTextDescription;
  this.positionalArgsHelpText=positionalArgsHelpText;
}
Program: 146642
Project: 146642
Buggy source:
public void parseArguments() throws ParseException {
  CommandLineParser parser=new DefaultParser();
  cmd=parser.parse(options,args);
}

Fixed version (ground truth):
public void parseArguments(String[] args) throws ParseException {
  CommandLineParser parser=new DefaultParser();
  cmd=parser.parse(options,args);
  this.args=cmd.getArgs();
}
Program: 146643
Project: 146643
Buggy source:
protected void printHelpText(){
  String usage="String_Node_Str" + commandName + "String_Node_Str"+ getPositionalArgsHelpText();
  String header=getHelpTextDescription() + "String_Node_Str";
  HelpFormatter formatter=new HelpFormatter();
  formatter.setWidth(200);
  formatter.printHelp(usage,header,options,"String_Node_Str",true);
}

Fixed version (ground truth):
protected void printHelpText(){
  String usage="String_Node_Str" + commandName + "String_Node_Str"+ positionalArgsHelpText;
  String header=helpTextDescription + "String_Node_Str";
  HelpFormatter formatter=new HelpFormatter();
  formatter.setWidth(200);
  formatter.printHelp(usage,header,options,"String_Node_Str",true);
}
Program: 146644
Project: 146644
Buggy source:
public CliPlayCommand(String commandName,String[] args){
  super(commandName,args);
}

Fixed version (ground truth):
public CliPlayCommand(){
  super("String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 146645
Project: 146645
Buggy source:
@Override public void handle(){
  super.handle();
  PrototypeFactory prototypeFactory=new LivePrototypeFactory();
  if (args.length < 2) {
    printHelpText();
    System.exit(-1);
  }
  try {
    CommCareConfigEngine engine=configureApp(args[1],prototypeFactory);
    ApplicationHost host=new ApplicationHost(engine,prototypeFactory);
    if (cmd.hasOption("String_Node_Str")) {
      host.setRestoreToLocalFile(cmd.getOptionValue("String_Node_Str"));
    }
 else {
      if (args.length < 4) {
        printHelpText();
        System.exit(-1);
        return;
      }
      String username=args[2];
      String password=args[3];
      username=username.trim().toLowerCase();
      host.setRestoreToRemoteUser(username,password);
    }
    host.run();
    System.exit(-1);
  }
 catch (  RuntimeException re) {
    System.out.print("String_Node_Str");
    re.printStackTrace();
    throw re;
  }
 finally {
    System.exit(0);
  }
}

Fixed version (ground truth):
@Override public void handle(){
  super.handle();
  PrototypeFactory prototypeFactory=new LivePrototypeFactory();
  try {
    CommCareConfigEngine engine=configureApp(args[0],prototypeFactory);
    ApplicationHost host=new ApplicationHost(engine,prototypeFactory);
    if (cmd.hasOption("String_Node_Str")) {
      host.setRestoreToLocalFile(cmd.getOptionValue("String_Node_Str"));
    }
 else {
      username=username.trim().toLowerCase();
      host.setRestoreToRemoteUser(username,password);
    }
    host.run();
    System.exit(-1);
  }
 catch (  RuntimeException re) {
    System.out.print("String_Node_Str");
    re.printStackTrace();
    throw re;
  }
 finally {
    System.exit(0);
  }
}
Program: 146646
Project: 146646
Buggy source:
public CliValidateCommand(String commandName,String[] args){
  super(commandName,args);
}

Fixed version (ground truth):
public CliValidateCommand(){
  super("String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 146647
Project: 146647
Buggy source:
@Override public void handle(){
  super.handle();
  PrototypeFactory prototypeFactory=new LivePrototypeFactory();
  if (args.length < 2) {
    printHelpText();
    System.exit(-1);
  }
  CommCareConfigEngine engine=configureApp(args[1],prototypeFactory);
  engine.describeApplication();
  System.exit(0);
}

Fixed version (ground truth):
@Override public void handle(){
  super.handle();
  PrototypeFactory prototypeFactory=new LivePrototypeFactory();
  CommCareConfigEngine engine=configureApp(resourcePath,prototypeFactory);
  engine.describeApplication();
  System.exit(0);
}
Program: 146648
Project: 146648
Buggy source:
public void readExternal(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  init();
  setValue(ExtUtil.readDate(in));
}

Fixed version (ground truth):
public void readExternal(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  setValue(ExtUtil.readDate(in));
  init();
}
Program: 146649
Project: 146649
Buggy source:
private void parseControlChildren(Element e,QuestionDef question,IFormElement parent,boolean isSelect){
  for (int i=0; i < e.getChildCount(); i++) {
    int type=e.getType(i);
    Element child=(type == Node.ELEMENT ? e.getElement(i) : null);
    String childName=(child != null ? child.getName() : null);
    if (LABEL_ELEMENT.equals(childName) || HINT_ELEMENT.equals(childName) || HELP_ELEMENT.equals(childName)|| CONSTRAINT_ELEMENT.equals(childName)) {
      parseHelperText(question,child);
    }
 else     if (isSelect && "String_Node_Str".equals(childName)) {
      parseItem(question,child);
    }
 else     if (isSelect && "String_Node_Str".equals(childName)) {
      parseItemset(question,child,parent);
    }
 else     if (actionHandlers.contains(childName)) {
      actionHandlers.get(childName).handle(this,child,question);
    }
  }
}

Fixed version (ground truth):
private void parseControlChildren(Element e,QuestionDef question,IFormElement parent,boolean isSelect){
  for (int i=0; i < e.getChildCount(); i++) {
    int type=e.getType(i);
    Element child=(type == Node.ELEMENT ? e.getElement(i) : null);
    String childName=(child != null ? child.getName() : null);
    if (LABEL_ELEMENT.equals(childName) || HINT_ELEMENT.equals(childName) || HELP_ELEMENT.equals(childName)|| CONSTRAINT_ELEMENT.equals(childName)) {
      parseHelperText(question,child);
    }
 else     if (isSelect && "String_Node_Str".equals(childName)) {
      parseItem(question,child);
    }
 else     if (isSelect && "String_Node_Str".equals(childName)) {
      parseItemset(question,child,parent);
    }
 else     if (actionHandlers.containsKey(childName)) {
      actionHandlers.get(childName).handle(this,child,question);
    }
  }
}
Program: 146650
Project: 146650
Buggy source:
/** 
 * Test triggers fired from inserting a new repeat entry. Triggers fired during insert action don't need to be fired again when all triggers rooted by that repeat entry are fired.
 */
@Test public void testRepeatInsertTriggering() throws Exception {
  FormParseInit fpi=new FormParseInit("String_Node_Str");
  FormEntryController fec=fpi.getFormEntryController();
  fpi.getFormDef().initialize(true,null);
  fec.jumpToIndex(FormIndex.createBeginningOfFormIndex());
  do {
  }
 while (fec.stepToNextEvent() != FormEntryController.EVENT_END_OF_FORM);
  EvaluationContext evalCtx=fpi.getFormDef().getEvaluationContext();
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str","String_Node_Str","String_Node_Str",evalCtx);
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str","String_Node_Str","String_Node_Str",evalCtx);
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str","String_Node_Str","String_Node_Str",evalCtx);
}

Fixed version (ground truth):
/** 
 * Test triggers fired from inserting a new repeat entry. Triggers fired during insert action don't need to be fired again when all triggers rooted by that repeat entry are fired.
 */
@Test public void testRepeatInsertTriggering() throws Exception {
  FormParseInit fpi=new FormParseInit("String_Node_Str");
  FormEntryController fec=initFormEntry(fpi);
  stepThroughEntireForm(fec);
  EvaluationContext evalCtx=fpi.getFormDef().getEvaluationContext();
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str","String_Node_Str","String_Node_Str",evalCtx);
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str","String_Node_Str","String_Node_Str",evalCtx);
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str","String_Node_Str","String_Node_Str",evalCtx);
}
Program: 146651
Project: 146651
Buggy source:
/** 
 * Test nested form repeat triggers and actions
 */
@Test public void testNestedRepeatActions() throws Exception {
  FormParseInit fpi=new FormParseInit("String_Node_Str");
  FormEntryController fec=fpi.getFormEntryController();
  fpi.getFormDef().initialize(true,null);
  fec.jumpToIndex(FormIndex.createBeginningOfFormIndex());
  do {
  }
 while (fec.stepToNextEvent() != FormEntryController.EVENT_END_OF_FORM);
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str",30.0,"String_Node_Str",fpi.getFormDef().getEvaluationContext());
}

Fixed version (ground truth):
/** 
 * Test nested form repeat triggers and actions
 */
@Test public void testNestedRepeatActions() throws Exception {
  FormParseInit fpi=new FormParseInit("String_Node_Str");
  FormEntryController fec=initFormEntry(fpi);
  stepThroughEntireForm(fec);
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str",30.0,"String_Node_Str",fpi.getFormDef().getEvaluationContext());
}
Program: 146652
Project: 146652
Buggy source:
/** 
 * Tests trigger caching related to cascading relevancy calculations to children.
 */
@Test public void testTriggerCaching() throws Exception {
  FormParseInit fpi=new FormParseInit("String_Node_Str");
  FormEntryController fec=fpi.getFormEntryController();
  fpi.getFormDef().initialize(true,null);
  fec.jumpToIndex(FormIndex.createBeginningOfFormIndex());
  do {
  }
 while (fec.stepToNextEvent() != FormEntryController.EVENT_END_OF_FORM);
  EvaluationContext evalCtx=fpi.getFormDef().getEvaluationContext();
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str",400.0,"String_Node_Str",evalCtx);
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str",100.0,"String_Node_Str",evalCtx);
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str","String_Node_Str","String_Node_Str",evalCtx);
  Object weighTimeResult=ExprEvalUtils.xpathEval(evalCtx,"String_Node_Str");
  if ("String_Node_Str".equals(weighTimeResult) || "String_Node_Str".equals(weighTimeResult)) {
    fail("String_Node_Str");
  }
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str",1.0,"String_Node_Str",evalCtx);
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str","String_Node_Str","String_Node_Str",evalCtx);
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str","String_Node_Str","String_Node_Str",evalCtx);
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str","String_Node_Str","String_Node_Str",evalCtx);
}

Fixed version (ground truth):
/** 
 * Tests trigger caching related to cascading relevancy calculations to children.
 */
@Test public void testTriggerCaching() throws Exception {
  FormParseInit fpi=new FormParseInit("String_Node_Str");
  FormEntryController fec=initFormEntry(fpi);
  stepThroughEntireForm(fec);
  EvaluationContext evalCtx=fpi.getFormDef().getEvaluationContext();
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str",400.0,"String_Node_Str",evalCtx);
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str",100.0,"String_Node_Str",evalCtx);
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str","String_Node_Str","String_Node_Str",evalCtx);
  Object weighTimeResult=ExprEvalUtils.xpathEval(evalCtx,"String_Node_Str");
  if ("String_Node_Str".equals(weighTimeResult) || "String_Node_Str".equals(weighTimeResult)) {
    fail("String_Node_Str");
  }
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str",1.0,"String_Node_Str",evalCtx);
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str","String_Node_Str","String_Node_Str",evalCtx);
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str","String_Node_Str","String_Node_Str",evalCtx);
  ExprEvalUtils.assertEqualsXpathEval("String_Node_Str","String_Node_Str","String_Node_Str",evalCtx);
}
Program: 146653
Project: 146653
Buggy source:
/** 
 * Make sure that 'current()' expands correctly when used in conditionals such as in 'relevant' tags. The test answers a question and expects the correct elements to be re-evaluated and set to not relevant.
 */
@Test public void testCurrentFuncInTriggers(){
  FormParseInit fpi=new FormParseInit("String_Node_Str");
  FormEntryController fec=fpi.getFormEntryController();
  fec.jumpToIndex(FormIndex.createBeginningOfFormIndex());
  do {
    QuestionDef q=fpi.getCurrentQuestion();
    if (q == null) {
      continue;
    }
    TreeReference qRef=(TreeReference)(q.getBind()).getReference();
    if (qRef.toString().equals("String_Node_Str")) {
      int response=fec.answerQuestion(new StringData("String_Node_Str"));
      if (response != FormEntryController.ANSWER_OK) {
        fail("String_Node_Str");
      }
    }
 else     if (q.getID() == 2) {
      fail("String_Node_Str");
    }
  }
 while (fec.stepToNextEvent() != FormEntryController.EVENT_END_OF_FORM);
}

Fixed version (ground truth):
/** 
 * Make sure that 'current()' expands correctly when used in conditionals such as in 'relevant' tags. The test answers a question and expects the correct elements to be re-evaluated and set to not relevant.
 */
@Test public void testCurrentFuncInTriggers(){
  FormParseInit fpi=new FormParseInit("String_Node_Str");
  FormEntryController fec=initFormEntry(fpi);
  do {
    QuestionDef q=fpi.getCurrentQuestion();
    if (q == null) {
      continue;
    }
    TreeReference qRef=(TreeReference)(q.getBind()).getReference();
    if (qRef.toString().equals("String_Node_Str")) {
      int response=fec.answerQuestion(new StringData("String_Node_Str"));
      if (response != FormEntryController.ANSWER_OK) {
        fail("String_Node_Str");
      }
    }
 else     if (q.getID() == 2) {
      fail("String_Node_Str");
    }
  }
 while (fec.stepToNextEvent() != FormEntryController.EVENT_END_OF_FORM);
}
Program: 146655
Project: 146655
Buggy source:
/** 
 * Regressions around complex repeat behaviors
 */
@Test public void testLoopedRepeatIndexFetches() throws Exception {
  FormParseInit fpi=new FormParseInit("String_Node_Str");
  FormEntryController fec=fpi.getFormEntryController();
  fpi.getFormDef().initialize(true,null);
  fec.jumpToIndex(FormIndex.createBeginningOfFormIndex());
  fec.stepToNextEvent();
  fec.stepToNextEvent();
  fec.answerQuestion(new IntegerData(2));
  while (fec.stepToNextEvent() != FormEntryController.EVENT_QUESTION)   ;
  fec.answerQuestion(new UncastData("String_Node_Str"));
  while (fec.stepToNextEvent() != FormEntryController.EVENT_QUESTION)   ;
  fec.getNextIndex(fec.getModel().getFormIndex(),true);
  fec.answerQuestion(new IntegerData(2));
  fec.getNextIndex(fec.getModel().getFormIndex(),true);
}

Fixed version (ground truth):
/** 
 * Regressions around complex repeat behaviors
 */
@Test public void testLoopedRepeatIndexFetches() throws Exception {
  FormParseInit fpi=new FormParseInit("String_Node_Str");
  FormEntryController fec=initFormEntry(fpi);
  fec.stepToNextEvent();
  fec.stepToNextEvent();
  fec.answerQuestion(new IntegerData(2));
  while (fec.stepToNextEvent() != FormEntryController.EVENT_QUESTION)   ;
  fec.answerQuestion(new UncastData("String_Node_Str"));
  while (fec.stepToNextEvent() != FormEntryController.EVENT_QUESTION)   ;
  fec.getNextIndex(fec.getModel().getFormIndex(),true);
  fec.answerQuestion(new IntegerData(2));
  fec.getNextIndex(fec.getModel().getFormIndex(),true);
}
Program: 146656
Project: 146656
Buggy source:
@Test public void testAnswerConstraint(){
  IntegerData ans=new IntegerData(13);
  FormParseInit fpi=new FormParseInit("String_Node_Str");
  FormEntryController fec=fpi.getFormEntryController();
  fec.jumpToIndex(FormIndex.createBeginningOfFormIndex());
  do {
    QuestionDef q=fpi.getCurrentQuestion();
    if (q == null || q.getTextID() == null || "String_Node_Str".equals(q.getTextID())) {
      continue;
    }
    if (q.getTextID().equals("String_Node_Str")) {
      int response=fec.answerQuestion(ans);
      if (response == FormEntryController.ANSWER_CONSTRAINT_VIOLATED) {
        fail("String_Node_Str");
      }
 else       if (response == FormEntryController.ANSWER_OK) {
        break;
      }
 else {
        fail("String_Node_Str");
      }
    }
  }
 while (fec.stepToNextEvent() != FormEntryController.EVENT_END_OF_FORM);
}

Fixed version (ground truth):
@Test public void testAnswerConstraint(){
  FormParseInit fpi=new FormParseInit("String_Node_Str");
  FormEntryController fec=initFormEntry(fpi);
  do {
    QuestionDef q=fpi.getCurrentQuestion();
    if (q == null || q.getTextID() == null || "String_Node_Str".equals(q.getTextID())) {
      continue;
    }
    if (q.getTextID().equals("String_Node_Str")) {
      int response=fec.answerQuestion(new IntegerData(13));
      if (response == FormEntryController.ANSWER_CONSTRAINT_VIOLATED) {
        fail("String_Node_Str");
      }
 else       if (response == FormEntryController.ANSWER_OK) {
        break;
      }
 else {
        fail("String_Node_Str");
      }
    }
  }
 while (fec.stepToNextEvent() != FormEntryController.EVENT_END_OF_FORM);
}
Program: 146657
Project: 146657
Buggy source:
/** 
 * Test setvalue expressions which have predicate references
 */
@Test public void testSetValuePredicate(){
  FormParseInit fpi=new FormParseInit("String_Node_Str");
  FormEntryController fec=fpi.getFormEntryController();
  fpi.getFormDef().initialize(true,null);
  fec.jumpToIndex(FormIndex.createBeginningOfFormIndex());
  boolean testPassed=false;
  do {
    if (fec.getModel().getEvent() != FormEntryController.EVENT_QUESTION) {
      continue;
    }
    String text=fec.getModel().getQuestionPrompt().getQuestionText();
    if (text.contains("String_Node_Str") && text.contains("String_Node_Str")) {
      testPassed=true;
    }
  }
 while (fec.stepToNextEvent() != FormEntryController.EVENT_END_OF_FORM);
  if (!testPassed) {
    fail("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Test setvalue expressions which have predicate references
 */
@Test public void testSetValuePredicate(){
  FormParseInit fpi=new FormParseInit("String_Node_Str");
  FormEntryController fec=initFormEntry(fpi);
  boolean testPassed=false;
  do {
    if (fec.getModel().getEvent() != FormEntryController.EVENT_QUESTION) {
      continue;
    }
    String text=fec.getModel().getQuestionPrompt().getQuestionText();
    if (text.contains("String_Node_Str") && text.contains("String_Node_Str")) {
      testPassed=true;
    }
  }
 while (fec.stepToNextEvent() != FormEntryController.EVENT_END_OF_FORM);
  if (!testPassed) {
    fail("String_Node_Str");
  }
}
Program: 146658
Project: 146658
Buggy source:
/** 
 * Remove from the graph the node at this index, and remove all nodes that are made invalid by the non-existence of that node (i.e. all of its child and extension cases). Also accumulate a list of edges that need to be removed as a result of this method call. Actual edge removal should then be done all at once by the caller, to avoid ConcurrentModificationException
 */
private void removeNodeAndPropagate(String indexOfRemovedNode,Vector<String[]> accumulatedEdgesToRemove){
  Vector<Edge<String,String>> childCases=internalCaseDAG.getParents(indexOfRemovedNode);
  for (  Edge<String,String> child : childCases) {
    accumulatedEdgesToRemove.addElement(new String[]{child.i,indexOfRemovedNode});
    removeNodeAndPropagate(child.i,accumulatedEdgesToRemove);
  }
  Vector<Edge<String,String>> parentCases=internalCaseDAG.getChildren(indexOfRemovedNode);
  for (  Edge<String,String> parent : parentCases) {
    accumulatedEdgesToRemove.addElement(new String[]{indexOfRemovedNode,parent.i});
  }
  int storageIdOfRemovedNode=internalCaseDAG.removeNode(indexOfRemovedNode)[1];
  idsToRemove.addElement(new Integer(storageIdOfRemovedNode));
  casesRemovedDueToMissingCases.add(indexOfRemovedNode);
}

Fixed version (ground truth):
/** 
 * Remove from the graph the node at this index, and remove all nodes that are made invalid by the non-existence of that node (i.e. all of its child and extension cases). Also accumulate a list of edges that need to be removed as a result of this method call. Actual edge removal should then be done all at once by the caller, to avoid ConcurrentModificationException
 */
private void removeNodeAndPropagate(String indexOfRemovedNode,Vector<String[]> accumulatedEdgesToRemove){
  Vector<Edge<String,String>> childCases=internalCaseDAG.getParents(indexOfRemovedNode);
  for (  Edge<String,String> child : childCases) {
    accumulatedEdgesToRemove.addElement(new String[]{child.i,indexOfRemovedNode});
    removeNodeAndPropagate(child.i,accumulatedEdgesToRemove);
  }
  Vector<Edge<String,String>> parentCases=internalCaseDAG.getChildren(indexOfRemovedNode);
  for (  Edge<String,String> parent : parentCases) {
    accumulatedEdgesToRemove.addElement(new String[]{indexOfRemovedNode,parent.i});
  }
  int storageIdOfRemovedNode=internalCaseDAG.removeNode(indexOfRemovedNode)[1];
  idsToRemove.addElement(new Integer(storageIdOfRemovedNode));
  casesRemovedDueToMissingCases.addElement(indexOfRemovedNode);
}
Program: 146659
Project: 146659
Buggy source:
/** 
 * Traverse the graph to accumulate a list of any edges to empty nodes (which are created when a child makes a placeholder index to a parent, but then the parent does not actually exist on the phone for some reason). Then remove any nodes that are made invalid by that parent node not existing, which further accumulates the list of invalid edges
 * @return Whether or not this method invocation removed any invalid edges from the DAG
 */
private Vector<String[]> getInvalidEdges(){
  Hashtable<String,Vector<Edge<String,String>>> allEdges=internalCaseDAG.getEdges();
  Vector<String> childOfNonexistentParent=new Vector<String>();
  Vector<String[]> edgesToRemove=new Vector<String[]>();
  Enumeration edgeOriginIndices=allEdges.keys();
  while (edgeOriginIndices.hasMoreElements()) {
    String originIndex=(String)edgeOriginIndices.nextElement();
    Vector<Edge<String,String>> edgeListForOrigin=allEdges.get(originIndex);
    for (    Edge<String,String> edge : edgeListForOrigin) {
      String targetIndex=edge.i;
      if (internalCaseDAG.getNode(targetIndex) == null) {
        missingCases.add(targetIndex);
        edgesToRemove.addElement(new String[]{originIndex,targetIndex});
        childOfNonexistentParent.addElement(originIndex);
      }
    }
  }
  for (  String index : childOfNonexistentParent) {
    removeNodeAndPropagate(index,edgesToRemove);
  }
  invalidEdgesWereRemoved=edgesToRemove.size() > 0;
  return edgesToRemove;
}

Fixed version (ground truth):
/** 
 * Traverse the graph to accumulate a list of any edges to empty nodes (which are created when a child makes a placeholder index to a parent, but then the parent does not actually exist on the phone for some reason). Then remove any nodes that are made invalid by that parent node not existing, which further accumulates the list of invalid edges
 * @return Whether or not this method invocation removed any invalid edges from the DAG
 */
private Vector<String[]> getInvalidEdges(){
  Hashtable<String,Vector<Edge<String,String>>> allEdges=internalCaseDAG.getEdges();
  Vector<String> childOfNonexistentParent=new Vector<String>();
  Vector<String[]> edgesToRemove=new Vector<String[]>();
  Enumeration edgeOriginIndices=allEdges.keys();
  while (edgeOriginIndices.hasMoreElements()) {
    String originIndex=(String)edgeOriginIndices.nextElement();
    Vector<Edge<String,String>> edgeListForOrigin=allEdges.get(originIndex);
    for (    Edge<String,String> edge : edgeListForOrigin) {
      String targetIndex=edge.i;
      if (internalCaseDAG.getNode(targetIndex) == null) {
        missingCases.addElement(targetIndex);
        edgesToRemove.addElement(new String[]{originIndex,targetIndex});
        childOfNonexistentParent.addElement(originIndex);
      }
    }
  }
  for (  String index : childOfNonexistentParent) {
    removeNodeAndPropagate(index,edgesToRemove);
  }
  invalidEdgesWereRemoved=edgesToRemove.size() > 0;
  return edgesToRemove;
}
Program: 146660
Project: 146660
Buggy source:
public void registerModule(){
  String[] classes={"String_Node_Str","String_Node_Str"};
  PrototypeManager.registerPrototypes(classes);
  PrototypeManager.registerPrototypes(XPathParseTool.xpathClasses);
  RestoreUtils.xfFact=new IXFormyFactory(){
    public TreeReference ref(    String refStr){
      return FormInstance.unpackReference(new XPathReference(refStr));
    }
    public IDataPayload serializeInstance(    FormInstance dm){
      try {
        return (new XFormSerializingVisitor()).createSerializedPayload(dm);
      }
 catch (      IOException e) {
        return null;
      }
    }
    public FormInstance parseRestore(    byte[] data,    Class restorableType){
      return XFormParser.restoreDataModel(data,restorableType);
    }
    public IConditionExpr refToPathExpr(    TreeReference ref){
      return new XPathConditional(XPathPathExpr.fromRef(ref));
    }
  }
;
}

Fixed version (ground truth):
public void registerModule(){
  String[] classes={"String_Node_Str","String_Node_Str"};
  PrototypeManager.registerPrototypes(classes);
  PrototypeManager.registerPrototypes(XPathParseTool.xpathClasses);
  RestoreUtils.xfFact=new IXFormyFactory(){
    public TreeReference ref(    String refStr){
      return FormInstance.unpackReference(new XPathReference(refStr));
    }
    public IDataPayload serializeInstance(    FormInstance dm){
      try {
        return (new XFormSerializingVisitor()).createSerializedPayload(dm);
      }
 catch (      IOException e) {
        return null;
      }
    }
    public IConditionExpr refToPathExpr(    TreeReference ref){
      return new XPathConditional(XPathPathExpr.fromRef(ref));
    }
  }
;
}
Program: 146661
Project: 146661
Buggy source:
protected AbstractTreeElement setupFixtureData(ExternalDataInstance instance){
  String ref=instance.getReference();
  String userId="String_Node_Str";
  User u=mSandbox.getLoggedInUser();
  if (u != null) {
    userId=u.getUniqueId();
  }
  String refId=ref.substring(ref.lastIndexOf('/') + 1,ref.length());
  try {
    FormInstance fixture=SandboxUtils.loadFixture(mSandbox,refId,userId);
    if (fixture == null) {
      throw new RuntimeException("String_Node_Str" + ref);
    }
    TreeElement root=fixture.getRoot();
    root.setParent(instance.getBase());
    return root;
  }
 catch (  IllegalStateException ise) {
    throw new RuntimeException("String_Node_Str" + ref);
  }
}

Fixed version (ground truth):
protected AbstractTreeElement setupFixtureData(ExternalDataInstance instance){
  String ref=instance.getReference();
  String userId="String_Node_Str";
  User u=mSandbox.getLoggedInUser();
  if (u != null) {
    userId=u.getUniqueId();
  }
  String refId=ref.substring(ref.lastIndexOf('/') + 1,ref.length());
  try {
    FormInstance fixture=SandboxUtils.loadFixture(mSandbox,refId,userId);
    if (fixture == null) {
      throw new FixtureInitializationException("String_Node_Str" + ref);
    }
    TreeElement root=fixture.getRoot();
    root.setParent(instance.getBase());
    return root;
  }
 catch (  IllegalStateException ise) {
    throw new FixtureInitializationException("String_Node_Str" + ref);
  }
}
Program: 146664
Project: 146664
Buggy source:
public static FormInstance loadFixtureForUser(String refId,String userId){
  IStorageUtilityIndexed storage=(IStorageUtilityIndexed)StorageManager.getStorage("String_Node_Str");
  FormInstance fixture=null;
  Vector<Integer> relevantFixtures=storage.getIDsForValue(FormInstance.META_ID,refId);
  if (relevantFixtures.size() == 1) {
    fixture=(FormInstance)storage.read(relevantFixtures.elementAt(0).intValue());
  }
 else   if (relevantFixtures.size() > 1) {
    Vector<Integer> relevantUserFixtures=storage.getIDsForValue(FormInstance.META_XMLNS,userId);
    if (relevantUserFixtures.size() != 0) {
      Integer userFixture=ArrayUtilities.intersectSingle(relevantFixtures,relevantUserFixtures);
      if (userFixture != null) {
        fixture=(FormInstance)storage.read(userFixture.intValue());
      }
    }
    if (fixture == null) {
      Integer globalFixture=ArrayUtilities.intersectSingle(storage.getIDsForValue(FormInstance.META_XMLNS,"String_Node_Str"),relevantFixtures);
      if (globalFixture == null) {
        return null;
      }
      fixture=(FormInstance)storage.read(globalFixture.intValue());
    }
  }
 else {
    return null;
  }
  return fixture;
}

Fixed version (ground truth):
public static FormInstance loadFixtureForUser(String refId,String userId){
  IStorageUtilityIndexed storage=(IStorageUtilityIndexed)StorageManager.getStorage(FormInstance.STORAGE_KEY);
  FormInstance fixture=null;
  Vector<Integer> relevantFixtures=storage.getIDsForValue(FormInstance.META_ID,refId);
  if (relevantFixtures.size() == 1) {
    fixture=(FormInstance)storage.read(relevantFixtures.elementAt(0).intValue());
  }
 else   if (relevantFixtures.size() > 1) {
    Vector<Integer> relevantUserFixtures=storage.getIDsForValue(FormInstance.META_XMLNS,userId);
    if (relevantUserFixtures.size() != 0) {
      Integer userFixture=ArrayUtilities.intersectSingle(relevantFixtures,relevantUserFixtures);
      if (userFixture != null) {
        fixture=(FormInstance)storage.read(userFixture.intValue());
      }
    }
    if (fixture == null) {
      Integer globalFixture=ArrayUtilities.intersectSingle(storage.getIDsForValue(FormInstance.META_XMLNS,"String_Node_Str"),relevantFixtures);
      if (globalFixture == null) {
        return null;
      }
      fixture=(FormInstance)storage.read(globalFixture.intValue());
    }
  }
 else {
    return null;
  }
  return fixture;
}
Program: 146665
Project: 146665
Buggy source:
protected IStorageUtilityIndexed<FormInstance> getFixtureStorage(){
  return (IStorageUtilityIndexed<FormInstance>)StorageManager.getStorage("String_Node_Str");
}

Fixed version (ground truth):
protected IStorageUtilityIndexed<FormInstance> getFixtureStorage(){
  return (IStorageUtilityIndexed<FormInstance>)StorageManager.getStorage(FormInstance.STORAGE_KEY);
}
Program: 146666
Project: 146666
Buggy source:
public IStorageUtilityIndexed<FormInstance> storage(){
  if (fixtureStorage == null) {
    fixtureStorage=CommCareTransactionParserFactory.this.sandbox.getUserFixtureStorage();
  }
  return fixtureStorage;
}

Fixed version (ground truth):
public IStorageUtilityIndexed<FormInstance> storage(){
  if (fixtureStorage == null) {
    fixtureStorage=sandbox.getUserFixtureStorage();
  }
  return fixtureStorage;
}
Program: 146667
Project: 146667
Buggy source:
public void initFixtureParser(){
  fixtureParser=new TransactionParserFactory(){
    FixtureXmlParser created=null;
    public TransactionParser getParser(    KXmlParser parser){
      if (created == null) {
        created=new FixtureXmlParser(parser){
          private IStorageUtilityIndexed<FormInstance> fixtureStorage;
          public IStorageUtilityIndexed<FormInstance> storage(){
            if (fixtureStorage == null) {
              fixtureStorage=CommCareTransactionParserFactory.this.sandbox.getUserFixtureStorage();
            }
            return fixtureStorage;
          }
        }
;
      }
      return created;
    }
  }
;
}

Fixed version (ground truth):
public void initFixtureParser(){
  fixtureParser=new TransactionParserFactory(){
    FixtureXmlParser created=null;
    public TransactionParser getParser(    KXmlParser parser){
      if (created == null) {
        created=new FixtureXmlParser(parser){
          private IStorageUtilityIndexed<FormInstance> fixtureStorage;
          public IStorageUtilityIndexed<FormInstance> storage(){
            if (fixtureStorage == null) {
              fixtureStorage=sandbox.getUserFixtureStorage();
            }
            return fixtureStorage;
          }
        }
;
      }
      return created;
    }
  }
;
}
Program: 146668
Project: 146668
Buggy source:
public CommCareConfigEngine(OutputStream output,PrototypeFactory prototypeFactory){
  this.output=output;
  this.print=new PrintStream(output);
  this.platform=new CommCarePlatform(2,26);
  this.mLiveFactory=prototypeFactory;
  setRoots();
  table=ResourceTable.RetrieveTable(new DummyIndexedStorageUtility(Resource.class,mLiveFactory));
  updateTable=ResourceTable.RetrieveTable(new DummyIndexedStorageUtility(Resource.class,mLiveFactory));
  recoveryTable=ResourceTable.RetrieveTable(new DummyIndexedStorageUtility(Resource.class,mLiveFactory));
  StorageManager.forceClear();
  StorageManager.setStorageFactory(new IStorageFactory(){
    public IStorageUtility newStorage(    String name,    Class type){
      return new DummyIndexedStorageUtility(type,mLiveFactory);
    }
  }
);
  StorageManager.registerStorage(Profile.STORAGE_KEY,Profile.class);
  StorageManager.registerStorage(Suite.STORAGE_KEY,Suite.class);
  StorageManager.registerStorage(FormDef.STORAGE_KEY,FormDef.class);
  StorageManager.registerStorage("String_Node_Str",FormInstance.class);
}

Fixed version (ground truth):
public CommCareConfigEngine(OutputStream output,PrototypeFactory prototypeFactory){
  this.output=output;
  this.print=new PrintStream(output);
  this.platform=new CommCarePlatform(2,26);
  this.mLiveFactory=prototypeFactory;
  setRoots();
  table=ResourceTable.RetrieveTable(new DummyIndexedStorageUtility(Resource.class,mLiveFactory));
  updateTable=ResourceTable.RetrieveTable(new DummyIndexedStorageUtility(Resource.class,mLiveFactory));
  recoveryTable=ResourceTable.RetrieveTable(new DummyIndexedStorageUtility(Resource.class,mLiveFactory));
  StorageManager.forceClear();
  StorageManager.setStorageFactory(new IStorageFactory(){
    public IStorageUtility newStorage(    String name,    Class type){
      return new DummyIndexedStorageUtility(type,mLiveFactory);
    }
  }
);
  StorageManager.registerStorage(Profile.STORAGE_KEY,Profile.class);
  StorageManager.registerStorage(Suite.STORAGE_KEY,Suite.class);
  StorageManager.registerStorage(FormDef.STORAGE_KEY,FormDef.class);
  StorageManager.registerStorage(FormInstance.STORAGE_KEY,FormInstance.class);
}
Program: 146669
Project: 146669
Buggy source:
@Override public void writeExternal(DataOutputStream out) throws IOException {
  ExtUtil.writeString(out,frameId);
  ExtUtil.write(out,new ExtWrapList(steps));
  ExtUtil.write(out,new ExtWrapList(snapshot));
  ExtUtil.writeBool(out,dead);
}

Fixed version (ground truth):
@Override public void writeExternal(DataOutputStream out) throws IOException {
  ExtUtil.write(out,new ExtWrapNullable(frameId));
  ExtUtil.write(out,new ExtWrapList(steps));
  ExtUtil.write(out,new ExtWrapList(snapshot));
  ExtUtil.writeBool(out,dead);
}
Program: 146670
Project: 146670
Buggy source:
public synchronized void clearSnapshot(){
  this.snapshot=null;
}

Fixed version (ground truth):
public synchronized void clearSnapshot(){
  this.snapshot.clear();
}
Program: 146671
Project: 146671
Buggy source:
/** 
 * Requests that the frame capture an original snapshot of its state. This snapshot can be referenced later to compare the eventual state of the frame to an earlier point
 */
public synchronized void captureSnapshot(){
  snapshot=new Vector<StackFrameStep>();
  for (  StackFrameStep s : steps) {
    snapshot.addElement(s);
  }
}

Fixed version (ground truth):
/** 
 * Requests that the frame capture an original snapshot of its state. This snapshot can be referenced later to compare the eventual state of the frame to an earlier point
 */
public synchronized void captureSnapshot(){
  snapshot.clear();
  for (  StackFrameStep s : steps) {
    snapshot.addElement(s);
  }
}
Program: 146672
Project: 146672
Buggy source:
@Override public void readExternal(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  frameId=ExtUtil.readString(in);
  steps=(Vector<StackFrameStep>)ExtUtil.read(in,new ExtWrapList(StackFrameStep.class),pf);
  snapshot=(Vector<StackFrameStep>)ExtUtil.read(in,new ExtWrapList(StackFrameStep.class),pf);
  dead=ExtUtil.readBool(in);
}

Fixed version (ground truth):
@Override public void readExternal(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  frameId=(String)ExtUtil.read(in,new ExtWrapNullable(String.class));
  steps=(Vector<StackFrameStep>)ExtUtil.read(in,new ExtWrapList(StackFrameStep.class),pf);
  snapshot=(Vector<StackFrameStep>)ExtUtil.read(in,new ExtWrapList(StackFrameStep.class),pf);
  dead=ExtUtil.readBool(in);
}
Program: 146673
Project: 146673
Buggy source:
/** 
 * Determines whether the current frame state is incompatible with a previously snapshotted frame state, if one exists. If no snapshot exists, this method will return false. Compatibility is determined by checking that each step in the previous snapshot is matched by an identical step in the current snapshot.
 */
public synchronized boolean isSnapshotIncompatible(){
  if (snapshot == null) {
    return false;
  }
  if (snapshot.size() > steps.size()) {
    return true;
  }
  for (int i=0; i < snapshot.size(); ++i) {
    if (!snapshot.elementAt(i).equals(steps.elementAt(i))) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Determines whether the current frame state is incompatible with a previously snapshotted frame state, if one exists. If no snapshot exists, this method will return false. Compatibility is determined by checking that each step in the previous snapshot is matched by an identical step in the current snapshot.
 */
public synchronized boolean isSnapshotIncompatible(){
  if (snapshot.isEmpty()) {
    return false;
  }
  if (snapshot.size() > steps.size()) {
    return true;
  }
  for (int i=0; i < snapshot.size(); ++i) {
    if (!snapshot.elementAt(i).equals(steps.elementAt(i))) {
      return true;
    }
  }
  return false;
}
Program: 146674
Project: 146674
Buggy source:
@Override public String toString(){
  StringBuilder output=new StringBuilder("String_Node_Str");
  prettyPrintSteps(steps,output);
  if (snapshot != null && !snapshot.isEmpty()) {
    output.append("String_Node_Str");
    prettyPrintSteps(snapshot,output);
  }
  if (dead) {
    output.append("String_Node_Str");
  }
  return output.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder output=new StringBuilder("String_Node_Str");
  prettyPrintSteps(steps,output);
  if (!snapshot.isEmpty()) {
    output.append("String_Node_Str");
    prettyPrintSteps(snapshot,output);
  }
  if (dead) {
    output.append("String_Node_Str");
  }
  return output.toString();
}
Program: 146676
Project: 146676
Buggy source:
public Vector getChildrenWithName(String name){
  Vector children=super.getChildrenWithName(CaseChildElement.this.parent.intern(name));
  if (!done[0]) {
    return children;
  }
  if (children.size() == 0) {
    TreeElement emptyNode=new TreeElement(name);
    emptyNode.setAttribute(null,"String_Node_Str","String_Node_Str");
    this.addChild(emptyNode);
    emptyNode.setParent(this);
    children.addElement(emptyNode);
  }
  return children;
}

Fixed version (ground truth):
public Vector getChildrenWithName(String name){
  Vector children=super.getChildrenWithName(CaseChildElement.this.parent.intern(name));
  if (!done[0]) {
    return children;
  }
  if (children.size() == 0) {
    TreeElement emptyNode=new TreeElement(name);
    emptyNode.setAttribute(null,"String_Node_Str","String_Node_Str");
    emptyNode.setAttribute(null,"String_Node_Str","String_Node_Str");
    this.addChild(emptyNode);
    emptyNode.setParent(this);
    children.addElement(emptyNode);
  }
  return children;
}
Program: 146678
Project: 146678
Buggy source:
/** 
 * Rebase assigns this tree element to a new root instance node. Used to migrate the already created tree structure to a new instance connector.
 * @param instanceRoot The root of the new tree that this element should be a part of
 */
public void rebase(AbstractTreeElement instanceRoot){
  this.instanceRoot=instanceRoot;
  expireCachedRef();
}

Fixed version (ground truth):
/** 
 * Rebase assigns this tree element to a new root instance node. Used to migrate the already created tree structure to a new instance connector.
 * @param instanceRoot The root of the new tree that this element should be a part of//     
 */
public void rebase(AbstractTreeElement instanceRoot){
  this.instanceRoot=instanceRoot;
  expireCachedRef();
}
Program: 146679
Project: 146679
Buggy source:
@Override public Object eval(FormInstance model,EvaluationContext ec){
  try {
    return expr.evalRaw(model,ec);
  }
 catch (  XPathException e) {
    e.setSource("String_Node_Str" + contextRef.toString(true));
    throw e;
  }
}

Fixed version (ground truth):
public Object eval(FormInstance model,EvaluationContext ec){
  try {
    return expr.evalRaw(model,ec);
  }
 catch (  XPathException e) {
    e.setSource("String_Node_Str" + contextRef.toString(true));
    throw e;
  }
}
Program: 146680
Project: 146680
Buggy source:
@Override public boolean canCascade(){
  return true;
}

Fixed version (ground truth):
public boolean canCascade(){
  return true;
}
Program: 146681
Project: 146681
Buggy source:
@Override public void apply(TreeReference ref,Object result,FormInstance model,FormDef f){
  int dataType=f.getMainInstance().resolveReference(ref).getDataType();
  f.setAnswer(wrapData(result,dataType),ref);
}

Fixed version (ground truth):
public void apply(TreeReference ref,Object result,FormInstance model,FormDef f){
  int dataType=f.getMainInstance().resolveReference(ref).getDataType();
  f.setAnswer(wrapData(result,dataType),ref);
}
Program: 146682
Project: 146682
Buggy source:
@Override public String getDebugLabel(){
  return "String_Node_Str";
}

Fixed version (ground truth):
public String getDebugLabel(){
  return "String_Node_Str";
}
Program: 146683
Project: 146683
Buggy source:
/** 
 * Creates a new factory for processing incoming XML.
 * @param tolerant True if processing should fail in the event of conflicting data,false if processing should proceed as long as it is possible.
 */
public J2METransactionParserFactory(boolean tolerant){
  super(new J2MESandbox());
  syncToken=null;
  caseTallies=new int[3];
  this.tolerant=tolerant;
}

Fixed version (ground truth):
/** 
 * Creates a new factory for processing incoming XML.
 * @param tolerant True if processing should fail in the event of conflicting data,false if processing should proceed as long as it is possible.
 */
public J2METransactionParserFactory(boolean tolerant){
  super(new J2MESandbox());
  caseTallies=new int[3];
  this.tolerant=tolerant;
}
Program: 146684
Project: 146684
Buggy source:
/** 
 * Copy constructor
 */
public ExternalDataInstance(ExternalDataInstance instance){
  super(instance.getInstanceId());
  this.reference=instance.getReference();
  this.base=instance.getBase();
  this.root=instance.getRoot();
}

Fixed version (ground truth):
/** 
 * Copy constructor
 */
public ExternalDataInstance(ExternalDataInstance instance){
  super(instance.getInstanceId());
  this.reference=instance.getReference();
  this.base=instance.getBase();
  this.root=instance.getRoot();
  this.mCacheHost=instance.getCacheHost();
}
Program: 146686
Project: 146686
Buggy source:
/** 
 * Take in a value (only a string for now, TODO: Extend?) that doesn't have any type information and attempt to infer a more specific type that may assist in equality or comparison operations
 * @param attrValue A typeless data object
 * @return The passed in object in as specific of a type as was able tobe identified.
 */
public static Object InferType(String attrValue){
  try {
    return new Double(Double.parseDouble(attrValue));
  }
 catch (  NumberFormatException ife) {
  }
  return attrValue;
}

Fixed version (ground truth):
/** 
 * Take in a value (only a string for now, TODO: Extend?) that doesn't have any type information and attempt to infer a more specific type that may assist in equality or comparison operations
 * @param attrValue A typeless data object
 * @return The passed in object in as specific of a type as was able tobe identified.
 */
public static Object InferType(String attrValue){
  Double d=mDoubleParseCache.retrieve(attrValue);
  if (d != null) {
    if (d.isNaN()) {
      return attrValue;
    }
 else {
      return d;
    }
  }
  try {
    Double ret=new Double(Double.parseDouble(attrValue));
    mDoubleParseCache.register(attrValue,ret);
    return ret;
  }
 catch (  NumberFormatException ife) {
    mDoubleParseCache.register(attrValue,new Double(Double.NaN));
  }
  return attrValue;
}
Program: 146688
Project: 146688
Buggy source:
/** 
 * Given an array of details, count their total number of fields.
 * @return int
 */
private int getFlattenedFieldCount(){
  Detail[] details=this.getFlattenedDetails();
  int count=0;
  for (int i=0; i < details.length; i++) {
    count+=details[i].getFields().length;
  }
  return count;
}

Fixed version (ground truth):
/** 
 * Given an array of details, count their total number of fields.
 * @return int
 */
public int getFlattenedFieldCount(){
  Detail[] details=this.getFlattenedDetails();
  int count=0;
  for (int i=0; i < details.length; i++) {
    count+=details[i].getFields().length;
  }
  return count;
}
Program: 146690
Project: 146690
Buggy source:
public static void parseAndAdd(OrderedHashtable locale,String line,int curline){
  line=line.trim();
  int i=0;
  int dec=line.length();
  while ((i=LocalizationUtils.lastIndexOf(line.substring(0,dec),"String_Node_Str")) != -1) {
    if ((i != 0) && !(line.charAt(i - 1) == '\\')) {
      line=line.substring(0,i);
      dec=line.length();
    }
 else {
      dec=i;
    }
  }
  if (line.indexOf('=') == -1) {
    if (line.trim().equals("String_Node_Str")) {
    }
 else {
      System.out.println("String_Node_Str" + curline + "String_Node_Str"+ line);
    }
  }
 else {
    if (line.indexOf('=') != line.length() - 1) {
      String value=line.substring(line.indexOf('=') + 1,line.length());
      locale.put(line.substring(0,line.indexOf('=')),parseValue(value));
    }
 else {
      System.out.println("String_Node_Str" + curline + "String_Node_Str"+ line+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public static void parseAndAdd(OrderedHashtable locale,String line,int curline){
  line=line.trim();
  int i=0;
  int dec=line.length();
  while ((i=LocalizationUtils.lastIndexOf(line.substring(0,dec),"String_Node_Str")) != -1) {
    if ((i == 0) || !(line.charAt(i - 1) == '\\')) {
      line=line.substring(0,i);
      dec=line.length();
    }
 else {
      dec=i;
    }
  }
  if (line.indexOf('=') == -1) {
    if (line.trim().equals("String_Node_Str")) {
    }
 else {
      System.out.println("String_Node_Str" + curline + "String_Node_Str"+ line);
    }
  }
 else {
    if (line.indexOf('=') != line.length() - 1) {
      String value=line.substring(line.indexOf('=') + 1,line.length());
      locale.put(line.substring(0,line.indexOf('=')),parseValue(value));
    }
 else {
      System.out.println("String_Node_Str" + curline + "String_Node_Str"+ line+ "String_Node_Str");
    }
  }
}
Program: 146691
Project: 146691
Buggy source:
public CaseChildElement getChild(String name,int multiplicity){
  if ((multiplicity == TreeReference.INDEX_TEMPLATE) && "String_Node_Str".equals(name)) {
    return CaseChildElement.TemplateElement(this);
  }
  if (name.equals("String_Node_Str")) {
    getCases();
    if (cases.size() == 0) {
      return CaseChildElement.TemplateElement(this);
    }
    return cases.elementAt(multiplicity);
  }
  return null;
}

Fixed version (ground truth):
public CaseChildElement getChild(String name,int multiplicity){
  if ((multiplicity == TreeReference.INDEX_TEMPLATE) && "String_Node_Str".equals(name)) {
    return null;
  }
  if (name.equals("String_Node_Str")) {
    getCases();
    if (cases.size() == 0) {
      return CaseChildElement.TemplateElement(this);
    }
    return cases.elementAt(multiplicity);
  }
  return null;
}