Leo Sutic wrote:
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Leo Simons

+1. That's what the collection APIs do, innit?
Not really:

Set set = new HashSet ();

assertTrue( !set.contains(null) );
set.add( null );
assertTrue( set.contains(null) );
Map map = new HashMap ();
assertTrue( !map.containsKey(null) );
assertTrue( map.get(null) == null );
map.put( null, null );
assertTrue( map.containsKey(null) );
assertTrue( map.get(null) == null );


get() will still give you null, but containsKey will return true.

rephrase: its what they should be doing! IMNSHO :D. "null" as a key does not make sense.


cheers!

- LSD



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to