Program: 150878
Project: 150878
Buggy source:
private void handleClearDots(boolean detected){
  String message="String_Node_Str";
  drawPadding();
  if (detected) {
    gui.getInfoPanel().updateView(saver.getCurrentView());
    gui.getInfoPanel().updateFocusScore(saver.getFocusScore());
    double stationaryTime=actions.getStationaryTime();
    CalibrationObservation points=detector.getDetectedPoints();
    view.getSides(points,sides);
    boolean closeToMagnet=false;
    for (int i=0; i < magnets.size(); i++) {
      closeToMagnet|=magnets.get(i).handleDetection();
    }
    boolean resetImageSelector=true;
    if (pictureTaken) {
      if (stationaryTime >= STILL_THRESHOLD) {
        message="String_Node_Str";
      }
 else {
        pictureTaken=false;
      }
    }
 else     if (stationaryTime >= STILL_THRESHOLD) {
      if (checkMagnetCapturePicture()) {
        saver.save();
        pictureTaken=true;
        message="String_Node_Str";
        captureFiducialPoints();
        gui.getInfoPanel().updateEdgeFill(1.0 - (magnets.size() / (double)totalMagnets));
        if (magnets.isEmpty()) {
          state=State.FILL_SCREEN;
        }
      }
    }
 else     if (stationaryTime > DISPLAY_TIME) {
      if (closeToMagnet) {
        message=String.format("String_Node_Str",stationaryTime);
        resetImageSelector=false;
      }
 else {
        message="String_Node_Str";
      }
    }
    if (resetImageSelector) {
      saver.clearHistory();
      saver.updateScore(input,sides);
    }
 else {
      saver.process(inputBuffered,input,sides);
    }
    renderMagnets();
    renderArrows();
    renderCalibrationPoints(stationaryTime,points.points);
  }
 else {
    saver.clearHistory();
    for (int i=0; i < magnets.size(); i++) {
      magnets.get(i).handleNoDetection();
    }
    renderMagnets();
  }
  renderFillPolygons();
  gui.setMessage(message);
}

Fixed version (ground truth):
private void handleClearDots(boolean detected){
  String message="String_Node_Str";
  if (detected) {
    gui.getInfoPanel().updateView(saver.getCurrentView());
    gui.getInfoPanel().updateFocusScore(saver.getFocusScore());
    double stationaryTime=actions.getStationaryTime();
    CalibrationObservation points=detector.getDetectedPoints();
    view.getSides(points,sides);
    boolean closeToMagnet=false;
    for (int i=0; i < magnets.size(); i++) {
      closeToMagnet|=magnets.get(i).handleDetection();
    }
    boolean resetImageSelector=true;
    if (pictureTaken) {
      if (stationaryTime >= STILL_THRESHOLD) {
        message="String_Node_Str";
      }
 else {
        pictureTaken=false;
      }
    }
 else     if (stationaryTime >= STILL_THRESHOLD) {
      if (checkMagnetCapturePicture()) {
        saver.save();
        pictureTaken=true;
        message="String_Node_Str";
        captureFiducialPoints();
        gui.getInfoPanel().updateEdgeFill(1.0 - (magnets.size() / (double)totalMagnets));
        if (magnets.isEmpty()) {
          state=State.FILL_SCREEN;
        }
      }
    }
 else     if (stationaryTime > DISPLAY_TIME) {
      if (closeToMagnet) {
        message=String.format("String_Node_Str",stationaryTime);
        resetImageSelector=false;
      }
 else {
        message="String_Node_Str";
      }
    }
    if (resetImageSelector) {
      saver.clearHistory();
      saver.updateScore(input,sides);
    }
 else {
      saver.process(inputBuffered,input,sides);
    }
    drawPadding();
    renderMagnets();
    renderArrows();
    renderCalibrationPoints(stationaryTime,points.points);
  }
 else {
    drawPadding();
    saver.clearHistory();
    for (int i=0; i < magnets.size(); i++) {
      magnets.get(i).handleNoDetection();
    }
    renderMagnets();
  }
  renderFillPolygons();
  gui.setMessage(message);
}