Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355467 - The result of sorting resources that contains null blank cells is not correct in Remote System Details view.
Summary: The result of sorting resources that contains null blank cells is not correct...
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3.1   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 356355
  Show dependency tree
 
Reported: 2011-08-23 03:46 EDT by Atsushi Yokoi CLA
Modified: 2011-09-13 08:17 EDT (History)
3 users (show)

See Also:
kjdoyle: review+
xuanchen: review+


Attachments
patch to check for null (1.92 KB, patch)
2011-08-31 11:11 EDT, David McKnight CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Atsushi Yokoi CLA 2011-08-23 03:46:01 EDT
Build Identifier: M20110210-1200

Our product uses Remote System Details view and blank cells may be included on the view in our case. When I sort resources on this view by the "Created" header that seems to contain Date class object, blank cells and other cells are partially sorted in both ascending and descending case, instead of sorting all records by the date labels. Other header, for example "Size", causes same issue, if some blank cells are included.


The sort logic of this view is included in SystemTableViewSorter of RSE. In this class, the "compare" method compares two arguments those are treated as the instances of the same class. In our case that the one object is a instance of Date class and the other is null, NPE occurs in this "compare" and zero is returned so that sorting result is not correct.

Please add null check into the "compare" method.

Reproducible: Always

Steps to Reproduce:
1. show resources in Remote System Details view. Some resources should have empty cells those belong to Integer, Date or some other non-String classes.
2. sort by non-String columns header that includes some blank cells.
Comment 1 David McKnight CLA 2011-08-31 11:11:44 EDT
Created attachment 202536 [details]
patch to check for null
Comment 2 David McKnight CLA 2011-08-31 11:12:47 EDT
Kevin and Xuan, could you please review this patch?
Comment 3 Kevin Doyle CLA 2011-08-31 19:30:15 EDT
Review +.
Comment 4 Xuan Chen CLA 2011-09-01 10:18:57 EDT
The fix looks good.  Thanks.
Comment 5 David McKnight CLA 2011-09-01 13:48:14 EDT
Thanks for the reviews. I've committed the change to the HEAD stream.