Re: java.util.Properties extending from HashMap<Object, Object> instead of HashMap<String, String>
- From: "Mike Schilling" <mscottschilling@xxxxxxxxxxx>
- Date: Sat, 5 Apr 2008 23:44:03 -0700
Zig wrote:
On Fri, 04 Apr 2008 20:02:29 -0400, Lew <lew@xxxxxxxxxxxxx> wrote:
Completely wrong. Properties is meant for Strings only.
Take a look at the javadocs for Properties.stringPropertyNames(). At
first glance, one expects this method to cast keySet() to a
Set<String>, but note one difference:
"Properties whose key or value is not of type String are omitted"
There may be some other examples, but this was just the first that
caught my eye.
I think this is an indication that, while Properties are *meant* for
Strings, there may be existing code which uses them for other
things.
I think this is axiomatic. If an API is intended to be used for A,
the documentation explains carefully that it's intended for A, and all
the examples show it being used for A, some perverse *** is going
to use it for B, C, and D, particularly when that's inferior to the
natural ways of doing those.
.
- 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
- java.util.Properties extending from HashMap<Object, Object> instead of HashMap<String, String>
- Prev by Date: Special Stainless Steel Bracelet KB919 From China
- Next by Date: Jet command line
- 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):