Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355467

Summary: The result of sorting resources that contains null blank cells is not correct in Remote System Details view.
Product: [Tools] Target Management Reporter: Atsushi Yokoi <AYOKOI>
Component: RSEAssignee: David McKnight <dmcknigh>
Status: RESOLVED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: normal    
Priority: P3 CC: dmcknigh, kjdoyle, xuanchen
Version: unspecifiedFlags: kjdoyle: review+
xuanchen: review+
Target Milestone: 3.3.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 356355    
Attachments:
Description Flags
patch to check for null none

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.