Program: 145137
Project: 145137
Buggy source:
private void jumpToQuestion(FormIndex questionIndex){
  boolean newRepeat=false;
  if (questionIndex.isInForm() && !model.isIndexRelevant(questionIndex))   throw new IllegalStateException();
  updatePins(questionIndex);
  IFormElement last=model.getForm().getChild(questionIndex);
  if (last instanceof GroupDef) {
    if (((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 {
      boolean forwards=questionIndex.compareTo(activeQuestionIndex) > 0;
      if (forwards) {
        createHeaderForElement(questionIndex);
      }
 else {
        removeHeaderForElement(questionIndex);
      }
      if (forwards) {
        step(controller.stepToNextEvent());
      }
 else {
        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);
    }
  }
 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) {
        putQuestion(questionIndex,true,newRepeat);
      }
 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 {
    this.addCommand(backCommand);
  }
  babysitStyles();
}

Fixed version (ground truth):
private void jumpToQuestion(FormIndex questionIndex){
  boolean newRepeat=false;
  if (questionIndex.isInForm() && !model.isIndexRelevant(questionIndex))   throw new IllegalStateException();
  updatePins(questionIndex);
  IFormElement last=model.getForm().getChild(questionIndex);
  if (last instanceof GroupDef) {
    if (((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 {
      boolean forwards=questionIndex.compareTo(activeQuestionIndex) > 0;
      if (forwards) {
        createHeaderForElement(questionIndex);
      }
 else {
        removeHeaderForElement(questionIndex);
      }
      if (forwards) {
        step(controller.stepToNextEvent());
      }
 else {
        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);
    }
  }
 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) {
        putQuestion(questionIndex,true,newRepeat);
      }
 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();
}