Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334837 - Ordering of Library list entries incorrect after migration
Summary: Ordering of Library list entries incorrect after migration
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: Core (show other bugs)
Version: 3.1.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M5   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 335504
  Show dependency tree
 
Reported: 2011-01-19 16:58 EST by San CLA
Modified: 2011-01-26 15:48 EST (History)
1 user (show)

See Also:


Attachments
Screen capture (22.24 KB, image/gif)
2011-01-19 16:58 EST, San CLA
no flags Details
sample workspace (74.57 KB, multipart/x-zip)
2011-01-19 16:59 EST, San CLA
no flags Details
patch to use LinkedHashMap instead of HashMap (2.69 KB, patch)
2011-01-26 15:01 EST, David McKnight CLA
no flags Details | Diff
additional patch to use LinkedHashMap in PropertySetContainer (1.82 KB, patch)
2011-01-26 15:27 EST, 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 San CLA 2011-01-19 16:58:00 EST
After a workspace from WDSC 7.0 is migrated, the library list of an IBMi connection is incorrect.

The attached an image (Library_List_err.gif) shows the incorrect library list in the UI. 

The attachment workspace_70_Migr.zip is a very simply workspace from WDSC 7.0.
You can use it to reproduce the problem following these steps:
1) Un-zip the workspace
2) Launch RD Power 8.0.0.1 against this workspace
   Migration should occur automatically.
3) After migration, right-click on the connection > Properties  to show the library list. The order is incorrect. 


The class org.eclipse.rse.core.model.PropertySet.java in plugin org.eclipse.rse.core is using a HashMap to store the library list entries.
HashMap does not guantantee the ordering of the map so the library list could be in an order. The fix is to replace the usage of HashMap with LinkedHashMap which does guarantee the ordering (insertion-order) of the map entries. 

I found 2 PropertySet contstructor where this change should be made:
//_properties = new HashMap();      //old
_properties = new LinkedHashMap();  //new


Please include this change in the R3_2_maintenance stream so we can pick it up for a fixpack.
Comment 1 San CLA 2011-01-19 16:58:53 EST
Created attachment 187154 [details]
Screen capture
Comment 2 San CLA 2011-01-19 16:59:58 EST
Created attachment 187155 [details]
sample workspace
Comment 3 David McKnight CLA 2011-01-26 15:01:47 EST
Created attachment 187678 [details]
patch to use LinkedHashMap instead of HashMap
Comment 4 David McKnight CLA 2011-01-26 15:02:32 EST
San, could you verify the the patch I've attached here solves the problem?  Thanks.
Comment 5 David McKnight CLA 2011-01-26 15:27:13 EST
Created attachment 187681 [details]
additional patch to use LinkedHashMap in PropertySetContainer
Comment 6 San CLA 2011-01-26 15:39:46 EST
I verified the patch solves the problem.
Comment 7 David McKnight CLA 2011-01-26 15:48:53 EST
Thanks San, I've committed the change to cvs.  I'll follow up with the 3.2.x backport (bug 335504) when it has been reviewed.