logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1435776 - in /logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j: ./ message/ simple/ spi/ status/ util/
Date Sun, 20 Jan 2013 02:30:25 GMT
Author: rgoers
Date: Sun Jan 20 02:30:24 2013
New Revision: 1435776

URL: http://svn.apache.org/viewvc?rev=1435776&view=rev
Log:
Fix some of the checkstyle errors that have recently been introduced.

Added:
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/package-info.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/package-info.java
Modified:
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/LogManager.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/Logger.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/ThreadContext.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/FormattedMessage.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/FormattedMessageFactory.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/LocalizedMessageFactory.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/Message.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MessageFactory.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessageFactory.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessageFactory.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StringFormatterMessageFactory.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ThreadDumpMessage.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLogger.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContext.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContextFactory.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/LoggerContextFactory.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/EnglishEnums.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/LogManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/LogManager.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/LogManager.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/LogManager.java Sun Jan 20 02:30:24 2013
@@ -41,19 +41,11 @@ public class LogManager {
      */
     public static final String ROOT_LOGGER_NAME = "";
 
-    private static final String LOGGER_RESOURCE = "META-INF/log4j-provider.properties";
-    private static final String LOGGER_CONTEXT_FACTORY = "LoggerContextFactory";
-    private static final String API_VERSION = "Log4jAPIVersion";
-    private static final String FACTORY_PRIORITY = "FactoryPriority";
-    private static final String[] COMPATIBLE_API_VERSIONS = {
-        "2.0.0"
-    };
-
     private static final String FACTORY_PROPERTY_NAME = "log4j2.loggerContextFactory";
 
     private static LoggerContextFactory factory;
 
-    private static final Logger logger = StatusLogger.getLogger();
+    private static final Logger LOGGER = StatusLogger.getLogger();
 
     /**
      * Scans the classpath to find all logging implementation. Currently, only one will
@@ -71,9 +63,9 @@ public class LogManager {
                     factory = (LoggerContextFactory) clazz.newInstance();
                 }
             } catch (final ClassNotFoundException cnfe) {
-                logger.error("Unable to locate configured LoggerContextFactory {}", factoryClass);
+                LOGGER.error("Unable to locate configured LoggerContextFactory {}", factoryClass);
             } catch (final Exception ex) {
-                logger.error("Unable to create configured LoggerContextFactory {}", factoryClass, ex);
+                LOGGER.error("Unable to create configured LoggerContextFactory {}", factoryClass, ex);
             }
         }
 
@@ -91,16 +83,16 @@ public class LogManager {
                             if (LoggerContextFactory.class.isAssignableFrom(clazz)) {
                                 factories.put(provider.getPriority(), (LoggerContextFactory) clazz.newInstance());
                             } else {
-                                logger.error(className + " does not implement " + LoggerContextFactory.class.getName());
+                                LOGGER.error(className + " does not implement " + LoggerContextFactory.class.getName());
                             }
                         } catch (final ClassNotFoundException cnfe) {
-                            logger.error("Unable to locate class " + className + " specified in " +
+                            LOGGER.error("Unable to locate class " + className + " specified in " +
                                 provider.getURL().toString(), cnfe);
                         } catch (final IllegalAccessException iae) {
-                            logger.error("Unable to create class " + className + " specified in " +
+                            LOGGER.error("Unable to create class " + className + " specified in " +
                                 provider.getURL().toString(), iae);
                         } catch (final Exception e) {
-                            logger.error("Unable to create class " + className + " specified in " +
+                            LOGGER.error("Unable to create class " + className + " specified in " +
                                 provider.getURL().toString(), e);
                             e.printStackTrace();
                         }
@@ -108,7 +100,7 @@ public class LogManager {
                 }
 
                 if (factories.size() == 0) {
-                    logger.error("Unable to locate a logging implementation, using SimpleLogger");
+                    LOGGER.error("Unable to locate a logging implementation, using SimpleLogger");
                     factory = new SimpleLoggerContextFactory();
                 } else {
                     final StringBuilder sb = new StringBuilder("Multiple logging implementations found: \n");
@@ -118,17 +110,23 @@ public class LogManager {
                     }
                     factory = factories.get(factories.lastKey());
                     sb.append("Using factory: ").append(factory.getClass().getName());
-                    logger.warn(sb.toString());
+                    LOGGER.warn(sb.toString());
 
                 }
             } else {
-                logger.error("Unable to locate a logging implementation, using SimpleLogger");
+                LOGGER.error("Unable to locate a logging implementation, using SimpleLogger");
                 factory = new SimpleLoggerContextFactory();
             }
         }
     }
 
     /**
+     * Prevents instantiation
+     */
+    protected LogManager() {
+    }
+
+    /**
      * Returns the current LoggerContext.
      * <p>
      * WARNING - The LoggerContext returned by this method may not be the LoggerContext used to create a Logger
@@ -191,7 +189,8 @@ public class LogManager {
      * returned. If true then only a single LoggerContext will be returned.
      * @return a LoggerContext.
      */
-    protected static LoggerContext getContext(final String fqcn, final ClassLoader loader, final boolean currentContext) {
+    protected static LoggerContext getContext(final String fqcn, final ClassLoader loader,
+                                              final boolean currentContext) {
         return factory.getContext(fqcn, loader, currentContext);
     }
 
@@ -305,7 +304,8 @@ public class LogManager {
     /**
      * Returns a Logger using the fully qualified name of the Class as the Logger name.
      * @param clazz The Class whose name should be used as the Logger name.
-     * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change the logger but will log a warning if mismatched.
+     * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change
+     *                       the logger but will log a warning if mismatched.
      * @return The Logger.
      */
     public static Logger getLogger(final Class<?> clazz, final MessageFactory messageFactory) {
@@ -324,7 +324,8 @@ public class LogManager {
     /**
      * Returns a Logger using the fully qualified class name of the value as the Logger name.
      * @param value The value whose class name should be used as the Logger name.
-     * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change the logger but will log a warning if mismatched.
+     * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change
+     *                       the logger but will log a warning if mismatched.
      * @return The Logger.
      */
     public static Logger getLogger(final Object value, final MessageFactory messageFactory) {
@@ -345,14 +346,14 @@ public class LogManager {
      * Returns a Logger with the specified name.
      *
      * @param name The logger name.
-     * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change the logger but will log a warning if mismatched.
+     * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change
+     *                       the logger but will log a warning if mismatched.
      * @return The Logger.
      */
     public static Logger getLogger(final String name, final MessageFactory messageFactory) {
         return factory.getContext(LogManager.class.getName(), null, false).getLogger(name, messageFactory);
     }
 
-
     /**
      * Returns a Logger with the specified name.
      *
@@ -363,20 +364,4 @@ public class LogManager {
     protected static Logger getLogger(final String fqcn, final String name) {
         return factory.getContext(fqcn, null, false).getLogger(name);
     }
-
-    private static boolean validVersion(final String version) {
-        for (final String v : COMPATIBLE_API_VERSIONS) {
-            if (version.startsWith(v)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Prevents instantiation
-     */
-    protected LogManager() {
-    }
-
 }

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/Logger.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/Logger.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/Logger.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/Logger.java Sun Jan 20 02:30:24 2013
@@ -25,7 +25,7 @@ import org.apache.logging.log4j.message.
  * @doubt See LOG4J2-16.
  */
 public interface Logger {
-    
+
   /**
    * Logs an exception or error that has been caught.
    * @param level The logging Level.
@@ -446,7 +446,7 @@ public interface Logger {
 
   /**
    * Gets the logger name.
-   * 
+   *
    * @return the logger name.
    */
     String getName();
@@ -605,7 +605,7 @@ public interface Logger {
    * @return boolean - {@code true} if this Logger is enabled for level, {@code false} otherwise.
    */
   boolean isEnabled(Level level);
-  
+
   /**
    * Checks whether this Logger is enabled for the {@link Level#ERROR ERROR} Level.
    *
@@ -957,7 +957,7 @@ public interface Logger {
    * @param message the message to log; the format depends on the message factory.
    * @param params parameters to the message.
    * @see #getMessageFactory()
-   * 
+   *
    * @doubt Likely to misinterpret existing log4j client code that intended to call
    * info(Object,Throwable). Incurs array creation expense on every call. (RG) I assume you
    * meant warn, not info. It isn't possible to be misinterpreted as the previous method
@@ -973,10 +973,10 @@ public interface Logger {
    * @param t       the exception to log, including its stack trace.
    */
   void warn(String message, Throwable t);
-  
+
   /**
    * Gets the message factory used to convert message Objects and Strings into actual log Messages.
-   * 
+   *
    * @return the message factory.
    */
   MessageFactory getMessageFactory();

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/ThreadContext.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/ThreadContext.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/ThreadContext.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/ThreadContext.java Sun Jan 20 02:30:24 2013
@@ -312,6 +312,7 @@ public final class ThreadContext  {
      * with ParameterizedMessage.
      *
      * @param message The new diagnostic context information.
+     * @param args Parameters for the message.
      */
     public static void push(final String message, final Object... args) {
         if (!useStack) {

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/FormattedMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/FormattedMessage.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/FormattedMessage.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/FormattedMessage.java Sun Jan 20 02:30:24 2013
@@ -39,6 +39,10 @@ public class FormattedMessage implements
 
     private static final int HASHVAL = 31;
 
+    private static final String FORMAT_SPECIFIER = "%(\\d+\\$)?([-#+ 0,(\\<]*)?(\\d+)?(\\.\\d+)?([tT])?([a-zA-Z%])";
+
+    private static final Pattern MSG_PATTERN = Pattern.compile(FORMAT_SPECIFIER);
+
     private String messagePattern;
     private transient Object[] argArray;
     private String[] stringArgs;
@@ -47,12 +51,6 @@ public class FormattedMessage implements
 
     private Message message;
 
-    private static final String formatSpecifier
-        = "%(\\d+\\$)?([-#+ 0,(\\<]*)?(\\d+)?(\\.\\d+)?([tT])?([a-zA-Z%])";
-
-    private static final Pattern MSG_PATTERN = Pattern.compile(formatSpecifier);
-
-
     public FormattedMessage(final String messagePattern, final Object[] arguments, final Throwable throwable) {
         this.messagePattern = messagePattern;
         this.argArray = arguments;

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/FormattedMessageFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/FormattedMessageFactory.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/FormattedMessageFactory.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/FormattedMessageFactory.java Sun Jan 20 02:30:24 2013
@@ -27,6 +27,10 @@ public class FormattedMessageFactory ext
     /**
      * Creates {@link StringFormattedMessage} instances.
      *
+     * @param message The message format.
+     * @param params Message parameters.
+     * @return The Message object.
+     *
      * @see MessageFactory#newMessage(String, Object...)
      */
     @Override

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java Sun Jan 20 02:30:24 2013
@@ -34,8 +34,7 @@ import java.util.ResourceBundle;
  * used to read the events and display them to the user should also localize and format the
  * messages for the end user.
  */
-public class LocalizedMessage implements Message, LoggerNameAwareMessage
-{
+public class LocalizedMessage implements Message, LoggerNameAwareMessage {
     private static final long serialVersionUID = 3893703791567290742L;
 
     private String bundleId;
@@ -54,7 +53,7 @@ public class LocalizedMessage implements
     private transient Throwable throwable;
 
     /**
-     * <p></p>
+     * Constructor with message pattern and arguments.
      *
      * @param messagePattern the message pattern that to be checked for placeholders.
      * @param arguments      the argument array to be converted.
@@ -68,7 +67,7 @@ public class LocalizedMessage implements
     }
 
     public LocalizedMessage(final ResourceBundle bundle, final String key, final Object[] arguments) {
-        this(bundle, (Locale)null, key, arguments);
+        this(bundle, (Locale) null, key, arguments);
     }
 
     public LocalizedMessage(final String bundleId, final Locale locale, final String key, final Object[] arguments) {
@@ -78,7 +77,8 @@ public class LocalizedMessage implements
         setup(bundleId, null, locale);
     }
 
-    public LocalizedMessage(final ResourceBundle bundle, final Locale locale, final String key, final Object[] arguments) {
+    public LocalizedMessage(final ResourceBundle bundle, final Locale locale, final String key,
+                            final Object[] arguments) {
         this.messagePattern = key;
         this.argArray = arguments;
         this.throwable = null;
@@ -125,11 +125,13 @@ public class LocalizedMessage implements
         this(bundle, (Locale) null, key, new Object[] {arg1, arg2});
     }
 
-    public LocalizedMessage(final String bundleId, final Locale locale, final String key, final Object arg1, final Object arg2) {
+    public LocalizedMessage(final String bundleId, final Locale locale, final String key, final Object arg1,
+                            final Object arg2) {
         this(bundleId, locale, key, new Object[] {arg1, arg2});
     }
 
-    public LocalizedMessage(final ResourceBundle bundle, final Locale locale, final String key, final Object arg1, final Object arg2) {
+    public LocalizedMessage(final ResourceBundle bundle, final Locale locale, final String key, final Object arg1,
+                            final Object arg2) {
         this(bundle, locale, key, new Object[] {arg1, arg2});
     }
 

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/LocalizedMessageFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/LocalizedMessageFactory.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/LocalizedMessageFactory.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/LocalizedMessageFactory.java Sun Jan 20 02:30:24 2013
@@ -44,6 +44,10 @@ public class LocalizedMessageFactory ext
     /**
      * Creates {@link org.apache.logging.log4j.message.StringFormattedMessage} instances.
      *
+     * @param message The message format String.
+     * @param params The parameters for the message.
+     * @return The Message.
+     *
      * @see org.apache.logging.log4j.message.MessageFactory#newMessage(String, Object...)
      */
     @Override

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java Sun Jan 20 02:30:24 2013
@@ -298,7 +298,7 @@ public class MapMessage implements Multi
 
     /**
      * Always returns null.
-     * 
+     *
      * @return null
      */
     public Throwable getThrowable() {

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/Message.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/Message.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/Message.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/Message.java Sun Jan 20 02:30:24 2013
@@ -36,7 +36,7 @@ import java.io.Serializable;
  * interface to implement or extend Serializable". Such is the case here as the LogEvent must be Serializable.
  */
 public interface Message extends Serializable {
-    
+
     /**
      * Gets the Message formatted as a String. Each Message implementation determines the
      * appropriate way to format the data encapsulated in the Message. Messages that provide
@@ -68,7 +68,7 @@ public interface Message extends Seriali
 
     /**
      * Gets the throwable, if any.
-     * 
+     *
      * @return the throwable or null.
      */
     Throwable getThrowable();

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MessageFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MessageFactory.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MessageFactory.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MessageFactory.java Sun Jan 20 02:30:24 2013
@@ -18,7 +18,7 @@ package org.apache.logging.log4j.message
 
 /**
  * Creates messages. Implementations can provide different message format syntaxes.
- * 
+ *
  * @see ParameterizedMessageFactory
  * @see StringFormatterMessageFactory
  * @version $Id$
@@ -27,7 +27,7 @@ public interface MessageFactory {
 
     /**
      * Creates a new message based on an Object.
-     * 
+     *
      * @param message
      *            a message object
      * @return a new message
@@ -36,7 +36,7 @@ public interface MessageFactory {
 
     /**
      * Creates a new message based on a String.
-     * 
+     *
      * @param message
      *            a message String
      * @return a new message
@@ -45,7 +45,7 @@ public interface MessageFactory {
 
     /**
      * Creates a new parameterized message.
-     * 
+     *
      * @param message
      *            a message template, the kind of message template depends on the implementaion.
      * @param params
@@ -55,5 +55,4 @@ public interface MessageFactory {
      * @see StringFormatterMessageFactory
      */
     Message newMessage(String message, Object... params);
-
-}
\ No newline at end of file
+}

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessageFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessageFactory.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessageFactory.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessageFactory.java Sun Jan 20 02:30:24 2013
@@ -26,6 +26,9 @@ public class MessageFormatMessageFactory
 
     /**
      * Creates {@link org.apache.logging.log4j.message.StringFormattedMessage} instances.
+     * @param message The message pattern.
+     * @param params Parameters to the message.
+     * @return The Message.
      *
      * @see org.apache.logging.log4j.message.MessageFactory#newMessage(String, Object...)
      */

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java Sun Jan 20 02:30:24 2013
@@ -105,7 +105,7 @@ public class ObjectMessage implements Me
 
     /**
      * Gets the message if it is a throwable.
-     * 
+     *
      * @return the message if it is a throwable.
      */
     public Throwable getThrowable() {

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessageFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessageFactory.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessageFactory.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessageFactory.java Sun Jan 20 02:30:24 2013
@@ -24,7 +24,7 @@ package org.apache.logging.log4j.message
  * <p>
  * This class is immutable.
  * </p>
- * 
+ *
  * @version $Id$
  */
 public final class ParameterizedMessageFactory extends AbstractMessageFactory {
@@ -36,7 +36,10 @@ public final class ParameterizedMessageF
 
     /**
      * Creates {@link ParameterizedMessage} instances.
-     * 
+     * @param message The message pattern.
+     * @param params The message parameters.
+     * @return The Message.
+     *
      * @see MessageFactory#newMessage(String, Object...)
      */
     @Override

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java Sun Jan 20 02:30:24 2013
@@ -89,7 +89,7 @@ public class SimpleMessage implements Me
 
     /**
      * Always returns null.
-     * 
+     *
      * @return null
      */
     public Throwable getThrowable() {

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java Sun Jan 20 02:30:24 2013
@@ -147,7 +147,7 @@ public class StringFormattedMessage impl
 
     /**
      * Always returns null.
-     * 
+     *
      * @return null
      */
     public Throwable getThrowable() {

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StringFormatterMessageFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StringFormatterMessageFactory.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StringFormatterMessageFactory.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StringFormatterMessageFactory.java Sun Jan 20 02:30:24 2013
@@ -26,7 +26,7 @@ import java.util.Formatter;
  * <p>
  * This class is immutable.
  * </p>
- * 
+ *
  * @version $Id$
  */
 public final class StringFormatterMessageFactory extends AbstractMessageFactory {
@@ -38,7 +38,11 @@ public final class StringFormatterMessag
 
     /**
      * Creates {@link StringFormattedMessage} instances.
-     * 
+     *
+     * @param message The message pattern.
+     * @param params The parameters to the message.
+     * @return The Message.
+     *
      * @see MessageFactory#newMessage(String, Object...)
      */
     @Override

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java Sun Jan 20 02:30:24 2013
@@ -81,7 +81,8 @@ public class StructuredDataId implements
      * @param required         The list of keys that are required for this id.
      * @param optional         The list of keys that are optional for this id.
      */
-    public StructuredDataId(final String name, final int enterpriseNumber, final String[] required, final String[] optional) {
+    public StructuredDataId(final String name, final int enterpriseNumber, final String[] required,
+                            final String[] optional) {
         if (name == null) {
             throw new IllegalArgumentException("No structured id name was supplied");
         }

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ThreadDumpMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ThreadDumpMessage.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ThreadDumpMessage.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ThreadDumpMessage.java Sun Jan 20 02:30:24 2013
@@ -33,7 +33,7 @@ public class ThreadDumpMessage implement
 
     private static final long serialVersionUID = -1103400781608841088L;
 
-    private final static ThreadInfoFactory factory;
+    private static final ThreadInfoFactory FACTORY;
 
     private volatile Map<ThreadInformation, StackTraceElement[]> threads;
 
@@ -50,7 +50,7 @@ public class ThreadDumpMessage implement
                 break;
             }
         }
-        factory = basic ? new BasicThreadInfoFactory() : new ExtendedThreadInfoFactory();
+        FACTORY = basic ? new BasicThreadInfoFactory() : new ExtendedThreadInfoFactory();
     }
 
     /**
@@ -59,7 +59,7 @@ public class ThreadDumpMessage implement
      */
     public ThreadDumpMessage(final String title) {
         this.title = title == null ? "" : title;
-        threads = factory.createThreadInfo();
+        threads = FACTORY.createThreadInfo();
     }
 
     private ThreadDumpMessage(final String formattedMsg, final String title) {
@@ -192,7 +192,7 @@ public class ThreadDumpMessage implement
 
     /**
      * Always returns null.
-     * 
+     *
      * @return null
      */
     public Throwable getThrowable() {

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLogger.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLogger.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLogger.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLogger.java Sun Jan 20 02:30:24 2013
@@ -55,9 +55,10 @@ public class SimpleLogger extends Abstra
     private String logName;
 
 
-    public SimpleLogger(final String name, final Level defaultLevel, final boolean showLogName, final boolean showShortLogName,
-                        final boolean showDateTime, final boolean showContextMap, final String dateTimeFormat,
-                        final MessageFactory messageFactory, final PropertiesUtil props, final PrintStream stream) {
+    public SimpleLogger(final String name, final Level defaultLevel, final boolean showLogName,
+                        final boolean showShortLogName, final boolean showDateTime, final boolean showContextMap,
+                        final String dateTimeFormat, final MessageFactory messageFactory, final PropertiesUtil props,
+                        final PrintStream stream) {
         super(name, messageFactory);
         final String lvl = props.getStringProperty(SimpleLoggerContext.SYSTEM_PREFIX + name + ".level");
         this.level = Level.toLevel(lvl, defaultLevel);
@@ -78,7 +79,7 @@ public class SimpleLogger extends Abstra
         if (showDateTime) {
             try {
                 this.dateFormatter = new SimpleDateFormat(dateTimeFormat);
-            } catch(final IllegalArgumentException e) {
+            } catch (final IllegalArgumentException e) {
                 // If the format pattern is invalid - use the default format
                 this.dateFormatter = new SimpleDateFormat(SimpleLoggerContext.DEFAULT_DATE_TIME_FORMAT);
             }
@@ -96,13 +97,14 @@ public class SimpleLogger extends Abstra
     }
 
     @Override
-    public void log(final Marker marker, final String fqcn, final Level level, final Message msg, final Throwable throwable) {
+    public void log(final Marker marker, final String fqcn, final Level level, final Message msg,
+                    final Throwable throwable) {
         final StringBuilder sb = new StringBuilder();
         // Append date-time if so configured
-        if(showDateTime) {
+        if (showDateTime) {
             final Date now = new Date();
             String dateText;
-            synchronized(dateFormatter) {
+            synchronized (dateFormatter) {
                 dateText = dateFormatter.format(now);
             }
             sb.append(dateText);
@@ -126,7 +128,7 @@ public class SimpleLogger extends Abstra
         }
         final Object[] params = msg.getParameters();
         Throwable t;
-        if (throwable == null && params != null && params[params.length -1] instanceof Throwable ) {
+        if (throwable == null && params != null && params[params.length - 1] instanceof Throwable) {
             t = (Throwable) params[params.length - 1];
         } else {
             t = throwable;

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContext.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContext.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContext.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContext.java Sun Jan 20 02:30:24 2013
@@ -64,6 +64,8 @@ public class SimpleLoggerContext impleme
 
     private final PrintStream stream;
 
+    private final ConcurrentMap<String, Logger> loggers = new ConcurrentHashMap<String, Logger>();
+
     public SimpleLoggerContext() {
         props = new PropertiesUtil("log4j2.simplelog.properties");
 
@@ -94,8 +96,6 @@ public class SimpleLoggerContext impleme
         this.stream = ps;
     }
 
-    private final ConcurrentMap<String, Logger> loggers = new ConcurrentHashMap<String, Logger>();
-
     public Logger getLogger(final String name) {
         return getLogger(name, null);
     }

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContextFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContextFactory.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContextFactory.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContextFactory.java Sun Jan 20 02:30:24 2013
@@ -26,7 +26,7 @@ public class SimpleLoggerContextFactory 
 
     private static LoggerContext context = new SimpleLoggerContext();
 
-    public LoggerContext getContext(final String FQCN, final ClassLoader loader, final boolean currentContext) {
+    public LoggerContext getContext(final String fqcn, final ClassLoader loader, final boolean currentContext) {
         return context;
     }
 }

Added: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/package-info.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/package-info.java?rev=1435776&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/package-info.java (added)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/package-info.java Sun Jan 20 02:30:24 2013
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+/**
+ * Simple logging implementation.
+ */
+package org.apache.logging.log4j.simple;

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java Sun Jan 20 02:30:24 2013
@@ -30,78 +30,51 @@ import org.apache.logging.log4j.status.S
  *
  */
 public abstract class AbstractLogger implements Logger {
-
-    /**
-     * The default MessageFactory class.
-     */
-    public static Class<? extends MessageFactory> DEFAULT_MESSAGE_FACTORY_CLASS = ParameterizedMessageFactory.class;
-    
-    private static final String THROWING = "throwing";
-    
-    private static final String CATCHING = "catching";
-
     /**
      * Marker for flow tracing.
      */
     public static final Marker FLOW_MARKER = MarkerManager.getMarker("FLOW");
-    
+
     /**
      * Marker for method entry tracing.
      */
     public static final Marker ENTRY_MARKER = MarkerManager.getMarker("ENTRY", FLOW_MARKER);
-    
+
     /**
      * Marker for method exit tracing.
      */
     public static final Marker EXIT_MARKER = MarkerManager.getMarker("EXIT", FLOW_MARKER);
-    
+
     /**
      * Marker for exception tracing.
      */
     public static final Marker EXCEPTION_MARKER = MarkerManager.getMarker("EXCEPTION");
-    
+
     /**
      * Marker for throwing exceptions.
      */
     public static final Marker THROWING_MARKER = MarkerManager.getMarker("THROWING", EXCEPTION_MARKER);
-    
+
     /**
      * Marker for catching exceptions.
      */
     public static final Marker CATCHING_MARKER = MarkerManager.getMarker("CATCHING", EXCEPTION_MARKER);
 
+    /**
+     * The default MessageFactory class.
+     */
+    public static final Class<? extends MessageFactory> DEFAULT_MESSAGE_FACTORY_CLASS =
+        ParameterizedMessageFactory.class;
+
     private static final String FQCN = AbstractLogger.class.getName();
 
+    private static final String THROWING = "throwing";
+
+    private static final String CATCHING = "catching";
+
     private final String name;
-    
-    private final MessageFactory messageFactory;
 
-    /**
-     * Checks that the message factory a logger was created with is the same as the given messageFactory. If they are
-     * different log a warning to the {@linkplain StatusLogger}. A null MessageFactory translates to the default
-     * MessageFactory {@link #DEFAULT_MESSAGE_FACTORY_CLASS}.
-     * 
-     * @param logger
-     *            The logger to check
-     * @param messageFactory
-     *            The message factory to check.
-     */
-    public static void checkMessageFactory(final Logger logger, final MessageFactory messageFactory) {
-        final String name = logger.getName();
-        final MessageFactory loggerMessageFactory = logger.getMessageFactory();
-        if (messageFactory != null && !loggerMessageFactory.equals(messageFactory)) {
-            StatusLogger
-                    .getLogger()
-                    .warn("The Logger {} was created with the message factory {} and is now requested with the message factory {}, which may create log events with unexpected formatting.",
-                            name, loggerMessageFactory, messageFactory);
-        } else if (messageFactory == null
-                && !loggerMessageFactory.getClass().equals(DEFAULT_MESSAGE_FACTORY_CLASS)) {
-            StatusLogger
-                    .getLogger()
-                    .warn("The Logger {} was created with the message factory {} and is now requested with a null message factory (defaults to {}), which may create log events with unexpected formatting.",
-                            name, loggerMessageFactory, DEFAULT_MESSAGE_FACTORY_CLASS.getName());
-        }
-    }
+    private final MessageFactory messageFactory;
 
     /**
      * Creates a new logger named after the class (or subclass).
@@ -132,6 +105,35 @@ public abstract class AbstractLogger imp
         this.messageFactory = messageFactory == null ? createDefaultMessageFactory() : messageFactory;
     }
 
+    /**
+     * Checks that the message factory a logger was created with is the same as the given messageFactory. If they are
+     * different log a warning to the {@linkplain StatusLogger}. A null MessageFactory translates to the default
+     * MessageFactory {@link #DEFAULT_MESSAGE_FACTORY_CLASS}.
+     *
+     * @param logger
+     *            The logger to check
+     * @param messageFactory
+     *            The message factory to check.
+     */
+    public static void checkMessageFactory(final Logger logger, final MessageFactory messageFactory) {
+        final String name = logger.getName();
+        final MessageFactory loggerMessageFactory = logger.getMessageFactory();
+        if (messageFactory != null && !loggerMessageFactory.equals(messageFactory)) {
+            StatusLogger
+                    .getLogger()
+                    .warn("The Logger {} was created with the message factory {} and is now requested with the " +
+                        "message factory {}, which may create log events with unexpected formatting.",
+                            name, loggerMessageFactory, messageFactory);
+        } else if (messageFactory == null
+                && !loggerMessageFactory.getClass().equals(DEFAULT_MESSAGE_FACTORY_CLASS)) {
+            StatusLogger
+                    .getLogger()
+                    .warn("The Logger {} was created with the message factory {} and is now requested with a null " +
+                        "message factory (defaults to {}), which may create log events with unexpected formatting.",
+                            name, loggerMessageFactory, DEFAULT_MESSAGE_FACTORY_CLASS.getName());
+        }
+    }
+
     private MessageFactory createDefaultMessageFactory() {
         try {
             return DEFAULT_MESSAGE_FACTORY_CLASS.newInstance();
@@ -1555,7 +1557,7 @@ public abstract class AbstractLogger imp
 
     /**
      * Gets the message factory.
-     * 
+     *
      * @return the message factory.
      */
     public MessageFactory getMessageFactory() {

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java Sun Jan 20 02:30:24 2013
@@ -40,7 +40,8 @@ public interface LoggerContext {
     /**
      * Returns a Logger.
      * @param name The name of the Logger to return.
-     * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change the logger but will log a warning if mismatched.
+     * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change
+     *                       the logger but will log a warning if mismatched.
      * @return The logger with the specified name.
      */
     Logger getLogger(String name, MessageFactory messageFactory);

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/LoggerContextFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/LoggerContextFactory.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/LoggerContextFactory.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/LoggerContextFactory.java Sun Jan 20 02:30:24 2013
@@ -23,7 +23,7 @@ public interface LoggerContextFactory {
 
     /**
      * Creates a {@link LoggerContext}.
-     * 
+     *
      * @param fqcn The fully qualified class name of the caller.
      * @param loader The ClassLoader to use or null.
      * @param currentContext If true returns the current Context, if false returns the Context appropriate

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java Sun Jan 20 02:30:24 2013
@@ -45,13 +45,13 @@ public final class StatusLogger extends 
 
     private static final String NOT_AVAIL = "?";
 
-    private static final PropertiesUtil props = new PropertiesUtil("log4j2.StatusLogger.properties");
+    private static final PropertiesUtil PROPS = new PropertiesUtil("log4j2.StatusLogger.properties");
 
-    private static final int MAX_ENTRIES = props.getIntegerProperty(MAX_STATUS_ENTRIES, 200);
+    private static final int MAX_ENTRIES = PROPS.getIntegerProperty(MAX_STATUS_ENTRIES, 200);
 
     // private static final String FQCN = AbstractLogger.class.getName();
 
-    private static final StatusLogger statusLogger = new StatusLogger();
+    private static final StatusLogger STATUS_LOGGER = new StatusLogger();
 
     private final SimpleLogger logger;
 
@@ -62,7 +62,8 @@ public final class StatusLogger extends 
     private final ReentrantLock msgLock = new ReentrantLock();
 
     private StatusLogger() {
-        this.logger = new SimpleLogger("StatusLogger", Level.ERROR, false, true, false, false, "", null, props, System.err);
+        this.logger = new SimpleLogger("StatusLogger", Level.ERROR, false, true, false, false, "", null, PROPS,
+            System.err);
     }
 
     /**
@@ -70,7 +71,7 @@ public final class StatusLogger extends 
      * @return The StatusLogger.
      */
     public static StatusLogger getLogger() {
-        return statusLogger;
+        return STATUS_LOGGER;
     }
 
     public void setLevel(final Level level) {

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/EnglishEnums.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/EnglishEnums.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/EnglishEnums.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/EnglishEnums.java Sun Jan 20 02:30:24 2013
@@ -25,7 +25,10 @@ import java.util.Locale;
  * avoid problems on the Turkish locale. Do not use with Turkish enum values.
  * </p>
  */
-public class EnglishEnums {
+public final class EnglishEnums {
+
+    private EnglishEnums() {
+    }
 
     /**
      * Returns the Result for the given string.
@@ -33,10 +36,11 @@ public class EnglishEnums {
      * The {@code name} is converted internally to upper case with the {@linkplain Locale#ENGLISH ENGLISH} locale to
      * avoid problems on the Turkish locale. Do not use with Turkish enum values.
      * </p>
-     * 
-     * @param name
-     *            The enum name, case-insensitive. If null, returns {@code defaultValue}
-     * @return an enum value or null if {@code name} is null
+     *
+     * @param enumType The Class of the enum.
+     * @param name The enum name, case-insensitive. If null, returns {@code defaultValue}.
+     * @param <T> The type of the enum.
+     * @return an enum value or null if {@code name} is null.
      */
     public static <T extends Enum<T>> T valueOf(final Class<T> enumType, final String name) {
         return valueOf(enumType, name, null);
@@ -48,12 +52,12 @@ public class EnglishEnums {
      * The {@code name} is converted internally to upper case with the {@linkplain Locale#ENGLISH ENGLISH} locale to
      * avoid problems on the Turkish locale. Do not use with Turkish enum values.
      * </p>
-     * 
-     * @param name
-     *            The enum name, case-insensitive. If null, returns {@code defaultValue}
-     * @param defaultValue
-     *            the enum value to return if {@code name} is null
-     * @return an enum value or {@code defaultValue} if {@code name} is null
+     *
+     * @param name The enum name, case-insensitive. If null, returns {@code defaultValue}.
+     * @param enumType The Class of the enum.
+     * @param defaultValue the enum value to return if {@code name} is null.
+     * @param <T> The type of the enum.
+     * @return an enum value or {@code defaultValue} if {@code name} is null.
      */
     public static <T extends Enum<T>> T valueOf(final Class<T> enumType, final String name, final T defaultValue) {
         return name == null ? defaultValue : Enum.valueOf(enumType, name.toUpperCase(Locale.ENGLISH));

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java Sun Jan 20 02:30:24 2013
@@ -16,7 +16,6 @@
  */
 package org.apache.logging.log4j.util;
 
-import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.status.StatusLogger;
 
 import java.io.IOException;
@@ -28,15 +27,9 @@ import java.util.Properties;
  */
 public class PropertiesUtil {
 
-    private final Properties props;
-
     private static final PropertiesUtil LOG4J_PROPERTIES = new PropertiesUtil("log4j2.component.properties");
 
-    private Logger logger;
-
-    public static PropertiesUtil getProperties() {
-        return LOG4J_PROPERTIES;
-    }
+    private final Properties props;
 
     public PropertiesUtil(final Properties props) {
         this.props = props;
@@ -61,6 +54,10 @@ public class PropertiesUtil {
         }
     }
 
+    public static PropertiesUtil getProperties() {
+        return LOG4J_PROPERTIES;
+    }
+
     public String getStringProperty(final String name) {
         String prop = null;
         try {

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java?rev=1435776&r1=1435775&r2=1435776&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java Sun Jan 20 02:30:24 2013
@@ -42,7 +42,7 @@ public final class ProviderUtil {
 
     private static final Logger LOGGER = StatusLogger.getLogger();
 
-    private static final List<Provider> providers = new ArrayList<Provider>();
+    private static final List<Provider> PROVIDERS = new ArrayList<Provider>();
 
     private ProviderUtil() {
     }
@@ -68,17 +68,17 @@ public final class ProviderUtil {
                 if (!validVersion(props.getProperty(API_VERSION))) {
                     continue;
                 }
-                providers.add(new Provider(props, url));
+                PROVIDERS.add(new Provider(props, url));
             }
         }
     }
 
     public static Iterator<Provider> getProviders() {
-        return providers.iterator();
+        return PROVIDERS.iterator();
     }
 
     public static boolean hasProviders() {
-        return providers.size() > 0;
+        return PROVIDERS.size() > 0;
     }
 
     public static ClassLoader findClassLoader() {

Added: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/package-info.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/package-info.java?rev=1435776&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/package-info.java (added)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/util/package-info.java Sun Jan 20 02:30:24 2013
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+/**
+ * Internal utility classes for the Log4j 2 API.
+ */
+package org.apache.logging.log4j.util;



Mime
View raw message