From: markt Date: Fri, 12 Aug 2011 09:09:32 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51650 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=395da5875d5fac608480a6514bf67b58d276a47f;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51650 Code clean-up git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1157018 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/util/RequestUtil.java b/java/org/apache/catalina/util/RequestUtil.java index ae5615a30..bf099a3b8 100644 --- a/java/org/apache/catalina/util/RequestUtil.java +++ b/java/org/apache/catalina/util/RequestUtil.java @@ -174,8 +174,8 @@ public final class RequestUtil { * * @param map Map that accumulates the resulting parameters * @param data Input string containing request parameters - * @param encoding The encoding to use; if null, the default encoding is - * used. If an unsupported encoding is specified the parameters will not be + * @param encoding The encoding to use; encoding must not be null. + * If an unsupported encoding is specified the parameters will not be * parsed and the map will not be modified */ public static void parseParameters(Map map, String data, @@ -184,15 +184,10 @@ public final class RequestUtil { if ((data != null) && (data.length() > 0)) { // use the specified encoding to extract bytes out of the - // given string so that the encoding is not lost. If an - // encoding is not specified, let it use platform default + // given string so that the encoding is not lost. byte[] bytes = null; try { - if (encoding == null) { - bytes = data.getBytes(Charset.defaultCharset()); - } else { - bytes = data.getBytes(B2CConverter.getCharset(encoding)); - } + bytes = data.getBytes(B2CConverter.getCharset(encoding)); parseParameters(map, bytes, encoding); } catch (UnsupportedEncodingException uee) { if (log.isDebugEnabled()) {