Summary: | [1.5][compiler] generic type checking not performed for method return array types | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | mike andrews <mikea> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | eclipse.org |
Version: | 3.1 | ||
Target Milestone: | 3.1 M5 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
mike andrews
2004-11-21 08:20:53 EST
I think the same problem applies for all array assignments, for example, this code produces no warnings, but gives a run time class cast exception: public class GenericArrayTrouble { public static void main(String[] args) { List<Integer>[] nums = new List[] {Collections.singletonList("Uh oh")}; System.out.println(nums[0].get(0).intValue()); } } We did not properly check array types. Added support, we now report: Type safety: The expression of type Set[] needs unchecked conversion to conform to Set<String>[]. Added GenericTypeTest#test462. Second scenario is the same issue indeed. Added GenericTypeTest#test463. Fixed Tests are actually: test463 & test464. Verified in I20050214 |