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



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
.



Relevant Pages

  • Re: Androcless accusations of lying
    ... ct is scalar multiple of x, otherwise it may already be squewed or ... Oranges, and apples, if you like. ... Of course, I'm talking about real physics and sanity, not theoretical ...
    (sci.physics.relativity)
  • Re: Question about light clock and derivation of time dilation
    ... >>> Unfortunately, with morons like Androcles and Wilson, ... >> Indeed there are negative time intervals because measuring a time ... > negative apples or negatove oranges, ...
    (sci.physics.relativity)
  • OT: movie-fan rgpers
    ... Who like apples and oranges equally? ... Blues Brothers ... Zatoichi flics ...
    (rec.gambling.poker)
  • Re: ARod is not clutch
    ... season and a small handful of plate appearances in the playoffs ... is mixing apples and oranges. ... are somehow more relevant today than recent history. ...
    (alt.sports.baseball.ny-yankees)
  • Re: macro for coding an id number
    ... > 1001 apples USA large red ... > 3235 apples Spain large green ... > 7771 oranges France small ... > 7772 oranges France medium ...
    (microsoft.public.excel.programming)