RFR: 8210311: IllegalArgumentException in CookieManager - Comparison method violates its general contract

Michael McMahon michael.x.mcmahon at oracle.com
Thu Sep 13 10:03:33 UTC 2018


Thanks for the reviews. This suggestion looks reasonable Daniel.

Michael.

On 13/09/2018, 10:00, Daniel Fuchs wrote:
> Looks good Michael!
>
> An alternative in HttpCookie.java would be to do:
>
>   144     private HttpCookie(String name, String value, String header) {
> - 145         this(name, value, header, -1);
> + 145         this(name, value, header, System.currentTimeMillis());
>   146     }
>
>  [...]
>
> - 162         whenCreated = (creationTime == -1) ?
>                   System.currentTimeMillis() : creationTime;
> + 162         whenCreated =  creationTime;
>
> best regards,
>
> -- daniel
>
>
> On 12/09/2018 17:28, Michael McMahon wrote:
>> Could I get the following reviewed please?
>> It fixes a problem in j.n.CookieManager where an internal Comparator 
>> was not obeying its contract
>> and crashing occasionally in Collections.sort(). It also updates the 
>> behavior (sorting of cookie headers)
>> to RFC6265.
>>
>> http://cr.openjdk.java.net/~michaelm/8210311/webrev.1/
>>
>> Thanks,
>> Michael
>


More information about the net-dev mailing list