The default implementation already handles a null trace, and
VirtualMachineView overrides it as @Nullable.
This allows subclasses to call the method with the return value of
getTrace(), which can be null, without needing a null check and get an
empty list back.
Change-Id: Ie7cb5c79bb841796be4e20fcafedb43ad8b2c839
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/78104
Reviewed-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.widgets.Composite;
}
@Override
- protected @NonNull Iterable<ITmfTrace> getTracesToBuild(@NonNull ITmfTrace trace) {
+ protected @NonNull Iterable<ITmfTrace> getTracesToBuild(@Nullable ITmfTrace trace) {
/*
* Return the current trace only. Experiments will return their
* children's analyses
*/
- return Collections.singleton(trace);
+ return (trace != null) ? Collections.singleton(trace) : Collections.EMPTY_LIST;
}
}
* some of which may receive events in live streaming mode.
*
* @param trace
- * The trace associated with this view
+ * The trace associated with this view, can be null
* @return List of traces with data to display
*/
- protected @NonNull Iterable<ITmfTrace> getTracesToBuild(@NonNull ITmfTrace trace) {
+ protected @NonNull Iterable<ITmfTrace> getTracesToBuild(@Nullable ITmfTrace trace) {
return TmfTraceManager.getTraceSet(trace);
}