Bug 359177 - Test MethodVerifyTest#testBug317719h fails when run with 1.6 JVM
Summary: Test MethodVerifyTest#testBug317719h fails when run with 1.6 JVM
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.8   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.8 M3   Edit
Assignee: Satyam Kandula CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-28 01:34 EDT by Satyam Kandula CLA
Modified: 2011-10-24 20:52 EDT (History)
2 users (show)

See Also:


Attachments
Proposed test patch (3.23 KB, patch)
2011-09-28 06:40 EDT, Satyam Kandula CLA
satyam.kandula: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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