You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2015/12/08 18:30:48 UTC

[1/7] logging-log4j2 git commit: Checkstyle: RedundantModifier.

Repository: logging-log4j2
Updated Branches:
  refs/heads/master 22d8aa70f -> f882b66ff


Checkstyle: RedundantModifier.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/3a3243c2
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/3a3243c2
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/3a3243c2

Branch: refs/heads/master
Commit: 3a3243c2c5ab154ad579564a433550c015f10016
Parents: 22d8aa7
Author: ggregory <gg...@apache.org>
Authored: Mon Dec 7 19:18:36 2015 -0500
Committer: ggregory <gg...@apache.org>
Committed: Mon Dec 7 19:18:36 2015 -0500

----------------------------------------------------------------------
 .../java/org/apache/logging/log4j/message/ThreadDumpMessage.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3a3243c2/log4j-api/src/main/java/org/apache/logging/log4j/message/ThreadDumpMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ThreadDumpMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ThreadDumpMessage.java
index 9479820..77c15df 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ThreadDumpMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ThreadDumpMessage.java
@@ -143,7 +143,7 @@ public class ThreadDumpMessage implements Message {
         private final String formattedMsg;
         private final String title;
 
-        public ThreadDumpMessageProxy(final ThreadDumpMessage msg) {
+        ThreadDumpMessageProxy(final ThreadDumpMessage msg) {
             this.formattedMsg = msg.getFormattedMessage();
             this.title = msg.title;
         }


[7/7] logging-log4j2 git commit: Use TimeUnit instead of magic number.

Posted by gg...@apache.org.
Use TimeUnit instead of magic number.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/f882b66f
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/f882b66f
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/f882b66f

Branch: refs/heads/master
Commit: f882b66ff39920a198a7d8dfa82fb1eef7fd5ec6
Parents: 84b6088
Author: ggregory <gg...@apache.org>
Authored: Mon Dec 7 20:19:32 2015 -0500
Committer: ggregory <gg...@apache.org>
Committed: Mon Dec 7 20:19:32 2015 -0500

----------------------------------------------------------------------
 .../org/apache/logging/log4j/flume/appender/FlumeAvroManager.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f882b66f/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java
----------------------------------------------------------------------
diff --git a/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java b/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java
index ef3234a..dd5dd96 100644
--- a/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java
+++ b/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java
@@ -17,6 +17,7 @@
 package org.apache.logging.log4j.flume.appender;
 
 import java.util.Properties;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.flume.Event;
 import org.apache.flume.api.RpcClient;
@@ -70,7 +71,7 @@ public class FlumeAvroManager extends AbstractFlumeManager {
         this.agents = agents;
         this.batchSize = batchSize;
         this.delayMillis = delayMillis;
-        this.delayNanos = delayMillis * 1000000;
+        this.delayNanos = TimeUnit.MILLISECONDS.toNanos(delayMillis);
         this.retries = retries;
         this.connectTimeoutMillis = connectTimeout;
         this.requestTimeoutMillis = requestTimeout;


[6/7] logging-log4j2 git commit: Do not hide.

Posted by gg...@apache.org.
Do not hide.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/84b6088a
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/84b6088a
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/84b6088a

Branch: refs/heads/master
Commit: 84b6088ad6b825e854488fe8147eedee59ed3bb0
Parents: 6bcb20c
Author: ggregory <gg...@apache.org>
Authored: Mon Dec 7 20:08:24 2015 -0500
Committer: ggregory <gg...@apache.org>
Committed: Mon Dec 7 20:08:24 2015 -0500

----------------------------------------------------------------------
 .../slf4j/SLF4JLoggerContextFactory.java        | 124 +++++++++----------
 1 file changed, 62 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/84b6088a/log4j-to-slf4j/src/main/java/org/apache/logging/slf4j/SLF4JLoggerContextFactory.java
----------------------------------------------------------------------
diff --git a/log4j-to-slf4j/src/main/java/org/apache/logging/slf4j/SLF4JLoggerContextFactory.java b/log4j-to-slf4j/src/main/java/org/apache/logging/slf4j/SLF4JLoggerContextFactory.java
index 4cae70f..aec9458 100644
--- a/log4j-to-slf4j/src/main/java/org/apache/logging/slf4j/SLF4JLoggerContextFactory.java
+++ b/log4j-to-slf4j/src/main/java/org/apache/logging/slf4j/SLF4JLoggerContextFactory.java
@@ -1,62 +1,62 @@
-/*
- * 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.
- */
-package org.apache.logging.slf4j;
-
-import java.net.URI;
-
-import org.apache.logging.log4j.spi.LoggerContext;
-import org.apache.logging.log4j.spi.LoggerContextFactory;
-import org.apache.logging.log4j.status.StatusLogger;
-
-/**
- *
- */
-public class SLF4JLoggerContextFactory implements LoggerContextFactory {
-    private static final StatusLogger LOGGER = StatusLogger.getLogger();
-    private static LoggerContext context = new SLF4JLoggerContext();
-
-    public SLF4JLoggerContextFactory() {
-        // LOG4J2-230, LOG4J2-204 (improve error reporting when misconfigured)
-        boolean misconfigured = false;
-        try {
-            Class.forName("org.slf4j.helpers.Log4jLoggerFactory");
-            misconfigured = true;
-        } catch (final ClassNotFoundException classNotFoundIsGood) {
-            LOGGER.debug("org.slf4j.helpers.Log4jLoggerFactory is not on classpath. Good!");
-        }
-        if (misconfigured) {
-            throw new IllegalStateException("slf4j-impl jar is mutually exclusive with log4j-to-slf4j jar "
-                    + "(the first routes calls from SLF4J to Log4j, the second from Log4j to SLF4J)");
-        }
-    }
-
-    @Override
-    public LoggerContext getContext(final String fqcn, final ClassLoader loader, final Object externalContext,
-                                    final boolean currentContext) {
-        return context;
-    }
-
-    @Override
-    public LoggerContext getContext(final String fqcn, final ClassLoader loader, final Object externalContext,
-                                    final boolean currentContext, final URI configLocation, final String name) {
-        return context;
-    }
-
-    @Override
-    public void removeContext(final LoggerContext context) {
-    }
-}
+/*
+ * 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.
+ */
+package org.apache.logging.slf4j;
+
+import java.net.URI;
+
+import org.apache.logging.log4j.spi.LoggerContext;
+import org.apache.logging.log4j.spi.LoggerContextFactory;
+import org.apache.logging.log4j.status.StatusLogger;
+
+/**
+ *
+ */
+public class SLF4JLoggerContextFactory implements LoggerContextFactory {
+    private static final StatusLogger LOGGER = StatusLogger.getLogger();
+    private static LoggerContext context = new SLF4JLoggerContext();
+
+    public SLF4JLoggerContextFactory() {
+        // LOG4J2-230, LOG4J2-204 (improve error reporting when misconfigured)
+        boolean misconfigured = false;
+        try {
+            Class.forName("org.slf4j.helpers.Log4jLoggerFactory");
+            misconfigured = true;
+        } catch (final ClassNotFoundException classNotFoundIsGood) {
+            LOGGER.debug("org.slf4j.helpers.Log4jLoggerFactory is not on classpath. Good!");
+        }
+        if (misconfigured) {
+            throw new IllegalStateException("slf4j-impl jar is mutually exclusive with log4j-to-slf4j jar "
+                    + "(the first routes calls from SLF4J to Log4j, the second from Log4j to SLF4J)");
+        }
+    }
+
+    @Override
+    public LoggerContext getContext(final String fqcn, final ClassLoader loader, final Object externalContext,
+                                    final boolean currentContext) {
+        return context;
+    }
+
+    @Override
+    public LoggerContext getContext(final String fqcn, final ClassLoader loader, final Object externalContext,
+                                    final boolean currentContext, final URI configLocation, final String name) {
+        return context;
+    }
+
+    @Override
+    public void removeContext(final LoggerContext ignored) {
+    }
+}


[5/7] logging-log4j2 git commit: Missing Javadoc @param.

Posted by gg...@apache.org.
Missing Javadoc @param.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/6bcb20c4
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/6bcb20c4
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/6bcb20c4

Branch: refs/heads/master
Commit: 6bcb20c45ce891d84f356eea7f513cd46cf95742
Parents: dc94e04
Author: ggregory <gg...@apache.org>
Authored: Mon Dec 7 19:31:06 2015 -0500
Committer: ggregory <gg...@apache.org>
Committed: Mon Dec 7 19:31:06 2015 -0500

----------------------------------------------------------------------
 .../src/main/java/org/apache/logging/log4j/spi/LoggerContext.java  | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6bcb20c4/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java b/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java
index 320c8e0..88c3b7e 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java
@@ -55,6 +55,7 @@ public interface LoggerContext {
     /**
      * Detects if a Logger with the specified name and MessageFactory exists.
      * @param name The Logger name to search for.
+     * @param messageFactory The message factory to search for.
      * @return true if the Logger exists, false otherwise.
      * @since 2.5
      */
@@ -63,6 +64,7 @@ public interface LoggerContext {
     /**
      * Detects if a Logger with the specified name and MessageFactory type exists.
      * @param name The Logger name to search for.
+     * @param messageFactoryClass The message factory class to search for.
      * @return true if the Logger exists, false otherwise.
      * @since 2.5
      */


[4/7] logging-log4j2 git commit: Redundant specification of type arguments .

Posted by gg...@apache.org.
Redundant specification of type arguments <ClassLoader>.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/dc94e04e
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/dc94e04e
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/dc94e04e

Branch: refs/heads/master
Commit: dc94e04e631f811176ca29908a0b5ec18e35ed5d
Parents: 3b09c5b
Author: ggregory <gg...@apache.org>
Authored: Mon Dec 7 19:28:30 2015 -0500
Committer: ggregory <gg...@apache.org>
Committed: Mon Dec 7 19:28:30 2015 -0500

----------------------------------------------------------------------
 log4j-api/src/main/java/org/apache/logging/log4j/spi/Provider.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/dc94e04e/log4j-api/src/main/java/org/apache/logging/log4j/spi/Provider.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/spi/Provider.java b/log4j-api/src/main/java/org/apache/logging/log4j/spi/Provider.java
index f5c9f48..837f501 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/spi/Provider.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/spi/Provider.java
@@ -53,7 +53,7 @@ public class Provider {
 
     public Provider(final Properties props, final URL url, final ClassLoader classLoader) {
         this.url = url;
-        this.classLoader = new WeakReference<ClassLoader>(classLoader);
+        this.classLoader = new WeakReference<>(classLoader);
         final String weight = props.getProperty(FACTORY_PRIORITY);
         priority = weight == null ? DEFAULT_PRIORITY : Integer.valueOf(weight);
         className = props.getProperty(LOGGER_CONTEXT_FACTORY);


[3/7] logging-log4j2 git commit: Checkstyle: RedundantModifier.

Posted by gg...@apache.org.
Checkstyle: RedundantModifier.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/3b09c5b4
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/3b09c5b4
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/3b09c5b4

Branch: refs/heads/master
Commit: 3b09c5b4a96daad325288b33239947d3030e0507
Parents: f51e4b4
Author: ggregory <gg...@apache.org>
Authored: Mon Dec 7 19:20:19 2015 -0500
Committer: ggregory <gg...@apache.org>
Committed: Mon Dec 7 19:20:19 2015 -0500

----------------------------------------------------------------------
 .../src/main/java/org/apache/logging/log4j/util/LoaderUtil.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3b09c5b4/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
index 144be32..bd6a455 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
@@ -243,7 +243,7 @@ public final class LoaderUtil {
         private final ClassLoader classLoader;
         private final URL url;
 
-        public UrlResource(final ClassLoader classLoader, final URL url) {
+        UrlResource(final ClassLoader classLoader, final URL url) {
             this.classLoader = classLoader;
             this.url = url;
         }


[2/7] logging-log4j2 git commit: Checkstyle: RedundantModifier.

Posted by gg...@apache.org.
Checkstyle: RedundantModifier.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/f51e4b43
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/f51e4b43
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/f51e4b43

Branch: refs/heads/master
Commit: f51e4b43d96917aed4c0c4226b663cae3e860163
Parents: 3a3243c
Author: ggregory <gg...@apache.org>
Authored: Mon Dec 7 19:19:19 2015 -0500
Committer: ggregory <gg...@apache.org>
Committed: Mon Dec 7 19:19:19 2015 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/logging/log4j/status/StatusLogger.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f51e4b43/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java b/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
index ce563ef..21a7f2a 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
@@ -303,7 +303,7 @@ public final class StatusLogger extends AbstractLogger {
 
         private final int size;
 
-        public BoundedQueue(final int size) {
+        BoundedQueue(final int size) {
             this.size = size;
         }