> From: Daniel Rall [mailto:[EMAIL PROTECTED]]
> 
> 
> "Geir Magnusson Jr." <[EMAIL PROTECTED]> writes:
> 
> > I personally think that Context should accept null values 
> and keys and not
> > throw exceptions, but that's just me.  If you want to store 
> a null, great.
> > Context will give it back when you ask for it :)
> > 
> > It's not a Hashtable.  It uses a Hashtable.  It acts like a 
> hashtable.  But
> > it's not a hashtable.
> 
> Null values are your friend.  I'm not sure of the value of 
> null keys, however.
> 

I would agree with you that it would make sense to differentiate 
between A variable in the Context that happens to be NULL and
an trying to access an undeclared variable. The former is a perfectly
valid situation, the later looks like a template misused to me.

Notice that the fact that we cannot store null values in the Context
is due to the fact that we use a java.util.Hashtable in its implementation.
If we used instead a java.util.HashMap we could store NULL values.
Moreover, HashMap access is not syncronized, which given our usage
of Context is unnecessary. That could even speed things up.

Jose Alberto

Reply via email to