Yo T2 developers -- this one make it in?

David Vandegrift <[EMAIL PROTECTED]> writes:

> Back on January 18, 2002 a patch was submitted by Stephane Bailliez to fix a
> NullPointerException in DefaultCookieParser.
> DefaultCookieParser should be expecting a null since HttpServletRequest
> returns null if no cookies were sent to the server.
> 
> Any chance this fix can be applied to repository?
> 
> I've pasted the original patch below.  Of course, it's now out of date but
> it gets the point across.
> 
> Thanks,
>   David
> 
> 
> 
> Index: DefaultCookieParser.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-turbine-2/src/java/org/apache/turbine/util/parser/De
> faultCookieParser.java,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 DefaultCookieParser.java
> --- DefaultCookieParser.java  16 Aug 2001 05:09:58 -0000      1.1.1.1
> +++ DefaultCookieParser.java  18 Jan 2002 12:19:42 -0000
> @@ -152,16 +152,18 @@
>          cookiePath = new DynamicURI(data);
>  
>          Cookie[] cookies = data.getRequest().getCookies();
> -
> -        Log.info ("Number of Cookies "+cookies.length);
> -
> -        for (int i=0; i<cookies.length; i++)
> +        int cookiesCount = (cookies != null ? cookies.length : 0);
> +        
> +        Log.info ("Number of Cookies: " + cookiesCount);
> +        
> +        for (int i = 0; i < cookiesCount; i++)
>          {
>              String name = convert (cookies[i].getName());
>              String value = cookies[i].getValue();
> -            Log.info ("Adding "+name+"="+value);
> +            Log.info ("Adding " + name + "=" + value);
>              add (name,value);
>          }
> +
>  
>          this.data = data;
>      }
-- 

Daniel Rall <[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:turbine-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:turbine-dev-help@;jakarta.apache.org>

Reply via email to