Bug 84055

Summary: [1.5] Unnecessary cast wrongly reported with boxing
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Olivier Thomann CLA 2005-01-31 11:29:01 EST
Using latest, compiling the following example reports an unnecessary cast that
is indeed required, otherwise it is a compile error.

public class X {

	private static void checkConversions(byte _byte) {
		Short s = (short) _byte; // cast reported as unnecessary
	} 

    public static void main(String args[]) {
        byte _byte = 2;

        checkConversions(_byte);
        System.out.println("OK");
      }
}

This might be related to bug 83965.
Comment 1 Philipe Mulet CLA 2005-02-03 04:41:37 EST
Tuned unnecessary cast reporting to handle this situation.
Added AutoboxingTest#test086
Fixed
Comment 2 Jerome Lanneluc CLA 2005-02-15 06:44:30 EST
Verified in I20050214