Code clean-up. Remove unused code. Fix generics related warnings. No functional change.
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 25 Mar 2008 23:19:15 +0000 (23:19 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 25 Mar 2008 23:19:15 +0000 (23:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@641073 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/connector/InputBuffer.java

index 7eebefb..ed762ca 100644 (file)
@@ -81,30 +81,12 @@ public class InputBuffer extends Reader
 
 
     /**
-     * Number of bytes read.
-     */
-    private int bytesRead = 0;
-
-
-    /**
-     * Number of chars read.
-     */
-    private int charsRead = 0;
-
-
-    /**
      * Flag which indicates if the input buffer is closed.
      */
     private boolean closed = false;
 
 
     /**
-     * Byte chunk used to input bytes.
-     */
-    private ByteChunk inputChunk = new ByteChunk();
-
-
-    /**
      * Encoding to use.
      */
     private String enc;
@@ -119,7 +101,8 @@ public class InputBuffer extends Reader
     /**
      * List of encoders.
      */
-    protected HashMap encoders = new HashMap();
+    protected HashMap<String,B2CConverter> encoders =
+        new HashMap<String,B2CConverter>();
 
 
     /**
@@ -211,8 +194,6 @@ public class InputBuffer extends Reader
     public void recycle() {
         
         state = INITIAL_STATE;
-        bytesRead = 0;
-        charsRead = 0;
         
         // If usage of mark made the buffer too big, reallocate it
         if (cb.getChars().length > size) {
@@ -481,14 +462,14 @@ public class InputBuffer extends Reader
         gotEnc = true;
         if (enc == null)
             enc = DEFAULT_ENCODING;
-        conv = (B2CConverter) encoders.get(enc);
+        conv = encoders.get(enc);
         if (conv == null) {
             if (SecurityUtil.isPackageProtectionEnabled()){
                 try{
-                    conv = (B2CConverter)AccessController.doPrivileged(
-                            new PrivilegedExceptionAction(){
+                    conv = AccessController.doPrivileged(
+                            new PrivilegedExceptionAction<B2CConverter>(){
 
-                                public Object run() throws IOException{
+                                public B2CConverter run() throws IOException {
                                     return new B2CConverter(enc);
                                 }