Author: markt
Date: Fri Aug 12 09:09:32 2011
New Revision: 1157018
URL: http://svn.apache.org/viewvc?rev=1157018&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51650
Code clean-up
Modified:
tomcat/trunk/java/org/apache/catalina/util/RequestUtil.java
Modified: tomcat/trunk/java/org/apache/catalina/util/RequestUtil.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/util/RequestUtil.java?rev=1157018&r1=1157017&r2=1157018&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/util/RequestUtil.java (original)
+++ tomcat/trunk/java/org/apache/catalina/util/RequestUtil.java Fri Aug 12
09:09:32 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()) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]