Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319600 - [Viewers] CheckboxTableViewer.getCheckedElements based on virtual table returns null data objects
Summary: [Viewers] CheckboxTableViewer.getCheckedElements based on virtual table retur...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: 3.7 M1   Edit
Assignee: Platform UI Triaged CLA
QA Contact: Hitesh CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-12 11:53 EDT by Ilya CLA
Modified: 2010-07-14 04:24 EDT (History)
4 users (show)

See Also:


Attachments
Snippet for reproducing bug about null data rows in CheckboxTableViewer.getCheckedElements. (4.11 KB, text/plain)
2010-07-12 11:54 EDT, Ilya CLA
no flags Details
Patch V01 (2.35 KB, patch)
2010-07-13 07:56 EDT, Hitesh CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya CLA 2010-07-12 11:53:20 EDT
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.
Comment 1 Ilya CLA 2010-07-12 11:54:53 EDT
Created attachment 174055 [details]
Snippet for reproducing bug about null data rows in CheckboxTableViewer.getCheckedElements.
Comment 2 Hitesh CLA 2010-07-12 13:14:00 EDT
(In reply to comment #0)

> 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.

On my MS Windows 7 system I get a MessageDialog with "no null data" every time. 
Nonetheless your snippet does indicate the lack of a data-not-set check in the 'getCheckedElements' method. But this could be a platform specific issue; for example, the call TableItem#getChecked()sends SWT.SetData event for tableitems on my system. 

Prakash, could you please try to test and confirm the same on Mac. Thanks!!
Comment 3 Prakash Rangaraj CLA 2010-07-13 02:10:43 EDT
(In reply to comment #2)

> Prakash, could you please try to test and confirm the same on Mac. Thanks!!

  Yes, following the steps on Mac, it says about 10k rows have null data.
Comment 4 Hitesh CLA 2010-07-13 07:50:43 EDT
(In reply to comment #3)
> 
> > Prakash, could you please try to test and confirm the same on Mac. Thanks!!
> 
>   Yes, following the steps on Mac, it says about 10k rows have null data.

Thanks !!

> But this could be a platform specific issue; for
> example, the call TableItem#getChecked()sends SWT.SetData event for tableitems
> on my system. 

Bug 319509 was about the call to Table#setChecked(boolean) snubbing off SWT.SetData events. And the attached snippet on this bug demonstrates that TableItem#getChecked() will fire the event on the same platform. Yet this is different on a different platform. Adding Felipe for comment.

As for the viewer, I'll post a patch adding the data-not-set check in required places to prevent premature materialization of items.
Comment 5 Hitesh CLA 2010-07-13 07:56:40 EDT
Created attachment 174129 [details]
Patch V01

Before releasing this one, I'd like to see if it covers all the susceptible methods. Ilya, let me know if it is possible for you to test this patch. Thanks.
Comment 6 Ilya CLA 2010-07-13 08:20:53 EDT
(In reply to comment #5)
> Before releasing this one, I'd like to see if it covers all the susceptible
> methods. Ilya, let me know if it is possible for you to test this patch.
> Thanks.

Hitesh, unfortunately, I have never checked out Eclipse sources from VCS, patched and built it locally. So, probably, it will be faster to ask somebody who has environment adopted to work with Eclipse sources and developing it.

But if you prepare a standalone snippet based on patched platform (if it is possible and reasonable, of course), I can test it easily. 

In any case, I would like to start working with patched platform as soon as patches for these bugs will appear. So I will appreciate if you give me advise or link with instructions of how to get patched Eclipse platform version.

Thanks.
Comment 7 Hitesh CLA 2010-07-13 08:44:08 EDT
(In reply to comment #6)
No problem.

Prakash , another one <g> , if you could spare some time patching and running the same snippet again. Thanks.
Comment 8 Prakash Rangaraj CLA 2010-07-13 13:30:30 EDT
(In reply to comment #7)
> Prakash , another one <g> , if you could spare some time patching and running
> the same snippet again. Thanks.
    No null data after applying the patch.
Comment 9 Hitesh CLA 2010-07-14 04:24:20 EDT
Thanks, Prakash.

Patch applied to CVS HEAD; marking as fixed.