Summary: | [1.5][compiler] Cast error where there is none (Properties->Map) | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Claudio Nieder <private> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | RESOLVED INVALID | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.1 | ||
Target Milestone: | 3.1.1 | ||
Hardware: | PC | ||
OS: | Linux-GTK | ||
Whiteboard: |
Description
Claudio Nieder
2005-07-03 17:31:04 EDT
Given Properties extends Hashtable<Object,Object>, the cast comes down to converting Map<Object,Object> to Map<String,String> which is forbidden by the spec since these are provably distinct types. Note that javac correctly rejects: import java.util.*; public class X { public void foo(Hashtable<Object,Object> moo) { Map<String, String> m = (Map<String, String>) moo; } } but misses the indirect case when using Properties. Closing as javac bug. |