Follow-up to r1137925:
authorrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 23 Jun 2011 12:08:31 +0000 (12:08 +0000)
committerrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 23 Jun 2011 12:08:31 +0000 (12:08 +0000)
Use buf.add(char) when there is a single character string.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1138847 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/valves/AccessLogValve.java
java/org/apache/juli/OneLineFormatter.java

index 6082394..5bfe46d 100644 (file)
@@ -1302,9 +1302,10 @@ public class AccessLogValve extends ValveBase implements AccessLog {
                 long frac = timestamp % 1000;
                 if (frac < 100) {
                     if (frac < 10) {
-                        buf.append("00");
+                        buf.append('0');
+                        buf.append('0');
                     } else {
-                        buf.append("0");
+                        buf.append('0');
                     }
                 }
                 buf.append(frac);
index 72c7ca7..f090c73 100644 (file)
@@ -108,7 +108,8 @@ public class OneLineFormatter extends Formatter {
         buf.append('.');
         if (frac < 100) {
             if (frac < 10) {
-                buf.append("00");
+                buf.append('0');
+                buf.append('0');
             } else {
                 buf.append('0');
             }