tmf: Avoid recursion in AbstractSegmentStoreTableViewer pack listener
authorPatrick Tasse <patrick.tasse@gmail.com>
Mon, 4 Jan 2016 23:11:35 +0000 (18:11 -0500)
committerPatrick Tasse <patrick.tasse@gmail.com>
Tue, 5 Jan 2016 20:22:00 +0000 (15:22 -0500)
commitb2f6d73d1e080604eca5686f7f4e4c0d37670d64
treeb139dc85bb6c47957fb0b18a9c6757fdb77926c9
parent2c7577f41c76af9517fd3c8999c3eb31b5c6301d
tmf: Avoid recursion in AbstractSegmentStoreTableViewer pack listener

In the SWT.SetData listener TableColumn.pack() is called. This requires
all visible items from being filled in order to pack the column. For
each visible item a SWT.SetData event is fired which triggers another
TableColumn.pack().

In Windows, after 12 such iterations in the stack, the table somehow
behaves badly and the OS incorrectly returns an item count of zero,
which causes ArrayIndexOutOfBoundsException and other problems.

Since the intention is to pack the columns only once, the SWT.SetData
listener is removed before the pack instead of after the pack, thus
avoiding the recursive calls.

Change-Id: Id44c54a474ed6e04aa2d79c051d863011f55a8aa
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/63513
Reviewed-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/analysis/timing/ui/views/segmentstore/AbstractSegmentStoreTableViewer.java
This page took 0.026281 seconds and 5 git commands to generate.