Program: 91830
Project: 91830
Buggy source:
@Override protected void buildEventList(ITmfTrace trace,ITmfTrace parentTrace,IProgressMonitor monitor){
  Element viewElement=fViewInfo.getViewElement(TmfXmlUiStrings.TIME_GRAPH_VIEW);
  if (viewElement == null) {
    return;
  }
  ITimeGraphPresentationProvider2 pres=this.getPresentationProvider();
  if (pres instanceof XmlPresentationProvider) {
    ((XmlPresentationProvider)pres).loadNewStates(viewElement);
  }
  String title=fViewInfo.getViewTitle(viewElement);
  if (title == null) {
    title=Messages.XmlTimeGraphView_DefaultTitle;
  }
  setViewTitle(title);
  Set<String> analysisIds=fViewInfo.getViewAnalysisIds(viewElement);
  List<Element> entries=XmlUtils.getChildElements(viewElement,TmfXmlUiStrings.ENTRY_ELEMENT);
  Set<XmlEntry> entryList=new TreeSet<>(getEntryComparator());
  for (  ITmfTrace aTrace : TmfTraceManager.getTraceSet(trace)) {
    if (monitor.isCanceled()) {
      return;
    }
    List<ITmfAnalysisModuleWithStateSystems> stateSystemModules=new LinkedList<>();
    if (analysisIds.isEmpty()) {
      for (      ITmfAnalysisModuleWithStateSystems module : aTrace.getAnalysisModulesOfClass(ITmfAnalysisModuleWithStateSystems.class)) {
        stateSystemModules.add(module);
      }
    }
 else {
      for (      String moduleId : analysisIds) {
        ITmfAnalysisModuleWithStateSystems module=aTrace.getAnalysisModuleOfClass(ITmfAnalysisModuleWithStateSystems.class,moduleId);
        if (module != null) {
          stateSystemModules.add(module);
        }
      }
    }
    for (    ITmfAnalysisModuleWithStateSystems module : stateSystemModules) {
      module.schedule();
      if (module instanceof TmfStateSystemAnalysisModule) {
        ((TmfStateSystemAnalysisModule)module).waitForInitialization();
      }
      for (      ITmfStateSystem ssq : module.getStateSystems()) {
        if (ssq == null) {
          return;
        }
        ssq.waitUntilBuilt();
        long startTime=ssq.getStartTime();
        long endTime=ssq.getCurrentEndTime();
        XmlEntry groupEntry=new XmlEntry(-1,aTrace,aTrace.getName(),ssq);
        entryList.add(groupEntry);
        setStartTime(Math.min(getStartTime(),startTime));
        setEndTime(Math.max(getEndTime(),endTime));
        for (        Element entry : entries) {
          buildEntry(entry,groupEntry,-1);
        }
      }
    }
  }
  putEntryList(trace,new ArrayList<TimeGraphEntry>(entryList));
  if (trace.equals(getTrace())) {
    refresh();
  }
  for (  XmlEntry traceEntry : entryList) {
    if (monitor.isCanceled()) {
      return;
    }
    long startTime=traceEntry.getStateSystem().getStartTime();
    long endTime=traceEntry.getStateSystem().getCurrentEndTime() + 1;
    buildStatusEvent(traceEntry,monitor,startTime,endTime);
  }
}

Fixed version (ground truth):
@Override protected void buildEventList(ITmfTrace trace,ITmfTrace parentTrace,IProgressMonitor monitor){
  Element viewElement=fViewInfo.getViewElement(TmfXmlUiStrings.TIME_GRAPH_VIEW);
  if (viewElement == null) {
    return;
  }
  ITimeGraphPresentationProvider2 pres=this.getPresentationProvider();
  if (pres instanceof XmlPresentationProvider) {
    ((XmlPresentationProvider)pres).loadNewStates(viewElement);
  }
  String title=fViewInfo.getViewTitle(viewElement);
  if (title == null) {
    title=Messages.XmlTimeGraphView_DefaultTitle;
  }
  setViewTitle(title);
  Set<String> analysisIds=fViewInfo.getViewAnalysisIds(viewElement);
  List<Element> entries=XmlUtils.getChildElements(viewElement,TmfXmlUiStrings.ENTRY_ELEMENT);
  Set<XmlEntry> entryList=new TreeSet<>(getEntryComparator());
  for (  ITmfTrace aTrace : TmfTraceManager.getTraceSet(trace)) {
    if (monitor.isCanceled()) {
      return;
    }
    List<ITmfAnalysisModuleWithStateSystems> stateSystemModules=new LinkedList<>();
    if (analysisIds.isEmpty()) {
      for (      ITmfAnalysisModuleWithStateSystems module : aTrace.getAnalysisModulesOfClass(ITmfAnalysisModuleWithStateSystems.class)) {
        stateSystemModules.add(module);
      }
    }
 else {
      for (      String moduleId : analysisIds) {
        ITmfAnalysisModuleWithStateSystems module=aTrace.getAnalysisModuleOfClass(ITmfAnalysisModuleWithStateSystems.class,moduleId);
        if (module != null) {
          stateSystemModules.add(module);
        }
      }
    }
    for (    ITmfAnalysisModuleWithStateSystems module : stateSystemModules) {
      IStatus status=module.schedule();
      if (status.isOK()) {
        if (module instanceof TmfStateSystemAnalysisModule) {
          ((TmfStateSystemAnalysisModule)module).waitForInitialization();
        }
        for (        ITmfStateSystem ssq : module.getStateSystems()) {
          if (ssq == null) {
            return;
          }
          ssq.waitUntilBuilt();
          long startTime=ssq.getStartTime();
          long endTime=ssq.getCurrentEndTime();
          XmlEntry groupEntry=new XmlEntry(-1,aTrace,aTrace.getName(),ssq);
          entryList.add(groupEntry);
          setStartTime(Math.min(getStartTime(),startTime));
          setEndTime(Math.max(getEndTime(),endTime));
          for (          Element entry : entries) {
            buildEntry(entry,groupEntry,-1);
          }
        }
      }
 else {
        return;
      }
    }
  }
  putEntryList(trace,new ArrayList<TimeGraphEntry>(entryList));
  if (trace.equals(getTrace())) {
    refresh();
  }
  for (  XmlEntry traceEntry : entryList) {
    if (monitor.isCanceled()) {
      return;
    }
    long startTime=traceEntry.getStateSystem().getStartTime();
    long endTime=traceEntry.getStateSystem().getCurrentEndTime() + 1;
    buildStatusEvent(traceEntry,monitor,startTime,endTime);
  }
}