Author: markt
Date: Thu Sep  3 19:35:19 2015
New Revision: 1701113

URL: http://svn.apache.org/r1701113
Log:
Small simplification
Use 'conv == null' to indicate that conv has not been set rather than a 
separate flag.

Modified:
    tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java

Modified: tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java?rev=1701113&r1=1701112&r2=1701113&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java Thu Sep  3 
19:35:19 2015
@@ -96,12 +96,6 @@ public class InputBuffer extends Reader
 
 
     /**
-     * Encoder is set.
-     */
-    private boolean gotEnc = false;
-
-
-    /**
      * List of encoders.
      */
     protected final ConcurrentHashMap<String,B2CConverter> encoders = new 
ConcurrentHashMap<>();
@@ -202,9 +196,9 @@ public class InputBuffer extends Reader
 
         if (conv != null) {
             conv.recycle();
+            conv = null;
         }
 
-        gotEnc = false;
         enc = null;
     }
 
@@ -375,7 +369,7 @@ public class InputBuffer extends Reader
 
     @Override
     public int realReadChars() throws IOException {
-        if (!gotEnc) {
+        if (conv == null) {
             setConverter();
         }
 
@@ -542,24 +536,19 @@ public class InputBuffer extends Reader
     }
 
 
-    public void checkConverter()
-        throws IOException {
-
-        if (!gotEnc) {
+    public void checkConverter() throws IOException {
+        if (conv == null) {
             setConverter();
         }
-
     }
 
 
-    protected void setConverter()
-        throws IOException {
+    protected void setConverter() throws IOException {
 
         if (coyoteRequest != null) {
             enc = coyoteRequest.getCharacterEncoding();
         }
 
-        gotEnc = true;
         if (enc == null) {
             enc = org.apache.coyote.Constants.DEFAULT_CHARACTER_ENCODING;
         }



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

Reply via email to