Bug 359177

Summary: Test MethodVerifyTest#testBug317719h fails when run with 1.6 JVM
Product: [Eclipse Project] JDT Reporter: Satyam Kandula <satyam.kandula>
Component: CoreAssignee: Satyam Kandula <satyam.kandula>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: amj87.iitr, srikanth_sankaran
Version: 3.8   
Target Milestone: 3.8 M3   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Proposed test patch satyam.kandula: review?

Description Satyam Kandula CLA 2011-09-28 01:34:20 EDT
This test methodVerifyTest#testBug317719h passes when run with a 1.7 VM but fails when run with 1.6 VM.
Comment 1 Satyam Kandula CLA 2011-09-28 06:39:05 EDT
This problem happens with only some versions of Java. I didn't run with many versions of Java to find out the difference, but I think it is to do with IBM Java and Sun Java. 

I believe IBM JVM had LinkedHashMap overridden put(), but Sun Java doesn't causing the difference.
Comment 2 Satyam Kandula CLA 2011-09-28 06:40:42 EDT
Created attachment 204163 [details]
Proposed test patch

Changing the reference of LinkedHashMap to HashMap seems to keep both the java versions happy. Ayush, Here is the patch modifying it. Please look at it and see if this will break the intended test.
Comment 3 Ayushman Jain CLA 2011-09-28 09:34:30 EDT
(In reply to comment #1)
> This problem happens with only some versions of Java. I didn't run with many
> versions of Java to find out the difference, but I think it is to do with IBM
> Java and Sun Java. 
> 
> I believe IBM JVM had LinkedHashMap overridden put(), but Sun Java doesn't
> causing the difference.

Ah! I did conclude some VM difference is causing this but this is interesting to know! :)(In reply to comment #2)

> Changing the reference of LinkedHashMap to HashMap seems to keep both the java
> versions happy. Ayush, Here is the patch modifying it. Please look at it and
> see if this will break the intended test.

The patch looks good and preserves the behaviour being tested.
Comment 5 Srikanth Sankaran CLA 2011-10-24 20:52:02 EDT
Verified for 3.8 M3 using build id: N20111022-2000