Bug 319600 [Viewers] CheckboxTableViewer.getCheckedElements based on virtual table returns null data objects
Build Identifier: 20100617-1415 If programmatically select all rows in CheckboxTableViewer created upon virtual table using setAllChecked, then getCheckedElements method returns null data objects, probably, for non-displayed rows. In spite of the fact, that table is virtual, it is expected that getCheckedElements returns concrete non-null data objects associated with rows. Reproducible: Always Steps to Reproduce: 1. Launch attached snippet. 2. Click "Select/Deselect All" to select all rows, then click "Null Rows" and message with number of rows with null data objects will be displayed.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/CheckboxTableViewer.java
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Widget;
/**
 * A concrete viewer based on an SWT <code>Table</code>
 * control with checkboxes on each node.
 * <p>This class supports setting an {@link ICheckStateProvider} to 
 * set the checkbox states. To see standard SWT behavior, view
 * SWT Snippet274.</p>
 * <p>
 * This class is not intended to be subclassed outside the viewer framework. 
 * It is designed to be instantiated with a pre-existing SWT table control and configured
 * with a domain-specific content provider, label provider, element filter (optional),
 * and element sorter (optional).
 * </p>
 * @noextend This class is not intended to be subclassed by clients.
 */
public class CheckboxTableViewer extends TableViewer implements ICheckable {
    /**
     * List of check state listeners (element type: <code>ICheckStateListener</code>).
     */
    private ListenerList checkStateListeners = new ListenerList();
    
    /**
     * Provides the desired state of the check boxes.
     */
    private ICheckStateProvider checkStateProvider;
    /**
     * Creates a table viewer on a newly-created table control under the given parent.