On Sat, 2008-05-10 at 11:03 +0200, Sebastiaan van Erk wrote: > Hi, > > First of all, thanks for the new httpclient release. :-) > > When I was updating my project I ran into one small generics issue; the > following code will not compile: > > new UrlEncodedFormEntity(Collections.singletonList(new > BasicNameValuePair("a", "b"))); > > because UrlEncodedFormEntity wants a List<NameValuePair> and the above > code results in a List<BasicNameValuePair>. Considering that the list is > probably read only in the httpclient code, the declaration of the > UrlEncodedFormEntity constructor could be changed to: > > public UrlEncodedFormEntity ( > final List <? extends NameValuePair> parameters, > final String encoding) throws UnsupportedEncodingException { > super(URLEncodedUtils.format(parameters, encoding), > encoding); > setContentType(URLEncodedUtils.CONTENT_TYPE); > } > > (note the List<? extends NameValuePair>). >
Sebastiaan, It is obviously a bug. Please open a JIRA issue for it. We also happily accept patches ;-) Oleg > Regards, > Sebastiaan > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]