Program: 159174
Project: 159174
Buggy source:
public void update(TournamentView tournament){
  if (tournament == null) {
    return;
  }
  if (!firstInitDone) {
    Component c=this.getParent();
    while (c != null && !(c instanceof TournamentPane)) {
      c=c.getParent();
    }
    if (c != null) {
      ((TournamentPane)c).setTitle("String_Node_Str" + tournament.getTournamentName() + "String_Node_Str");
    }
    txtName.setText(tournament.getTournamentName());
    txtType.setText(tournament.getTournamentType());
    txtStartTime.setText(df.format(tournament.getStartTime()));
    txtEndTime.setText("String_Node_Str");
    firstInitDone=true;
  }
switch (tournament.getTournamentState()) {
case "String_Node_Str":
    String constructionTime=Format.getDuration(tournament.getConstructionTime() - (tournament.getServerTime().getTime() - tournament.getStepStartTime().getTime()) / 1000);
  txtTournamentState.setText(new StringBuilder(tournament.getTournamentState()).append("String_Node_Str").append(constructionTime).append("String_Node_Str").toString());
break;
case "String_Node_Str":
String duelingTime=Format.getDuration((tournament.getServerTime().getTime() - tournament.getStepStartTime().getTime()) / 1000);
txtTournamentState.setText(new StringBuilder(tournament.getTournamentState()).append("String_Node_Str").append(duelingTime).append("String_Node_Str").toString());
break;
default :
txtTournamentState.setText(tournament.getTournamentState());
break;
}
if (txtEndTime == null) {
return;
}
if (txtEndTime.getText().equals("String_Node_Str") && tournament.getEndTime() != null) {
txtEndTime.setText(df.format(tournament.getEndTime()));
}
playersModel.loadData(tournament);
matchesModel.loadData(tournament);
this.tablePlayers.repaint();
this.tableMatches.repaint();
btnQuitTournament.setVisible(false);
if (tournament.getEndTime() == null) {
for (TournamentPlayerView player : tournament.getPlayers()) {
if (player.getName().equals(session.getUserName())) {
if (!player.hasQuit()) {
btnQuitTournament.setVisible(true);
}
break;
}
}
}
}

Fixed version (ground truth):
public void update(TournamentView tournament){
  if (tournament == null) {
    return;
  }
  if (!firstInitDone) {
    Component c=this.getParent();
    while (c != null && !(c instanceof TournamentPane)) {
      c=c.getParent();
    }
    if (c != null) {
      ((TournamentPane)c).setTitle("String_Node_Str" + tournament.getTournamentName() + "String_Node_Str");
    }
    txtName.setText(tournament.getTournamentName());
    txtType.setText(tournament.getTournamentType());
    txtStartTime.setText(df.format(tournament.getStartTime()));
    txtEndTime.setText("String_Node_Str");
    firstInitDone=true;
  }
switch (tournament.getTournamentState()) {
case "String_Node_Str":
    String constructionTime="String_Node_Str";
  if (tournament.getStepStartTime() != null) {
    constructionTime=Format.getDuration(tournament.getConstructionTime() - (tournament.getServerTime().getTime() - tournament.getStepStartTime().getTime()) / 1000);
  }
txtTournamentState.setText(new StringBuilder(tournament.getTournamentState()).append("String_Node_Str").append(constructionTime).append("String_Node_Str").toString());
break;
case "String_Node_Str":
String duelingTime="String_Node_Str";
if (tournament.getStepStartTime() != null) {
duelingTime=Format.getDuration((tournament.getServerTime().getTime() - tournament.getStepStartTime().getTime()) / 1000);
}
txtTournamentState.setText(new StringBuilder(tournament.getTournamentState()).append("String_Node_Str").append(duelingTime).append("String_Node_Str").toString());
break;
default :
txtTournamentState.setText(tournament.getTournamentState());
break;
}
if (txtEndTime == null) {
return;
}
if (txtEndTime.getText().equals("String_Node_Str") && tournament.getEndTime() != null) {
txtEndTime.setText(df.format(tournament.getEndTime()));
}
playersModel.loadData(tournament);
matchesModel.loadData(tournament);
this.tablePlayers.repaint();
this.tableMatches.repaint();
btnQuitTournament.setVisible(false);
if (tournament.getEndTime() == null) {
for (TournamentPlayerView player : tournament.getPlayers()) {
if (player.getName().equals(session.getUserName())) {
if (!player.hasQuit()) {
btnQuitTournament.setVisible(true);
}
break;
}
}
}
}