Author: markt Date: Fri Aug 12 09:11:35 2011 New Revision: 1157019 URL: http://svn.apache.org/viewvc?rev=1157019&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51650 Code clean-up Patch provided by Felix Schumacher
Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/util/RequestUtil.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Aug 12 09:11:35 2011 @@ -1 +1 @@ -/tomcat/trunk:1156171,1156276,1156304,1156530,1156602,1157015 +/tomcat/trunk:1156171,1156276,1156304,1156530,1156602,1157015,1157018 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/util/RequestUtil.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/util/RequestUtil.java?rev=1157019&r1=1157018&r2=1157019&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/util/RequestUtil.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/util/RequestUtil.java Fri Aug 12 09:11:35 2011 @@ -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<String,String[]> 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()) { Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1157019&r1=1157018&r2=1157019&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Fri Aug 12 09:11:35 2011 @@ -71,6 +71,10 @@ <fix> Unregisters MBean of DataSource when web application stops. (kfujino) </fix> + <fix> + <bug>51650</bug>: Code clean-up. Patch provided by Felix Schumacher. + (markt) + </fix> </changelog> </subsection> <subsection name="Coyote"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org