Re: java.util.Properties extending from HashMap<Object, Object> instead of HashMap<String, String>



Zig wrote:
On Sat, 05 Apr 2008 20:22:50 -0400, Lew <lew@xxxxxxxxxxxxx> wrote:

* The type has to be <Object,Object> due to backwards compatibility issues for APIs which used Properties in ways it was not intended for.

That's not it. It's because that's the only backward-compatible type for a class that came from 1.0 days. It's for APIs that used Properties in ways that it *was* intended for.

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.

--
Lew
.