Bug 240807

Summary: [1.5][compiler] Missing unchecked cast warning on interface cast
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: Ed.Merks, jerome_lanneluc
Version: 3.4   
Target Milestone: 3.5 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch none

Description Philipe Mulet CLA 2008-07-15 07:32:38 EDT
3.4.0

Following code should yield an unchecked cast from List<Object> to Throwable.

import java.util.Collections;
public class X {
	X() {
		Throwable t = (Throwable) Collections.emptyList();
	}
}
Comment 1 Philipe Mulet CLA 2008-11-10 09:03:53 EST
import java.util.*;
public class X {
    X(List rawList, List<?> unboundList) {
            Throwable t0 = (Throwable) Collections.emptyList(); // unchecked
            Throwable t1 = (Throwable) rawList; // no warn
            Throwable t2 = (Throwable) unboundList; // unchecked
    }
}
Comment 2 Philipe Mulet CLA 2008-11-10 09:52:10 EST
Created attachment 117437 [details]
Proposed patch
Comment 3 Philipe Mulet CLA 2008-11-10 09:52:41 EST
Added GenericTypeTest#test1405
Comment 4 Philipe Mulet CLA 2008-11-10 11:54:30 EST
Released for 3.5M4.
Fixed
Comment 5 Philipe Mulet CLA 2008-12-02 04:54:40 EST
After second thought, I don't think this one should be flagged as unchecked any longer.

Will back out the change. 
Comment 6 Philipe Mulet CLA 2008-12-02 04:59:51 EST
Backed out the change, and added more unchecked warning tests:
GenericTypeTest#1408-1415
Comment 7 Jerome Lanneluc CLA 2008-12-09 06:43:11 EST
Verified for 3.5M4