DESCRIPTION

tmf: Fix NPE in Histogram view during mouse down event

This NPE happens when clicking into the histogram before any data is
available in the scaled data instance.

Change-Id: I57efdb03cd53e2198580fa6c0ed047fc2dc4c3ac
Signed-off-by: Ricky Reeves <Meredith xxx@xxx.xxx


COMMENTS

author: Luciana Barry
date: 2013-12-03 21:50:50.000000000

Patch Set 1: Code-Review-1

(1 comment)

- Because we use the signal throttler to broadcast TmfRangeSynchSignal, the clearing (setting fScaledData to null) can happen in a Timer thread. So are the null checks enough? Perhaps we need synchronization.

- I'm not even sure we need to set fScaledData to null when we clear. It seems to work fine when commented out. The scaled data is always set by scaleTo() triggered by clearing the histogram model.

- I found an unrelated problem, the checks in all the mouse listeners for getNbEvents() != 0 prevent any mouse button operation when zoomed in to where no events appear.

Line:774, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Histogram.java -> Got a NPE here also while testing

-------------------------------------
author: Luciana Barry
date: 2013-12-03 22:06:25.000000000

Patch Set 1:

For the last issue, replacing 'fDataModel.getNbEvents() != 0' with 'fDataModel.getStartTime() < fDataModel.getEndTime()' seems to do the trick, in mouseDown()'s and mouseHover().

-------------------------------------
author: Brenden Conley
date: 2013-12-03 22:19:27.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/4369/

-------------------------------------
author: Brenden Conley
date: 2013-12-03 23:11:53.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/4369/ : SUCCESS

-------------------------------------
