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

Bug 285573

Summary: [quick fix] Wrong quickfix proposal for operations involving double and Integer
Product: [Eclipse Project] JDT Reporter: Jay Arthanareeswaran <jarthana>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: markus.kell.r
Version: 3.6   
Target Milestone: 3.6 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Fix none

Description Jay Arthanareeswaran CLA 2009-08-04 08:47:07 EDT
Build ID: I20090803-1800

Steps To Reproduce:
                Integer value = 4711;
                double test = 47d;
                value = value + test; //Line3: Error

Line 3 is marked with a compilation error (Type mismatch: cannot convert from double to Integer) and one of the quick fixes suggest "Add a cast to
'Integer'". However, this is wrong and will not fix the compilation error as double to Integer cast is not allowed.

More information:
Comment 1 Markus Keller CLA 2009-08-06 12:01:20 EDT
From bug 100593:

Integer mu=5.0f
=> proposal here has to be (int) and not Integer.
Comment 2 Markus Keller CLA 2009-08-06 15:02:09 EDT
Created attachment 143705 [details]
Fix
Comment 3 Markus Keller CLA 2009-08-06 15:03:21 EDT
Fixed in HEAD (fix also improves bug 100593).