Bug 530420

Summary: [quick fix] Suggest narrowing cast in switch statement
Product: [Eclipse Project] JDT Reporter: Nathan Gilbert <tahgtahv>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: jarthana
Version: 4.7.2   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Nathan Gilbert CLA 2018-01-28 11:42:34 EST
When switching on an expression that evaluates to a long, double, or float, an error results. This is correct.  It would be nice if Quick Fix treats the target type as int, and provided the same suggestions as for assigning to an int.

Example:
long l;
switch(l) {}
//Quick Fix: Add cast to 'int'
//Quick Fix: Change type of 'l' to 'int'
Comment 1 Jay Arthanareeswaran CLA 2018-01-29 07:38:21 EST
Moving to UI