Jose Alberto Fernandez wrote:
> 
> > 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.

I tried that for both of those reasons, and was convinced it was slower
for whatever reason. Hm.  Maybe I will try again.

geir

> Jose Alberto

-- 
Geir Magnusson Jr.                               [EMAIL PROTECTED]
Velocity : it's not just a good idea. It should be the law.
http://jakarta.apache.org/velocity

Reply via email to