tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r652918 - in /tomcat/trunk/java/org/apache/coyote/http11: Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java
Date Fri, 02 May 2008 21:25:56 GMT
Author: markt
Date: Fri May  2 14:25:56 2008
New Revision: 652918

URL: http://svn.apache.org/viewvc?rev=652918&view=rev
Log:
Code clean up. Remove unused methods, unnecessary casts/code, fix generics warnings etc reported
by Eclipse.
No functional change.

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=652918&r1=652917&r2=652918&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Fri May  2 14:25:56
2008
@@ -470,7 +470,7 @@
      */
     protected void addFilter(String className) {
         try {
-            Class clazz = Class.forName(className);
+            Class<?> clazz = Class.forName(className);
             Object obj = clazz.newInstance();
             if (obj instanceof InputFilter) {
                 inputBuffer.addFilter((InputFilter) obj);
@@ -530,22 +530,6 @@
 
 
     /**
-     * General use method
-     *
-     * @param sArray the StringArray
-     * @param value string
-     */
-    private boolean inStringArray(String sArray[], String value) {
-        for (int i = 0; i < sArray.length; i++) {
-            if (sArray[i].equals(value)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-
-    /**
      * Checks if any entry in the string array starts with the specified value
      *
      * @param sArray the StringArray
@@ -1144,9 +1128,8 @@
                     }
                     // User key size
                     sslO = new Integer(SSLSocket.getInfoI(socket, SSL.SSL_INFO_CIPHER_USEKEYSIZE));
-                    if (sslO != null) {
-                        request.setAttribute(AprEndpoint.KEY_SIZE_KEY, sslO);
-                    }
+                    request.setAttribute(AprEndpoint.KEY_SIZE_KEY, sslO);
+
                     // SSL session ID
                     sslO = SSLSocket.getInfoS(socket, SSL.SSL_INFO_SESSION_ID);
                     if (sslO != null) {
@@ -1474,7 +1457,7 @@
             int port = 0;
             int mult = 1;
             for (int i = valueL - 1; i > colonPos; i--) {
-                int charValue = HexUtils.DEC[(int) valueB[i + valueS]];
+                int charValue = HexUtils.DEC[valueB[i + valueS]];
                 if (charValue == -1) {
                     // Invalid character
                     error = true;

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=652918&r1=652917&r2=652918&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Fri May  2 14:25:56
2008
@@ -89,7 +89,6 @@
         this.endpoint = endpoint;
 
         request = new Request();
-        int readTimeout = endpoint.getSoTimeout();
         inputBuffer = new InternalNioInputBuffer(request, maxHttpHeaderSize);
         request.setInputBuffer(inputBuffer);
 
@@ -478,7 +477,7 @@
      */
     protected void addFilter(String className) {
         try {
-            Class clazz = Class.forName(className);
+            Class<?> clazz = Class.forName(className);
             Object obj = clazz.newInstance();
             if (obj instanceof InputFilter) {
                 inputBuffer.addFilter((InputFilter) obj);
@@ -538,22 +537,6 @@
 
 
     /**
-     * General use method
-     *
-     * @param sArray the StringArray
-     * @param value string
-     */
-    private boolean inStringArray(String sArray[], String value) {
-        for (int i = 0; i < sArray.length; i++) {
-            if (sArray[i].equals(value)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-
-    /**
      * Checks if any entry in the string array starts with the specified value
      *
      * @param sArray the StringArray
@@ -811,8 +794,6 @@
         int keepAliveLeft = maxKeepAliveRequests;
         long soTimeout = endpoint.getSoTimeout();
 
-        int limit = 0;
-
         boolean keptAlive = false;
         boolean openSocket = false;
         boolean recycle = true;
@@ -840,7 +821,7 @@
                 }
                 request.setStartTime(System.currentTimeMillis());
                 if (!disableUploadTimeout) { //only for body, not for request headers
-                    socket.getIOChannel().socket().setSoTimeout((int)timeout);
+                    socket.getIOChannel().socket().setSoTimeout(timeout);
                 }
             } catch (IOException e) {
                 if (log.isDebugEnabled()) {
@@ -1507,7 +1488,7 @@
             int port = 0;
             int mult = 1;
             for (int i = valueL - 1; i > colonPos; i--) {
-                int charValue = HexUtils.DEC[(int) valueB[i + valueS]];
+                int charValue = HexUtils.DEC[valueB[i + valueS]];
                 if (charValue == -1) {
                     // Invalid character
                     error = true;

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java?rev=652918&r1=652917&r2=652918&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Fri May  2 14:25:56 2008
@@ -460,7 +460,7 @@
      */
     protected void addFilter(String className) {
         try {
-            Class clazz = Class.forName(className);
+            Class<?> clazz = Class.forName(className);
             Object obj = clazz.newInstance();
             if (obj instanceof InputFilter) {
                 inputBuffer.addFilter((InputFilter) obj);
@@ -520,22 +520,6 @@
 
 
     /**
-     * General use method
-     *
-     * @param sArray the StringArray
-     * @param value string
-     */
-    private boolean inStringArray(String sArray[], String value) {
-        for (int i = 0; i < sArray.length; i++) {
-            if (sArray[i].equals(value)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-
-    /**
      * Checks if any entry in the string array starts with the specified value
      *
      * @param sArray the StringArray
@@ -1386,7 +1370,7 @@
             int port = 0;
             int mult = 1;
             for (int i = valueL - 1; i > colonPos; i--) {
-                int charValue = HexUtils.DEC[(int) valueB[i + valueS]];
+                int charValue = HexUtils.DEC[valueB[i + valueS]];
                 if (charValue == -1) {
                     // Invalid character
                     error = true;
@@ -1555,9 +1539,9 @@
         // Add date header
         String date = null;
         if (org.apache.coyote.Constants.IS_SECURITY_ENABLED){
-            date = (String)AccessController.doPrivileged(
-                    new PrivilegedAction() {
-                        public Object run(){
+            date = AccessController.doPrivileged(
+                    new PrivilegedAction<String>() {
+                        public String run(){
                             return FastHttpDateFormat.getCurrentDate();
                         }
                     }



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


Mime
View raw message