Program: 145074
Project: 145074
Buggy source:
private void jumpToQuestion(FormIndex questionIndex){
  System.out.println(this.questionIndexes.toString());
  boolean newRepeat=false;
  if (questionIndex.isInForm() && !model.isIndexRelevant(questionIndex))   throw new IllegalStateException();
  updatePins(questionIndex);
  IFormElement last=model.getForm().getChild(questionIndex);
  Vector indexes=new Vector();
  Vector multiplicities=new Vector();
  Vector elements=new Vector();
  model.getForm().collapseIndex(questionIndex,indexes,multiplicities,elements);
  int mult=((Integer)multiplicities.lastElement()).intValue();
  if (last instanceof GroupDef) {
    if (!FormIndex.EXPERIMENTAL_API && ((GroupDef)last).getRepeat() && model.getForm().getInstance().resolveReference(model.getForm().getChildInstanceRef(questionIndex)) == null) {
      if (((GroupDef)last).noAddRemove) {
        boolean forwards=questionIndex.compareTo(activeQuestionIndex) > 0;
        if (forwards) {
          step(controller.stepToNextEvent());
        }
 else {
          step(controller.stepToPreviousEvent());
        }
        return;
      }
 else {
        newRepeat=true;
      }
    }
 else     if (FormIndex.EXPERIMENTAL_API && ((GroupDef)last).getRepeat() && mult == TreeReference.INDEX_REPEAT_JUNCTURE) {
      System.out.println("String_Node_Str");
      newRepeat=true;
    }
 else {
      boolean forwards=questionIndex.compareTo(activeQuestionIndex) > 0;
      if (forwards) {
        createHeaderForElement(questionIndex,false);
        step(controller.stepToNextEvent());
      }
 else {
        removeHeaderForElement(questionIndex);
        step(controller.stepToPreviousEvent());
      }
      return;
    }
  }
 else   if (questionIndex.isInForm() && model.isIndexReadonly(questionIndex)) {
    boolean forwards=questionIndex.compareTo(activeQuestionIndex) > 0;
    if (forwards) {
      step(controller.stepToNextEvent());
    }
 else {
      step(controller.stepToPreviousEvent());
    }
    return;
  }
  if (questionIndex.compareTo(activeQuestionIndex) > 0) {
    if (activeQuestionIndex.isInForm()) {
      if (activeIsInterstitial) {
        removeFrame(activeQuestionIndex);
      }
 else {
        ((ChatterboxWidget)get(questionIndexes.indexOf(activeQuestionIndex,true))).setViewState(ChatterboxWidget.VIEW_COLLAPSED);
      }
    }
    FormIndex index=activeQuestionIndex;
    while (!index.equals(questionIndex)) {
      index=model.getForm().incrementIndex(index);
      putQuestion(index,index.equals(questionIndex),newRepeat ? Q_REPEAT_JUNCTURE : Q_NORMAL);
    }
  }
 else   if (questionIndex.compareTo(activeQuestionIndex) <= 0) {
    FormIndex index=activeQuestionIndex;
    while (!index.equals(questionIndex)) {
      removeFrame(index);
      index=model.getForm().decrementIndex(index);
    }
    if (questionIndex.isInForm()) {
      if (newRepeat) {
        removeFrame(questionIndex);
        putQuestion(questionIndex,true,newRepeat ? (deleteInterstitial ? Q_REPEAT_DELETE : Q_REPEAT_JUNCTURE) : Q_NORMAL);
      }
 else {
        ((ChatterboxWidget)get(questionIndexes.indexOf(questionIndex,true))).setViewState(ChatterboxWidget.VIEW_EXPANDED);
      }
    }
  }
  if (!questionIndex.equals(activeQuestionIndex)) {
    activeQuestionIndex=questionIndex;
    if (activeQuestionIndex.isInForm()) {
      int index=questionIndexes.indexOf(activeQuestionIndex,true);
      ChatterboxWidget widget=(ChatterboxWidget)get(index);
      widget.setPinned(true);
      widget.showCommands();
      int prevheight=this.container.getScrollHeight();
      this.container.setScrollHeight(-1);
      this.focus(widget,true);
      this.container.setScrollHeight(prevheight);
    }
    progressBar.setMaxValue(model.getNumQuestions());
    progressBar.setValue(questionIndexes.size());
  }
  if (this.questionIndexes.size() <= 1) {
    this.removeCommand(backCommand);
  }
 else {
    addBackCommand();
  }
  babysitStyles();
}

