Program: 92776
Project: 92776
Buggy source:
/** 
 * Handler called when an experiment is selected. Checks if the experiment has changed and requests the selected experiment if it has not yet been cached.
 * @param signal contains the information about the selection.
 */
@TmfSignalHandler public void experimentSelected(TmfExperimentSelectedSignal<? extends TmfEvent> signal){
  if (signal != null) {
    TmfExperiment<?> experiment=signal.getExperiment();
    String experimentName=experiment.getName();
    if (TmfStatisticsTreeRootFactory.containsTreeRoot(getTreeID(experimentName))) {
      TmfStatisticsTreeNode experimentTreeNode=TmfStatisticsTreeRootFactory.getStatTreeRoot(getTreeID(experimentName));
      ITmfTrace[] traces=experiment.getTraces();
      int numTraces=experiment.getTraces().length;
      int numNodeTraces=experimentTreeNode.getNbChildren();
      if (numTraces == numNodeTraces) {
        boolean same=true;
        for (int i=0; i < numTraces; i++) {
          String traceName=traces[i].getName();
          if (!experimentTreeNode.containsChild(traceName)) {
            same=false;
            break;
          }
        }
        if (same) {
          fTreeViewer.setInput(experimentTreeNode);
          resetUpdateSynchronization();
          return;
        }
        experimentTreeNode.reset();
      }
    }
 else {
      TmfStatisticsTreeRootFactory.addStatsTreeRoot(getTreeID(experimentName),getStatisticData());
    }
    resetUpdateSynchronization();
    TmfStatisticsTreeNode treeModelRoot=TmfStatisticsTreeRootFactory.getStatTreeRoot(getTreeID(experiment.getName()));
    if (treeModelRoot.hasChildren()) {
      treeModelRoot.reset();
    }
    fTreeViewer.setInput(treeModelRoot);
    requestData(experiment,experiment.getTimeRange());
  }
}

Fixed version (ground truth):
/** 
 * Handler called when an experiment is selected. Checks if the experiment has changed and requests the selected experiment if it has not yet been cached.
 * @param signal contains the information about the selection.
 */
@TmfSignalHandler public void experimentSelected(TmfExperimentSelectedSignal<? extends TmfEvent> signal){
  if (signal != null) {
    TmfExperiment<?> experiment=signal.getExperiment();
    String experimentName=experiment.getName();
    if (TmfStatisticsTreeRootFactory.containsTreeRoot(getTreeID(experimentName))) {
      TmfStatisticsTreeNode experimentTreeNode=TmfStatisticsTreeRootFactory.getStatTreeRoot(getTreeID(experimentName));
      @SuppressWarnings("String_Node_Str") ITmfTrace[] traces=experiment.getTraces();
      int numTraces=experiment.getTraces().length;
      int numNodeTraces=experimentTreeNode.getNbChildren();
      if (numTraces == numNodeTraces) {
        boolean same=true;
        for (int i=0; i < numTraces; i++) {
          String traceName=traces[i].getName();
          if (!experimentTreeNode.containsChild(traceName)) {
            same=false;
            break;
          }
        }
        if (same) {
          fTreeViewer.setInput(experimentTreeNode);
          resetUpdateSynchronization();
          return;
        }
        experimentTreeNode.reset();
      }
    }
 else {
      TmfStatisticsTreeRootFactory.addStatsTreeRoot(getTreeID(experimentName),getStatisticData());
    }
    resetUpdateSynchronization();
    TmfStatisticsTreeNode treeModelRoot=TmfStatisticsTreeRootFactory.getStatTreeRoot(getTreeID(experiment.getName()));
    if (treeModelRoot.hasChildren()) {
      treeModelRoot.reset();
    }
    fTreeViewer.setInput(treeModelRoot);
    requestData(experiment,experiment.getTimeRange());
  }
}