logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1527861 - /logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
Date Tue, 01 Oct 2013 03:44:56 GMT
Author: ggregory
Date: Tue Oct  1 03:44:55 2013
New Revision: 1527861

URL: http://svn.apache.org/r1527861
Log:
Sort members.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java?rev=1527861&r1=1527860&r2=1527861&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
Tue Oct  1 03:44:55 2013
@@ -37,14 +37,19 @@ public final class DatePatternConverter 
     private static final String ABSOLUTE_FORMAT = "ABSOLUTE";
 
     /**
+     * SimpleTimePattern for ABSOLUTE.
+     */
+    private static final String ABSOLUTE_TIME_PATTERN = "HH:mm:ss,SSS";
+
+    /**
      * COMPACT string literal.
      */
     private static final String COMPACT_FORMAT = "COMPACT";
 
     /**
-     * SimpleTimePattern for ABSOLUTE.
+     * SimpleTimePattern for COMPACT.
      */
-    private static final String ABSOLUTE_TIME_PATTERN = "HH:mm:ss,SSS";
+    private static final String COMPACT_PATTERN = "yyyyMMddHHmmssSSS";
 
     /**
      * DATE string literal.
@@ -57,29 +62,34 @@ public final class DatePatternConverter 
     private static final String DATE_AND_TIME_PATTERN = "dd MMM yyyy HH:mm:ss,SSS";
 
     /**
-     * ISO8601 string literal.
+     * ISO8601_BASIC string literal.
      */
-    private static final String ISO8601_FORMAT = "ISO8601";
+    private static final String ISO8601_BASIC_FORMAT = "ISO8601_BASIC";
 
     /**
-     * ISO8601_BASIC string literal.
+     * SimpleTimePattern for ISO8601_BASIC.
      */
-    private static final String ISO8601_BASIC_FORMAT = "ISO8601_BASIC";
+    private static final String ISO8601_BASIC_PATTERN = "yyyyMMdd HHmmss,SSS";
 
     /**
-     * SimpleTimePattern for ISO8601.
+     * ISO8601 string literal.
      */
-    private static final String ISO8601_PATTERN = "yyyy-MM-dd HH:mm:ss,SSS";
+    private static final String ISO8601_FORMAT = "ISO8601";
 
     /**
-     * SimpleTimePattern for ISO8601_BASIC.
+     * SimpleTimePattern for ISO8601.
      */
-    private static final String ISO8601_BASIC_PATTERN = "yyyyMMdd HHmmss,SSS";
+    private static final String ISO8601_PATTERN = "yyyy-MM-dd HH:mm:ss,SSS";
 
     /**
-     * SimpleTimePattern for COMPACT.
+     * Obtains an instance of pattern converter.
+     *
+     * @param options options, may be null.
+     * @return instance of pattern converter.
      */
-    private static final String COMPACT_PATTERN = "yyyyMMddHHmmssSSS";
+    public static DatePatternConverter newInstance(final String[] options) {
+        return new DatePatternConverter(options);
+    }
 
     /**
      * Date format.
@@ -144,13 +154,15 @@ public final class DatePatternConverter 
     }
 
     /**
-     * Obtains an instance of pattern converter.
+     * Append formatted date to string buffer.
      *
-     * @param options options, may be null.
-     * @return instance of pattern converter.
+     * @param date       date
+     * @param toAppendTo buffer to which formatted date is appended.
      */
-    public static DatePatternConverter newInstance(final String[] options) {
-        return new DatePatternConverter(options);
+    public void format(final Date date, final StringBuilder toAppendTo) {
+        synchronized (this) {
+            toAppendTo.append(simpleFormat.format(date.getTime()));
+        }
     }
 
     /**
@@ -169,16 +181,6 @@ public final class DatePatternConverter 
         output.append(cachedDate);
     }
 
-    @Override
-    public void format(final StringBuilder toAppendTo, final Object... objects) {
-        for (final Object obj : objects) {
-            if (obj instanceof Date) {
-                format(obj, toAppendTo);
-                break;
-            }
-        }
-    }
-
     /**
      * {@inheritDoc}
      */
@@ -190,15 +192,13 @@ public final class DatePatternConverter 
         super.format(obj, output);
     }
 
-    /**
-     * Append formatted date to string buffer.
-     *
-     * @param date       date
-     * @param toAppendTo buffer to which formatted date is appended.
-     */
-    public void format(final Date date, final StringBuilder toAppendTo) {
-        synchronized (this) {
-            toAppendTo.append(simpleFormat.format(date.getTime()));
+    @Override
+    public void format(final StringBuilder toAppendTo, final Object... objects) {
+        for (final Object obj : objects) {
+            if (obj instanceof Date) {
+                format(obj, toAppendTo);
+                break;
+            }
         }
     }
 



Mime
View raw message