logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1337961 - in /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core: appender/ appender/rewrite/ appender/routing/ config/ helpers/
Date Sun, 13 May 2012 18:38:36 GMT
Author: rgoers
Date: Sun May 13 18:38:36 2012
New Revision: 1337961

URL: http://svn.apache.org/viewvc?rev=1337961&view=rev
Log:
Checkstyle fixes

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoversPlugin.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderRef.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/BaseConfiguration.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/FileUtils.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java?rev=1337961&r1=1337960&r2=1337961&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
Sun May 13 18:38:36 2012
@@ -21,7 +21,6 @@ import org.apache.logging.log4j.core.App
 import org.apache.logging.log4j.core.Filter;
 import org.apache.logging.log4j.core.LogEvent;
 import org.apache.logging.log4j.core.config.AppenderControl;
-import org.apache.logging.log4j.core.config.AppenderRef;
 import org.apache.logging.log4j.core.config.Configuration;
 import org.apache.logging.log4j.core.config.plugins.Plugin;
 import org.apache.logging.log4j.core.config.plugins.PluginAttr;
@@ -107,7 +106,7 @@ public final class FailoverAppender exte
                     written = true;
                     break;
                 } catch (Exception fex) {
-                    // Try the next failover.
+                    continue;
                 }
             }
             if (!written && !isExceptionSuppressed()) {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoversPlugin.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoversPlugin.java?rev=1337961&r1=1337960&r2=1337961&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoversPlugin.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoversPlugin.java
Sun May 13 18:38:36 2012
@@ -47,9 +47,10 @@ public final class FailoversPlugin {
 
         if (refs == null) {
             logger.error("failovers must contain an appender-reference");
+            return null;
         }
         String[] arr = new String[refs.length];
-        for (int i=0; i < refs.length; ++i) {
+        for (int i = 0; i < refs.length; ++i) {
             arr[i] = refs[i].getRef();
         }
         return arr;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java?rev=1337961&r1=1337960&r2=1337961&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java
Sun May 13 18:38:36 2012
@@ -16,10 +16,8 @@
  */
 package org.apache.logging.log4j.core.appender.rewrite;
 
-import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.core.Appender;
 import org.apache.logging.log4j.core.Filter;
-import org.apache.logging.log4j.core.Lifecycle;
 import org.apache.logging.log4j.core.LogEvent;
 import org.apache.logging.log4j.core.appender.AppenderBase;
 import org.apache.logging.log4j.core.config.AppenderControl;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java?rev=1337961&r1=1337960&r2=1337961&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
Sun May 13 18:38:36 2012
@@ -16,7 +16,6 @@
  */
 package org.apache.logging.log4j.core.appender.routing;
 
-import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.core.Appender;
 import org.apache.logging.log4j.core.Filter;
 import org.apache.logging.log4j.core.LogEvent;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java?rev=1337961&r1=1337960&r2=1337961&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java
Sun May 13 18:38:36 2012
@@ -40,6 +40,8 @@ public class AppenderControl extends Fil
     /**
      * Constructor.
      * @param appender The target Appender.
+     * @param level the Level to filter on.
+     * @param filter the Filter(s) to apply.
      */
     public AppenderControl(Appender appender, Level level, Filter filter) {
         super(filter);

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderRef.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderRef.java?rev=1337961&r1=1337960&r2=1337961&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderRef.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderRef.java
Sun May 13 18:38:36 2012
@@ -29,7 +29,7 @@ import org.apache.logging.log4j.status.S
  * An Appender reference.
  */
 @Plugin(name = "appender-ref", type = "Core", printObject = true)
-public class AppenderRef {
+public final class AppenderRef {
     private static final Logger LOGGER = StatusLogger.getLogger();
 
     private final String ref;
@@ -57,6 +57,8 @@ public class AppenderRef {
     /**
      * Create an Appender reference.
      * @param ref The name of the Appender.
+     * @param level The Level to filter against.
+     * @param filter The filter(s) to use.
      * @return The name of the Appender.
      */
     @PluginFactory

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/BaseConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/BaseConfiguration.java?rev=1337961&r1=1337960&r2=1337961&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/BaseConfiguration.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/BaseConfiguration.java
Sun May 13 18:38:36 2012
@@ -16,7 +16,6 @@
  */
 package org.apache.logging.log4j.core.config;
 
-import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.Appender;
 import org.apache.logging.log4j.core.Filter;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java?rev=1337961&r1=1337960&r2=1337961&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
Sun May 13 18:38:36 2012
@@ -41,10 +41,7 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CyclicBarrier;
-import java.util.concurrent.Semaphore;
 import java.util.concurrent.atomic.AtomicInteger;
 
 /**
@@ -54,6 +51,8 @@ import java.util.concurrent.atomic.Atomi
 public class LoggerConfig extends Filterable implements LogEventFactory {
 
     private static final Logger LOGGER = StatusLogger.getLogger();
+    private static final int MAX_RETRIES = 3;
+    private static final long WAIT_TIME = 1000;
 
     private List<AppenderRef> appenderRefs = new ArrayList<AppenderRef>();
     private Map<String, AppenderControl> appenders = new ConcurrentHashMap<String,
AppenderControl>();
@@ -65,8 +64,7 @@ public class LoggerConfig extends Filter
     private ConfigurationMonitor monitor = new DefaultConfigurationMonitor();
     private AtomicInteger counter = new AtomicInteger();
     private boolean shutdown = false;
-    private static final int MAX_RETRIES = 3;
-    private static final long WAIT_TIME = 1000;
+
 
     /**
      * Default constructor.
@@ -141,6 +139,8 @@ public class LoggerConfig extends Filter
     /**
      * Add an Appender to the LoggerConfig.
      * @param appender The Appender to add.
+     * @param level The Level to use.
+     * @param filter A Filter for the Appender reference.
      */
     public void addAppender(Appender appender, Level level, Filter filter) {
         appenders.put(appender.getName(), new AppenderControl(appender, level, filter));
@@ -303,7 +303,7 @@ public class LoggerConfig extends Filter
             }
         } finally {
             if (counter.decrementAndGet() == 0) {
-                synchronized(this) {
+                synchronized (this) {
                     if (shutdown) {
                         notifyAll();
                     }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/FileUtils.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/FileUtils.java?rev=1337961&r1=1337960&r2=1337961&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/FileUtils.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/FileUtils.java
Sun May 13 18:38:36 2012
@@ -33,7 +33,7 @@ public final class FileUtils {
 
     /** Constant for the file URL protocol.*/
     private static final String PROTOCOL_FILE = "file";
-    
+
     private static final String JBOSS_FILE = "vfsfile";
 
     private static Logger logger = StatusLogger.getLogger();
@@ -62,7 +62,7 @@ public final class FileUtils {
             return null;
         }
     }
-    
+
     public static boolean isFile(URL url) {
         return url != null && (url.getProtocol().equals(PROTOCOL_FILE) || url.getProtocol().equals(JBOSS_FILE));
     }



Mime
View raw message