tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1195949 - /tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java
Date Tue, 01 Nov 2011 12:13:43 GMT
Author: kkolinko
Date: Tue Nov  1 12:13:43 2011
New Revision: 1195949

URL: http://svn.apache.org/viewvc?rev=1195949&view=rev
Log:
Followup to r1195943
Simplify code. Move toString() call out of urlDecode() method.
No functional change.

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java?rev=1195949&r1=1195948&r2=1195949&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java Tue Nov  1 12:13:43 2011
@@ -317,18 +317,16 @@ public final class Parameters {
                 String value;
 
                 if (decodeName) {
-                    name = urlDecode(tmpName, charset);
-                } else {
-                    tmpName.setCharset(charset);
-                    name = tmpName.toString();
+                    urlDecode(tmpName);
                 }
+                tmpName.setCharset(charset);
+                name = tmpName.toString();
 
                 if (decodeValue) {
-                    value = urlDecode(tmpValue, charset);
-                } else {
-                    tmpValue.setCharset(charset);
-                    value = tmpValue.toString();
+                    urlDecode(tmpValue);
                 }
+                tmpValue.setCharset(charset);
+                value = tmpValue.toString();
 
                 addParameter(name, value);
             } catch (IOException e) {
@@ -359,14 +357,12 @@ public final class Parameters {
         }
     }
 
-    private String urlDecode(ByteChunk bc, Charset charset)
+    private void urlDecode(ByteChunk bc)
         throws IOException {
         if( urlDec==null ) {
             urlDec=new UDecoder();
         }
         urlDec.convert(bc);
-        bc.setCharset(charset);
-        return bc.toString();
     }
 
     public void processParameters( MessageBytes data, String encoding ) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message