You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2013/01/20 21:49:04 UTC

svn commit: r1435951 - in /logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j: ./ spi/ xml/

Author: rgoers
Date: Sun Jan 20 20:49:03 2013
New Revision: 1435951

URL: http://svn.apache.org/viewvc?rev=1435951&view=rev
Log:
Fix more checkstyle errors

Modified:
    logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Appender.java
    logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/BasicConfigurator.java
    logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Category.java
    logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Layout.java
    logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/LogManager.java
    logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/Filter.java
    logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/LoggerRepository.java
    logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/RepositorySelector.java
    logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/xml/DOMConfigurator.java

Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Appender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Appender.java?rev=1435951&r1=1435950&r2=1435951&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Appender.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Appender.java Sun Jan 20 20:49:03 2013
@@ -30,6 +30,7 @@ public interface Appender {
 
     /**
      * Add a filter to the end of the filter list.
+     * @param newFilter The filter to add.
      *
      * @since 0.9.0
      */
@@ -42,14 +43,14 @@ public interface Appender {
      * @return the head Filter or null, if no Filters are present
      * @since 1.1
      */
-    public Filter getFilter();
+    Filter getFilter();
 
     /**
      * Clear the list of filters by removing all the filters in it.
      *
      * @since 0.9.0
      */
-    public void clearFilters();
+    void clearFilters();
 
     /**
      * Release any resources allocated within the appender such as file
@@ -59,14 +60,15 @@ public interface Appender {
      *
      * @since 0.8.4
      */
-    public void close();
+    void close();
 
     /**
      * Log in <code>Appender</code> specific way. When appropriate,
      * Loggers will call the <code>doAppend</code> method of appender
      * implementations in order to log.
+     * @param event The LoggingEvent.
      */
-    public void doAppend(LoggingEvent event);
+    void doAppend(LoggingEvent event);
 
 
     /**
@@ -74,45 +76,50 @@ public interface Appender {
      *
      * @return name, may be null.
      */
-    public String getName();
+    String getName();
 
 
     /**
      * Set the {@link ErrorHandler} for this appender.
+     * @param errorHandler The error handler.
      *
      * @since 0.9.0
      */
-    public void setErrorHandler(ErrorHandler errorHandler);
+    void setErrorHandler(ErrorHandler errorHandler);
 
     /**
      * Returns the {@link ErrorHandler} for this appender.
+     * @return The error handler.
      *
      * @since 1.1
      */
-    public ErrorHandler getErrorHandler();
+    ErrorHandler getErrorHandler();
 
     /**
      * Set the {@link Layout} for this appender.
+     * @param layout The Layout.
      *
      * @since 0.8.1
      */
-    public void setLayout(Layout layout);
+    void setLayout(Layout layout);
 
     /**
      * Returns this appenders layout.
+     * @return the Layout.
      *
      * @since 1.1
      */
-    public Layout getLayout();
+    Layout getLayout();
 
 
     /**
      * Set the name of this appender. The name is used by other
      * components to identify this appender.
+     * @param name The appender name.
      *
      * @since 0.8.1
      */
-    public void setName(String name);
+    void setName(String name);
 
     /**
      * Configurators call this method to determine if the appender
@@ -127,9 +134,10 @@ public interface Appender {
      * <p>In the rather exceptional case, where the appender
      * implementation admits a layout but can also work without it, then
      * the appender should return {@code true}.
+     * @return true if a Layout is required.
      *
      * @since 0.8.4
      */
-    public boolean requiresLayout();
+    boolean requiresLayout();
 }
 

Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/BasicConfigurator.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/BasicConfigurator.java?rev=1435951&r1=1435950&r2=1435951&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/BasicConfigurator.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/BasicConfigurator.java Sun Jan 20 20:49:03 2013
@@ -33,6 +33,7 @@ public class BasicConfigurator {
 
     /**
      * No-op implementation.
+     * @param appender The appender.
      */
     public static void configure(final Appender appender) {
     }

Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Category.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Category.java?rev=1435951&r1=1435950&r2=1435951&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Category.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Category.java Sun Jan 20 20:49:03 2013
@@ -144,6 +144,7 @@ public class Category {
 
      <p>The root category is <em>not</em> included in the returned
      {@link Enumeration}.
+     @return and Enumeration of the Categories.
 
      @deprecated Please use {@link LogManager#getCurrentLoggers()} instead.
      */
@@ -295,7 +296,8 @@ public class Category {
 
     /**
      Is the appender passed as parameter attached to this category?
-     @param appender The Appender to add.
+     * @param appender The Appender to add.
+     * @return true if the appender is attached.
      */
     public boolean isAttached(final Appender appender) {
         return false;

Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Layout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Layout.java?rev=1435951&r1=1435950&r2=1435951&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Layout.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Layout.java Sun Jan 20 20:49:03 2013
@@ -24,19 +24,20 @@ import org.apache.logging.log4j.core.hel
  */
 public abstract class Layout {
 
-    // Note that the line.separator property can be looked up even by
-    // applets.
-    public final static int LINE_SEP_LEN = Constants.LINE_SEP.length();
-
+    /** Note that the line.separator property can be looked up even by applets. */
+    public static final int LINE_SEP_LEN = Constants.LINE_SEP.length();
 
     /**
      * Implement this method to create your own layout format.
+     * @param event The LoggingEvent.
+     * @return The formatted LoggingEvent.
      */
     public abstract String format(LoggingEvent event);
 
     /**
      * Returns the content type output by this layout. The base class
      * returns "text/plain".
+     * @return the type of content rendered by the Layout.
      */
     public String getContentType() {
         return "text/plain";
@@ -45,6 +46,7 @@ public abstract class Layout {
     /**
      * Returns the header for the layout format. The base class returns
      * <code>null</code>.
+     * @return The header.
      */
     public String getHeader() {
         return null;
@@ -53,6 +55,7 @@ public abstract class Layout {
     /**
      * Returns the footer for the layout format. The base class returns
      * <code>null</code>.
+     * @return The footer.
      */
     public String getFooter() {
         return null;
@@ -70,6 +73,7 @@ public abstract class Layout {
      * <p>The {@link SimpleLayout}, {@link TTCCLayout}, {@link
      * PatternLayout} all return {@code true}. The {@link
      * org.apache.log4j.xml.XMLLayout} returns {@code false}.
+     * @return true if the Layout ignores Throwables.
      *
      * @since 0.8.4
      */

Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/LogManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/LogManager.java?rev=1435951&r1=1435950&r2=1435951&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/LogManager.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/LogManager.java Sun Jan 20 20:49:03 2013
@@ -37,21 +37,19 @@ public final class LogManager {
     @Deprecated
     public static final String DEFAULT_CONFIGURATION_FILE = "log4j.properties";
 
-    static final String DEFAULT_XML_CONFIGURATION_FILE = "log4j.xml";
-
     /**
      * @deprecated This variable is for internal use only. It will
      * become private in future versions.
      * */
     @Deprecated
-    public static final String DEFAULT_CONFIGURATION_KEY="log4j.configuration";
+    public static final String DEFAULT_CONFIGURATION_KEY = "log4j.configuration";
 
     /**
      * @deprecated This variable is for internal use only. It will
      * become private in future versions.
      * */
     @Deprecated
-    public static final String CONFIGURATOR_CLASS_KEY="log4j.configuratorClass";
+    public static final String CONFIGURATOR_CLASS_KEY = "log4j.configuratorClass";
 
     /**
      * @deprecated This variable is for internal use only. It will
@@ -60,6 +58,8 @@ public final class LogManager {
     @Deprecated
     public static final String DEFAULT_INIT_OVERRIDE_KEY = "log4j.defaultInitOverride";
 
+    static final String DEFAULT_XML_CONFIGURATION_FILE = "log4j.xml";
+
     private static final LoggerRepository REPOSITORY = new Repository();
 
     private LogManager() {
@@ -114,7 +114,7 @@ public final class LogManager {
      * No-op implementation.
      * @param selector The RepositorySelector.
      * @param guard prevents calls at the incorrect time.
-     * @throws IllegalArgumentException
+     * @throws IllegalArgumentException if a parameter is invalid.
      */
     public static void setRepositorySelector(final RepositorySelector selector, final Object guard)
         throws IllegalArgumentException {
@@ -124,6 +124,9 @@ public final class LogManager {
         return REPOSITORY;
     }
 
+    /**
+     * The Repository.
+     */
     private static class Repository implements LoggerRepository {
         public void addHierarchyEventListener(final HierarchyEventListener listener) {
 

Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/Filter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/Filter.java?rev=1435951&r1=1435950&r2=1435951&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/Filter.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/Filter.java Sun Jan 20 20:49:03 2013
@@ -22,14 +22,6 @@ package org.apache.log4j.spi;
 public abstract class Filter {
 
     /**
-     * Points to the next filter in the filter chain.
-     *
-     * @deprecated As of 1.2.12, use {@link #getNext} and {@link #setNext} instead
-     */
-    @Deprecated
-    public Filter next;
-
-    /**
      * The log event must be dropped immediately without consulting
      * with the remaining filters, if any, in the chain.
      */
@@ -47,6 +39,13 @@ public abstract class Filter {
      */
     public static final int ACCEPT = 1;
 
+    /**
+     * Points to the next filter in the filter chain.
+     *
+     * @deprecated As of 1.2.12, use {@link #getNext} and {@link #setNext} instead
+     */
+    @Deprecated
+    public Filter next;
 
     /**
      * Usually filters options become active when set. We provide a
@@ -66,17 +65,19 @@ public abstract class Filter {
      * @param event The LoggingEvent to decide upon.
      * @return decision The decision of the filter.
      */
-    abstract public int decide(LoggingEvent event);
+    public abstract int decide(LoggingEvent event);
 
     /**
      * Set the next filter pointer.
+     * @param next The next Filter.
      */
     public void setNext(final Filter next) {
         this.next = next;
     }
 
     /**
-     * Return the pointer to the next filter;
+     * Return the pointer to the next filter.
+     * @return The next Filter.
      */
     public Filter getNext() {
         return next;

Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/LoggerRepository.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/LoggerRepository.java?rev=1435951&r1=1435950&r2=1435951&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/LoggerRepository.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/LoggerRepository.java Sun Jan 20 20:49:03 2013
@@ -40,7 +40,7 @@ public interface LoggerRepository {
     /**
      * Add a {@link HierarchyEventListener} event to the repository.
      */
-    public void addHierarchyEventListener(HierarchyEventListener listener);
+    void addHierarchyEventListener(HierarchyEventListener listener);
 
     /**
      * Returns whether this repository is disabled for a given
@@ -55,42 +55,42 @@ public interface LoggerRepository {
      * threshold are immediately dropped. By default, the threshold is
      * set to <code>Level.ALL</code> which has the lowest possible rank.
      */
-    public void setThreshold(Level level);
+    void setThreshold(Level level);
 
     /**
      * Another form of {@link #setThreshold(Level)} accepting a string
      * parameter instead of a <code>Level</code>.
      */
-    public void setThreshold(String val);
+    void setThreshold(String val);
 
-    public void emitNoAppenderWarning(Category cat);
+    void emitNoAppenderWarning(Category cat);
 
     /**
      * Get the repository-wide threshold. See {@link
      * #setThreshold(Level)} for an explanation.
      */
-    public Level getThreshold();
+    Level getThreshold();
 
-    public Logger getLogger(String name);
+    Logger getLogger(String name);
 
-    public Logger getLogger(String name, LoggerFactory factory);
+    Logger getLogger(String name, LoggerFactory factory);
 
-    public Logger getRootLogger();
+    Logger getRootLogger();
 
-    public abstract Logger exists(String name);
+    abstract Logger exists(String name);
 
-    public abstract void shutdown();
+    abstract void shutdown();
 
-    public Enumeration getCurrentLoggers();
+    Enumeration getCurrentLoggers();
 
     /**
      * Deprecated. Please use {@link #getCurrentLoggers} instead.
      */
-    public Enumeration getCurrentCategories();
+    Enumeration getCurrentCategories();
 
 
-    public abstract void fireAddAppenderEvent(Category logger, Appender appender);
+    abstract void fireAddAppenderEvent(Category logger, Appender appender);
 
-    public abstract void resetConfiguration();
+    abstract void resetConfiguration();
 
 }

Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/RepositorySelector.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/RepositorySelector.java?rev=1435951&r1=1435950&r2=1435951&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/RepositorySelector.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/RepositorySelector.java Sun Jan 20 20:49:03 2013
@@ -16,15 +16,13 @@
  */
 package org.apache.log4j.spi;
 
-import org.apache.log4j.spi.LoggerRepository;
-
 /**
 
  The <code>LogManager</code> uses one (and only one)
  <code>RepositorySelector</code> implementation to select the
  {@link org.apache.log4j.spi.LoggerRepository} for a particular application context.
 
- <p>It is the responsability of the <code>RepositorySelector</code>
+ <p>It is the responsibility of the <code>RepositorySelector</code>
  implementation to track the application context. Log4j makes no
  assumptions about the application context or on its management.
 
@@ -36,9 +34,10 @@ import org.apache.log4j.spi.LoggerReposi
 public interface RepositorySelector {
 
     /**
-     Returns a {@link org.apache.log4j.spi.LoggerRepository} depending on the
-     context. Implementors must make sure that a valid (non-null)
-     LoggerRepository is returned.
+     * Returns a {@link org.apache.log4j.spi.LoggerRepository} depending on the
+     * context. Implementors must make sure that a valid (non-null)
+     * LoggerRepository is returned.
+     * @return a LoggerRepository.
      */
-    public LoggerRepository getLoggerRepository();
+    LoggerRepository getLoggerRepository();
 }

Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/xml/DOMConfigurator.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/xml/DOMConfigurator.java?rev=1435951&r1=1435950&r2=1435951&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/xml/DOMConfigurator.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/xml/DOMConfigurator.java Sun Jan 20 20:49:03 2013
@@ -71,7 +71,7 @@ public class DOMConfigurator {
 
     }
 
-    public static Object parseElement(final Element element,final Properties props, final Class expectedClass)
+    public static Object parseElement(final Element element, final Properties props, final Class expectedClass)
         throws Exception {
         return null;
     }