Resurrect UrlEncodedQueryString (RFE 6306820)?

Weijun Wang Weijun.Wang at Sun.COM
Thu Mar 26 23:17:59 PDT 2009


Is it worthwhile to add some clarification on this order?

Say, create(), apply(), toString() always preserve the order, append()
adds at end, and set() updates in-place.

Thanks
Max

kennardconsulting wrote:
> Yes. From the JavaDoc for .equals():
> 
> ---
> 
> Compares the specified object with this UrlEncodedQueryString for equality. 
> 
> Returns true if the given object is also a UrlEncodedQueryString and the two
> UrlEncodedQueryStrings have the same parameters. More formally, two
> UrlEncodedQueryStrings t1 and t2 represent the same UrlEncodedQueryString if
> t1.toString().equals(t2.toString()). This ensures that the equals method
> checks the ordering, as well as the existence, of every parameter. 
> 
> Clients interested only in the existence, not the ordering, of parameters
> are recommended to use getMap().equals. 
> 
> This implementation first checks if the specified object is this
> UrlEncodedQueryString; if so it returns true. Then, it checks if the
> specified object is a UrlEncodedQueryString whose toString() is identical to
> the toString() of this UrlEncodedQueryString; if not, it returns false.
> Otherwise, it returns true 
> 
> ---
> 
> Regards,
> 
> Richard.



More information about the net-dev mailing list