Bug 146215

Summary: JDT Core tests should not be dependent on HashMap implementation
Product: [Eclipse Project] JDT Reporter: Jerome Lanneluc <jerome_lanneluc>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: frederic_fusier, Mike_Wilson, philippe_mulet
Version: 3.1   
Target Milestone: 3.2.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix none

Description Jerome Lanneluc CLA 2006-06-09 06:16:43 EDT
3.2RC7

With the latest Sun 1.5.0_08 VM, the implementation of HashMap seems to have changed, and iterating over the keys results in a different order.

The JDT Core tests are now failing as they rely on the original order to compare the actual result against the expected result.
Comment 1 Jerome Lanneluc CLA 2006-06-09 06:55:12 EDT
Created attachment 43972 [details]
Proposed fix
Comment 2 Jerome Lanneluc CLA 2006-06-09 07:29:20 EDT
Note that this fix changes the order of attributes in a classpath entry even if the VM doesn't change. 

There will be outgoing changes to the .classpath in the following scenario:
1. User runs Eclipse on Sun 1.4.2 VM.
2. This patch is applied
3. User adds a library entry to the build path
User will see the the new entry as an outgoing change, BUT it will also see existing entries being changed since their attributes order has changed.

There won't be any outgoing changes to the .classpath in the following scenario:
1. User runs Eclipse on Sun 1.4.2 VM.
2. This patch is applied
3. User edit the buildpath, adds a library in the buildpath wizard, changes her mind and remove the library, then press OK.
Comment 3 Jerome Lanneluc CLA 2006-06-09 07:29:59 EDT
Released in HEAD.
Released in TARGET_321.
Comment 4 Frederic Fusier CLA 2006-06-12 06:24:15 EDT
Released for 3.2.1
Released for 3.3 M1
Comment 5 Frederic Fusier CLA 2006-08-07 07:18:58 EDT
Verified for 3.3 M1 using build I20060807-0010.