commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dIon Gillard <d...@multitask.com.au>
Subject Re: [httpclient] New change to Cookie.java breaks Cactus
Date Sun, 17 Feb 2002 00:15:43 GMT
Vincent Massol wrote:

>It seems a change brought on the 14/02/2002 to Cookie.java is breaking
>the Cactus tests, as reported by GUMP :
>
>     [java]     [junit] Testcase: testSendMultipleCookies took 0.025 sec
>     [java]     [junit] 	Caused an ERROR
>     [java]     [junit] null
>     [java]     [junit] java.lang.NullPointerException
>     [java]     [junit] 	at
>org.apache.commons.httpclient.Cookie.compare(Cookie.java:513)
>     [java]     [junit] 	at
>java.util.TreeMap.compare(TreeMap.java:1047)
>     [java]     [junit] 	at
>java.util.TreeMap.put(TreeMap.java:449)
>     [java]     [junit] 	at
>java.util.TreeSet.add(TreeSet.java:198)
>     [java]     [junit] 	at
>org.apache.commons.httpclient.Cookie.createCookieHeader(Cookie.java:477)
>     [java]     [junit] 	at
>org.apache.commons.httpclient.Cookie.createCookieHeader(Cookie.java:456)
>     [java]     [junit] 	at
>org.apache.commons.httpclient.Cookie.createCookieHeader(Cookie.java:444)
>     [java]     [junit] 	at
>org.apache.commons.httpclient.Cookie.createCookieHeader(Cookie.java:421)
>     [java]     [junit] 	at
>org.apache.cactus.client.HttpClientHelper.addCookies(HttpClientHelper.ja
>va;org/apache/cactus/util/log/LogAspect.java(1k):377)
>
>My analysis is that the previous Cookie class was more lenient WRT the
>cookie domain (i.e. it could be "null"). However it seems the new
>Cookie.compare() method throws a NPE if it is null.
>
>Questions :
>1/ Is this done voluntarily (i.e. force the user to always specify a
>domain) ?
>
Not particularly, but it does make some sense. I can't find anywhere in 
the RFC  that says Domain is optional.

>
>2/ Is HttpClient going to preserve a backward compatibility or should I
>change the Cactus code ?
>
Not sure....I'd consider allowing a null domain in this case a bug. If I 
can find a good reason for keeping null domains, I'm happy to. Either 
way, the create code should throw a nullpointerexception well before the 
compare if it's not allowed to be null.

-- 
dIon Gillard, Multitask Consulting
http://www.multitask.com.au/developers




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


Mime
View raw message