Program: 112482
Project: 112482
Buggy source:
@Override public void update(GameContainer container,StateBasedGame game,int delta) throws SlickException {
  UI.update(delta);
  if (reloadThread == null)   MusicController.loopTrackIfEnded(true);
  int mouseX=input.getMouseX(), mouseY=input.getMouseY();
  UI.getBackButton().hoverUpdate(delta,mouseX,mouseY);
  selectModsButton.hoverUpdate(delta,mouseX,mouseY);
  selectRandomButton.hoverUpdate(delta,mouseX,mouseY);
  selectMapOptionsButton.hoverUpdate(delta,mouseX,mouseY);
  selectOptionsButton.hoverUpdate(delta,mouseX,mouseY);
  if (beatmapMenuTimer > -1) {
    beatmapMenuTimer+=delta;
    if (beatmapMenuTimer >= BEATMAP_MENU_DELAY) {
      beatmapMenuTimer=-1;
      if (focusNode != null) {
        ((ButtonMenu)game.getState(Opsu.STATE_BUTTONMENU)).setMenuState(MenuState.BEATMAP,focusNode);
        game.enterState(Opsu.STATE_BUTTONMENU);
      }
      return;
    }
  }
  if (focusNode != null) {
    Beatmap focusNodeBeatmap=focusNode.getSelectedBeatmap();
    if (!focusNodeBeatmap.isBackgroundLoading())     bgAlpha.update(delta);
    songChangeTimer.update(delta);
    if (!MusicController.isTrackLoading())     musicIconBounceTimer.update(delta);
  }
  starStream.update(delta);
  search.setFocus(true);
  searchTimer+=delta;
  if (searchTimer >= SEARCH_DELAY && reloadThread == null && beatmapMenuTimer == -1) {
    searchTimer=0;
    if (focusNode != null)     oldFocusNode=new SongNode(BeatmapSetList.get().getBaseNode(focusNode.index),focusNode.beatmapIndex);
    if (BeatmapSetList.get().search(search.getText())) {
      randomStack=new Stack<SongNode>();
      if (search.getText().isEmpty())       searchResultString=null;
      startNode=focusNode=null;
      scoreMap=null;
      focusScores=null;
      if (BeatmapSetList.get().size() > 0) {
        BeatmapSetList.get().init();
        if (search.getText().isEmpty()) {
          if (oldFocusNode != null)           setFocus(oldFocusNode.getNode(),oldFocusNode.getIndex(),true,true);
 else           setFocus(BeatmapSetList.get().getRandomNode(),-1,true,true);
        }
 else {
          int size=BeatmapSetList.get().size();
          searchResultString=String.format("String_Node_Str",size,(size == 1) ? "String_Node_Str" : "String_Node_Str");
          setFocus(BeatmapSetList.get().getRandomNode(),-1,true,true);
        }
        oldFocusNode=null;
      }
 else       if (!search.getText().isEmpty())       searchResultString="String_Node_Str";
    }
  }
  if (searchTransitionTimer < SEARCH_TRANSITION_TIME) {
    searchTransitionTimer+=delta;
    if (searchTransitionTimer > SEARCH_TRANSITION_TIME)     searchTransitionTimer=SEARCH_TRANSITION_TIME;
  }
  if (focusScores != null) {
    startScorePos.setMinMax(0,(focusScores.length - MAX_SCORE_BUTTONS) * ScoreData.getButtonOffset());
    startScorePos.update(delta);
  }
  songScrolling.update(delta);
  if (isScrollingToFocusNode) {
    float distanceDiff=Math.abs(songScrolling.getPosition() - songScrolling.getTargetPosition());
    if (distanceDiff <= buttonOffset / 8f) {
      songScrolling.scrollToPosition(songScrolling.getTargetPosition());
      songScrolling.setSpeedMultiplier(1f);
      isScrollingToFocusNode=false;
    }
  }
  updateDrawnSongPosition();
  BeatmapSetNode node=getNodeAtPosition(mouseX,mouseY);
  if (node != null) {
    if (node == hoverIndex)     hoverOffset.update(delta);
 else {
      hoverIndex=node;
      hoverOffset.setTime(0);
    }
    return;
  }
 else {
    hoverOffset.setTime(0);
    hoverIndex=null;
  }
  if (focusScores != null && ScoreData.areaContains(mouseX,mouseY)) {
    int startScore=(int)(startScorePos.getPosition() / ScoreData.getButtonOffset());
    int offset=(int)(-startScorePos.getPosition() + startScore * ScoreData.getButtonOffset());
    int scoreButtons=Math.min(focusScores.length - startScore,MAX_SCORE_BUTTONS);
    for (int i=0, rank=startScore; i < scoreButtons; i++, rank++) {
      if (rank < 0)       continue;
      if (ScoreData.buttonContains(mouseX,mouseY - offset,i)) {
        UI.updateTooltip(delta,focusScores[rank].getTooltipString(),true);
        break;
      }
    }
  }
}

