Previously, if the view was called and the trace is null, an exception
was raised. Now, if the trace is null, the view will do nothing. This situation
happens when using this viewer with XML views, the trace may still be null
when the viewer is updated.
Change-Id: I5f3e7dac7ef93e8b0cf795d7219278aad3fa9c90
Signed-off-by: Jean-Christian Kouame <jean-christian.kouame@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/68228
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Tested-by: Genevieve Bastien <gbastien+lttng@versatic.net>
@Override
public void initializeDataSource() {
- /* Should not be called while trace is still null */
- ITmfTrace trace = checkNotNull(getTrace());
- TmfAbstractAnalysisModule module = createStatisticsAnalysiModule();
- if (module == null) {
- return;
- }
- try {
- module.setTrace(trace);
- module.schedule();
- fModule = module;
- } catch (TmfAnalysisException e) {
- Activator.getDefault().logError("Error initializing statistics analysis module", e); //$NON-NLS-1$
+ ITmfTrace trace = getTrace();
+ if (trace != null) {
+ TmfAbstractAnalysisModule module = createStatisticsAnalysiModule();
+ if (module == null) {
+ return;
+ }
+ try {
+ module.setTrace(trace);
+ module.schedule();
+ fModule = module;
+ } catch (TmfAnalysisException e) {
+ Activator.getDefault().logError("Error initializing statistics analysis module", e); //$NON-NLS-1$
+ }
}
}