Fixed version (ground truth):
private void jumpToQuestion(FormIndex questionIndex){
  System.out.println(this.questionIndexes.toString());
  boolean newRepeat=false;
  if (questionIndex.isInForm() && !model.isIndexRelevant(questionIndex))   throw new IllegalStateException();
  updatePins(questionIndex);
  IFormElement last=model.getForm().getChild(questionIndex);
  Vector indexes=new Vector();
  Vector multiplicities=new Vector();
  Vector elements=new Vector();
  model.getForm().collapseIndex(questionIndex,indexes,multiplicities,elements);
  int mult=((Integer)multiplicities.lastElement()).intValue();
  if (last instanceof GroupDef) {
    if (!FormIndex.EXPERIMENTAL_API && ((GroupDef)last).getRepeat() && model.getForm().getInstance().resolveReference(model.getForm().getChildInstanceRef(questionIndex)) == null) {
      if (((GroupDef)last).noAddRemove) {
        boolean forwards=questionIndex.compareTo(activeQuestionIndex) > 0;
        if (forwards) {
          step(controller.stepToNextEvent());
        }
 else {
          step(controller.stepToPreviousEvent());
        }
        return;
      }
 else {
        newRepeat=true;
      }
    }
 else     if (FormIndex.EXPERIMENTAL_API && ((GroupDef)last).getRepeat() && mult == TreeReference.INDEX_REPEAT_JUNCTURE) {
      System.out.println("String_Node_Str");
      newRepeat=true;
    }
 else {
      boolean forwards=questionIndex.compareTo(activeQuestionIndex) > 0;
      if (forwards) {
        createHeaderForElement(questionIndex,false);
        step(controller.stepToNextEvent());
      }
 else {
        removeHeaderForElement(questionIndex);
        step(controller.stepToPreviousEvent());
      }
      return;
    }
  }
 else   if (questionIndex.isInForm() && model.isIndexReadonly(questionIndex)) {
    boolean forwards=questionIndex.compareTo(activeQuestionIndex) > 0;
    if (forwards) {
      step(controller.stepToNextEvent());
    }
 else {
      step(controller.stepToPreviousEvent());
    }
    return;
  }
  if (questionIndex.compareTo(activeQuestionIndex) > 0) {
    if (activeQuestionIndex.isInForm()) {
      if (activeIsInterstitial) {
        removeFrame(activeQuestionIndex);
      }
 else {
        ((ChatterboxWidget)get(questionIndexes.indexOf(activeQuestionIndex,true))).setViewState(ChatterboxWidget.VIEW_COLLAPSED);
      }
    }
    FormIndex index=activeQuestionIndex;
    while (!index.equals(questionIndex)) {
      index=model.getForm().incrementIndex(index);
      putQuestion(index,index.equals(questionIndex),newRepeat ? Q_REPEAT_JUNCTURE : Q_NORMAL);
    }
  }
 else   if (questionIndex.compareTo(activeQuestionIndex) <= 0) {
    FormIndex index=activeQuestionIndex;
    while (!index.equals(questionIndex)) {
      removeFrame(index);
      index=model.getForm().decrementIndex(index);
    }
    if (questionIndex.isInForm()) {
      if (newRepeat) {
        removeFrame(questionIndex);
        putQuestion(questionIndex,true,newRepeat ? (deleteInterstitial ? Q_REPEAT_DELETE : Q_REPEAT_JUNCTURE) : Q_NORMAL);
      }
 else {
        ((ChatterboxWidget)get(questionIndexes.indexOf(questionIndex,true))).setViewState(ChatterboxWidget.VIEW_EXPANDED);
      }
    }
  }
  if (!questionIndex.equals(activeQuestionIndex) || activeIsInterstitial) {
    activeQuestionIndex=questionIndex;
    if (activeQuestionIndex.isInForm()) {
      int index=questionIndexes.indexOf(activeQuestionIndex,true);
      ChatterboxWidget widget=(ChatterboxWidget)get(index);
      widget.setPinned(true);
      widget.showCommands();
      int prevheight=this.container.getScrollHeight();
      this.container.setScrollHeight(-1);
      this.focus(widget,true);
      this.container.setScrollHeight(prevheight);
    }
    progressBar.setMaxValue(model.getNumQuestions());
    progressBar.setValue(questionIndexes.size());
  }
  if (this.questionIndexes.size() <= 1) {
    this.removeCommand(backCommand);
  }
 else {
    addBackCommand();
  }
  babysitStyles();
}