*
* @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,
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()) {