You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2011/12/08 21:32:56 UTC

svn commit: r1212091 - in /tomcat/trunk/java/org/apache: juli/logging/DirectJDKLog.java tomcat/util/http/Cookies.java

Author: markt
Date: Thu Dec  8 20:32:55 2011
New Revision: 1212091

URL: http://svn.apache.org/viewvc?rev=1212091&view=rev
Log:
Clean-up in preparation for a fix for bug 52184

Modified:
    tomcat/trunk/java/org/apache/juli/logging/DirectJDKLog.java
    tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java

Modified: tomcat/trunk/java/org/apache/juli/logging/DirectJDKLog.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/juli/logging/DirectJDKLog.java?rev=1212091&r1=1212090&r2=1212091&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/juli/logging/DirectJDKLog.java (original)
+++ tomcat/trunk/java/org/apache/juli/logging/DirectJDKLog.java Thu Dec  8 20:32:55 2011
@@ -166,23 +166,23 @@ class DirectJDKLog implements Log {
     // using java.util.logging - and the ugliness if you need to wrap it - is far
     // worse than the unfriendly and uncommon default format for logs.
 
-    private void log( Level level, String msg, Throwable ex ) {
+    private void log(Level level, String msg, Throwable ex) {
         if (logger.isLoggable(level)) {
             // Hack (?) to get the stack trace.
             Throwable dummyException=new Throwable();
             StackTraceElement locations[]=dummyException.getStackTrace();
-            // Caller will be the third element
-            String cname="unknown";
-            String method="unknown";
-            if( locations!=null && locations.length >2 ) {
+            // Caller will be the third element (or later if logger is wrapped)
+            String cname = "unknown";
+            String method = "unknown";
+            if (locations != null && locations.length >2) {
                 StackTraceElement caller=locations[2];
                 cname=caller.getClassName();
                 method=caller.getMethodName();
             }
-            if( ex==null ) {
-                logger.logp( level, cname, method, msg );
+            if (ex==null) {
+                logger.logp(level, cname, method, msg);
             } else {
-                logger.logp( level, cname, method, msg, ex );
+                logger.logp(level, cname, method, msg, ex);
             }
         }
     }

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java?rev=1212091&r1=1212090&r2=1212091&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java Thu Dec  8 20:32:55 2011
@@ -31,9 +31,9 @@ import org.apache.tomcat.util.buf.Messag
  * @author Costin Manolache
  * @author kevin seguin
  */
-public final class Cookies { // extends MultiMap {
+public final class Cookies {
 
-    private static final org.apache.juli.logging.Log log=
+    private static final org.apache.juli.logging.Log log =
         org.apache.juli.logging.LogFactory.getLog(Cookies.class );
 
     // expected average number of cookies per request
@@ -128,8 +128,7 @@ public final class Cookies { // extends 
     /** Add all Cookie found in the headers of a request.
      */
     public  void processCookies( MimeHeaders headers ) {
-        if( headers==null )
-         {
+        if( headers==null ) {
             return;// nothing to process
         }
         // process each "cookie" header
@@ -148,7 +147,6 @@ public final class Cookies { // extends 
                 continue;
             }
 
-            // Uncomment to test the new parsing code
             if( cookieValue.getType() != MessageBytes.T_BYTES ) {
                 Exception e = new Exception();
                 log.warn("Cookies: Parsing cookie as String. Expected bytes.",
@@ -203,11 +201,11 @@ public final class Cookies { // extends 
             return false;
         }
         */
-       if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f') {
-        return true;
-    } else {
-        return false;
-    }
+        if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f') {
+            return true;
+        } else {
+            return false;
+        }
     }
 
     /**



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