I just bumped into this 5 minutes ago !

The null behavior is correct as of servlet spec.
The API mentions it returns null for no cookie.

Will send a patch in a couple of hours.

-- 
 St�phane Bailliez 
 Software Engineer, Paris - France 
 iMediation - http://www.imediation.com 
 Disclaimer: All the opinions expressed above are mine and not those from my
company. 



> -----Original Message-----
> From: Streithorst, Kip [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 18, 2002 12:48 AM
> To: 'Turbine Users List'
> Subject: RE: DefaultCookieParser null pointer exception
> 
> 
> See below.
> 
> > -----Original Message-----
> > From: Stanley,Michael P. [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, January 17, 2002 5:48 PM
> > To: Turbine Users List
> > Subject: Re: DefaultCookieParser null pointer exception
> > 
> > 
> > Streithorst, Kip wrote:
> > 
> > >The NPE is thrown in setRunData(RunData data) of the
> > >DefaultCookieParser.java, because Cookie [] cookies =
> > >data.getRequest().getCookies() is never checked for null 
> > before being used.
> > >
> > Is this desired?
> > 
> > Mike
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: 
> > <mailto:[EMAIL PROTECTED]>
> > 
> 
> That behavior is not desired, because on the next line, 
> cookies.length is called, but when cookies is null, an NPE is 
> returned. By
> wrapping that part of code in a cookies != null if, you will get a
> CookieParser that has no key,value pairs in it if no cookies 
> were returned
> by the client, as of now you get an NPE.
> 
> Thanks,
> Kip
> 
> --
> To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

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

Reply via email to