Fixed version (ground truth):
@Override public void update(GameContainer container,StateBasedGame game,int delta) throws SlickException {
  UI.update(delta);
  if (reloadThread == null)   MusicController.loopTrackIfEnded(true);
 else   if (reloadThread.isFinished()) {
    if (BeatmapSetList.get().size() > 0) {
      BeatmapSetList.get().init();
      setFocus(BeatmapSetList.get().getRandomNode(),-1,true,true);
    }
 else     MusicController.playThemeSong();
    reloadThread=null;
  }
  int mouseX=input.getMouseX(), mouseY=input.getMouseY();
  UI.getBackButton().hoverUpdate(delta,mouseX,mouseY);
  selectModsButton.hoverUpdate(delta,mouseX,mouseY);
  selectRandomButton.hoverUpdate(delta,mouseX,mouseY);
  selectMapOptionsButton.hoverUpdate(delta,mouseX,mouseY);
  selectOptionsButton.hoverUpdate(delta,mouseX,mouseY);
  if (beatmapMenuTimer > -1) {
    beatmapMenuTimer+=delta;
    if (beatmapMenuTimer >= BEATMAP_MENU_DELAY) {
      beatmapMenuTimer=-1;
      if (focusNode != null) {
        ((ButtonMenu)game.getState(Opsu.STATE_BUTTONMENU)).setMenuState(MenuState.BEATMAP,focusNode);
        game.enterState(Opsu.STATE_BUTTONMENU);
      }
      return;
    }
  }
  if (focusNode != null) {
    Beatmap focusNodeBeatmap=focusNode.getSelectedBeatmap();
    if (!focusNodeBeatmap.isBackgroundLoading())     bgAlpha.update(delta);
    songChangeTimer.update(delta);
    if (!MusicController.isTrackLoading())     musicIconBounceTimer.update(delta);
  }
  starStream.update(delta);
  search.setFocus(true);
  searchTimer+=delta;
  if (searchTimer >= SEARCH_DELAY && reloadThread == null && beatmapMenuTimer == -1) {
    searchTimer=0;
    if (focusNode != null)     oldFocusNode=new SongNode(BeatmapSetList.get().getBaseNode(focusNode.index),focusNode.beatmapIndex);
    if (BeatmapSetList.get().search(search.getText())) {
      randomStack=new Stack<SongNode>();
      if (search.getText().isEmpty())       searchResultString=null;
      startNode=focusNode=null;
      scoreMap=null;
      focusScores=null;
      if (BeatmapSetList.get().size() > 0) {
        BeatmapSetList.get().init();
        if (search.getText().isEmpty()) {
          if (oldFocusNode != null)           setFocus(oldFocusNode.getNode(),oldFocusNode.getIndex(),true,true);
 else           setFocus(BeatmapSetList.get().getRandomNode(),-1,true,true);
        }
 else {
          int size=BeatmapSetList.get().size();
          searchResultString=String.format("String_Node_Str",size,(size == 1) ? "String_Node_Str" : "String_Node_Str");
          setFocus(BeatmapSetList.get().getRandomNode(),-1,true,true);
        }
        oldFocusNode=null;
      }
 else       if (!search.getText().isEmpty())       searchResultString="String_Node_Str";
    }
  }
  if (searchTransitionTimer < SEARCH_TRANSITION_TIME) {
    searchTransitionTimer+=delta;
    if (searchTransitionTimer > SEARCH_TRANSITION_TIME)     searchTransitionTimer=SEARCH_TRANSITION_TIME;
  }
  if (focusScores != null) {
    startScorePos.setMinMax(0,(focusScores.length - MAX_SCORE_BUTTONS) * ScoreData.getButtonOffset());
    startScorePos.update(delta);
  }
  songScrolling.update(delta);
  if (isScrollingToFocusNode) {
    float distanceDiff=Math.abs(songScrolling.getPosition() - songScrolling.getTargetPosition());
    if (distanceDiff <= buttonOffset / 8f) {
      songScrolling.scrollToPosition(songScrolling.getTargetPosition());
      songScrolling.setSpeedMultiplier(1f);
      isScrollingToFocusNode=false;
    }
  }
  updateDrawnSongPosition();
  BeatmapSetNode node=getNodeAtPosition(mouseX,mouseY);
  if (node != null) {
    if (node == hoverIndex)     hoverOffset.update(delta);
 else {
      hoverIndex=node;
      hoverOffset.setTime(0);
    }
    return;
  }
 else {
    hoverOffset.setTime(0);
    hoverIndex=null;
  }
  if (focusScores != null && ScoreData.areaContains(mouseX,mouseY)) {
    int startScore=(int)(startScorePos.getPosition() / ScoreData.getButtonOffset());
    int offset=(int)(-startScorePos.getPosition() + startScore * ScoreData.getButtonOffset());
    int scoreButtons=Math.min(focusScores.length - startScore,MAX_SCORE_BUTTONS);
    for (int i=0, rank=startScore; i < scoreButtons; i++, rank++) {
      if (rank < 0)       continue;
      if (ScoreData.buttonContains(mouseX,mouseY - offset,i)) {
        UI.updateTooltip(delta,focusScores[rank].getTooltipString(),true);
        break;
      }
    }
  }
}