tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1188823 - /tomcat/trunk/java/org/apache/catalina/filters/
Date Tue, 25 Oct 2011 17:43:47 GMT
Author: markt
Date: Tue Oct 25 17:43:47 2011
New Revision: 1188823

URL: http://svn.apache.org/viewvc?rev=1188823&view=rev
Log:
Clean-up. No functional change.

Modified:
    tomcat/trunk/java/org/apache/catalina/filters/AddDefaultCharsetFilter.java
    tomcat/trunk/java/org/apache/catalina/filters/Constants.java
    tomcat/trunk/java/org/apache/catalina/filters/CsrfPreventionFilter.java
    tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java
    tomcat/trunk/java/org/apache/catalina/filters/FilterBase.java
    tomcat/trunk/java/org/apache/catalina/filters/RemoteAddrFilter.java
    tomcat/trunk/java/org/apache/catalina/filters/RemoteHostFilter.java
    tomcat/trunk/java/org/apache/catalina/filters/RequestDumperFilter.java
    tomcat/trunk/java/org/apache/catalina/filters/RequestFilter.java
    tomcat/trunk/java/org/apache/catalina/filters/SetCharacterEncodingFilter.java
    tomcat/trunk/java/org/apache/catalina/filters/WebdavFixFilter.java

Modified: tomcat/trunk/java/org/apache/catalina/filters/AddDefaultCharsetFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/AddDefaultCharsetFilter.java?rev=1188823&r1=1188822&r2=1188823&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/filters/AddDefaultCharsetFilter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/filters/AddDefaultCharsetFilter.java Tue Oct 25
17:43:47 2011
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.catalina.filters;
 
 import java.io.IOException;

Modified: tomcat/trunk/java/org/apache/catalina/filters/Constants.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/Constants.java?rev=1188823&r1=1188822&r2=1188823&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/filters/Constants.java (original)
+++ tomcat/trunk/java/org/apache/catalina/filters/Constants.java Tue Oct 25 17:43:47 2011
@@ -14,8 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.catalina.filters;
 
 
@@ -26,7 +24,6 @@ package org.apache.catalina.filters;
  * @author Craig R. McClanahan
  * @version $Id$
  */
