Bug 240807 - [1.5][compiler] Missing unchecked cast warning on interface cast
Summary: [1.5][compiler] Missing unchecked cast warning on interface cast
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-15 07:32 EDT by Philipe Mulet CLA
Modified: 2008-12-09 06:43 EST (History)
2 users (show)

See Also:


Attachments
Proposed patch (4.80 KB, patch)
2008-11-10 09:52 EST, Philipe Mulet CLA
no flags Details | Diff

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