Move encoding outside the loop
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 19 May 2010 13:03:57 +0000 (13:03 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 19 May 2010 13:03:57 +0000 (13:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@946168 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/connector/CoyoteAdapter.java

index 29b39ac..9027a79 100644 (file)
@@ -646,18 +646,15 @@ public class CoyoteAdapter implements Adapter {
         
         ByteChunk uriBC = req.decodedURI().getByteChunk();
         int semicolon = uriBC.indexOf(';', 0);
-        String enc = null;
+
+        // What encoding to use? Some platforms, eg z/os, use a default
+        // encoding that doesn't give the expected result so be explicit
+        String enc = connector.getURIEncoding();
+        if (enc == null) {
+            enc = "ISO-8859-1";
+        }
         
         while (semicolon > -1) {
-            if (enc == null) {
-                // What encoding to use? Some platforms, eg z/os, use a default
-                // encoding that doesn't give the expected result so be explicit
-                enc = connector.getURIEncoding();
-                if (enc == null) {
-                    enc = "ISO-8859-1";
-                }
-            }
-            
             // Parse path param, and extract it from the decoded request URI
             int start = uriBC.getStart();
             int end = uriBC.getEnd();