Bug 188663 [Viewers] Virtual TreeViewer with columns: First and last row have wrong labels
Seen with 3.3 M7 I have a virtual TreeViewer/ILazyTreeContentProvider with multiple columns. Upon setting new input, the first row stays blank with the exception of the first cell. And the last row shows the labels of the first row, with the exception of the first cell. The attached plugin shows the problem: When opening the view, the second column's label is blank on the first row, and the third row's second column shows the label that should be in the first row. Pressing refresh makes the problem go away. Pressing 'New Input' shows the problem again. I did some debugging and here's what I can come up with: When an empty tree is populated, setting an image into the first column on the first row will create a new image list in Tree#imageIndex(Image, int). The call to OS.SendMessage (handle, OS.TVM_SETIMAGELIST, OS.TVSIL_NORMAL, hImageList); somehow causes all following SWT.SetData events to be handled before the first one that was about to set the image into the tree item. The attached SWT snippet shows this clearer (logged on the console). Once the first SetData callback gets control again, ColumnViewer's cached cell already points to the last row, which would explain why the first one stays empty and the last one gets the first row's labels.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTreeViewer.java
*            the tree expansion event
	 * @see ITreeViewerListener#treeExpanded
	 */
	protected void fireTreeExpanded(final TreeExpansionEvent event) {
		Object[] listeners = treeListeners.getListeners();
		for (int i = 0; i < listeners.length; ++i) {
			final ITreeViewerListener l = (ITreeViewerListener) listeners[i];
			SafeRunnable.run(new SafeRunnable() {
				public void run() {
					l.treeExpanded(event);
				}
			});
		}
	}
	/**
	 * Returns the auto-expand level.
	 * 
	 * @return non-negative level, or <code>ALL_LEVELS</code> if all levels of
	 *         the tree are expanded automatically
	 * @see #setAutoExpandLevel
	 */
	public int getAutoExpandLevel() {
		return expandToLevel;
	}
	/**
	 * Returns the SWT child items for the given SWT widget.
	 * 
	 * @param widget
	 *            the widget
	 * @return the child items