-
 public final class Constants {
 
     public static final String Package = "org.apache.catalina.filters";

Modified: tomcat/trunk/java/org/apache/catalina/filters/CsrfPreventionFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/CsrfPreventionFilter.java?rev=1188823&r1=1188822&r2=1188823&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/filters/CsrfPreventionFilter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/filters/CsrfPreventionFilter.java Tue Oct 25 17:43:47
2011
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.catalina.filters;
 
 import java.io.IOException;
@@ -204,14 +203,16 @@ public class CsrfPreventionFilter extend
         for (int j = 0; j < random.length; j++) {
             byte b1 = (byte) ((random[j] & 0xf0) >> 4);
             byte b2 = (byte) (random[j] & 0x0f);
-            if (b1 < 10)
+            if (b1 < 10) {
                 buffer.append((char) ('0' + b1));
-            else
+            } else {
                 buffer.append((char) ('A' + (b1 - 10)));
-            if (b2 < 10)
+            }
+            if (b2 < 10) {
                 buffer.append((char) ('0' + b2));
-            else
+            } else {
                 buffer.append((char) ('A' + (b2 - 10)));
+            }
         }
 
         return buffer.toString();
@@ -220,7 +221,7 @@ public class CsrfPreventionFilter extend
     protected static class CsrfResponseWrapper
             extends HttpServletResponseWrapper {
 
-        private String nonce;
+        private final String nonce;
 
         public CsrfResponseWrapper(HttpServletResponse response, String nonce) {
             super(response);
@@ -257,8 +258,9 @@ public class CsrfPreventionFilter extend
          */
         private String addNonce(String url) {
 
-            if ((url == null) || (nonce == null))
+            if ((url == null) || (nonce == null)) {
                 return (url);
+            }
 
             String path = url;
             String query = "";

Modified: tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java?rev=1188823&r1=1188822&r2=1188823&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java Tue Oct 25 17:43:47 2011
@@ -464,12 +464,12 @@ public class ExpiresFilter extends Filte
         /**
          * List of duration elements.
          */
-        private List<Duration> durations;
+        private final List<Duration> durations;
 
         /**
          * Starting point of the elaspse to set in the response.
          */
-        private StartingPoint startingPoint;
+        private final StartingPoint startingPoint;
 
         public ExpiresConfiguration(StartingPoint startingPoint,
                 List<Duration> durations) {
@@ -533,7 +533,7 @@ public class ExpiresFilter extends Filte
 
         private PrintWriter printWriter;
 
-        private HttpServletRequest request;
+        private final HttpServletRequest request;
 
         private ServletOutputStream servletOutputStream;
 
@@ -636,11 +636,11 @@ public class ExpiresFilter extends Filte
      * "Start Write Response Body" event.
      */
     public class XPrintWriter extends PrintWriter {
-        private PrintWriter out;
+        private final PrintWriter out;
 
-        private HttpServletRequest request;
+        private final HttpServletRequest request;
 
-        private XHttpServletResponse response;
+        private final XHttpServletResponse response;
 
         public XPrintWriter(PrintWriter out, HttpServletRequest request,
                 XHttpServletResponse response) {
@@ -851,11 +851,11 @@ public class ExpiresFilter extends Filte
      */
     public class XServletOutputStream extends ServletOutputStream {
 
-        private HttpServletRequest request;
+        private final HttpServletRequest request;
 
-        private XHttpServletResponse response;
+        private final XHttpServletResponse response;
 
-        private ServletOutputStream servletOutputStream;
+        private final ServletOutputStream servletOutputStream;
 
         public XServletOutputStream(ServletOutputStream servletOutputStream,
                 HttpServletRequest request, XHttpServletResponse response) {

Modified: tomcat/trunk/java/org/apache/catalina/filters/FilterBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/FilterBase.java?rev=1188823&r1=1188822&r2=1188823&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/filters/FilterBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/filters/FilterBase.java Tue Oct 25 17:43:47 2011
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.catalina.filters;
 
 import java.util.Enumeration;

Modified: tomcat/trunk/java/org/apache/catalina/filters/RemoteAddrFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/RemoteAddrFilter.java?rev=1188823&r1=1188822&r2=1188823&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/filters/RemoteAddrFilter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/filters/RemoteAddrFilter.java Tue Oct 25 17:43:47
2011
@@ -14,8 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.catalina.filters;
 
 
@@ -40,8 +38,7 @@ import org.apache.juli.logging.LogFactor
  *
  */
 
-public final class RemoteAddrFilter
-    extends RequestFilter {
+public final class RemoteAddrFilter extends RequestFilter {
 
     // ----------------------------------------------------- Instance Variables
     private static final Log log = LogFactory.getLog(RemoteAddrFilter.class);

Modified: tomcat/trunk/java/org/apache/catalina/filters/RemoteHostFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/RemoteHostFilter.java?rev=1188823&r1=1188822&r2=1188823&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/filters/RemoteHostFilter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/filters/RemoteHostFilter.java Tue Oct 25 17:43:47
2011
@@ -14,8 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.catalina.filters;
 
 
@@ -39,22 +37,15 @@ import org.apache.juli.logging.LogFactor
  * @author Craig R. McClanahan
  *
  */
-
-public final class RemoteHostFilter
-    extends RequestFilter {
-
+public final class RemoteHostFilter extends RequestFilter {
 
     // ----------------------------------------------------- Instance Variables
-    private static final Log log = LogFactory.getLog(RemoteHostFilter.class);
-
-
-    // ------------------------------------------------------------- Properties
 
+    private static final Log log = LogFactory.getLog(RemoteHostFilter.class);
 
 
     // --------------------------------------------------------- Public Methods
 
-
     /**
      * Extract the desired request property, and pass it (along with the
      * specified request and response objects and associated filter chain) to
@@ -98,5 +89,4 @@ public final class RemoteHostFilter
     protected Log getLogger() {
         return log;
     }
-
 }

Modified: tomcat/trunk/java/org/apache/catalina/filters/RequestDumperFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/RequestDumperFilter.java?rev=1188823&r1=1188822&r2=1188823&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/filters/RequestDumperFilter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/filters/RequestDumperFilter.java Tue Oct 25 17:43:47
2011
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.catalina.filters;
 
 import java.io.IOException;
@@ -49,7 +48,6 @@ import org.apache.juli.logging.LogFactor
  *
  * @author Craig R. McClanahan
  */
-
 public class RequestDumperFilter implements Filter {
 
     private static final String NON_HTTP_REQ_MSG =
@@ -121,9 +119,10 @@ public class RequestDumperFilter impleme
             doLog("       contextPath", hRequest.getContextPath());
             Cookie cookies[] = hRequest.getCookies();
             if (cookies != null) {
-                for (int i = 0; i < cookies.length; i++)
+                for (int i = 0; i < cookies.length; i++) {
                     doLog("            cookie", cookies[i].getName() +
                             "=" + cookies[i].getValue());
+                }
             }
             Enumeration<String> hnames = hRequest.getHeaderNames();
             while (hnames.hasMoreElements()) {
@@ -151,8 +150,9 @@ public class RequestDumperFilter impleme
             StringBuilder result = new StringBuilder(pname);
             result.append('=');
             for (int i = 0; i < pvalues.length; i++) {
-                if (i > 0)
+                if (i > 0) {
                     result.append(", ");
+                }
                 result.append(pvalues[i]);
             }
             doLog("         parameter", result.toString());
@@ -219,8 +219,9 @@ public class RequestDumperFilter impleme
             Iterable<String> rhnames = hResponse.getHeaderNames();
             for (String rhname : rhnames) {
                 Iterable<String> rhvalues = hResponse.getHeaders(rhname);
-                for (String rhvalue : rhvalues)
+                for (String rhvalue : rhvalues) {
                     doLog("            header", rhname + "=" + rhvalue);
+                }
             }
         }
 
@@ -274,8 +275,8 @@ public class RequestDumperFilter impleme
     }
 
     private static final class Timestamp {
-        private Date date = new Date(0);
-        private SimpleDateFormat format =
+        private final Date date = new Date(0);
+        private final SimpleDateFormat format =
             new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss");
         private String dateString = format.format(date);
         private void update() {

Modified: tomcat/trunk/java/org/apache/catalina/filters/RequestFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/RequestFilter.java?rev=1188823&r1=1188822&r2=1188823&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/filters/RequestFilter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/filters/RequestFilter.java Tue Oct 25 17:43:47 2011
@@ -14,8 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.catalina.filters;
 
 
@@ -57,9 +55,7 @@ import org.apache.catalina.comet.CometFi
  * <li>The request will be rejected with a "Forbidden" HTTP response.</li>
  * </ul>
  */
-
-public abstract class RequestFilter
-    extends FilterBase implements CometFilter {
+public abstract class RequestFilter extends FilterBase implements CometFilter {
 
 
     // ----------------------------------------------------- Instance Variables

Modified: tomcat/trunk/java/org/apache/catalina/filters/SetCharacterEncodingFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/SetCharacterEncodingFilter.java?rev=1188823&r1=1188822&r2=1188823&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/filters/SetCharacterEncodingFilter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/filters/SetCharacterEncodingFilter.java Tue Oct
25 17:43:47 2011
@@ -52,7 +52,6 @@ import org.apache.juli.logging.LogFactor
  * and <code>User-Agent</code> headers, or a value stashed in the current
  * user's session.</p>
  */
-
 public class SetCharacterEncodingFilter extends FilterBase {
 
     private static final Log log =
@@ -100,8 +99,9 @@ public class SetCharacterEncodingFilter 
         // Conditionally select and set the character encoding to be used
         if (ignore || (request.getCharacterEncoding() == null)) {
             String characterEncoding = selectEncoding(request);
-            if (characterEncoding != null)
+            if (characterEncoding != null) {
                 request.setCharacterEncoding(characterEncoding);
+            }
         }
 
         // Pass control on to the next filter

Modified: tomcat/trunk/java/org/apache/catalina/filters/WebdavFixFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/WebdavFixFilter.java?rev=1188823&r1=1188822&r2=1188823&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/filters/WebdavFixFilter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/filters/WebdavFixFilter.java Tue Oct 25 17:43:47
2011
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.catalina.filters;
 
 import java.io.IOException;
@@ -58,7 +57,6 @@ import javax.servlet.http.HttpServletRes
  *   <li>Unknown issue means it doesn't work</li>
  * </ul>
  */
-
 public class WebdavFixFilter implements Filter {
 
     private static final String LOG_MESSAGE_PREAMBLE =



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


Mime
View raw message