logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1396347 - in /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core: appender/rolling/PatternProcessor.java pattern/PatternParser.java
Date Tue, 09 Oct 2012 21:42:46 GMT
Author: ggregory
Date: Tue Oct  9 21:42:46 2012
New Revision: 1396347

URL: http://svn.apache.org/viewvc?rev=1396347&view=rev
Log:
Flip args and use varargs.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessor.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessor.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessor.java?rev=1396347&r1=1396346&r2=1396347&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessor.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessor.java
Tue Oct  9 21:42:46 2012
@@ -133,17 +133,15 @@ public class PatternProcessor {
      * @param buf string buffer to which formatted file name is appended, may not be null.
      */
     protected final void formatFileName(final Object obj, final StringBuilder buf) {
-        Object[] objects = new Object[] {new Date(System.currentTimeMillis()), obj};
-        formatFileName(objects, buf);
+        formatFileName(buf, new Date(System.currentTimeMillis()), obj);
     }
 
     /**
      * Format file name.
-     *
-     * @param objects objects to be evaluated in formatting, may not be null.
      * @param buf string buffer to which formatted file name is appended, may not be null.
+     * @param objects objects to be evaluated in formatting, may not be null.
      */
-    protected final void formatFileName(final Object[] objects, final StringBuilder buf)
{
+    protected final void formatFileName(final StringBuilder buf, final Object... objects)
{
         for (int i = 0; i < patternConverters.length; i++) {
             int fieldStart = buf.length();
             patternConverters[i].format(objects, buf);

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java?rev=1396347&r1=1396346&r2=1396347&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java
Tue Oct  9 21:42:46 2012
@@ -102,7 +102,7 @@ public final class PatternParser {
      * @param converterKey The key to lookup the converters.
      * @param expected The expected base Class of each Converter.
      */
-    public PatternParser(Configuration config, String converterKey, Class expected) {
+    public PatternParser(Configuration config, String converterKey, Class<?> expected)
{
         this.config = config;
         PluginManager manager = new PluginManager(converterKey, expected);
         manager.collectPlugins();
@@ -446,13 +446,13 @@ public final class PatternParser {
             return null;
         }
 
-        Class[] parmTypes = newInstanceMethod.getParameterTypes();
+        Class<?>[] parmTypes = newInstanceMethod.getParameterTypes();
         Object [] parms = parmTypes.length > 0 ? new Object[parmTypes.length] : null;
 
         if (parms != null) {
             int i = 0;
             boolean errors = false;
-            for (Class clazz : parmTypes) {
+            for (Class<?> clazz : parmTypes) {
                 if (clazz.isArray() && clazz.getName().equals("[Ljava.lang.String;"))
{
                     String[] optionsArray = options.toArray(new String[options.size()]);
                     parms[i] = optionsArray;



Mime
View raw message