Re: java.util.Properties extending from HashMap<Object, Object> instead of HashMap<String, String>
- From: Zig <none@xxxxxxxxxxx>
- Date: Sun, 06 Apr 2008 02:20:15 -0400
On Sun, 06 Apr 2008 01:45:15 -0400, Lew <lew@xxxxxxxxxxxxx> wrote:
If your speculation was correct, then java.util.Hashtable and java.util.Dictionary would also be required to be of type <Object,Object>.
No, because both those classes are parametrized. Properties is not. Apples and oranges.
Changing the parameterization doesn't affect runtime compatibility: methods with the initial erasure type for parameters and return types *must* still exist at runtime. I've listed that in a bit more detail in my initial response to Owen. If my logic is flawed there, please feel free to correct it.
At most it would have affected compile-time compatiblity. Assuming users are using Properties as intended, this would be limited to users doing things like:
Object o="foo";
new Properties().put(o, "bar");
And Sun's usual answer for this is for users to use "-source 1.4" to compile, until they have an opportunity to fix their source.
-Zig
.
- Follow-Ups:
- References:
- java.util.Properties extending from HashMap<Object, Object> instead of HashMap<String, String>
- From: Rakesh
- Re: java.util.Properties extending from HashMap<Object, Object> instead of HashMap<String, String>
- From: Owen Jacobson
- Re: java.util.Properties extending from HashMap<Object, Object> instead of HashMap<String, String>
- From: Zig
- Re: java.util.Properties extending from HashMap<Object, Object> instead of HashMap<String, String>
- From: Zig
- Re: java.util.Properties extending from HashMap<Object, Object> instead of HashMap<String, String>
- From: Lew
- Re: java.util.Properties extending from HashMap<Object, Object> instead of HashMap<String, String>
- From: Zig
- Re: java.util.Properties extending from HashMap<Object, Object> instead of HashMap<String, String>
- From: Lew
- Re: java.util.Properties extending from HashMap<Object, Object> instead of HashMap<String, String>
- From: Zig
- Re: java.util.Properties extending from HashMap<Object, Object> instead of HashMap<String, String>
- From: Lew
- java.util.Properties extending from HashMap<Object, Object> instead of HashMap<String, String>
- Prev by Date: Re: PDF's sent through tomcat/apache
- Next by Date: Special Stainless Steel Bracelet KB919 From China
- Previous by thread: Re: java.util.Properties extending from HashMap<Object, Object> instead of HashMap<String, String>
- Next by thread: Re: java.util.Properties extending from HashMap<Object, Object> instead of HashMap<String, String>
- Index(es):
Relevant Pages
|