From 6920b3882370ce458ee3b6c5c12088aa72276851 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Sun, 6 May 2012 13:58:20 +0000 Subject: [PATCH] UrlEncodedFormEntity constructors added in 4.2 no longer throw UnsupportedEncodingException git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1334630 13f79535-47bb-0310-9956-ffa450edef68 --- .../http/client/entity/UrlEncodedFormEntity.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/httpclient/src/main/java/org/apache/http/client/entity/UrlEncodedFormEntity.java b/httpclient/src/main/java/org/apache/http/client/entity/UrlEncodedFormEntity.java index bd1c54737..33e389fad 100644 --- a/httpclient/src/main/java/org/apache/http/client/entity/UrlEncodedFormEntity.java +++ b/httpclient/src/main/java/org/apache/http/client/entity/UrlEncodedFormEntity.java @@ -58,8 +58,8 @@ public class UrlEncodedFormEntity extends StringEntity { public UrlEncodedFormEntity ( final List parameters, final String charset) throws UnsupportedEncodingException { - super(URLEncodedUtils.format(parameters, - charset != null ? charset : HTTP.DEF_CONTENT_CHARSET.name()), + super(URLEncodedUtils.format(parameters, + charset != null ? charset : HTTP.DEF_CONTENT_CHARSET.name()), ContentType.create(URLEncodedUtils.CONTENT_TYPE, charset)); } @@ -69,15 +69,14 @@ public class UrlEncodedFormEntity extends StringEntity { * * @param parameters iterable collection of name/value pairs * @param charset encoding the name/value pairs be encoded with - * @throws UnsupportedEncodingException if the encoding isn't supported * * @since 4.2 */ public UrlEncodedFormEntity ( final Iterable parameters, final Charset charset) { - super(URLEncodedUtils.format(parameters, - charset != null ? charset : HTTP.DEF_CONTENT_CHARSET), + super(URLEncodedUtils.format(parameters, + charset != null ? charset : HTTP.DEF_CONTENT_CHARSET), ContentType.create(URLEncodedUtils.CONTENT_TYPE, charset)); } @@ -98,12 +97,11 @@ public class UrlEncodedFormEntity extends StringEntity { * of parameters with the default encoding of {@link HTTP#DEFAULT_CONTENT_CHARSET} * * @param parameters iterable collection of name/value pairs - * @throws UnsupportedEncodingException if the default encoding isn't supported * * @since 4.2 */ public UrlEncodedFormEntity ( - final Iterable parameters) throws UnsupportedEncodingException { + final Iterable parameters) { this(parameters, null); }