You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by pk...@apache.org on 2023/11/16 08:23:46 UTC

(logging-log4j2) branch main updated (e2d2ad13b9 -> b7f2c4cb9c)

This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


    from e2d2ad13b9 Merge branch 'main' into the-great-deletion
     new dd7b67ee20 Fix Error Prone warnings in `log4j-api`
     new 7a8ef005f8 Fix Javadoc tags
     new e4dfd1d4b6 Replace `Class#newInstance` invocations with `LoaderUtil`
     new 4788240281 Add comments to warning suppressions and small fixes
     new 8192d7f659 Factories must be public
     new d672923719 Replace `getDeclaredConstructor().getInstance()` with `LoaderUtil`
     new c4714e46ec Bump `o.a.l.l.message` package
     new 58798fcbc2 Fix code review problems #1961
     new 828c1f7c11 Add default value to `newCheckedInstanceOfProperty`
     new fa0c52828c Use @BaselineIgnore instead of packages exclusions
     new b7f2c4cb9c Fix compilation errors and remove deprecated methods

The 11 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/main/java/org/apache/log4j/jmx/Agent.java  |  11 +-
 .../log4j/util/PropertySourceTokenizerTest.java    |   2 +-
 log4j-api/pom.xml                                  |   4 -
 .../main/java/org/apache/logging/log4j/Level.java  |   2 +
 .../java/org/apache/logging/log4j/LogBuilder.java  |  55 +-
 .../main/java/org/apache/logging/log4j/Logger.java | 887 +++++++++++----------
 .../logging/log4j/internal/DefaultLogBuilder.java  |   5 +-
 .../log4j/message/BasicThreadInformation.java      |   8 +-
 .../log4j/message/DefaultFlowMessageFactory.java   |   1 -
 .../logging/log4j/message/FormattedMessage.java    |  22 +-
 .../apache/logging/log4j/message/MapMessage.java   |   9 +-
 .../log4j/message/MapMessageJsonFormatter.java     |   2 +-
 .../log4j/message/MessageFormatMessage.java        |  11 +-
 .../logging/log4j/message/ObjectMessage.java       |   2 +-
 .../log4j/message/ParameterizedMessage.java        |  20 +-
 .../log4j/message/ReusableMessageFactory.java      |   5 +
 .../logging/log4j/message/SimpleMessage.java       |  19 +-
 .../log4j/message/StringFormattedMessage.java      |   9 +-
 .../logging/log4j/message/StructuredDataId.java    |  45 --
 .../log4j/message/StructuredDataMessage.java       |  10 +-
 .../apache/logging/log4j/message/package-info.java |   2 +-
 .../org/apache/logging/log4j/package-info.java     |   2 +-
 .../apache/logging/log4j/spi/AbstractLogger.java   | 201 +++--
 .../apache/logging/log4j/spi/ExtendedLogger.java   |   2 +
 .../org/apache/logging/log4j/spi/Provider.java     |   9 +-
 .../apache/logging/log4j/status/StatusData.java    |   3 +-
 .../org/apache/logging/log4j/util/Constants.java   |   5 +-
 .../org/apache/logging/log4j/util/LambdaUtil.java  |   3 +
 .../org/apache/logging/log4j/util/LoaderUtil.java  |  39 +-
 .../apache/logging/log4j/util/PropertiesUtil.java  | 283 ++++++-
 .../org/apache/logging/log4j/util/Supplier.java    |   1 +
 .../java/org/apache/logging/log4j/util/Unbox.java  |  26 +-
 .../async/AsyncQueueFullPolicyFactoryTest.java     |   4 +-
 log4j-core/pom.xml                                 |  23 -
 .../core/async/AsyncQueueFullPolicyFactory.java    |  12 +-
 .../core/async/AsyncWaitStrategyFactoryConfig.java |   9 +-
 .../logging/log4j/core/async/DisruptorUtil.java    |  36 +-
 .../log4j/core/impl/ContextDataFactory.java        |  15 +-
 .../core/impl/ContextDataInjectorFactory.java      |  23 +-
 .../log4j/core/net/MulticastDnsAdvertiser.java     |   2 +-
 .../logging/log4j/core/util/OptionConverter.java   |   3 +-
 .../log4j/core/util/datetime/package-info.java     |   4 +-
 .../jpa/converter/ThrowableAttributeConverter.java |   2 +-
 .../log4j/jackson/json/layout/JsonLayout.java      |   8 +-
 .../log4j/jackson/xml/layout/XmlLayout.java        |   8 +-
 .../log4j/jackson/yaml/layout/YamlLayout.java      |   4 +-
 log4j-parent/pom.xml                               |   7 +
 47 files changed, 1141 insertions(+), 724 deletions(-)


(logging-log4j2) 02/11: Fix Javadoc tags

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 7a8ef005f8a8f87db6b1fa39f94442abb90904c8
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Fri Nov 10 19:43:21 2023 +0100

    Fix Javadoc tags
---
 log4j-api/src/main/java/org/apache/logging/log4j/Logger.java      | 2 +-
 .../org/apache/logging/log4j/jackson/json/layout/JsonLayout.java  | 8 ++++----
 .../org/apache/logging/log4j/jackson/xml/layout/XmlLayout.java    | 8 ++++----
 .../org/apache/logging/log4j/jackson/yaml/layout/YamlLayout.java  | 4 ++--
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/Logger.java b/log4j-api/src/main/java/org/apache/logging/log4j/Logger.java
index 7a312fd0f6..ff44e34044 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/Logger.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/Logger.java
@@ -69,7 +69,7 @@ import org.apache.logging.log4j.util.Supplier;
  * </pre>
  *
  * <p>
- * Note that although {@link MessageSupplier} is provided, using {@link Supplier<Message>} works just the
+ * Note that although {@link MessageSupplier} is provided, using {@link Supplier Supplier&lt;Message&gt;} works just the
  * same. MessageSupplier was deprecated in 2.6 and un-deprecated in 2.8.1. Anonymous class usage of these APIs
  * should prefer using Supplier instead.
  * </p>
diff --git a/log4j-layout-jackson-json/src/main/java/org/apache/logging/log4j/jackson/json/layout/JsonLayout.java b/log4j-layout-jackson-json/src/main/java/org/apache/logging/log4j/jackson/json/layout/JsonLayout.java
index af888adbf5..c098df9851 100644
--- a/log4j-layout-jackson-json/src/main/java/org/apache/logging/log4j/jackson/json/layout/JsonLayout.java
+++ b/log4j-layout-jackson-json/src/main/java/org/apache/logging/log4j/jackson/json/layout/JsonLayout.java
@@ -46,7 +46,7 @@ import org.apache.logging.log4j.plugins.PluginFactory;
  *
  * Appends a series of JSON events as strings serialized as bytes.
  *
- * <h3>Complete well-formed JSON vs. fragment JSON</h3>
+ * <h2>Complete well-formed JSON vs. fragment JSON</h2>
  * <p>
  * If you configure {@code complete="true"}, the appender outputs a well-formed JSON document. By default, with
  * {@code complete="false"}, you should include the output as an <em>external file</em> in a separate file to form a
@@ -56,18 +56,18 @@ import org.apache.logging.log4j.plugins.PluginFactory;
  * If {@code complete="false"}, the appender does not write the JSON open array character "[" at the start
  * of the document, "]" and the end, nor comma "," between records.
  * </p>
- * <h3>Encoding</h3>
+ * <h2>Encoding</h2>
  * <p>
  * Appenders using this layout should have their {@code charset} set to {@code UTF-8} or {@code UTF-16}, otherwise
  * events containing non ASCII characters could result in corrupted log files.
  * </p>
- * <h3>Pretty vs. compact JSON</h3>
+ * <h2>Pretty vs. compact JSON</h2>
  * <p>
  * By default, the JSON layout is not compact (a.k.a. "pretty") with {@code compact="false"}, which means the
  * appender uses end-of-line characters and indents lines to format the text. If {@code compact="true"}, then no
  * end-of-line or indentation is used. Message content may contain, of course, escaped end-of-lines.
  * </p>
- * <h3>Additional Fields</h3>
+ * <h2>Additional Fields</h2>
  * <p>
  * This property allows addition of custom fields into generated JSON.
  * {@code <JsonLayout><KeyValuePair key="foo" value="bar"/></JsonLayout>} inserts {@code "foo":"bar"} directly
diff --git a/log4j-layout-jackson-xml/src/main/java/org/apache/logging/log4j/jackson/xml/layout/XmlLayout.java b/log4j-layout-jackson-xml/src/main/java/org/apache/logging/log4j/jackson/xml/layout/XmlLayout.java
index 7e37e94923..d63ccb55b5 100644
--- a/log4j-layout-jackson-xml/src/main/java/org/apache/logging/log4j/jackson/xml/layout/XmlLayout.java
+++ b/log4j-layout-jackson-xml/src/main/java/org/apache/logging/log4j/jackson/xml/layout/XmlLayout.java
@@ -37,7 +37,7 @@ import org.apache.logging.log4j.plugins.PluginFactory;
 /**
  * Appends a series of {@code event} elements as defined in the <a href="log4j.dtd">log4j.dtd</a>.
  *
- * <h3>Complete well-formed XML vs. fragment XML</h3>
+ * <h2>Complete well-formed XML vs. fragment XML</h2>
  * <p>
  * If you configure {@code complete="true"}, the appender outputs a well-formed XML document where the default namespace
  * is the log4j namespace {@value XmlConstants#XML_NAMESPACE}. By default, with {@code complete="false"}, you should
@@ -46,18 +46,18 @@ import org.apache.logging.log4j.plugins.PluginFactory;
  * <p>
  * If {@code complete="false"}, the appender does not write the XML processing instruction and the root element.
  * </p>
- * <h3>Encoding</h3>
+ * <h2>Encoding</h2>
  * <p>
  * Appenders using this layout should have their {@code charset} set to {@code UTF-8} or {@code UTF-16}, otherwise
  * events containing non-ASCII characters could result in corrupted log files.
  * </p>
- * <h3>Pretty vs. compact XML</h3>
+ * <h2>Pretty vs. compact XML</h2>
  * <p>
  * By default, the XML layout is not compact (compact = not "pretty") with {@code compact="false"}, which means the
  * appender uses end-of-line characters and indents lines to format the XML. If {@code compact="true"}, then no
  * end-of-line or indentation is used. Message content may contain, of course, end-of-lines.
  * </p>
- * <h3>Additional Fields</h3>
+ * <h2>Additional Fields</h2>
  * <p>
  * This property allows addition of custom fields into generated JSON.
  * {@code <XmlLayout><KeyValuePair key="foo" value="bar"/></XmlLayout>} inserts {@code <foo>bar</foo>} directly into XML
diff --git a/log4j-layout-jackson-yaml/src/main/java/org/apache/logging/log4j/jackson/yaml/layout/YamlLayout.java b/log4j-layout-jackson-yaml/src/main/java/org/apache/logging/log4j/jackson/yaml/layout/YamlLayout.java
index d0a0c5df0e..46b5f85c04 100644
--- a/log4j-layout-jackson-yaml/src/main/java/org/apache/logging/log4j/jackson/yaml/layout/YamlLayout.java
+++ b/log4j-layout-jackson-yaml/src/main/java/org/apache/logging/log4j/jackson/yaml/layout/YamlLayout.java
@@ -40,12 +40,12 @@ import org.apache.logging.log4j.util.Strings;
 /**
  * Appends a series of YAML events as strings serialized as bytes.
  *
- * <h3>Encoding</h3>
+ * <h2>Encoding</h2>
  * <p>
  * Appenders using this layout should have their {@code charset} set to {@code UTF-8} or {@code UTF-16}, otherwise
  * events containing non ASCII characters could result in corrupted log files.
  * </p>
- * <h3>Additional Fields</h3>
+ * <h2>Additional Fields</h2>
  * <p>
  * This property allows addition of custom fields into generated JSON.
  * {@code <YamlLayout><KeyValuePair key="foo" value="bar"/></YamlLayout>} inserts {@code foo: "bar"} directly into YAML


(logging-log4j2) 03/11: Replace `Class#newInstance` invocations with `LoaderUtil`

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit e4dfd1d4b6d5ade816d548ea45d5383f6815b52a
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Mon Nov 13 10:20:52 2023 +0100

    Replace `Class#newInstance` invocations with `LoaderUtil`
---
 .../src/main/java/org/apache/log4j/jmx/Agent.java  | 11 +++---
 .../log4j/message/DefaultFlowMessageFactory.java   |  1 -
 .../org/apache/logging/log4j/util/LoaderUtil.java  | 36 +++++++++++++++++--
 .../core/async/AsyncQueueFullPolicyFactory.java    | 12 ++++---
 .../core/async/AsyncWaitStrategyFactoryConfig.java |  9 ++++-
 .../logging/log4j/core/async/DisruptorUtil.java    | 42 ++++++++++------------
 .../core/impl/ContextDataInjectorFactory.java      | 25 ++++++-------
 .../logging/log4j/core/util/OptionConverter.java   |  3 +-
 .../jpa/converter/ThrowableAttributeConverter.java |  2 +-
 9 files changed, 84 insertions(+), 57 deletions(-)

diff --git a/log4j-1.2-api/src/main/java/org/apache/log4j/jmx/Agent.java b/log4j-1.2-api/src/main/java/org/apache/log4j/jmx/Agent.java
index e893de26b6..634bd86691 100644
--- a/log4j-1.2-api/src/main/java/org/apache/log4j/jmx/Agent.java
+++ b/log4j-1.2-api/src/main/java/org/apache/log4j/jmx/Agent.java
@@ -25,6 +25,7 @@ import javax.management.MBeanServerFactory;
 import javax.management.ObjectName;
 
 import org.apache.log4j.Logger;
+import org.apache.logging.log4j.util.LoaderUtil;
 
 /**
  * Manages an instance of com.sun.jdmk.comm.HtmlAdapterServer which was provided for demonstration purposes in the Java
@@ -53,13 +54,9 @@ public class Agent {
     private static Object createServer() {
         Object newInstance = null;
         try {
-            newInstance = Class.forName("com.sun.jdmk.comm.HtmlAdapterServer").newInstance();
-        } catch (final ClassNotFoundException ex) {
-            throw new RuntimeException(ex.toString());
-        } catch (final InstantiationException ex) {
-            throw new RuntimeException(ex.toString());
-        } catch (final IllegalAccessException ex) {
-            throw new RuntimeException(ex.toString());
+            newInstance = LoaderUtil.newInstanceOf("com.sun.jdmk.comm.HtmlAdapterServer");
+        } catch (final ReflectiveOperationException ex) {
+            throw new RuntimeException(ex);
         }
         return newInstance;
     }
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/DefaultFlowMessageFactory.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/DefaultFlowMessageFactory.java
index e1a528e579..220233d3d2 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/DefaultFlowMessageFactory.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/DefaultFlowMessageFactory.java
@@ -48,7 +48,6 @@ public class DefaultFlowMessageFactory implements FlowMessageFactory {
      * @param exitText the text to use for trace exit, like {@code "Exit"}.
      */
     public DefaultFlowMessageFactory(final String entryText, final String exitText) {
-        super();
         this.entryText = entryText;
         this.exitText = exitText;
         this.messageFactory = LoggingSystem.getMessageFactory();
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 6f73e2d8fc..ec1299f326 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
@@ -215,7 +215,7 @@ public final class LoaderUtil {
      * @throws ExceptionInInitializerError if an exception is thrown during class initialization
      * @throws LinkageError                if the linkage of the class fails for any other reason
      * @see #loadClass(String)
-     * @since 3.0.0
+     * @since 2.22.0
      */
     public static Class<?> loadClassUnchecked(final String className) {
         try {
@@ -259,7 +259,7 @@ public final class LoaderUtil {
      * @throws InternalException  if an exception is thrown by the constructor
      * @throws InstantiationError if the provided class is abstract or an interface
      * @throws IllegalAccessError if the class cannot be accessed
-     * @since 3.0.0
+     * @since 2.22.0
      */
     public static <T> T newInstanceOfUnchecked(final Class<T> clazz) {
         try {
@@ -305,6 +305,35 @@ public final class LoaderUtil {
         return newInstanceOf(clazz);
     }
 
+    /**
+     * Loads and instantiates a class given by a property name.
+     *
+     * @param propertyKey The property name to look up a class name for.
+     * @param clazz        The class to cast it to.
+     * @param defaultSupplier Supplier of a default value if the property is not present.
+     * @param <T>          The type to cast it to.
+     * @return new instance of the class given in the property or {@code null} if the property was unset.
+     * @throws ClassNotFoundException      if the class isn't available to the usual ClassLoaders
+     * @throws ExceptionInInitializerError if an exception was thrown while initializing the class
+     * @throws LinkageError                if the linkage of the class fails for any other reason
+     * @throws ClassCastException          if the class is not compatible with the generic type parameter provided
+     * @throws NoSuchMethodException       if no zero-arg constructor exists
+     * @throws SecurityException           if this class is not allowed to access declared members of the provided class
+     * @throws IllegalAccessException      if the class can't be instantiated through a public constructor
+     * @throws InstantiationException      if the provided class is abstract or an interface
+     * @throws InvocationTargetException   if an exception is thrown by the constructor
+     * @since 3.0.0
+     */
+    public static <T> T newCheckedInstanceOfProperty(
+            final PropertyKey propertyKey, final Class<T> clazz, final Supplier<T> defaultSupplier)
+            throws ReflectiveOperationException {
+        final String className = PropertiesUtil.getProperties().getStringProperty(propertyKey);
+        if (className == null) {
+            return defaultSupplier.get();
+        }
+        return newCheckedInstanceOf(className, clazz);
+    }
+
     /**
      * Loads and instantiates a class by name using its default constructor. All checked reflective operation
      * exceptions are translated into corresponding {@link LinkageError} classes.
@@ -321,6 +350,7 @@ public final class LoaderUtil {
      * @throws InstantiationError          if the provided class is abstract or an interface
      * @throws IllegalAccessError          if the class cannot be accessed
      * @throws LinkageError                if the linkage of the class fails for any other reason
+     * @since 2.22.0
      */
     public static <T> T newInstanceOfUnchecked(final String className) {
         final Class<T> clazz = Cast.cast(loadClassUnchecked(className));
@@ -367,7 +397,7 @@ public final class LoaderUtil {
      * @throws InstantiationError          if the provided class is abstract or an interface
      * @throws IllegalAccessError          if the class cannot be accessed
      * @throws LinkageError                if the linkage of the class fails for any other reason
-     * @since 3.0.0
+     * @since 2.22.0
      */
     public static <T> T newInstanceOfUnchecked(final String className, final Class<T> supertype) {
         final Class<? extends T> clazz = loadClassUnchecked(className).asSubclass(supertype);
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncQueueFullPolicyFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncQueueFullPolicyFactory.java
index 0f71b4bb2e..bc5753ed4c 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncQueueFullPolicyFactory.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncQueueFullPolicyFactory.java
@@ -19,8 +19,8 @@ package org.apache.logging.log4j.core.async;
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
-import org.apache.logging.log4j.core.util.Loader;
 import org.apache.logging.log4j.status.StatusLogger;
+import org.apache.logging.log4j.util.LoaderUtil;
 import org.apache.logging.log4j.util.PropertiesUtil;
 import org.apache.logging.log4j.util.PropertyEnvironment;
 
@@ -90,12 +90,14 @@ public class AsyncQueueFullPolicyFactory {
 
     private static AsyncQueueFullPolicy createCustomRouter(final String router) {
         try {
-            final Class<? extends AsyncQueueFullPolicy> cls = Loader.loadClass(router).asSubclass(AsyncQueueFullPolicy.class);
             LOGGER.debug("Creating custom AsyncQueueFullPolicy '{}'", router);
-            return cls.newInstance();
+            return LoaderUtil.newCheckedInstanceOf(router, AsyncQueueFullPolicy.class);
         } catch (final Exception ex) {
-            LOGGER.debug("Using DefaultAsyncQueueFullPolicy. Could not create custom AsyncQueueFullPolicy '{}': {}", router,
-                    ex.toString());
+            LOGGER.debug(
+                    "Using DefaultAsyncQueueFullPolicy. Could not create custom AsyncQueueFullPolicy '{}': {}",
+                    router,
+                    ex.getMessage(),
+                    ex);
             return new DefaultAsyncQueueFullPolicy();
         }
     }
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncWaitStrategyFactoryConfig.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncWaitStrategyFactoryConfig.java
index b6674ab9f8..7c8c661dcd 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncWaitStrategyFactoryConfig.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncWaitStrategyFactoryConfig.java
@@ -88,8 +88,15 @@ public class AsyncWaitStrategyFactoryConfig {
     public AsyncWaitStrategyFactory createWaitStrategyFactory() {
         try {
             return LoaderUtil.newCheckedInstanceOf(factoryClassName, AsyncWaitStrategyFactory.class);
+        } catch (final ClassCastException e) {
+            LOGGER.error("Ignoring factory '{}': it is not assignable to AsyncWaitStrategyFactory", factoryClassName);
+            return null;
         } catch (ReflectiveOperationException | LinkageError e) {
-            LOGGER.info("Invalid implementation class name value: error creating AsyncWaitStrategyFactory {}: {}", factoryClassName, e);
+            LOGGER.info(
+                    "Invalid implementation class name value: error creating AsyncWaitStrategyFactory {}: {}",
+                    factoryClassName,
+                    e.getMessage(),
+                    e);
             return null;
         }
     }
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java
index b059ad8abf..71c1261f65 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java
@@ -24,8 +24,8 @@ import com.lmax.disruptor.WaitStrategy;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
 import org.apache.logging.log4j.core.util.Integers;
-import org.apache.logging.log4j.core.util.Loader;
 import org.apache.logging.log4j.status.StatusLogger;
+import org.apache.logging.log4j.util.LoaderUtil;
 import org.apache.logging.log4j.util.PropertiesUtil;
 import org.apache.logging.log4j.util.PropertyKey;
 
@@ -84,35 +84,31 @@ final class DisruptorUtil {
     }
 
     static ExceptionHandler<RingBufferLogEvent> getAsyncLoggerExceptionHandler() {
-        final String cls = PropertiesUtil.getProperties().getStringProperty(Log4jPropertyKey.ASYNC_LOGGER_EXCEPTION_HANDLER_CLASS_NAME);
-        if (cls == null) {
-            return new AsyncLoggerDefaultExceptionHandler();
-        }
+        ExceptionHandler<RingBufferLogEvent> handler = null;
         try {
-            @SuppressWarnings("unchecked")
-            final Class<? extends ExceptionHandler<RingBufferLogEvent>> klass =
-                (Class<? extends ExceptionHandler<RingBufferLogEvent>>) Loader.loadClass(cls);
-            return klass.newInstance();
-        } catch (final Exception e) {
-            LOGGER.debug("Invalid {} value: error creating {}: ", Log4jPropertyKey.ASYNC_LOGGER_EXCEPTION_HANDLER_CLASS_NAME, cls, e);
-            return new AsyncLoggerDefaultExceptionHandler();
+            handler =
+                    LoaderUtil.newCheckedInstanceOfProperty(Log4jPropertyKey.ASYNC_LOGGER_EXCEPTION_HANDLER_CLASS_NAME, ExceptionHandler.class);
+        } catch (final ReflectiveOperationException e) {
+            LOGGER.debug("Invalid AsyncLogger.ExceptionHandler value: {}", e.getMessage(), e);
+        }
+        if (handler != null) {
+            return handler;
         }
+        return new AsyncLoggerDefaultExceptionHandler();
     }
 
     static ExceptionHandler<AsyncLoggerConfigDisruptor.Log4jEventWrapper> getAsyncLoggerConfigExceptionHandler() {
-        final String cls = PropertiesUtil.getProperties().getStringProperty(Log4jPropertyKey.ASYNC_CONFIG_EXCEPTION_HANDLER_CLASS_NAME);
-        if (cls == null) {
-            return new AsyncLoggerConfigDefaultExceptionHandler();
-        }
+        ExceptionHandler<AsyncLoggerConfigDisruptor.Log4jEventWrapper> handler = null;
         try {
-            @SuppressWarnings("unchecked")
-            final Class<? extends ExceptionHandler<AsyncLoggerConfigDisruptor.Log4jEventWrapper>> klass =
-                    (Class<? extends ExceptionHandler<AsyncLoggerConfigDisruptor.Log4jEventWrapper>>) Loader.loadClass(cls);
-            return klass.newInstance();
-        } catch (final Exception e) {
-            LOGGER.debug("Invalid {} value: error creating {}: ", Log4jPropertyKey.ASYNC_CONFIG_EXCEPTION_HANDLER_CLASS_NAME, cls, e);
-            return new AsyncLoggerConfigDefaultExceptionHandler();
+            handler = LoaderUtil.newCheckedInstanceOfProperty(
+                    Log4jPropertyKey.ASYNC_CONFIG_EXCEPTION_HANDLER_CLASS_NAME, ExceptionHandler.class);
+        } catch (final ReflectiveOperationException e) {
+            LOGGER.debug("Invalid AsyncLogger.ExceptionHandler value: {}", e.getMessage(), e);
+        }
+        if (handler != null) {
+            return handler;
         }
+        return new AsyncLoggerConfigDefaultExceptionHandler();
     }
 
     /**
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ContextDataInjectorFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ContextDataInjectorFactory.java
index b3c24254f2..ed014d9d52 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ContextDataInjectorFactory.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ContextDataInjectorFactory.java
@@ -19,12 +19,11 @@ package org.apache.logging.log4j.core.impl;
 import org.apache.logging.log4j.ThreadContext;
 import org.apache.logging.log4j.core.ContextDataInjector;
 import org.apache.logging.log4j.core.LogEvent;
-import org.apache.logging.log4j.core.util.Loader;
 import org.apache.logging.log4j.spi.CopyOnWrite;
 import org.apache.logging.log4j.spi.DefaultThreadContextMap;
 import org.apache.logging.log4j.spi.ReadOnlyThreadContextMap;
 import org.apache.logging.log4j.status.StatusLogger;
-import org.apache.logging.log4j.util.PropertiesUtil;
+import org.apache.logging.log4j.util.LoaderUtil;
 import org.apache.logging.log4j.util.ReadOnlyStringMap;
 
 /**
@@ -66,21 +65,17 @@ public class ContextDataInjectorFactory {
      * @see ContextDataInjector
      */
     public static ContextDataInjector createInjector() {
-        final String className = PropertiesUtil.getProperties().getStringProperty(Log4jPropertyKey.THREAD_CONTEXT_DATA_INJECTOR_CLASS_NAME);
-        if (className == null) {
-            return createDefaultInjector();
-        }
+        ContextDataInjector injector = null;
         try {
-            final Class<? extends ContextDataInjector> cls = Loader.loadClass(className).asSubclass(
-                    ContextDataInjector.class);
-            return cls.newInstance();
-        } catch (final Exception dynamicFailed) {
-            final ContextDataInjector result = createDefaultInjector();
-            StatusLogger.getLogger().warn(
-                    "Could not create ContextDataInjector for '{}', using default {}: {}",
-                    className, result.getClass().getName(), dynamicFailed);
-            return result;
+            injector =
+                    LoaderUtil.newCheckedInstanceOfProperty(Log4jPropertyKey.THREAD_CONTEXT_DATA_INJECTOR_CLASS_NAME, ContextDataInjector.class);
+        } catch (final ReflectiveOperationException e) {
+            StatusLogger.getLogger().warn("Could not create ContextDataInjector: {}", e.getMessage(), e);
+        }
+        if (injector != null) {
+            return injector;
         }
+        return createDefaultInjector();
     }
 
     private static ContextDataInjector createDefaultInjector() {
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/OptionConverter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/OptionConverter.java
index 8339b12f6f..9d7af6d5e6 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/OptionConverter.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/OptionConverter.java
@@ -24,6 +24,7 @@ import java.util.Properties;
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.status.StatusLogger;
+import org.apache.logging.log4j.util.LoaderUtil;
 import org.apache.logging.log4j.util.PropertiesUtil;
 import org.apache.logging.log4j.util.Strings;
 
@@ -303,7 +304,7 @@ public final class OptionConverter {
                             superClass.getName(), superClass.getClassLoader(), classObj.getTypeName(), classObj.getName());
                     return defaultValue;
                 }
-                return classObj.newInstance();
+                return LoaderUtil.newInstanceOf(classObj);
             } catch (final Exception e) {
                 LOGGER.error("Could not instantiate class [{}].", className, e);
             }
diff --git a/log4j-jpa/src/main/java/org/apache/logging/log4j/jpa/converter/ThrowableAttributeConverter.java b/log4j-jpa/src/main/java/org/apache/logging/log4j/jpa/converter/ThrowableAttributeConverter.java
index 2d850592d6..e003de57c1 100644
--- a/log4j-jpa/src/main/java/org/apache/logging/log4j/jpa/converter/ThrowableAttributeConverter.java
+++ b/log4j-jpa/src/main/java/org/apache/logging/log4j/jpa/converter/ThrowableAttributeConverter.java
@@ -230,7 +230,7 @@ public class ThrowableAttributeConverter implements AttributeConverter<Throwable
 
     private Throwable getThrowable(final Class<Throwable> throwableClass) {
         try {
-            return throwableClass.newInstance();
+            return LoaderUtil.newInstanceOf(throwableClass);
         } catch (final Exception e) {
             return null;
         }


(logging-log4j2) 04/11: Add comments to warning suppressions and small fixes

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 47882402810afa53755fee25abd8d10eb0061194
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Mon Nov 13 11:22:13 2023 +0100

    Add comments to warning suppressions and small fixes
---
 .../org/apache/logging/log4j/message/ReusableMessageFactory.java | 4 ++++
 .../java/org/apache/logging/log4j/message/SimpleMessage.java     | 9 ++++++++-
 .../main/java/org/apache/logging/log4j/status/StatusData.java    | 4 ++--
 .../main/java/org/apache/logging/log4j/util/PropertiesUtil.java  | 5 ++++-
 log4j-api/src/main/java/org/apache/logging/log4j/util/Unbox.java | 4 ++++
 5 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableMessageFactory.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableMessageFactory.java
index 8ed882d350..6b8caac725 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableMessageFactory.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableMessageFactory.java
@@ -33,6 +33,10 @@ import org.apache.logging.log4j.util.PerformanceSensitive;
  * @since 2.6
  */
 @PerformanceSensitive("allocation")
+/*
+ * https://errorprone.info/bugpattern/ThreadLocalUsage
+ * Instance thread locals are not a problem here, since this class is almost a singleton.
+ */
 @SuppressWarnings("ThreadLocalUsage")
 public final class ReusableMessageFactory implements MessageFactory {
 
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java
index 4b8fcb97e6..0d739017a4 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java
@@ -96,7 +96,14 @@ public class SimpleMessage implements Message, StringBuilderFormattable, CharSeq
         }
 
         final SimpleMessage that = (SimpleMessage) o;
-        return Objects.equals(getFormattedMessage(), that.getFormattedMessage());
+
+        /*
+         * https://errorprone.info/bugpattern/UndefinedEquals
+         *
+         * If the char sequences are different, we fall back on string comparison.
+         */
+        return Objects.equals(this.charSequence, that.charSequence)
+                || Objects.equals(this.getFormattedMessage(), that.getFormattedMessage());
     }
 
     @Override
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusData.java b/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusData.java
index 9f7719380e..fde996c197 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusData.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusData.java
@@ -18,6 +18,7 @@ package org.apache.logging.log4j.status;
 
 import java.io.ByteArrayOutputStream;
 import java.io.PrintStream;
+import java.nio.charset.Charset;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
@@ -119,7 +120,6 @@ public class StatusData {
             value = "INFORMATION_EXPOSURE_THROUGH_AN_ERROR_MESSAGE",
             justification = "Log4j prints stacktraces only to logs, which should be private."
     )
-    @SuppressWarnings("DefaultCharset")
     public String getFormattedStatus() {
         final StringBuilder sb = new StringBuilder();
         final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS");
@@ -141,7 +141,7 @@ public class StatusData {
             sb.append(SPACE);
             final ByteArrayOutputStream baos = new ByteArrayOutputStream();
             t.printStackTrace(new PrintStream(baos));
-            sb.append(baos);
+            sb.append(baos.toString(Charset.defaultCharset()));
         }
         return sb.toString();
     }
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
index 2cd92fb124..e4a849fa31 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
@@ -885,7 +885,10 @@ public class PropertiesUtil implements PropertyEnvironment {
         HOURS("h,hour,hours", ChronoUnit.HOURS),
         DAYS("d,day,days", ChronoUnit.DAYS);
 
-        // descriptions is effectively immutable
+        /*
+         * https://errorprone.info/bugpattern/ImmutableEnumChecker
+         * This field is effectively immutable.
+         */
         @SuppressWarnings("ImmutableEnumChecker")
         private final String[] descriptions;
         private final ChronoUnit timeUnit;
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/Unbox.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/Unbox.java
index b12d054bfc..a7651e90e6 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/Unbox.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/Unbox.java
@@ -64,6 +64,10 @@ public class Unbox {
      * Such memory leaks will not occur if only JDK classes are stored in ThreadLocals.
      * </p>
      */
+    /*
+     * https://errorprone.info/bugpattern/ThreadLocalUsage
+     * Instance thread locals are not a problem here, since this class is a singleton.
+     */
     @SuppressWarnings("ThreadLocalUsage")
     private static class WebSafeState {
         private final ThreadLocal<StringBuilder[]> ringBuffer = new ThreadLocal<>();


(logging-log4j2) 07/11: Bump `o.a.l.l.message` package

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit c4714e46ecba9b2effe7d5606f70341777ad18f1
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Mon Nov 13 13:36:38 2023 +0100

    Bump `o.a.l.l.message` package
---
 .../src/main/java/org/apache/logging/log4j/message/package-info.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/package-info.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/package-info.java
index 3b5aa183f8..7e2c173188 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/package-info.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/package-info.java
@@ -19,7 +19,7 @@
  * Public Message Types used for Log4j 2. Users may implement their own Messages.
  */
 @Export
-@Version("2.20.1")
+@Version("2.22.0")
 package org.apache.logging.log4j.message;
 
 import org.osgi.annotation.bundle.Export;


(logging-log4j2) 01/11: Fix Error Prone warnings in `log4j-api`

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit dd7b67ee20bcd45534a9216e10df60b57cf68daa
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Fri Nov 10 12:43:04 2023 +0100

    Fix Error Prone warnings in `log4j-api`
    
    This suppresses or fixes most Error Prone warning in `log4j-api`.
    
    Only two dozens warnings are left, mainly in the
    [TypeParameterUnusedInFormals](https://errorprone.info/bugpattern/TypeParameterUnusedInFormals),
    which can not be removed for source compatibility reasons.
    
    Closes #1850.
---
 .../log4j/util/PropertySourceTokenizerTest.java    |   2 +-
 log4j-api/pom.xml                                  |   4 -
 .../main/java/org/apache/logging/log4j/Level.java  |   2 +
 .../java/org/apache/logging/log4j/LogBuilder.java  |  55 +-
 .../main/java/org/apache/logging/log4j/Logger.java | 889 +++++++++++----------
 .../logging/log4j/internal/DefaultLogBuilder.java  |   5 +-
 .../log4j/message/BasicThreadInformation.java      |   8 +-
 .../logging/log4j/message/FormattedMessage.java    |  22 +-
 .../apache/logging/log4j/message/MapMessage.java   |   9 +-
 .../log4j/message/MapMessageJsonFormatter.java     |   2 +-
 .../log4j/message/MessageFormatMessage.java        |  11 +-
 .../logging/log4j/message/ObjectMessage.java       |   2 +-
 .../log4j/message/ParameterizedMessage.java        |  20 +-
 .../log4j/message/ReusableMessageFactory.java      |   1 +
 .../logging/log4j/message/SimpleMessage.java       |  10 +-
 .../log4j/message/StringFormattedMessage.java      |   9 +-
 .../logging/log4j/message/StructuredDataId.java    |  32 -
 .../log4j/message/StructuredDataMessage.java       |  10 +-
 .../apache/logging/log4j/spi/AbstractLogger.java   | 201 +++--
 .../apache/logging/log4j/spi/ExtendedLogger.java   |   2 +
 .../org/apache/logging/log4j/spi/Provider.java     |   9 +-
 .../apache/logging/log4j/status/StatusData.java    |   1 +
 .../org/apache/logging/log4j/util/Constants.java   |   4 +-
 .../org/apache/logging/log4j/util/LambdaUtil.java  |   3 +
 .../org/apache/logging/log4j/util/LoaderUtil.java  |   2 +-
 .../apache/logging/log4j/util/PropertiesUtil.java  | 280 ++++++-
 .../apache/logging/log4j/util/PropertySource.java  |   8 +-
 .../org/apache/logging/log4j/util/Supplier.java    |   1 +
 .../java/org/apache/logging/log4j/util/Unbox.java  |  22 +-
 log4j-core/pom.xml                                 |  39 +-
 log4j-parent/pom.xml                               |   7 +
 31 files changed, 1055 insertions(+), 617 deletions(-)

diff --git a/log4j-api-test/src/test/java/org/apache/logging/log4j/util/PropertySourceTokenizerTest.java b/log4j-api-test/src/test/java/org/apache/logging/log4j/util/PropertySourceTokenizerTest.java
index 1b9ab20e9c..7af9e130a3 100644
--- a/log4j-api-test/src/test/java/org/apache/logging/log4j/util/PropertySourceTokenizerTest.java
+++ b/log4j-api-test/src/test/java/org/apache/logging/log4j/util/PropertySourceTokenizerTest.java
@@ -52,7 +52,7 @@ public class PropertySourceTokenizerTest {
 
     @ParameterizedTest
     @MethodSource("data")
-    public void testTokenize(final CharSequence value, final List<CharSequence> expectedTokens) {
+    public void testTokenize(final String value, final List<CharSequence> expectedTokens) {
         final List<CharSequence> tokens = PropertySource.Util.tokenize(value);
         assertEquals(expectedTokens, tokens);
     }
diff --git a/log4j-api/pom.xml b/log4j-api/pom.xml
index 42c057471a..a270a53c96 100644
--- a/log4j-api/pom.xml
+++ b/log4j-api/pom.xml
@@ -23,15 +23,11 @@
     <version>${revision}</version>
     <relativePath>../log4j-parent</relativePath>
   </parent>
-
   <artifactId>log4j-api</artifactId>
   <packaging>jar</packaging>
   <name>Apache Log4j API</name>
   <description>The Apache Log4j API</description>
   <properties>
-    <log4jParentDir>${basedir}/..</log4jParentDir>
-    <docLabel>API Documentation</docLabel>
-    <projectDir>/api</projectDir>
     <maven.javadoc.skip>false</maven.javadoc.skip>
 
     <!--
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/Level.java b/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
index 8a44ed332b..c920f62910 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
@@ -121,6 +121,8 @@ public final class Level implements Comparable<Level> {
     public static final String NAMESPACE = "Level";
 
     /**
+     * Category to be used by custom levels.
+     *
      * @since 2.1
      */
     public static final String CATEGORY = NAMESPACE;
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/LogBuilder.java b/log4j-api/src/main/java/org/apache/logging/log4j/LogBuilder.java
index 2aa5b2065e..88cf3504f8 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/LogBuilder.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/LogBuilder.java
@@ -25,15 +25,15 @@ import org.apache.logging.log4j.util.Supplier;
  * by calling one of the Logger methods that return a LogBuilder.
  */
 public interface LogBuilder {
-
-    LogBuilder NOOP = new LogBuilder() {};
+    /** NOOP Logbuilder */
+    LogBuilder NOOP = new LogBuilder() { };
 
     /**
      * Includes a Marker in the log event. Interface default method does nothing.
      * @param marker The Marker to log.
      * @return The LogBuilder.
      */
-    default LogBuilder withMarker(final Marker marker) {
+    default LogBuilder withMarker(Marker marker) {
         return this;
     }
 
@@ -42,7 +42,7 @@ public interface LogBuilder {
      * @param throwable The Throwable to log.
      * @return the LogBuilder.
      */
-    default LogBuilder withThrowable(final Throwable throwable) {
+    default LogBuilder withThrowable(Throwable throwable) {
         return this;
     }
 
@@ -60,7 +60,7 @@ public interface LogBuilder {
      * @param location The stack trace element to include in the log event.
      * @return The LogBuilder.
      */
-    default LogBuilder withLocation(final StackTraceElement location) {
+    default LogBuilder withLocation(StackTraceElement location) {
         return this;
     }
 
@@ -68,14 +68,14 @@ public interface LogBuilder {
      * Causes all the data collected to be logged along with the message. Interface default method does nothing.
      * @param message The message to log.
      */
-    default void log(final CharSequence message) {
+    default void log(CharSequence message) {
     }
 
     /**
      * Causes all the data collected to be logged along with the message. Interface default method does nothing.
      * @param message The message to log.
      */
-    default void log(final String message) {
+    default void log(String message) {
     }
 
     /**
@@ -86,7 +86,7 @@ public interface LogBuilder {
      *
      * @see org.apache.logging.log4j.util.Unbox
      */
-    default void log(final String message, final Object... params) {
+    default void log(String message, Object... params) {
     }
 
     /**
@@ -95,21 +95,23 @@ public interface LogBuilder {
      * @param message The message.
      * @param params Parameters to the message.
      */
-    default void log(final String message, final Supplier<?>... params) {
+    @SuppressWarnings("deprecation")
+    default void log(String message, Supplier<?>... params) {
     }
 
     /**
      * Causes all the data collected to be logged along with the message. Interface default method does nothing.
      * @param message The message to log.
      */
-    default void log(final Message message) {
+    default void log(Message message) {
     }
 
     /**
      * Causes all the data collected to be logged along with the message. Interface default method does nothing.
      * @param messageSupplier The supplier of the message to log.
      */
-    default void log(final Supplier<Message> messageSupplier) {
+    @SuppressWarnings("deprecation")
+    default void log(Supplier<Message> messageSupplier) {
     }
 
     /**
@@ -119,6 +121,7 @@ public interface LogBuilder {
      * @return the message logger or {@code null} if no logging occurred.
      * @since 2.20
      */
+    @SuppressWarnings("deprecation")
     default Message logAndGet(final Supplier<Message> messageSupplier) {
         return null;
     }
@@ -127,7 +130,7 @@ public interface LogBuilder {
      * Causes all the data collected to be logged along with the message. Interface default method does nothing.
      * @param message The message to log.
      */
-    default void log(final Object message) {
+    default void log(Object message) {
     }
 
     /**
@@ -138,7 +141,7 @@ public interface LogBuilder {
      *
      * @see org.apache.logging.log4j.util.Unbox
      */
-    default void log(final String message, final Object p0) {
+    default void log(String message, Object p0) {
     }
 
     /**
@@ -150,7 +153,7 @@ public interface LogBuilder {
      *
      * @see org.apache.logging.log4j.util.Unbox
      */
-    default void log(final String message, final Object p0, final Object p1) {
+    default void log(String message, Object p0, Object p1) {
     }
 
     /**
@@ -163,7 +166,7 @@ public interface LogBuilder {
      *
      * @see org.apache.logging.log4j.util.Unbox
      */
-    default void log(final String message, final Object p0, final Object p1, final Object p2) {
+    default void log(String message, Object p0, Object p1, Object p2) {
     }
 
     /**
@@ -177,7 +180,7 @@ public interface LogBuilder {
      *
      * @see org.apache.logging.log4j.util.Unbox
      */
-    default void log(final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
+    default void log(String message, Object p0, Object p1, Object p2, Object p3) {
     }
 
     /**
@@ -192,7 +195,7 @@ public interface LogBuilder {
      *
      * @see org.apache.logging.log4j.util.Unbox
      */
-    default void log(final String message, final Object p0, final Object p1, final Object p2, final Object p3, final Object p4) {
+    default void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4) {
     }
 
     /**
@@ -208,7 +211,7 @@ public interface LogBuilder {
      *
      * @see org.apache.logging.log4j.util.Unbox
      */
-    default void log(final String message, final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5) {
+    default void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5) {
     }
 
     /**
@@ -225,7 +228,7 @@ public interface LogBuilder {
      *
      * @see org.apache.logging.log4j.util.Unbox
      */
-    default void log(final String message, final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5, final Object p6) {
+    default void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6) {
     }
 
     /**
@@ -243,8 +246,8 @@ public interface LogBuilder {
      *
      * @see org.apache.logging.log4j.util.Unbox
      */
-    default void log(final String message, final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5, final Object p6,
-                     final Object p7) {
+    default void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6,
+            Object p7) {
     }
 
     /**
@@ -263,8 +266,8 @@ public interface LogBuilder {
      *
      * @see org.apache.logging.log4j.util.Unbox
      */
-    default void log(final String message, final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5, final Object p6,
-                     final Object p7, final Object p8) {
+    default void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6,
+            Object p7, Object p8) {
     }
 
     /**
@@ -284,12 +287,12 @@ public interface LogBuilder {
      *
      * @see org.apache.logging.log4j.util.Unbox
      */
-    default void log(final String message, final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5, final Object p6,
-                     final Object p7, final Object p8, final Object p9) {
+    default void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6,
+            Object p7, Object p8, Object p9) {
     }
 
     /**
-     * Causes all the data collected to be logged. Default implementation does nothing.
+     * Causes all the data collected to be logged. Default implementatoin does nothing.
      */
     default void log() {
     }
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/Logger.java b/log4j-api/src/main/java/org/apache/logging/log4j/Logger.java
index 603dee3cea..7a312fd0f6 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/Logger.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/Logger.java
@@ -33,12 +33,12 @@ import org.apache.logging.log4j.util.Supplier;
  * {@link LogManager#getLogger()} method). Thus, the simplest way to use this would be like so:
  * </p>
  *
- * <pre><code>
+ * <pre>
  * public class MyClass {
  *     private static final Logger LOGGER = LogManager.getLogger();
  *     // ...
  * }
- * </code></pre>
+ * </pre>
  * <p>
  * For ease of filtering, searching, sorting, etc., it is generally a good idea to create Loggers for each class rather
  * than sharing Loggers. Instead, {@link Marker Markers} should be used for shared, filterable identification.
@@ -52,13 +52,13 @@ import org.apache.logging.log4j.util.Supplier;
  * allow client code to lazily log messages without explicitly checking if the requested log level is enabled. For
  * example, previously one would write:
  *
- * <pre><code>
+ * <pre>
  * // pre-Java 8 style optimization: explicitly check the log level
  * // to make sure the expensiveOperation() method is only called if necessary
  * if (logger.isTraceEnabled()) {
  *     logger.trace(&quot;Some long-running operation returned {}&quot;, expensiveOperation());
  * }
- * </code></pre>
+ * </pre>
  * <p>
  * With Java 8, the same effect can be achieved with a lambda expression:
  *
@@ -69,7 +69,7 @@ import org.apache.logging.log4j.util.Supplier;
  * </pre>
  *
  * <p>
- * Note that although {@link MessageSupplier} is provided, using {@link Supplier Supplier&lt;Message&gt;} works just the
+ * Note that although {@link MessageSupplier} is provided, using {@link Supplier<Message>} works just the
  * same. MessageSupplier was deprecated in 2.6 and un-deprecated in 2.8.1. Anonymous class usage of these APIs
  * should prefer using Supplier instead.
  * </p>
@@ -77,39 +77,41 @@ import org.apache.logging.log4j.util.Supplier;
 public interface Logger {
 
     /**
-     * Logs an exception or error that has been caught to a specific logging level.
+     * Logs a {@link Throwable} that has been caught to a specific logging level.
      *
      * @param level The logging Level.
-     * @param t The Throwable.
+     * @param throwable the Throwable.
      */
-    void catching(Level level, Throwable t);
+    void catching(Level level, Throwable throwable);
 
     /**
-     * Logs an exception or error that has been caught. Normally, one may wish to provide additional information with an
-     * exception while logging it; in these cases, one would not use this method. In other cases where simply logging
-     * the fact that an exception was swallowed somewhere (e.g., at the top of the stack trace in a {@code main()}
-     * method), this method is ideal for it.
+     * Logs a {@link Throwable} that has been caught at the {@link Level#ERROR ERROR} level.
+     * Normally, one may wish to provide additional information with an exception while logging it;
+     * in these cases, one would not use this method.
+     * In other cases where simply logging the fact that an exception was swallowed somewhere
+     * (e.g., at the top of the stack trace in a {@code main()} method),
+     * this method is ideal for it.
      *
-     * @param t The Throwable.
+     * @param throwable the Throwable.
      */
-    void catching(Throwable t);
+    void catching(Throwable throwable);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#DEBUG DEBUG} level.
      *
      * @param marker the marker data specific to this log statement
-     * @param msg the message string to be logged
+     * @param message the message string to be logged
      */
-    void debug(Marker marker, Message msg);
+    void debug(Marker marker, Message message);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#DEBUG DEBUG} level.
      *
      * @param marker the marker data specific to this log statement
-     * @param msg the message string to be logged
-     * @param t A Throwable or null.
+     * @param message the message string to be logged
+     * @param throwable A Throwable or null.
      */
-    void debug(Marker marker, Message msg, Throwable t);
+    void debug(Marker marker, Message message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#DEBUG DEBUG} level with
@@ -117,22 +119,22 @@ public interface Logger {
      * {@code Message}.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message.
+     * @param messageSupplier A function, which when called, produces the desired log message.
      * @since 2.4
      */
-    void debug(Marker marker, MessageSupplier msgSupplier);
+    void debug(Marker marker, MessageSupplier messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#DEBUG DEBUG} level) with the
-     * specified Marker and including the stack trace of the {@link Throwable} <code>t</code> passed as parameter. The
+     * specified Marker and including the stack trace of the {@link Throwable} <code>throwable</code> passed as parameter. The
      * {@code MessageSupplier} may or may not use the {@link MessageFactory} to construct the {@code Message}.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message.
-     * @param t A Throwable or null.
+     * @param messageSupplier A function, which when called, produces the desired log message.
+     * @param throwable A Throwable or null.
      * @since 2.4
      */
-    void debug(Marker marker, MessageSupplier msgSupplier, Throwable t);
+    void debug(Marker marker, MessageSupplier messageSupplier, Throwable throwable);
 
     /**
      * Logs a message CharSequence with the {@link Level#DEBUG DEBUG} level.
@@ -144,13 +146,13 @@ public interface Logger {
 
     /**
      * Logs a message CharSequence at the {@link Level#DEBUG DEBUG} level including the stack trace of the
-     * {@link Throwable} <code>t</code> passed as parameter.
+     * {@link Throwable} <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement
      * @param message the message CharSequence to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void debug(Marker marker, CharSequence message, Throwable t);
+    void debug(Marker marker, CharSequence message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#DEBUG DEBUG} level.
@@ -162,13 +164,13 @@ public interface Logger {
 
     /**
      * Logs a message at the {@link Level#DEBUG DEBUG} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement
      * @param message the message to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void debug(Marker marker, Object message, Throwable t);
+    void debug(Marker marker, Object message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#DEBUG DEBUG} level.
@@ -197,75 +199,78 @@ public interface Logger {
      * @param paramSuppliers An array of functions, which when called, produce the desired log message parameters.
      * @since 2.4
      */
+    @SuppressWarnings("deprecation")
     void debug(Marker marker, String message, Supplier<?>... paramSuppliers);
 
     /**
      * Logs a message at the {@link Level#DEBUG DEBUG} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement
      * @param message the message to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void debug(Marker marker, String message, Throwable t);
+    void debug(Marker marker, String message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#DEBUG DEBUG} level with
      * the specified Marker.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
      * @since 2.4
      */
-    void debug(Marker marker, Supplier<?> msgSupplier);
+    @SuppressWarnings("deprecation")
+    void debug(Marker marker, Supplier<?> messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#DEBUG DEBUG} level) with the
-     * specified Marker and including the stack trace of the {@link Throwable} <code>t</code> passed as parameter.
+     * specified Marker and including the stack trace of the {@link Throwable} <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
-     * @param t A Throwable or null.
+     * @param throwable A Throwable or null.
      * @since 2.4
      */
-    void debug(Marker marker, Supplier<?> msgSupplier, Throwable t);
+    @SuppressWarnings("deprecation")
+    void debug(Marker marker, Supplier<?> messageSupplier, Throwable throwable);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#DEBUG DEBUG} level.
      *
-     * @param msg the message string to be logged
+     * @param message the message string to be logged
      */
-    void debug(Message msg);
+    void debug(Message message);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#DEBUG DEBUG} level.
      *
-     * @param msg the message string to be logged
-     * @param t A Throwable or null.
+     * @param message the message string to be logged
+     * @param throwable A Throwable or null.
      */
-    void debug(Message msg, Throwable t);
+    void debug(Message message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#DEBUG DEBUG} level. The
      * {@code MessageSupplier} may or may not use the {@link MessageFactory} to construct the {@code Message}.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message.
+     * @param messageSupplier A function, which when called, produces the desired log message.
      * @since 2.4
      */
-    void debug(MessageSupplier msgSupplier);
+    void debug(MessageSupplier messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#DEBUG DEBUG} level) including the
-     * stack trace of the {@link Throwable} <code>t</code> passed as parameter. The {@code MessageSupplier} may or may
+     * stack trace of the {@link Throwable} <code>throwable</code> passed as parameter. The {@code MessageSupplier} may or may
      * not use the {@link MessageFactory} to construct the {@code Message}.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message.
-     * @param t the exception to log, including its stack trace.
+     * @param messageSupplier A function, which when called, produces the desired log message.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      * @since 2.4
      */
-    void debug(MessageSupplier msgSupplier, Throwable t);
+    void debug(MessageSupplier messageSupplier, Throwable throwable);
 
     /**
      * Logs a message CharSequence with the {@link Level#DEBUG DEBUG} level.
@@ -276,12 +281,12 @@ public interface Logger {
 
     /**
      * Logs a CharSequence at the {@link Level#DEBUG DEBUG} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param message the message CharSequence to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void debug(CharSequence message, Throwable t);
+    void debug(CharSequence message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#DEBUG DEBUG} level.
@@ -292,12 +297,12 @@ public interface Logger {
 
     /**
      * Logs a message at the {@link Level#DEBUG DEBUG} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param message the message to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void debug(Object message, Throwable t);
+    void debug(Object message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#DEBUG DEBUG} level.
@@ -323,36 +328,39 @@ public interface Logger {
      * @param paramSuppliers An array of functions, which when called, produce the desired log message parameters.
      * @since 2.4
      */
+    @SuppressWarnings("deprecation")
     void debug(String message, Supplier<?>... paramSuppliers);
 
     /**
      * Logs a message at the {@link Level#DEBUG DEBUG} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param message the message to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void debug(String message, Throwable t);
+    void debug(String message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#DEBUG DEBUG} level.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
      * @since 2.4
      */
-    void debug(Supplier<?> msgSupplier);
+    @SuppressWarnings("deprecation")
+    void debug(Supplier<?> messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#DEBUG DEBUG} level) including the
-     * stack trace of the {@link Throwable} <code>t</code> passed as parameter.
+     * stack trace of the {@link Throwable} <code>throwable</code> passed as parameter.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      * @since 2.4
      */
-    void debug(Supplier<?> msgSupplier, Throwable t);
+    @SuppressWarnings("deprecation")
+    void debug(Supplier<?> messageSupplier, Throwable throwable);
 
     /**
      * Logs a message with parameters at debug level.
@@ -624,18 +632,18 @@ public interface Logger {
      * Logs a message with the specific Marker at the {@link Level#ERROR ERROR} level.
      *
      * @param marker the marker data specific to this log statement
-     * @param msg the message string to be logged
+     * @param message the message string to be logged
      */
-    void error(Marker marker, Message msg);
+    void error(Marker marker, Message message);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#ERROR ERROR} level.
      *
      * @param marker the marker data specific to this log statement
-     * @param msg the message string to be logged
-     * @param t A Throwable or null.
+     * @param message the message string to be logged
+     * @param throwable A Throwable or null.
      */
-    void error(Marker marker, Message msg, Throwable t);
+    void error(Marker marker, Message message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#ERROR ERROR} level with
@@ -643,22 +651,22 @@ public interface Logger {
      * {@code Message}.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message.
+     * @param messageSupplier A function, which when called, produces the desired log message.
      * @since 2.4
      */
-    void error(Marker marker, MessageSupplier msgSupplier);
+    void error(Marker marker, MessageSupplier messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#ERROR ERROR} level) with the
-     * specified Marker and including the stack trace of the {@link Throwable} <code>t</code> passed as parameter. The
+     * specified Marker and including the stack trace of the {@link Throwable} <code>throwable</code> passed as parameter. The
      * {@code MessageSupplier} may or may not use the {@link MessageFactory} to construct the {@code Message}.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message.
-     * @param t A Throwable or null.
+     * @param messageSupplier A function, which when called, produces the desired log message.
+     * @param throwable A Throwable or null.
      * @since 2.4
      */
-    void error(Marker marker, MessageSupplier msgSupplier, Throwable t);
+    void error(Marker marker, MessageSupplier messageSupplier, Throwable throwable);
 
     /**
      * Logs a message CharSequence with the {@link Level#ERROR ERROR} level.
@@ -670,13 +678,13 @@ public interface Logger {
 
     /**
      * Logs a CharSequence at the {@link Level#ERROR ERROR} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement.
      * @param message the message CharSequence to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void error(Marker marker, CharSequence message, Throwable t);
+    void error(Marker marker, CharSequence message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#ERROR ERROR} level.
@@ -688,13 +696,13 @@ public interface Logger {
 
     /**
      * Logs a message at the {@link Level#ERROR ERROR} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement.
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void error(Marker marker, Object message, Throwable t);
+    void error(Marker marker, Object message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#ERROR ERROR} level.
@@ -723,75 +731,78 @@ public interface Logger {
      * @param paramSuppliers An array of functions, which when called, produce the desired log message parameters.
      * @since 2.4
      */
+    @SuppressWarnings("deprecation")
     void error(Marker marker, String message, Supplier<?>... paramSuppliers);
 
     /**
      * Logs a message at the {@link Level#ERROR ERROR} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement.
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void error(Marker marker, String message, Throwable t);
+    void error(Marker marker, String message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#ERROR ERROR} level with
      * the specified Marker.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
      * @since 2.4
      */
-    void error(Marker marker, Supplier<?> msgSupplier);
+    @SuppressWarnings("deprecation")
+    void error(Marker marker, Supplier<?> messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#ERROR ERROR} level) with the
-     * specified Marker and including the stack trace of the {@link Throwable} <code>t</code> passed as parameter.
+     * specified Marker and including the stack trace of the {@link Throwable} <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
-     * @param t A Throwable or null.
+     * @param throwable A Throwable or null.
      * @since 2.4
      */
-    void error(Marker marker, Supplier<?> msgSupplier, Throwable t);
+    @SuppressWarnings("deprecation")
+    void error(Marker marker, Supplier<?> messageSupplier, Throwable throwable);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#ERROR ERROR} level.
      *
-     * @param msg the message string to be logged
+     * @param message the message string to be logged
      */
-    void error(Message msg);
+    void error(Message message);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#ERROR ERROR} level.
      *
-     * @param msg the message string to be logged
-     * @param t A Throwable or null.
+     * @param message the message string to be logged
+     * @param throwable A Throwable or null.
      */
-    void error(Message msg, Throwable t);
+    void error(Message message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#ERROR ERROR} level. The
      * {@code MessageSupplier} may or may not use the {@link MessageFactory} to construct the {@code Message}.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message.
+     * @param messageSupplier A function, which when called, produces the desired log message.
      * @since 2.4
      */
-    void error(MessageSupplier msgSupplier);
+    void error(MessageSupplier messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#ERROR ERROR} level) including the
-     * stack trace of the {@link Throwable} <code>t</code> passed as parameter. The {@code MessageSupplier} may or may
+     * stack trace of the {@link Throwable} <code>throwable</code> passed as parameter. The {@code MessageSupplier} may or may
      * not use the {@link MessageFactory} to construct the {@code Message}.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message.
-     * @param t the exception to log, including its stack trace.
+     * @param messageSupplier A function, which when called, produces the desired log message.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      * @since 2.4
      */
-    void error(MessageSupplier msgSupplier, Throwable t);
+    void error(MessageSupplier messageSupplier, Throwable throwable);
 
     /**
      * Logs a message CharSequence with the {@link Level#ERROR ERROR} level.
@@ -802,12 +813,12 @@ public interface Logger {
 
     /**
      * Logs a CharSequence at the {@link Level#ERROR ERROR} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param message the message CharSequence to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void error(CharSequence message, Throwable t);
+    void error(CharSequence message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#ERROR ERROR} level.
@@ -818,12 +829,12 @@ public interface Logger {
 
     /**
      * Logs a message at the {@link Level#ERROR ERROR} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void error(Object message, Throwable t);
+    void error(Object message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#ERROR ERROR} level.
@@ -849,36 +860,39 @@ public interface Logger {
      * @param paramSuppliers An array of functions, which when called, produce the desired log message parameters.
      * @since 2.4
      */
+    @SuppressWarnings("deprecation")
     void error(String message, Supplier<?>... paramSuppliers);
 
     /**
      * Logs a message at the {@link Level#ERROR ERROR} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void error(String message, Throwable t);
+    void error(String message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#ERROR ERROR} level.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
      * @since 2.4
      */
-    void error(Supplier<?> msgSupplier);
+    @SuppressWarnings("deprecation")
+    void error(Supplier<?> messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#ERROR ERROR} level) including the
-     * stack trace of the {@link Throwable} <code>t</code> passed as parameter.
+     * stack trace of the {@link Throwable} <code>throwable</code> passed as parameter.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      * @since 2.4
      */
-    void error(Supplier<?> msgSupplier, Throwable t);
+    @SuppressWarnings("deprecation")
+    void error(Supplier<?> messageSupplier, Throwable throwable);
 
     /**
      * Logs a message with parameters at error level.
@@ -1150,18 +1164,18 @@ public interface Logger {
      * Logs a message with the specific Marker at the {@link Level#FATAL FATAL} level.
      *
      * @param marker the marker data specific to this log statement
-     * @param msg the message string to be logged
+     * @param message the message string to be logged
      */
-    void fatal(Marker marker, Message msg);
+    void fatal(Marker marker, Message message);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#FATAL FATAL} level.
      *
      * @param marker the marker data specific to this log statement
-     * @param msg the message string to be logged
-     * @param t A Throwable or null.
+     * @param message the message string to be logged
+     * @param throwable A Throwable or null.
      */
-    void fatal(Marker marker, Message msg, Throwable t);
+    void fatal(Marker marker, Message message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#FATAL FATAL} level with
@@ -1169,22 +1183,22 @@ public interface Logger {
      * {@code Message}.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message.
+     * @param messageSupplier A function, which when called, produces the desired log message.
      * @since 2.4
      */
-    void fatal(Marker marker, MessageSupplier msgSupplier);
+    void fatal(Marker marker, MessageSupplier messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#FATAL FATAL} level) with the
-     * specified Marker and including the stack trace of the {@link Throwable} <code>t</code> passed as parameter. The
+     * specified Marker and including the stack trace of the {@link Throwable} <code>throwable</code> passed as parameter. The
      * {@code MessageSupplier} may or may not use the {@link MessageFactory} to construct the {@code Message}.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message.
-     * @param t A Throwable or null.
+     * @param messageSupplier A function, which when called, produces the desired log message.
+     * @param throwable A Throwable or null.
      * @since 2.4
      */
-    void fatal(Marker marker, MessageSupplier msgSupplier, Throwable t);
+    void fatal(Marker marker, MessageSupplier messageSupplier, Throwable throwable);
 
     /**
      * Logs a message CharSequence with the {@link Level#FATAL FATAL} level.
@@ -1196,13 +1210,13 @@ public interface Logger {
 
     /**
      * Logs a CharSequence at the {@link Level#FATAL FATAL} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param marker The marker data specific to this log statement.
      * @param message the message CharSequence to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void fatal(Marker marker, CharSequence message, Throwable t);
+    void fatal(Marker marker, CharSequence message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#FATAL FATAL} level.
@@ -1214,13 +1228,13 @@ public interface Logger {
 
     /**
      * Logs a message at the {@link Level#FATAL FATAL} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param marker The marker data specific to this log statement.
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void fatal(Marker marker, Object message, Throwable t);
+    void fatal(Marker marker, Object message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#FATAL FATAL} level.
@@ -1249,75 +1263,78 @@ public interface Logger {
      * @param paramSuppliers An array of functions, which when called, produce the desired log message parameters.
      * @since 2.4
      */
+    @SuppressWarnings("deprecation")
     void fatal(Marker marker, String message, Supplier<?>... paramSuppliers);
 
     /**
      * Logs a message at the {@link Level#FATAL FATAL} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param marker The marker data specific to this log statement.
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void fatal(Marker marker, String message, Throwable t);
+    void fatal(Marker marker, String message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#FATAL FATAL} level with
      * the specified Marker.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
      * @since 2.4
      */
-    void fatal(Marker marker, Supplier<?> msgSupplier);
+    @SuppressWarnings("deprecation")
+    void fatal(Marker marker, Supplier<?> messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#FATAL FATAL} level) with the
-     * specified Marker and including the stack trace of the {@link Throwable} <code>t</code> passed as parameter.
+     * specified Marker and including the stack trace of the {@link Throwable} <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
-     * @param t A Throwable or null.
+     * @param throwable A Throwable or null.
      * @since 2.4
      */
-    void fatal(Marker marker, Supplier<?> msgSupplier, Throwable t);
+    @SuppressWarnings("deprecation")
+    void fatal(Marker marker, Supplier<?> messageSupplier, Throwable throwable);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#FATAL FATAL} level.
      *
-     * @param msg the message string to be logged
+     * @param message the message string to be logged
      */
-    void fatal(Message msg);
+    void fatal(Message message);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#FATAL FATAL} level.
      *
-     * @param msg the message string to be logged
-     * @param t A Throwable or null.
+     * @param message the message string to be logged
+     * @param throwable A Throwable or null.
      */
-    void fatal(Message msg, Throwable t);
+    void fatal(Message message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#FATAL FATAL} level. The
      * {@code MessageSupplier} may or may not use the {@link MessageFactory} to construct the {@code Message}.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message.
+     * @param messageSupplier A function, which when called, produces the desired log message.
      * @since 2.4
      */
-    void fatal(MessageSupplier msgSupplier);
+    void fatal(MessageSupplier messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#FATAL FATAL} level) including the
-     * stack trace of the {@link Throwable} <code>t</code> passed as parameter. The {@code MessageSupplier} may or may
+     * stack trace of the {@link Throwable} <code>throwable</code> passed as parameter. The {@code MessageSupplier} may or may
      * not use the {@link MessageFactory} to construct the {@code Message}.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message.
-     * @param t the exception to log, including its stack trace.
+     * @param messageSupplier A function, which when called, produces the desired log message.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      * @since 2.4
      */
-    void fatal(MessageSupplier msgSupplier, Throwable t);
+    void fatal(MessageSupplier messageSupplier, Throwable throwable);
 
     /**
      * Logs a message CharSequence with the {@link Level#FATAL FATAL} level.
@@ -1328,12 +1345,12 @@ public interface Logger {
 
     /**
      * Logs a CharSequence at the {@link Level#FATAL FATAL} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param message the message CharSequence to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void fatal(CharSequence message, Throwable t);
+    void fatal(CharSequence message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#FATAL FATAL} level.
@@ -1344,12 +1361,12 @@ public interface Logger {
 
     /**
      * Logs a message at the {@link Level#FATAL FATAL} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void fatal(Object message, Throwable t);
+    void fatal(Object message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#FATAL FATAL} level.
@@ -1375,36 +1392,39 @@ public interface Logger {
      * @param paramSuppliers An array of functions, which when called, produce the desired log message parameters.
      * @since 2.4
      */
+    @SuppressWarnings("deprecation")
     void fatal(String message, Supplier<?>... paramSuppliers);
 
     /**
      * Logs a message at the {@link Level#FATAL FATAL} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void fatal(String message, Throwable t);
+    void fatal(String message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#FATAL FATAL} level.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
      * @since 2.4
      */
-    void fatal(Supplier<?> msgSupplier);
+    @SuppressWarnings("deprecation")
+    void fatal(Supplier<?> messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#FATAL FATAL} level) including the
-     * stack trace of the {@link Throwable} <code>t</code> passed as parameter.
+     * stack trace of the {@link Throwable} <code>throwable</code> passed as parameter.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      * @since 2.4
      */
-    void fatal(Supplier<?> msgSupplier, Throwable t);
+    @SuppressWarnings("deprecation")
+    void fatal(Supplier<?> messageSupplier, Throwable throwable);
 
     /**
      * Logs a message with parameters at fatal level.
@@ -1682,7 +1702,12 @@ public interface Logger {
     /**
      * Gets the message factory used to convert message Objects and Strings/CharSequences into actual log Messages.
      *
-     * @param <MF> The type of the MessageFactory.
+     * Since version 2.6, Log4j internally uses message factories that implement the {@link MessageFactory} interface.
+     * From version 2.6.2, the return type of this method was changed from {@link MessageFactory} to
+     * {@code <MF extends MessageFactory> MF}. The returned factory will always implement {@link MessageFactory},
+     * but the return type of this method could not be changed to {@link MessageFactory} without breaking binary
+     * compatibility.
+     *
      * @return the message factory, as an instance of {@link MessageFactory}
      */
     <MF extends MessageFactory> MF getMessageFactory();
@@ -1706,18 +1731,18 @@ public interface Logger {
      * Logs a message with the specific Marker at the {@link Level#INFO INFO} level.
      *
      * @param marker the marker data specific to this log statement
-     * @param msg the message string to be logged
+     * @param message the message string to be logged
      */
-    void info(Marker marker, Message msg);
+    void info(Marker marker, Message message);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#INFO INFO} level.
      *
      * @param marker the marker data specific to this log statement
-     * @param msg the message string to be logged
-     * @param t A Throwable or null.
+     * @param message the message string to be logged
+     * @param throwable A Throwable or null.
      */
-    void info(Marker marker, Message msg, Throwable t);
+    void info(Marker marker, Message message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#INFO INFO} level with the
@@ -1725,22 +1750,22 @@ public interface Logger {
      * {@code Message}.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message.
+     * @param messageSupplier A function, which when called, produces the desired log message.
      * @since 2.4
      */
-    void info(Marker marker, MessageSupplier msgSupplier);
+    void info(Marker marker, MessageSupplier messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#INFO INFO} level) with the
-     * specified Marker and including the stack trace of the {@link Throwable} <code>t</code> passed as parameter. The
+     * specified Marker and including the stack trace of the {@link Throwable} <code>throwable</code> passed as parameter. The
      * {@code MessageSupplier} may or may not use the {@link MessageFactory} to construct the {@code Message}.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message.
-     * @param t A Throwable or null.
+     * @param messageSupplier A function, which when called, produces the desired log message.
+     * @param throwable A Throwable or null.
      * @since 2.4
      */
-    void info(Marker marker, MessageSupplier msgSupplier, Throwable t);
+    void info(Marker marker, MessageSupplier messageSupplier, Throwable throwable);
 
     /**
      * Logs a message CharSequence with the {@link Level#INFO INFO} level.
@@ -1752,13 +1777,13 @@ public interface Logger {
 
     /**
      * Logs a CharSequence at the {@link Level#INFO INFO} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement
      * @param message the message CharSequence to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void info(Marker marker, CharSequence message, Throwable t);
+    void info(Marker marker, CharSequence message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#INFO INFO} level.
@@ -1770,13 +1795,13 @@ public interface Logger {
 
     /**
      * Logs a message at the {@link Level#INFO INFO} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void info(Marker marker, Object message, Throwable t);
+    void info(Marker marker, Object message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#INFO INFO} level.
@@ -1805,75 +1830,78 @@ public interface Logger {
      * @param paramSuppliers An array of functions, which when called, produce the desired log message parameters.
      * @since 2.4
      */
+    @SuppressWarnings("deprecation")
     void info(Marker marker, String message, Supplier<?>... paramSuppliers);
 
     /**
      * Logs a message at the {@link Level#INFO INFO} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void info(Marker marker, String message, Throwable t);
+    void info(Marker marker, String message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#INFO INFO} level with the
      * specified Marker.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
      * @since 2.4
      */
-    void info(Marker marker, Supplier<?> msgSupplier);
+    @SuppressWarnings("deprecation")
+    void info(Marker marker, Supplier<?> messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#INFO INFO} level) with the
-     * specified Marker and including the stack trace of the {@link Throwable} <code>t</code> passed as parameter.
+     * specified Marker and including the stack trace of the {@link Throwable} <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
-     * @param t A Throwable or null.
+     * @param throwable A Throwable or null.
      * @since 2.4
      */
-    void info(Marker marker, Supplier<?> msgSupplier, Throwable t);
+    @SuppressWarnings("deprecation")
+    void info(Marker marker, Supplier<?> messageSupplier, Throwable throwable);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#INFO INFO} level.
      *
-     * @param msg the message string to be logged
+     * @param message the message string to be logged
      */
-    void info(Message msg);
+    void info(Message message);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#INFO INFO} level.
      *
-     * @param msg the message string to be logged
-     * @param t A Throwable or null.
+     * @param message the message string to be logged
+     * @param throwable A Throwable or null.
      */
-    void info(Message msg, Throwable t);
+    void info(Message message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#INFO INFO} level. The
      * {@code MessageSupplier} may or may not use the {@link MessageFactory} to construct the {@code Message}.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message.
+     * @param messageSupplier A function, which when called, produces the desired log message.
      * @since 2.4
      */
-    void info(MessageSupplier msgSupplier);
+    void info(MessageSupplier messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#INFO INFO} level) including the
-     * stack trace of the {@link Throwable} <code>t</code> passed as parameter. The {@code MessageSupplier} may or may
+     * stack trace of the {@link Throwable} <code>throwable</code> passed as parameter. The {@code MessageSupplier} may or may
      * not use the {@link MessageFactory} to construct the {@code Message}.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message.
-     * @param t the exception to log, including its stack trace.
+     * @param messageSupplier A function, which when called, produces the desired log message.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      * @since 2.4
      */
-    void info(MessageSupplier msgSupplier, Throwable t);
+    void info(MessageSupplier messageSupplier, Throwable throwable);
 
     /**
      * Logs a message CharSequence with the {@link Level#INFO INFO} level.
@@ -1884,12 +1912,12 @@ public interface Logger {
 
     /**
      * Logs a CharSequence at the {@link Level#INFO INFO} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param message the message CharSequence to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void info(CharSequence message, Throwable t);
+    void info(CharSequence message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#INFO INFO} level.
@@ -1900,12 +1928,12 @@ public interface Logger {
 
     /**
      * Logs a message at the {@link Level#INFO INFO} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void info(Object message, Throwable t);
+    void info(Object message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#INFO INFO} level.
@@ -1931,36 +1959,39 @@ public interface Logger {
      * @param paramSuppliers An array of functions, which when called, produce the desired log message parameters.
      * @since 2.4
      */
+    @SuppressWarnings("deprecation")
     void info(String message, Supplier<?>... paramSuppliers);
 
     /**
      * Logs a message at the {@link Level#INFO INFO} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void info(String message, Throwable t);
+    void info(String message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#INFO INFO} level.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
      * @since 2.4
      */
-    void info(Supplier<?> msgSupplier);
+    @SuppressWarnings("deprecation")
+    void info(Supplier<?> messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#INFO INFO} level) including the
-     * stack trace of the {@link Throwable} <code>t</code> passed as parameter.
+     * stack trace of the {@link Throwable} <code>throwable</code> passed as parameter.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      * @since 2.4
      */
-    void info(Supplier<?> msgSupplier, Throwable t);
+    @SuppressWarnings("deprecation")
+    void info(Supplier<?> messageSupplier, Throwable throwable);
 
     /**
      * Logs a message with parameters at info level.
@@ -2349,19 +2380,19 @@ public interface Logger {
      *
      * @param level the logging level
      * @param marker the marker data specific to this log statement
-     * @param msg the message string to be logged
+     * @param message the message string to be logged
      */
-    void log(Level level, Marker marker, Message msg);
+    void log(Level level, Marker marker, Message message);
 
     /**
      * Logs a message with the specific Marker at the given level.
      *
      * @param level the logging level
      * @param marker the marker data specific to this log statement
-     * @param msg the message string to be logged
-     * @param t A Throwable or null.
+     * @param message the message string to be logged
+     * @param throwable A Throwable or null.
      */
-    void log(Level level, Marker marker, Message msg, Throwable t);
+    void log(Level level, Marker marker, Message message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the specified level with the specified
@@ -2370,23 +2401,23 @@ public interface Logger {
      *
      * @param level the logging level
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message.
+     * @param messageSupplier A function, which when called, produces the desired log message.
      * @since 2.4
      */
-    void log(Level level, Marker marker, MessageSupplier msgSupplier);
+    void log(Level level, Marker marker, MessageSupplier messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the specified level) with the specified Marker and
-     * including the stack log of the {@link Throwable} <code>t</code> passed as parameter. The {@code MessageSupplier}
+     * including the stack log of the {@link Throwable} <code>throwable</code> passed as parameter. The {@code MessageSupplier}
      * may or may not use the {@link MessageFactory} to construct the {@code Message}.
      *
      * @param level the logging level
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message.
-     * @param t A Throwable or null.
+     * @param messageSupplier A function, which when called, produces the desired log message.
+     * @param throwable A Throwable or null.
      * @since 2.4
      */
-    void log(Level level, Marker marker, MessageSupplier msgSupplier, Throwable t);
+    void log(Level level, Marker marker, MessageSupplier messageSupplier, Throwable throwable);
 
     /**
      * Logs a message CharSequence with the given level.
@@ -2398,15 +2429,15 @@ public interface Logger {
     void log(Level level, Marker marker, CharSequence message);
 
     /**
-     * Logs a CharSequence at the given level including the stack trace of the {@link Throwable} <code>t</code> passed as
+     * Logs a CharSequence at the given level including the stack trace of the {@link Throwable} <code>throwable</code> passed as
      * parameter.
      *
      * @param level the logging level
      * @param marker the marker data specific to this log statement
      * @param message the message CharSequence to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void log(Level level, Marker marker, CharSequence message, Throwable t);
+    void log(Level level, Marker marker, CharSequence message, Throwable throwable);
 
     /**
      * Logs a message object with the given level.
@@ -2418,15 +2449,15 @@ public interface Logger {
     void log(Level level, Marker marker, Object message);
 
     /**
-     * Logs a message at the given level including the stack trace of the {@link Throwable} <code>t</code> passed as
+     * Logs a message at the given level including the stack trace of the {@link Throwable} <code>throwable</code> passed as
      * parameter.
      *
      * @param level the logging level
      * @param marker the marker data specific to this log statement
      * @param message the message to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void log(Level level, Marker marker, Object message, Throwable t);
+    void log(Level level, Marker marker, Object message, Throwable throwable);
 
     /**
      * Logs a message object with the given level.
@@ -2457,81 +2488,84 @@ public interface Logger {
      * @param paramSuppliers An array of functions, which when called, produce the desired log message parameters.
      * @since 2.4
      */
+    @SuppressWarnings("deprecation")
     void log(Level level, Marker marker, String message, Supplier<?>... paramSuppliers);
 
     /**
-     * Logs a message at the given level including the stack trace of the {@link Throwable} <code>t</code> passed as
+     * Logs a message at the given level including the stack trace of the {@link Throwable} <code>throwable</code> passed as
      * parameter.
      *
      * @param level the logging level
      * @param marker the marker data specific to this log statement
      * @param message the message to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void log(Level level, Marker marker, String message, Throwable t);
+    void log(Level level, Marker marker, String message, Throwable throwable);
 
     /**
      * Logs a message (only to be constructed if the logging level is the specified level) with the specified Marker.
      *
      * @param level the logging level
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
      * @since 2.4
      */
-    void log(Level level, Marker marker, Supplier<?> msgSupplier);
+    @SuppressWarnings("deprecation")
+    void log(Level level, Marker marker, Supplier<?> messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the specified level) with the specified Marker and
-     * including the stack log of the {@link Throwable} <code>t</code> passed as parameter.
+     * including the stack log of the {@link Throwable} <code>throwable</code> passed as parameter.
      *
      * @param level the logging level
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
-     * @param t A Throwable or null.
+     * @param throwable A Throwable or null.
      * @since 2.4
      */
-    void log(Level level, Marker marker, Supplier<?> msgSupplier, Throwable t);
+    @SuppressWarnings("deprecation")
+    void log(Level level, Marker marker, Supplier<?> messageSupplier, Throwable throwable);
 
     /**
      * Logs a message with the specific Marker at the given level.
      *
      * @param level the logging level
-     * @param msg the message string to be logged
+     * @param message the message string to be logged
      */
-    void log(Level level, Message msg);
+    void log(Level level, Message message);
 
     /**
      * Logs a message with the specific Marker at the given level.
      *
      * @param level the logging level
-     * @param msg the message string to be logged
-     * @param t A Throwable or null.
+     * @param message the message string to be logged
+     * @param throwable A Throwable or null.
      */
-    void log(Level level, Message msg, Throwable t);
+    void log(Level level, Message message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the specified level. The
      * {@code MessageSupplier} may or may not use the {@link MessageFactory} to construct the {@code Message}.
      *
      * @param level the logging level
-     * @param msgSupplier A function, which when called, produces the desired log message.
+     * @param messageSupplier A function, which when called, produces the desired log message.
      * @since 2.4
      */
-    void log(Level level, MessageSupplier msgSupplier);
+    void log(Level level, MessageSupplier messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the specified level) including the stack log of
-     * the {@link Throwable} <code>t</code> passed as parameter. The {@code MessageSupplier} may or may not use the
+     * the {@link Throwable} <code>throwable</code> passed as parameter. The {@code MessageSupplier} may or may not use the
      * {@link MessageFactory} to construct the {@code Message}.
      *
      * @param level the logging level
-     * @param msgSupplier A function, which when called, produces the desired log message.
-     * @param t the exception to log, including its stack log.
+     * @param messageSupplier A function, which when called, produces the desired log message.
+     * @param throwable the {@code Throwable} to log, including its stack log.
      * @since 2.4
      */
-    void log(Level level, MessageSupplier msgSupplier, Throwable t);
+    void log(Level level, MessageSupplier messageSupplier, Throwable throwable);
 
     /**
      * Logs a message CharSequence with the given level.
@@ -2542,14 +2576,14 @@ public interface Logger {
     void log(Level level, CharSequence message);
 
     /**
-     * Logs a CharSequence at the given level including the stack trace of the {@link Throwable} <code>t</code> passed as
+     * Logs a CharSequence at the given level including the stack trace of the {@link Throwable} <code>throwable</code> passed as
      * parameter.
      *
      * @param level the logging level
      * @param message the message CharSequence to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void log(Level level, CharSequence message, Throwable t);
+    void log(Level level, CharSequence message, Throwable throwable);
 
     /**
      * Logs a message object with the given level.
@@ -2560,14 +2594,14 @@ public interface Logger {
     void log(Level level, Object message);
 
     /**
-     * Logs a message at the given level including the stack trace of the {@link Throwable} <code>t</code> passed as
+     * Logs a message at the given level including the stack trace of the {@link Throwable} <code>throwable</code> passed as
      * parameter.
      *
      * @param level the logging level
      * @param message the message to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void log(Level level, Object message, Throwable t);
+    void log(Level level, Object message, Throwable throwable);
 
     /**
      * Logs a message object with the given level.
@@ -2595,39 +2629,42 @@ public interface Logger {
      * @param paramSuppliers An array of functions, which when called, produce the desired log message parameters.
      * @since 2.4
      */
+    @SuppressWarnings("deprecation")
     void log(Level level, String message, Supplier<?>... paramSuppliers);
 
     /**
-     * Logs a message at the given level including the stack trace of the {@link Throwable} <code>t</code> passed as
+     * Logs a message at the given level including the stack trace of the {@link Throwable} <code>throwable</code> passed as
      * parameter.
      *
      * @param level the logging level
      * @param message the message to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void log(Level level, String message, Throwable t);
+    void log(Level level, String message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the specified level.
      *
      * @param level the logging level
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
      * @since 2.4
      */
-    void log(Level level, Supplier<?> msgSupplier);
+    @SuppressWarnings("deprecation")
+    void log(Level level, Supplier<?> messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the specified level) including the stack log of
-     * the {@link Throwable} <code>t</code> passed as parameter.
+     * the {@link Throwable} <code>throwable</code> passed as parameter.
      *
      * @param level the logging level
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
-     * @param t the exception to log, including its stack log.
+     * @param throwable the {@code Throwable} to log, including its stack log.
      * @since 2.4
      */
-    void log(Level level, Supplier<?> msgSupplier, Throwable t);
+    @SuppressWarnings("deprecation")
+    void log(Level level, Supplier<?> messageSupplier, Throwable throwable);
 
     /**
      * Logs a message with parameters at the specified level.
@@ -2935,7 +2972,7 @@ public interface Logger {
     void printf(Level level, String format, Object... params);
 
     /**
-     * Logs an exception or error to be thrown. This may be coded as:
+     * Logs a {@link Throwable} to be thrown. This may be coded as:
      *
      * <pre>
      * throw logger.throwing(Level.DEBUG, myException);
@@ -2943,40 +2980,41 @@ public interface Logger {
      *
      * @param <T> the Throwable type.
      * @param level The logging Level.
-     * @param t The Throwable.
+     * @param throwable The Throwable.
      * @return the Throwable.
      */
-    <T extends Throwable> T throwing(Level level, T t);
+    <T extends Throwable> T throwing(Level level, T throwable);
 
     /**
-     * Logs an exception or error to be thrown. This may be coded as:
+     * Logs a {@link Throwable} to be thrown at the {@link Level#ERROR ERROR} level.
+     * This may be coded as:
      *
      * <pre>
      * throw logger.throwing(myException);
      * </pre>
      *
      * @param <T> the Throwable type.
-     * @param t The Throwable.
+     * @param throwable The Throwable.
      * @return the Throwable.
      */
-    <T extends Throwable> T throwing(T t);
+    <T extends Throwable> T throwing(T throwable);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#TRACE TRACE} level.
      *
      * @param marker the marker data specific to this log statement
-     * @param msg the message string to be logged
+     * @param message the message string to be logged
      */
-    void trace(Marker marker, Message msg);
+    void trace(Marker marker, Message message);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#TRACE TRACE} level.
      *
      * @param marker the marker data specific to this log statement
-     * @param msg the message string to be logged
-     * @param t A Throwable or null.
+     * @param message the message string to be logged
+     * @param throwable A Throwable or null.
      */
-    void trace(Marker marker, Message msg, Throwable t);
+    void trace(Marker marker, Message message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#TRACE TRACE} level with
@@ -2984,22 +3022,22 @@ public interface Logger {
      * {@code Message}.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message.
+     * @param messageSupplier A function, which when called, produces the desired log message.
      * @since 2.4
      */
-    void trace(Marker marker, MessageSupplier msgSupplier);
+    void trace(Marker marker, MessageSupplier messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#TRACE TRACE} level) with the
-     * specified Marker and including the stack trace of the {@link Throwable} <code>t</code> passed as parameter. The
+     * specified Marker and including the stack trace of the {@link Throwable} <code>throwable</code> passed as parameter. The
      * {@code MessageSupplier} may or may not use the {@link MessageFactory} to construct the {@code Message}.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message.
-     * @param t A Throwable or null.
+     * @param messageSupplier A function, which when called, produces the desired log message.
+     * @param throwable A Throwable or null.
      * @since 2.4
      */
-    void trace(Marker marker, MessageSupplier msgSupplier, Throwable t);
+    void trace(Marker marker, MessageSupplier messageSupplier, Throwable throwable);
 
     /**
      * Logs a message CharSequence with the {@link Level#TRACE TRACE} level.
@@ -3011,14 +3049,14 @@ public interface Logger {
 
     /**
      * Logs a CharSequence at the {@link Level#TRACE TRACE} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement
      * @param message the message CharSequence to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      * @see #debug(String)
      */
-    void trace(Marker marker, CharSequence message, Throwable t);
+    void trace(Marker marker, CharSequence message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#TRACE TRACE} level.
@@ -3030,14 +3068,14 @@ public interface Logger {
 
     /**
      * Logs a message at the {@link Level#TRACE TRACE} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      * @see #debug(String)
      */
-    void trace(Marker marker, Object message, Throwable t);
+    void trace(Marker marker, Object message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#TRACE TRACE} level.
@@ -3066,76 +3104,79 @@ public interface Logger {
      * @param paramSuppliers An array of functions, which when called, produce the desired log message parameters.
      * @since 2.4
      */
+    @SuppressWarnings("deprecation")
     void trace(Marker marker, String message, Supplier<?>... paramSuppliers);
 
     /**
      * Logs a message at the {@link Level#TRACE TRACE} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      * @see #debug(String)
      */
-    void trace(Marker marker, String message, Throwable t);
+    void trace(Marker marker, String message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#TRACE TRACE} level with
      * the specified Marker.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
      * @since 2.4
      */
-    void trace(Marker marker, Supplier<?> msgSupplier);
+    @SuppressWarnings("deprecation")
+    void trace(Marker marker, Supplier<?> messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#TRACE TRACE} level) with the
-     * specified Marker and including the stack trace of the {@link Throwable} <code>t</code> passed as parameter.
+     * specified Marker and including the stack trace of the {@link Throwable} <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
-     * @param t A Throwable or null.
+     * @param throwable A Throwable or null.
      * @since 2.4
      */
-    void trace(Marker marker, Supplier<?> msgSupplier, Throwable t);
+    @SuppressWarnings("deprecation")
+    void trace(Marker marker, Supplier<?> messageSupplier, Throwable throwable);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#TRACE TRACE} level.
      *
-     * @param msg the message string to be logged
+     * @param message the message string to be logged
      */
-    void trace(Message msg);
+    void trace(Message message);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#TRACE TRACE} level.
      *
-     * @param msg the message string to be logged
-     * @param t A Throwable or null.
+     * @param message the message string to be logged
+     * @param throwable A Throwable or null.
      */
-    void trace(Message msg, Throwable t);
+    void trace(Message message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#TRACE TRACE} level. The
      * {@code MessageSupplier} may or may not use the {@link MessageFactory} to construct the {@code Message}.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message.
+     * @param messageSupplier A function, which when called, produces the desired log message.
      * @since 2.4
      */
-    void trace(MessageSupplier msgSupplier);
+    void trace(MessageSupplier messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#TRACE TRACE} level) including the
-     * stack trace of the {@link Throwable} <code>t</code> passed as parameter. The {@code MessageSupplier} may or may
+     * stack trace of the {@link Throwable} <code>throwable</code> passed as parameter. The {@code MessageSupplier} may or may
      * not use the {@link MessageFactory} to construct the {@code Message}.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message.
-     * @param t the exception to log, including its stack trace.
+     * @param messageSupplier A function, which when called, produces the desired log message.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      * @since 2.4
      */
-    void trace(MessageSupplier msgSupplier, Throwable t);
+    void trace(MessageSupplier messageSupplier, Throwable throwable);
 
     /**
      * Logs a message CharSequence with the {@link Level#TRACE TRACE} level.
@@ -3146,13 +3187,13 @@ public interface Logger {
 
     /**
      * Logs a CharSequence at the {@link Level#TRACE TRACE} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param message the message CharSequence to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      * @see #debug(String)
      */
-    void trace(CharSequence message, Throwable t);
+    void trace(CharSequence message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#TRACE TRACE} level.
@@ -3163,13 +3204,13 @@ public interface Logger {
 
     /**
      * Logs a message at the {@link Level#TRACE TRACE} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      * @see #debug(String)
      */
-    void trace(Object message, Throwable t);
+    void trace(Object message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#TRACE TRACE} level.
@@ -3195,37 +3236,40 @@ public interface Logger {
      * @param paramSuppliers An array of functions, which when called, produce the desired log message parameters.
      * @since 2.4
      */
+    @SuppressWarnings("deprecation")
     void trace(String message, Supplier<?>... paramSuppliers);
 
     /**
      * Logs a message at the {@link Level#TRACE TRACE} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      * @see #debug(String)
      */
-    void trace(String message, Throwable t);
+    void trace(String message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#TRACE TRACE} level.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
      * @since 2.4
      */
-    void trace(Supplier<?> msgSupplier);
+    @SuppressWarnings("deprecation")
+    void trace(Supplier<?> messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#TRACE TRACE} level) including the
-     * stack trace of the {@link Throwable} <code>t</code> passed as parameter.
+     * stack trace of the {@link Throwable} <code>throwable</code> passed as parameter.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      * @since 2.4
      */
-    void trace(Supplier<?> msgSupplier, Throwable t);
+    @SuppressWarnings("deprecation")
+    void trace(Supplier<?> messageSupplier, Throwable throwable);
 
     /**
      * Logs a message with parameters at trace level.
@@ -3505,20 +3549,20 @@ public interface Logger {
     /**
      * Logs entry to a method along with its parameters. For example,
      *
-     * <pre><code>
+     * <pre>
      * public void doSomething(String foo, int bar) {
      *     LOGGER.traceEntry("Parameters: {} and {}", foo, bar);
      *     // do something
      * }
-     * </code></pre>
+     * </pre>
      * or:
-     * <pre><code>
+     * <pre>
      * public int doSomething(String foo, int bar) {
      *     Message m = LOGGER.traceEntry("doSomething(foo={}, bar={})", foo, bar);
      *     // do something
      *     return traceExit(m, value);
      * }
-     * </code></pre>
+     * </pre>
      *
      * @param format The format String for the parameters.
      * @param params The parameters to the method.
@@ -3531,33 +3575,30 @@ public interface Logger {
     /**
      * Logs entry to a method along with its parameters. For example,
      *
-     * <pre>
-     * <code>
+     * <pre>{@code
      * public void doSomething(Request foo) {
-     *     LOGGER.traceEntry(()-&gt;gson.toJson(foo));
+     *     LOGGER.traceEntry(()->gson.toJson(foo));
      *     // do something
      * }
-     * </code>
-     * </pre>
+     * }</pre>
      *
      * @param paramSuppliers The Suppliers for the parameters to the method.
      * @return built message
      *
      * @since 2.6
      */
+    @SuppressWarnings("deprecation")
     EntryMessage traceEntry(Supplier<?>... paramSuppliers);
 
     /**
      * Logs entry to a method along with its parameters. For example,
      *
-     * <pre>
-     * <code>
+     * <pre>{@code
      * public void doSomething(String foo, int bar) {
-     *     LOGGER.traceEntry("Parameters: {} and {}", ()-&gt;gson.toJson(foo), ()-&gt; bar);
+     *     LOGGER.traceEntry("Parameters: {} and {}", ()->gson.toJson(foo), ()-> bar);
      *     // do something
      * }
-     * </code>
-     * </pre>
+     * }</pre>
      *
      * @param format The format String for the parameters.
      * @param paramSuppliers The Suppliers for the parameters to the method.
@@ -3565,16 +3606,17 @@ public interface Logger {
      *
      * @since 2.6
      */
+    @SuppressWarnings("deprecation")
     EntryMessage traceEntry(String format, Supplier<?>... paramSuppliers);
 
     /**
      * Logs entry to a method using a Message to describe the parameters.
-     * <pre><code>
+     * <pre>
      * public void doSomething(Request foo) {
      *     LOGGER.traceEntry(new JsonMessage(foo));
      *     // do something
      * }
-     * </code></pre>
+     * </pre>
      * <p>
      * Avoid passing a {@code ReusableMessage} to this method (therefore, also avoid passing messages created by
      * calling {@code logger.getMessageFactory().newMessage("some message")}): Log4j will replace such messages with
@@ -3600,9 +3642,9 @@ public interface Logger {
     /**
      * Logs exiting from a method with the result. This may be coded as:
      *
-     * <pre><code>
+     * <pre>
      * return LOGGER.traceExit(myResult);
-     * </code></pre>
+     * </pre>
      *
      * @param <R> The type of the parameter and object being returned.
      * @param result The result being returned from the method call.
@@ -3615,9 +3657,9 @@ public interface Logger {
     /**
      * Logs exiting from a method with the result. This may be coded as:
      *
-     * <pre><code>
+     * <pre>
      * return LOGGER.traceExit("Result: {}", myResult);
-     * </code></pre>
+     * </pre>
      *
      * @param <R> The type of the parameter and object being returned.
      * @param format The format String for the result.
@@ -3631,13 +3673,13 @@ public interface Logger {
     /**
      * Logs exiting from a method with no result. Allows custom formatting of the result. This may be coded as:
      *
-     * <pre><code>
+     * <pre>
      * public long doSomething(int a, int b) {
      *    EntryMessage m = traceEntry("doSomething(a={}, b={})", a, b);
      *    // ...
      *    return LOGGER.traceExit(m);
      * }
-     * </code></pre>
+     * </pre>
      * @param message The Message containing the formatted result.
      *
      * @since 2.6
@@ -3647,13 +3689,13 @@ public interface Logger {
     /**
      * Logs exiting from a method with the result. Allows custom formatting of the result. This may be coded as:
      *
-     * <pre><code>
+     * <pre>
      * public long doSomething(int a, int b) {
      *    EntryMessage m = traceEntry("doSomething(a={}, b={})", a, b);
      *    // ...
      *    return LOGGER.traceExit(m, myResult);
      * }
-     * </code></pre>
+     * </pre>
      * @param message The Message containing the formatted result.
      * @param result The result being returned from the method call.
      *
@@ -3667,9 +3709,9 @@ public interface Logger {
     /**
      * Logs exiting from a method with the result. Allows custom formatting of the result. This may be coded as:
      *
-     * <pre><code>
+     * <pre>
      * return LOGGER.traceExit(new JsonMessage(myResult), myResult);
-     * </code></pre>
+     * </pre>
      * @param message The Message containing the formatted result.
      * @param result The result being returned from the method call.
      *
@@ -3684,18 +3726,18 @@ public interface Logger {
      * Logs a message with the specific Marker at the {@link Level#WARN WARN} level.
      *
      * @param marker the marker data specific to this log statement
-     * @param msg the message string to be logged
+     * @param message the message string to be logged
      */
-    void warn(Marker marker, Message msg);
+    void warn(Marker marker, Message message);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#WARN WARN} level.
      *
      * @param marker the marker data specific to this log statement
-     * @param msg the message string to be logged
-     * @param t A Throwable or null.
+     * @param message the message string to be logged
+     * @param throwable A Throwable or null.
      */
-    void warn(Marker marker, Message msg, Throwable t);
+    void warn(Marker marker, Message message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#WARN WARN} level with the
@@ -3703,22 +3745,22 @@ public interface Logger {
      * {@code Message}.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message.
+     * @param messageSupplier A function, which when called, produces the desired log message.
      * @since 2.4
      */
-    void warn(Marker marker, MessageSupplier msgSupplier);
+    void warn(Marker marker, MessageSupplier messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#WARN WARN} level) with the
-     * specified Marker and including the stack warn of the {@link Throwable} <code>t</code> passed as parameter. The
+     * specified Marker and including the stack warn of the {@link Throwable} <code>throwable</code> passed as parameter. The
      * {@code MessageSupplier} may or may not use the {@link MessageFactory} to construct the {@code Message}.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message.
-     * @param t A Throwable or null.
+     * @param messageSupplier A function, which when called, produces the desired log message.
+     * @param throwable A Throwable or null.
      * @since 2.4
      */
-    void warn(Marker marker, MessageSupplier msgSupplier, Throwable t);
+    void warn(Marker marker, MessageSupplier messageSupplier, Throwable throwable);
 
     /**
      * Logs a message CharSequence with the {@link Level#WARN WARN} level.
@@ -3730,13 +3772,13 @@ public interface Logger {
 
     /**
      * Logs a CharSequence at the {@link Level#WARN WARN} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement
      * @param message the message CharSequence to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void warn(Marker marker, CharSequence message, Throwable t);
+    void warn(Marker marker, CharSequence message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#WARN WARN} level.
@@ -3748,13 +3790,13 @@ public interface Logger {
 
     /**
      * Logs a message at the {@link Level#WARN WARN} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void warn(Marker marker, Object message, Throwable t);
+    void warn(Marker marker, Object message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#WARN WARN} level.
@@ -3783,75 +3825,78 @@ public interface Logger {
      * @param paramSuppliers An array of functions, which when called, produce the desired log message parameters.
      * @since 2.4
      */
+    @SuppressWarnings("deprecation")
     void warn(Marker marker, String message, Supplier<?>... paramSuppliers);
 
     /**
      * Logs a message at the {@link Level#WARN WARN} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void warn(Marker marker, String message, Throwable t);
+    void warn(Marker marker, String message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#WARN WARN} level with the
      * specified Marker.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
      * @since 2.4
      */
-    void warn(Marker marker, Supplier<?> msgSupplier);
+    @SuppressWarnings("deprecation")
+    void warn(Marker marker, Supplier<?> messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#WARN WARN} level) with the
-     * specified Marker and including the stack warn of the {@link Throwable} <code>t</code> passed as parameter.
+     * specified Marker and including the stack warn of the {@link Throwable} <code>throwable</code> passed as parameter.
      *
      * @param marker the marker data specific to this log statement
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
-     * @param t A Throwable or null.
+     * @param throwable A Throwable or null.
      * @since 2.4
      */
-    void warn(Marker marker, Supplier<?> msgSupplier, Throwable t);
+    @SuppressWarnings("deprecation")
+    void warn(Marker marker, Supplier<?> messageSupplier, Throwable throwable);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#WARN WARN} level.
      *
-     * @param msg the message string to be logged
+     * @param message the message string to be logged
      */
-    void warn(Message msg);
+    void warn(Message message);
 
     /**
      * Logs a message with the specific Marker at the {@link Level#WARN WARN} level.
      *
-     * @param msg the message string to be logged
-     * @param t A Throwable or null.
+     * @param message the message string to be logged
+     * @param throwable A Throwable or null.
      */
-    void warn(Message msg, Throwable t);
+    void warn(Message message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#WARN WARN} level. The
      * {@code MessageSupplier} may or may not use the {@link MessageFactory} to construct the {@code Message}.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message.
+     * @param messageSupplier A function, which when called, produces the desired log message.
      * @since 2.4
      */
-    void warn(MessageSupplier msgSupplier);
+    void warn(MessageSupplier messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#WARN WARN} level) including the
-     * stack warn of the {@link Throwable} <code>t</code> passed as parameter. The {@code MessageSupplier} may or may
+     * stack warn of the {@link Throwable} <code>throwable</code> passed as parameter. The {@code MessageSupplier} may or may
      * not use the {@link MessageFactory} to construct the {@code Message}.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message.
-     * @param t the exception to log, including its stack warn.
+     * @param messageSupplier A function, which when called, produces the desired log message.
+     * @param throwable the {@code Throwable} to log, including its stack warn.
      * @since 2.4
      */
-    void warn(MessageSupplier msgSupplier, Throwable t);
+    void warn(MessageSupplier messageSupplier, Throwable throwable);
 
     /**
      * Logs a message CharSequence with the {@link Level#WARN WARN} level.
@@ -3862,12 +3907,12 @@ public interface Logger {
 
     /**
      * Logs a CharSequence at the {@link Level#WARN WARN} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param message the message CharSequence to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void warn(CharSequence message, Throwable t);
+    void warn(CharSequence message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#WARN WARN} level.
@@ -3878,12 +3923,12 @@ public interface Logger {
 
     /**
      * Logs a message at the {@link Level#WARN WARN} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void warn(Object message, Throwable t);
+    void warn(Object message, Throwable throwable);
 
     /**
      * Logs a message object with the {@link Level#WARN WARN} level.
@@ -3909,36 +3954,39 @@ public interface Logger {
      * @param paramSuppliers An array of functions, which when called, produce the desired log message parameters.
      * @since 2.4
      */
+    @SuppressWarnings("deprecation")
     void warn(String message, Supplier<?>... paramSuppliers);
 
     /**
      * Logs a message at the {@link Level#WARN WARN} level including the stack trace of the {@link Throwable}
-     * <code>t</code> passed as parameter.
+     * <code>throwable</code> passed as parameter.
      *
      * @param message the message object to log.
-     * @param t the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      */
-    void warn(String message, Throwable t);
+    void warn(String message, Throwable throwable);
 
     /**
      * Logs a message which is only to be constructed if the logging level is the {@link Level#WARN WARN} level.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
      * @since 2.4
      */
-    void warn(Supplier<?> msgSupplier);
+    @SuppressWarnings("deprecation")
+    void warn(Supplier<?> messageSupplier);
 
     /**
      * Logs a message (only to be constructed if the logging level is the {@link Level#WARN WARN} level) including the
-     * stack warn of the {@link Throwable} <code>t</code> passed as parameter.
+     * stack warn of the {@link Throwable} <code>throwable</code> passed as parameter.
      *
-     * @param msgSupplier A function, which when called, produces the desired log message; the format depends on the
+     * @param messageSupplier A function, which when called, produces the desired log message; the format depends on the
      *            message factory.
-     * @param t the exception to log, including its stack warn.
+     * @param throwable the {@code Throwable} to log, including its stack warn.
      * @since 2.4
      */
-    void warn(Supplier<?> msgSupplier, Throwable t);
+    @SuppressWarnings("deprecation")
+    void warn(Supplier<?> messageSupplier, Throwable throwable);
 
     /**
      * Logs a message with parameters at warn level.
@@ -4214,12 +4262,12 @@ public interface Logger {
      *            method when location information needs to be logged.
      * @param location The location of the caller.
      * @param message The message format.
-     * @param throwable the exception to log, including its stack trace.
+     * @param throwable the {@code Throwable} to log, including its stack trace.
      * @since 2.13.0
      */
-    default void logMessage(final Level level, final Marker marker, final String fqcn, final StackTraceElement location, final Message message,
-                            final Throwable throwable) {
-
+    default void logMessage(Level level, Marker marker, String fqcn, StackTraceElement location, Message message,
+        Throwable throwable) {
+        // noop
     }
 
     /**
@@ -4230,6 +4278,7 @@ public interface Logger {
     default LogBuilder atTrace() {
         return LogBuilder.NOOP;
     }
+
     /**
      * Construct a trace log event.
      * @return a LogBuilder.
@@ -4238,6 +4287,7 @@ public interface Logger {
     default LogBuilder atDebug() {
         return LogBuilder.NOOP;
     }
+
     /**
      * Construct a trace log event.
      * @return a LogBuilder.
@@ -4246,6 +4296,7 @@ public interface Logger {
     default LogBuilder atInfo() {
         return LogBuilder.NOOP;
     }
+
     /**
      * Construct a trace log event.
      * @return a LogBuilder.
@@ -4254,6 +4305,7 @@ public interface Logger {
     default LogBuilder atWarn() {
         return LogBuilder.NOOP;
     }
+
     /**
      * Construct a trace log event.
      * @return a LogBuilder.
@@ -4262,6 +4314,7 @@ public interface Logger {
     default LogBuilder atError() {
         return LogBuilder.NOOP;
     }
+
     /**
      * Construct a trace log event.
      * @return a LogBuilder.
@@ -4270,6 +4323,7 @@ public interface Logger {
     default LogBuilder atFatal() {
         return LogBuilder.NOOP;
     }
+
     /**
      * Construct a log event that will always be logged.
      * @return a LogBuilder.
@@ -4278,13 +4332,14 @@ public interface Logger {
     default LogBuilder always() {
         return LogBuilder.NOOP;
     }
+
     /**
      * Construct a log event.
-     * @param level The Logging Level.
+     * @param level Any level (ignoreed here).
      * @return a LogBuilder.
      * @since 2.13.0
      */
-    default LogBuilder atLevel(final Level level) {
+    default LogBuilder atLevel(Level level) {
         return LogBuilder.NOOP;
     }
 
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/internal/DefaultLogBuilder.java b/log4j-api/src/main/java/org/apache/logging/log4j/internal/DefaultLogBuilder.java
index f7a19f7fe0..ff79e165a7 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/internal/DefaultLogBuilder.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/internal/DefaultLogBuilder.java
@@ -106,6 +106,7 @@ public class DefaultLogBuilder implements BridgeAware, LogBuilder, RecyclerAware
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public Message logAndGet(final Supplier<Message> messageSupplier) {
         Message message = null;
         if (isEnabled(message = messageSupplier.get())) {
@@ -136,7 +137,8 @@ public class DefaultLogBuilder implements BridgeAware, LogBuilder, RecyclerAware
     }
 
     @Override
-    public void log(final String message, final Supplier<?>... params) {
+    @SuppressWarnings("deprecation")
+    public void log(String message, Supplier<?>... params) {
         final Object[] objs;
         if (isEnabled(message, objs = LambdaUtil.getAll(params))) {
             logMessage(logger.getMessageFactory().newMessage(message, objs));
@@ -144,6 +146,7 @@ public class DefaultLogBuilder implements BridgeAware, LogBuilder, RecyclerAware
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void log(final Supplier<Message> messageSupplier) {
         logAndGet(messageSupplier);
     }
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/BasicThreadInformation.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/BasicThreadInformation.java
index 5aa59b841f..26dfbed302 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/BasicThreadInformation.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/BasicThreadInformation.java
@@ -27,10 +27,8 @@ class BasicThreadInformation implements ThreadInformation {
     private static final int HASH_MULTIPLIER = 31;
     private final long id;
     private final String name;
-    private final String longName;
     private final Thread.State state;
     private final int priority;
-    private final boolean isAlive;
     private final boolean isDaemon;
     private final String threadGroupName;
 
@@ -41,10 +39,10 @@ class BasicThreadInformation implements ThreadInformation {
     BasicThreadInformation(final Thread thread) {
         this.id = thread.getId();
         this.name = thread.getName();
-        this.longName = thread.toString();
+
         this.state = thread.getState();
         this.priority = thread.getPriority();
-        this.isAlive = thread.isAlive();
+
         this.isDaemon = thread.isDaemon();
         final ThreadGroup group = thread.getThreadGroup();
         threadGroupName = group == null ? null : group.getName();
@@ -55,7 +53,7 @@ class BasicThreadInformation implements ThreadInformation {
         if (this == o) {
             return true;
         }
-        if (o == null || getClass() != o.getClass()) {
+        if (!(o instanceof BasicThreadInformation)) {
             return false;
         }
 
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/FormattedMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/FormattedMessage.java
index a63b2c3605..bae8f67072 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/FormattedMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/FormattedMessage.java
@@ -130,6 +130,20 @@ public class FormattedMessage implements Message {
         this.throwable = throwable;
     }
 
+
+    @Override
+    public boolean equals(final Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (!(o instanceof FormattedMessage)) {
+            return false;
+        }
+
+        final FormattedMessage that = (FormattedMessage) o;
+        return Objects.equals(messagePattern, that.messagePattern) && Arrays.equals(argArray, that.argArray);
+    }
+
     /**
      * Gets the message pattern.
      * @return the message pattern.
@@ -194,14 +208,6 @@ public class FormattedMessage implements Message {
         return message.getThrowable();
     }
 
-    @Override
-    public boolean equals(final Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        final FormattedMessage that = (FormattedMessage) o;
-        return Objects.equals(messagePattern, that.messagePattern) && Arrays.equals(argArray, that.argArray);
-    }
-
     @Override
     public int hashCode() {
         int result = Objects.hash(messagePattern);
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
index 31cdeecd46..0613be3b86 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
@@ -478,8 +478,13 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
 
     @Override
     public boolean equals(final Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
+        if (this == o) {
+            return true;
+        }
+        if (!(o instanceof MapMessage)) {
+            return false;
+        }
+
         final MapMessage<?, ?> that = (MapMessage<?, ?>) o;
         return Objects.equals(data, that.data);
     }
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessageJsonFormatter.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessageJsonFormatter.java
index 4dfa5b9bfa..9f4bac0f75 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessageJsonFormatter.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessageJsonFormatter.java
@@ -268,7 +268,7 @@ enum MapMessageJsonFormatter {;
         } else {
             final long longNumber = number.longValue();
             final double doubleValue = number.doubleValue();
-            if (Double.compare(longNumber, doubleValue) == 0) {
+            if (Double.compare((double) longNumber, doubleValue) == 0) {
                 sb.append(longNumber);
             } else {
                 sb.append(doubleValue);
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessage.java
index 031b7e2f7a..b6235b8135 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessage.java
@@ -26,7 +26,7 @@ import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.status.StatusLogger;
 
 /**
- * Handles messages that consist of a format string conforming to {@link MessageFormat}.
+ * Handles messages that consist of a format string conforming to java.text.MessageFormat.
  */
 public class MessageFormatMessage implements Message {
 
@@ -108,8 +108,13 @@ public class MessageFormatMessage implements Message {
 
     @Override
     public boolean equals(final Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
+        if (this == o) {
+            return true;
+        }
+        if (!(o instanceof MessageFormatMessage)) {
+            return false;
+        }
+
         final MessageFormatMessage that = (MessageFormatMessage) o;
         return Objects.equals(messagePattern, that.messagePattern) && Arrays.equals(parameters, that.parameters);
     }
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java
index 3fc950053a..f6b5315801 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java
@@ -94,7 +94,7 @@ public class ObjectMessage implements Message, StringBuilderFormattable {
         if (this == o) {
             return true;
         }
-        if (o == null || getClass() != o.getClass()) {
+        if (!(o instanceof ObjectMessage)) {
             return false;
         }
 
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java
index 391bee004d..8410707b18 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java
@@ -222,11 +222,15 @@ public class ParameterizedMessage implements Message, StringBuilderFormattable {
     }
 
     @Override
-    public boolean equals(final Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        final ParameterizedMessage that = (ParameterizedMessage) o;
-        return Objects.equals(messagePattern, that.messagePattern) && Arrays.equals(argArray, that.argArray);
+    public boolean equals(final Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (!(object instanceof ParameterizedMessage)) {
+            return false;
+        }
+        final ParameterizedMessage that = (ParameterizedMessage) object;
+        return Objects.equals(pattern, that.pattern) && Arrays.equals(args, that.args);
     }
 
     @Override
@@ -237,10 +241,8 @@ public class ParameterizedMessage implements Message, StringBuilderFormattable {
     }
 
     /**
-     * Counts the number of unescaped placeholders in the given messagePattern.
-     *
-     * @param messagePattern the message pattern to be analyzed.
-     * @return the number of unescaped placeholders.
+     * Returns the number of argument placeholders.
+     * @param pattern the message pattern to be analyzed
      */
     public static int countArgumentPlaceholders(final String messagePattern) {
         return ParameterFormatter.countArgumentPlaceholders(messagePattern);
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableMessageFactory.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableMessageFactory.java
index 8abab0c851..8ed882d350 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableMessageFactory.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableMessageFactory.java
@@ -33,6 +33,7 @@ import org.apache.logging.log4j.util.PerformanceSensitive;
  * @since 2.6
  */
 @PerformanceSensitive("allocation")
+@SuppressWarnings("ThreadLocalUsage")
 public final class ReusableMessageFactory implements MessageFactory {
 
     /**
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java
index 94075aa872..4b8fcb97e6 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java
@@ -86,9 +86,15 @@ public class SimpleMessage implements Message, StringBuilderFormattable, CharSeq
     }
 
     @Override
+    @SuppressWarnings("UndefinedEquals")
     public boolean equals(final Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
+        if (this == o) {
+            return true;
+        }
+        if (!(o instanceof SimpleMessage)) {
+            return false;
+        }
+
         final SimpleMessage that = (SimpleMessage) o;
         return Objects.equals(getFormattedMessage(), that.getFormattedMessage());
     }
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java
index df197e39d2..e61f752799 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java
@@ -118,8 +118,13 @@ public class StringFormattedMessage implements Message {
 
     @Override
     public boolean equals(final Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
+        if (this == o) {
+            return true;
+        }
+        if (!(o instanceof StringFormattedMessage)) {
+            return false;
+        }
+
         final StringFormattedMessage that = (StringFormattedMessage) o;
         return Objects.equals(messagePattern, that.messagePattern) && Arrays.equals(argArray, that.argArray);
     }
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java
index 3e22a3d136..5aa6330cd1 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java
@@ -130,21 +130,6 @@ public class StructuredDataId implements StringBuilderFormattable {
         this(name, enterpriseNumber, required, optional, MAX_LENGTH);
     }
 
-    /**
-     * A Constructor that helps conformance to RFC 5424.
-     *
-     * @param name The name portion of the id.
-     * @param enterpriseNumber The enterprise number.
-     * @param required The list of keys that are required for this id.
-     * @param optional The list of keys that are optional for this id.
-     * @deprecated Use {@link #StructuredDataId(String, String, String[], String[])} instead.
-     */
-    @Deprecated
-    public StructuredDataId(final String name, final int enterpriseNumber, final String[] required,
-                            final String[] optional) {
-        this(name, String.valueOf(enterpriseNumber), required, optional, MAX_LENGTH);
-    }
-
     /**
      * A Constructor that helps conformance to RFC 5424.
      *
@@ -176,23 +161,6 @@ public class StructuredDataId implements StringBuilderFormattable {
         this.optional = optional;
     }
 
-    /**
-     * A Constructor that helps conformance to RFC 5424.
-     *
-     * @param name The name portion of the id.
-     * @param enterpriseNumber The enterprise number.
-     * @param required The list of keys that are required for this id.
-     * @param optional The list of keys that are optional for this id.
-     * @param maxLength The maximum length of the StructuredData Id key.
-     * @since 2.9
-     * @deprecated Use {@link #StructuredDataId(String, String, String[], String[], int)} instead.
-     */
-    @Deprecated
-    public StructuredDataId(final String name, final int enterpriseNumber, final String[] required,
-            final String[] optional, final int maxLength) {
-        this(name, String.valueOf(enterpriseNumber), required, optional, maxLength);
-    }
-
     /**
      * Creates an id using another id to supply default values.
      *
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java
index 60ad5404ff..8d580ec0b6 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java
@@ -413,9 +413,13 @@ public class StructuredDataMessage extends MapMessage<StructuredDataMessage, Str
 
     @Override
     public boolean equals(final Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        if (!super.equals(o)) return false;
+        if (this == o) {
+            return true;
+        }
+        if (!(o instanceof StructuredDataMessage)) {
+            return false;
+        }
+
         final StructuredDataMessage that = (StructuredDataMessage) o;
         return Objects.equals(id, that.id) && Objects.equals(message, that.message) && Objects.equals(type, that.type);
     }
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java b/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
index cfd92255cf..0e72f989d3 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
@@ -16,11 +16,24 @@
  */
 package org.apache.logging.log4j.spi;
 
-import org.apache.logging.log4j.*;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogBuilder;
+import org.apache.logging.log4j.LoggingException;
+import org.apache.logging.log4j.Marker;
+import org.apache.logging.log4j.MarkerManager;
 import org.apache.logging.log4j.internal.DefaultLogBuilder;
-import org.apache.logging.log4j.message.*;
+import org.apache.logging.log4j.message.EntryMessage;
+import org.apache.logging.log4j.message.FlowMessageFactory;
+import org.apache.logging.log4j.message.Message;
+import org.apache.logging.log4j.message.MessageFactory;
+import org.apache.logging.log4j.message.StringFormattedMessage;
 import org.apache.logging.log4j.status.StatusLogger;
-import org.apache.logging.log4j.util.*;
+import org.apache.logging.log4j.util.Cast;
+import org.apache.logging.log4j.util.LambdaUtil;
+import org.apache.logging.log4j.util.MessageSupplier;
+import org.apache.logging.log4j.util.PerformanceSensitive;
+import org.apache.logging.log4j.util.StackLocatorUtil;
+import org.apache.logging.log4j.util.Supplier;
 
 /**
  * Base implementation of a Logger. It is highly recommended that any Logger implementation extend this class.
@@ -268,31 +281,37 @@ public abstract class AbstractLogger implements ExtendedLogger {
     }
 
     @Override
-    public void debug(final Supplier<?> msgSupplier) {
-        logIfEnabled(FQCN, Level.DEBUG, null, msgSupplier, (Throwable) null);
+    @SuppressWarnings("deprecation")
+    public void debug(final Supplier<?> messageSupplier) {
+        logIfEnabled(FQCN, Level.DEBUG, null, messageSupplier, (Throwable) null);
     }
 
     @Override
-    public void debug(final Supplier<?> msgSupplier, final Throwable t) {
-        logIfEnabled(FQCN, Level.DEBUG, null, msgSupplier, t);
+    @SuppressWarnings("deprecation")
+    public void debug(final Supplier<?> messageSupplier, final Throwable throwable) {
+        logIfEnabled(FQCN, Level.DEBUG, null, messageSupplier, throwable);
     }
 
     @Override
-    public void debug(final Marker marker, final Supplier<?> msgSupplier) {
-        logIfEnabled(FQCN, Level.DEBUG, marker, msgSupplier, (Throwable) null);
+    @SuppressWarnings("deprecation")
+    public void debug(final Marker marker, final Supplier<?> messageSupplier) {
+        logIfEnabled(FQCN, Level.DEBUG, marker, messageSupplier, (Throwable) null);
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void debug(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
         logIfEnabled(FQCN, Level.DEBUG, marker, message, paramSuppliers);
     }
 
     @Override
-    public void debug(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
-        logIfEnabled(FQCN, Level.DEBUG, marker, msgSupplier, t);
+    @SuppressWarnings("deprecation")
+    public void debug(final Marker marker, final Supplier<?> messageSupplier, final Throwable throwable) {
+        logIfEnabled(FQCN, Level.DEBUG, marker, messageSupplier, throwable);
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void debug(final String message, final Supplier<?>... paramSuppliers) {
         logIfEnabled(FQCN, Level.DEBUG, null, message, paramSuppliers);
     }
@@ -445,6 +464,7 @@ public abstract class AbstractLogger implements ExtendedLogger {
      * @param paramSuppliers The Suppliers of the parameters.
      * @return The EntryMessage.
      */
+    @SuppressWarnings("deprecation")
     protected EntryMessage enter(final String fqcn, final String format, final Supplier<?>... paramSuppliers) {
         EntryMessage entryMsg = null;
         if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
@@ -493,6 +513,7 @@ public abstract class AbstractLogger implements ExtendedLogger {
      * @param fqcn The fully qualified class name of the <b>caller</b>.
      * @param params The parameters to the method.
      */
+    @SuppressWarnings("deprecation")
     protected void entry(final String fqcn, final Object... params) {
         if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
             if (params == null) {
@@ -516,6 +537,7 @@ public abstract class AbstractLogger implements ExtendedLogger {
         return entryMsg(format, params);
     }
 
+    @SuppressWarnings("deprecation")
     protected EntryMessage entryMsg(final String format, final Supplier<?>... paramSuppliers) {
         return entryMsg(format, LambdaUtil.getAll(paramSuppliers));
     }
@@ -611,31 +633,37 @@ public abstract class AbstractLogger implements ExtendedLogger {
     }
 
     @Override
-    public void error(final Supplier<?> msgSupplier) {
-        logIfEnabled(FQCN, Level.ERROR, null, msgSupplier, (Throwable) null);
+    @SuppressWarnings("deprecation")
+    public void error(final Supplier<?> messageSupplier) {
+        logIfEnabled(FQCN, Level.ERROR, null, messageSupplier, (Throwable) null);
     }
 
     @Override
-    public void error(final Supplier<?> msgSupplier, final Throwable t) {
-        logIfEnabled(FQCN, Level.ERROR, null, msgSupplier, t);
+    @SuppressWarnings("deprecation")
+    public void error(final Supplier<?> messageSupplier, final Throwable throwable) {
+        logIfEnabled(FQCN, Level.ERROR, null, messageSupplier, throwable);
     }
 
     @Override
-    public void error(final Marker marker, final Supplier<?> msgSupplier) {
-        logIfEnabled(FQCN, Level.ERROR, marker, msgSupplier, (Throwable) null);
+    @SuppressWarnings("deprecation")
+    public void error(final Marker marker, final Supplier<?> messageSupplier) {
+        logIfEnabled(FQCN, Level.ERROR, marker, messageSupplier, (Throwable) null);
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void error(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
         logIfEnabled(FQCN, Level.ERROR, marker, message, paramSuppliers);
     }
 
     @Override
-    public void error(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
-        logIfEnabled(FQCN, Level.ERROR, marker, msgSupplier, t);
+    @SuppressWarnings("deprecation")
+    public void error(final Marker marker, final Supplier<?> messageSupplier, final Throwable throwable) {
+        logIfEnabled(FQCN, Level.ERROR, marker, messageSupplier, throwable);
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void error(final String message, final Supplier<?>... paramSuppliers) {
         logIfEnabled(FQCN, Level.ERROR, null, message, paramSuppliers);
     }
@@ -903,31 +931,37 @@ public abstract class AbstractLogger implements ExtendedLogger {
     }
 
     @Override
-    public void fatal(final Supplier<?> msgSupplier) {
-        logIfEnabled(FQCN, Level.FATAL, null, msgSupplier, (Throwable) null);
+    @SuppressWarnings("deprecation")
+    public void fatal(final Supplier<?> messageSupplier) {
+        logIfEnabled(FQCN, Level.FATAL, null, messageSupplier, (Throwable) null);
     }
 
     @Override
-    public void fatal(final Supplier<?> msgSupplier, final Throwable t) {
-        logIfEnabled(FQCN, Level.FATAL, null, msgSupplier, t);
+    @SuppressWarnings("deprecation")
+    public void fatal(final Supplier<?> messageSupplier, final Throwable throwable) {
+        logIfEnabled(FQCN, Level.FATAL, null, messageSupplier, throwable);
     }
 
     @Override
-    public void fatal(final Marker marker, final Supplier<?> msgSupplier) {
-        logIfEnabled(FQCN, Level.FATAL, marker, msgSupplier, (Throwable) null);
+    @SuppressWarnings("deprecation")
+    public void fatal(final Marker marker, final Supplier<?> messageSupplier) {
+        logIfEnabled(FQCN, Level.FATAL, marker, messageSupplier, (Throwable) null);
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void fatal(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
         logIfEnabled(FQCN, Level.FATAL, marker, message, paramSuppliers);
     }
 
     @Override
-    public void fatal(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
-        logIfEnabled(FQCN, Level.FATAL, marker, msgSupplier, t);
+    @SuppressWarnings("deprecation")
+    public void fatal(final Marker marker, final Supplier<?> messageSupplier, final Throwable throwable) {
+        logIfEnabled(FQCN, Level.FATAL, marker, messageSupplier, throwable);
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void fatal(final String message, final Supplier<?>... paramSuppliers) {
         logIfEnabled(FQCN, Level.FATAL, null, message, paramSuppliers);
     }
@@ -1174,31 +1208,37 @@ public abstract class AbstractLogger implements ExtendedLogger {
     }
 
     @Override
-    public void info(final Supplier<?> msgSupplier) {
-        logIfEnabled(FQCN, Level.INFO, null, msgSupplier, (Throwable) null);
+    @SuppressWarnings("deprecation")
+    public void info(final Supplier<?> messageSupplier) {
+        logIfEnabled(FQCN, Level.INFO, null, messageSupplier, (Throwable) null);
     }
 
     @Override
-    public void info(final Supplier<?> msgSupplier, final Throwable t) {
-        logIfEnabled(FQCN, Level.INFO, null, msgSupplier, t);
+    @SuppressWarnings("deprecation")
+    public void info(final Supplier<?> messageSupplier, final Throwable throwable) {
+        logIfEnabled(FQCN, Level.INFO, null, messageSupplier, throwable);
     }
 
     @Override
-    public void info(final Marker marker, final Supplier<?> msgSupplier) {
-        logIfEnabled(FQCN, Level.INFO, marker, msgSupplier, (Throwable) null);
+    @SuppressWarnings("deprecation")
+    public void info(final Marker marker, final Supplier<?> messageSupplier) {
+        logIfEnabled(FQCN, Level.INFO, marker, messageSupplier, (Throwable) null);
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void info(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
         logIfEnabled(FQCN, Level.INFO, marker, message, paramSuppliers);
     }
 
     @Override
-    public void info(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
-        logIfEnabled(FQCN, Level.INFO, marker, msgSupplier, t);
+    @SuppressWarnings("deprecation")
+    public void info(final Marker marker, final Supplier<?> messageSupplier, final Throwable throwable) {
+        logIfEnabled(FQCN, Level.INFO, marker, messageSupplier, throwable);
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void info(final String message, final Supplier<?>... paramSuppliers) {
         logIfEnabled(FQCN, Level.INFO, null, message, paramSuppliers);
     }
@@ -1506,31 +1546,37 @@ public abstract class AbstractLogger implements ExtendedLogger {
     }
 
     @Override
-    public void log(final Level level, final Supplier<?> msgSupplier) {
-        logIfEnabled(FQCN, level, null, msgSupplier, (Throwable) null);
+    @SuppressWarnings("deprecation")
+    public void log(final Level level, final Supplier<?> messageSupplier) {
+        logIfEnabled(FQCN, level, null, messageSupplier, (Throwable) null);
     }
 
     @Override
-    public void log(final Level level, final Supplier<?> msgSupplier, final Throwable t) {
-        logIfEnabled(FQCN, level, null, msgSupplier, t);
+    @SuppressWarnings("deprecation")
+    public void log(final Level level, final Supplier<?> messageSupplier, final Throwable throwable) {
+        logIfEnabled(FQCN, level, null, messageSupplier, throwable);
     }
 
     @Override
-    public void log(final Level level, final Marker marker, final Supplier<?> msgSupplier) {
-        logIfEnabled(FQCN, level, marker, msgSupplier, (Throwable) null);
+    @SuppressWarnings("deprecation")
+    public void log(final Level level, final Marker marker, final Supplier<?> messageSupplier) {
+        logIfEnabled(FQCN, level, marker, messageSupplier, (Throwable) null);
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void log(final Level level, final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
         logIfEnabled(FQCN, level, marker, message, paramSuppliers);
     }
 
     @Override
-    public void log(final Level level, final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
-        logIfEnabled(FQCN, level, marker, msgSupplier, t);
+    @SuppressWarnings("deprecation")
+    public void log(final Level level, final Marker marker, final Supplier<?> messageSupplier, final Throwable throwable) {
+        logIfEnabled(FQCN, level, marker, messageSupplier, throwable);
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void log(final Level level, final String message, final Supplier<?>... paramSuppliers) {
         logIfEnabled(FQCN, level, null, message, paramSuppliers);
     }
@@ -1705,10 +1751,11 @@ public abstract class AbstractLogger implements ExtendedLogger {
     }
 
     @Override
-    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final Supplier<?> msgSupplier,
-            final Throwable t) {
-        if (isEnabled(level, marker, msgSupplier, t)) {
-            logMessage(fqcn, level, marker, msgSupplier, t);
+    @SuppressWarnings("deprecation")
+    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final Supplier<?> messageSupplier,
+            final Throwable throwable) {
+        if (isEnabled(level, marker, messageSupplier, throwable)) {
+            logMessage(fqcn, level, marker, messageSupplier, throwable);
         }
     }
 
@@ -1720,6 +1767,7 @@ public abstract class AbstractLogger implements ExtendedLogger {
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
             final Supplier<?>... paramSuppliers) {
         if (isEnabled(level, marker, message)) {
@@ -1843,10 +1891,14 @@ public abstract class AbstractLogger implements ExtendedLogger {
         logMessageSafely(fqcn, level, marker, message, (t == null && message != null) ? message.getThrowable() : t);
     }
 
-    protected void logMessage(final String fqcn, final Level level, final Marker marker, final Supplier<?> msgSupplier,
-            final Throwable t) {
-        final Message message = LambdaUtil.getMessage(msgSupplier, messageFactory);
-        logMessageSafely(fqcn, level, marker, message, (t == null && message != null) ? message.getThrowable() : t);
+    @SuppressWarnings("deprecation")
+    protected void logMessage(final String fqcn, final Level level, final Marker marker, final Supplier<?> messageSupplier,
+            final Throwable throwable) {
+        final Message message = LambdaUtil.getMessage(messageSupplier, messageFactory);
+        final Throwable effectiveThrowable = (throwable == null && message != null)
+                ? message.getThrowable()
+                : throwable;
+        logMessageSafely(fqcn, level, marker, message, effectiveThrowable);
     }
 
     protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
@@ -1929,6 +1981,7 @@ public abstract class AbstractLogger implements ExtendedLogger {
         logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
     }
 
+    @SuppressWarnings("deprecation")
     protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
             final Supplier<?>... paramSuppliers) {
         final Message msg = messageFactory.newMessage(message, LambdaUtil.getAll(paramSuppliers));
@@ -2188,31 +2241,37 @@ public abstract class AbstractLogger implements ExtendedLogger {
     }
 
     @Override
-    public void trace(final Supplier<?> msgSupplier) {
-        logIfEnabled(FQCN, Level.TRACE, null, msgSupplier, (Throwable) null);
+    @SuppressWarnings("deprecation")
+    public void trace(final Supplier<?> messageSupplier) {
+        logIfEnabled(FQCN, Level.TRACE, null, messageSupplier, (Throwable) null);
     }
 
     @Override
-    public void trace(final Supplier<?> msgSupplier, final Throwable t) {
-        logIfEnabled(FQCN, Level.TRACE, null, msgSupplier, t);
+    @SuppressWarnings("deprecation")
+    public void trace(final Supplier<?> messageSupplier, final Throwable throwable) {
+        logIfEnabled(FQCN, Level.TRACE, null, messageSupplier, throwable);
     }
 
     @Override
-    public void trace(final Marker marker, final Supplier<?> msgSupplier) {
-        logIfEnabled(FQCN, Level.TRACE, marker, msgSupplier, (Throwable) null);
+    @SuppressWarnings("deprecation")
+    public void trace(final Marker marker, final Supplier<?> messageSupplier) {
+        logIfEnabled(FQCN, Level.TRACE, marker, messageSupplier, (Throwable) null);
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void trace(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
         logIfEnabled(FQCN, Level.TRACE, marker, message, paramSuppliers);
     }
 
     @Override
-    public void trace(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
-        logIfEnabled(FQCN, Level.TRACE, marker, msgSupplier, t);
+    @SuppressWarnings("deprecation")
+    public void trace(final Marker marker, final Supplier<?> messageSupplier, final Throwable throwable) {
+        logIfEnabled(FQCN, Level.TRACE, marker, messageSupplier, throwable);
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void trace(final String message, final Supplier<?>... paramSuppliers) {
         logIfEnabled(FQCN, Level.TRACE, null, message, paramSuppliers);
     }
@@ -2363,11 +2422,13 @@ public abstract class AbstractLogger implements ExtendedLogger {
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public EntryMessage traceEntry(final Supplier<?>... paramSuppliers) {
         return enter(FQCN, null, paramSuppliers);
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public EntryMessage traceEntry(final String format, final Supplier<?>... paramSuppliers) {
         return enter(FQCN, format, paramSuppliers);
     }
@@ -2509,31 +2570,37 @@ public abstract class AbstractLogger implements ExtendedLogger {
     }
 
     @Override
-    public void warn(final Supplier<?> msgSupplier) {
-        logIfEnabled(FQCN, Level.WARN, null, msgSupplier, (Throwable) null);
+    @SuppressWarnings("deprecation")
+    public void warn(final Supplier<?> messageSupplier) {
+        logIfEnabled(FQCN, Level.WARN, null, messageSupplier, (Throwable) null);
     }
 
     @Override
-    public void warn(final Supplier<?> msgSupplier, final Throwable t) {
-        logIfEnabled(FQCN, Level.WARN, null, msgSupplier, t);
+    @SuppressWarnings("deprecation")
+    public void warn(final Supplier<?> messageSupplier, final Throwable throwable) {
+        logIfEnabled(FQCN, Level.WARN, null, messageSupplier, throwable);
     }
 
     @Override
-    public void warn(final Marker marker, final Supplier<?> msgSupplier) {
-        logIfEnabled(FQCN, Level.WARN, marker, msgSupplier, (Throwable) null);
+    @SuppressWarnings("deprecation")
+    public void warn(final Marker marker, final Supplier<?> messageSupplier) {
+        logIfEnabled(FQCN, Level.WARN, marker, messageSupplier, (Throwable) null);
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void warn(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
         logIfEnabled(FQCN, Level.WARN, marker, message, paramSuppliers);
     }
 
     @Override
-    public void warn(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
-        logIfEnabled(FQCN, Level.WARN, marker, msgSupplier, t);
+    @SuppressWarnings("deprecation")
+    public void warn(final Marker marker, final Supplier<?> messageSupplier, final Throwable throwable) {
+        logIfEnabled(FQCN, Level.WARN, marker, messageSupplier, throwable);
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void warn(final String message, final Supplier<?>... paramSuppliers) {
         logIfEnabled(FQCN, Level.WARN, null, message, paramSuppliers);
     }
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/spi/ExtendedLogger.java b/log4j-api/src/main/java/org/apache/logging/log4j/spi/ExtendedLogger.java
index 5de4b6d7db..9c78985270 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/spi/ExtendedLogger.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/spi/ExtendedLogger.java
@@ -533,6 +533,7 @@ public interface ExtendedLogger extends Logger {
      * @param message The message format.
      * @param paramSuppliers An array of functions, which when called, produce the desired log message parameters.
      */
+    @SuppressWarnings("deprecation")
     void logIfEnabled(String fqcn, Level level, Marker marker, String message, Supplier<?>... paramSuppliers);
 
     /**
@@ -545,6 +546,7 @@ public interface ExtendedLogger extends Logger {
      * @param msgSupplier A function, which when called, produces the desired log message.
      * @param t the exception to log, including its stack trace.
      */
+    @SuppressWarnings("deprecation")
     void logIfEnabled(String fqcn, Level level, Marker marker, Supplier<?> msgSupplier, Throwable t);
 
 }
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 ad7db2f784..09f9980814 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
@@ -222,8 +222,13 @@ public class Provider {
 
     @Override
     public boolean equals(final Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
+        if (this == o) {
+            return true;
+        }
+        if (!(o instanceof Provider)) {
+            return false;
+        }
+
         final Provider provider = (Provider) o;
         return Objects.equals(priority, provider.priority) &&
                 Objects.equals(className, provider.className) &&
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusData.java b/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusData.java
index 8b83601d72..9f7719380e 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusData.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusData.java
@@ -119,6 +119,7 @@ public class StatusData {
             value = "INFORMATION_EXPOSURE_THROUGH_AN_ERROR_MESSAGE",
             justification = "Log4j prints stacktraces only to logs, which should be private."
     )
+    @SuppressWarnings("DefaultCharset")
     public String getFormattedStatus() {
         final StringBuilder sb = new StringBuilder();
         final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS");
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/Constants.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/Constants.java
index 9c8b7b07da..a8be1c1f4a 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/Constants.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/Constants.java
@@ -109,8 +109,8 @@ public final class Constants {
     }
 
     static int getMajorVersion(final String version) {
-        final String[] parts = version.split("-|\\.");
-        final boolean isJEP223;
+        final String[] parts = version.split("-|\\.", -1);
+        boolean isJEP223;
         try {
             final int token = Integer.parseInt(parts[0]);
             isJEP223 = token != 1;
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/LambdaUtil.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/LambdaUtil.java
index bc036f759e..c5b53493e7 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/LambdaUtil.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/LambdaUtil.java
@@ -37,6 +37,7 @@ public final class LambdaUtil {
      * @return an array containing the results of evaluating the lambda expressions (or {@code null} if the suppliers
      *         array was {@code null}
      */
+    @SuppressWarnings("deprecation")
     public static Object[] getAll(final Supplier<?>... suppliers) {
         if (suppliers == null) {
             return null;
@@ -55,6 +56,7 @@ public final class LambdaUtil {
      * @return the results of evaluating the lambda expression (or {@code null} if the supplier
      *         was {@code null}
      */
+    @SuppressWarnings("deprecation")
     public static Object get(final Supplier<?> supplier) {
         if (supplier == null) {
             return null;
@@ -84,6 +86,7 @@ public final class LambdaUtil {
      * @return the Message resulting from evaluating the lambda expression or the Message created by the factory for
      * supplied values that are not of type Message
      */
+    @SuppressWarnings("deprecation")
     public static Message getMessage(final Supplier<?> supplier, final MessageFactory messageFactory) {
         if (supplier == null) {
             return null;
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 43d3f87c1c..6f73e2d8fc 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
@@ -457,7 +457,7 @@ public final class LoaderUtil {
             if (this == o) {
                 return true;
             }
-            if (o == null || getClass() != o.getClass()) {
+            if (!(o instanceof UrlResource)) {
                 return false;
             }
 
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
index 86a7a34c7c..2cd92fb124 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
@@ -21,7 +21,11 @@ import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
+import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
+import java.time.Duration;
+import java.time.temporal.ChronoUnit;
+import java.time.temporal.TemporalUnit;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Enumeration;
@@ -206,6 +210,102 @@ public class PropertiesUtil implements PropertyEnvironment {
         return environment.hasProperty(name);
     }
 
+    /**
+     * Gets the named property as a boolean value. If the property matches the string {@code "true"} (case-insensitive),
+     * then it is returned as the boolean value {@code true}. Any other non-{@code null} text in the property is
+     * considered {@code false}.
+     *
+     * @param name the name of the property to look up
+     * @return the boolean value of the property or {@code false} if undefined.
+     */
+    public boolean getBooleanProperty(final String name) {
+        return getBooleanProperty(name, false);
+    }
+
+    /**
+     * Gets the named property as a boolean value.
+     *
+     * @param name         the name of the property to look up
+     * @param defaultValue the default value to use if the property is undefined
+     * @return the boolean value of the property or {@code defaultValue} if undefined.
+     */
+    public boolean getBooleanProperty(final String name, final boolean defaultValue) {
+        final String prop = getStringProperty(name);
+        return prop == null ? defaultValue : "true".equalsIgnoreCase(prop);
+    }
+
+    /**
+     * Gets the named property as a boolean value.
+     *
+     * @param name                  the name of the property to look up
+     * @param defaultValueIfAbsent  the default value to use if the property is undefined
+     * @param defaultValueIfPresent the default value to use if the property is defined but not assigned
+     * @return the boolean value of the property or {@code defaultValue} if undefined.
+     */
+    public boolean getBooleanProperty(final String name, final boolean defaultValueIfAbsent,
+                                      final boolean defaultValueIfPresent) {
+        final String prop = getStringProperty(name);
+        return prop == null ? defaultValueIfAbsent
+            : prop.isEmpty() ? defaultValueIfPresent : "true".equalsIgnoreCase(prop);
+    }
+
+    /**
+     * Retrieves a property that may be prefixed by more than one string.
+     * @param prefixes The array of prefixes.
+     * @param key The key to locate.
+     * @param supplier The method to call to derive the default value. If the value is null, null will be returned
+     * if no property is found.
+     * @return The value or null if it is not found.
+     * @since 2.13.0
+     */
+    @SuppressWarnings("deprecation")
+    public Boolean getBooleanProperty(final String[] prefixes, final String key, final Supplier<Boolean> supplier) {
+        for (String prefix : prefixes) {
+            if (hasProperty(prefix + key)) {
+                return getBooleanProperty(prefix + key);
+            }
+        }
+        return supplier != null ? supplier.get() : null;
+    }
+
+    /**
+     * Gets the named property as a Charset value.
+     *
+     * @param name the name of the property to look up
+     * @return the Charset value of the property or {@link Charset#defaultCharset()} if undefined.
+     */
+    public Charset getCharsetProperty(final String name) {
+        return getCharsetProperty(name, Charset.defaultCharset());
+    }
+
+    /**
+     * Gets the named property as a Charset value. If we cannot find the named Charset, see if it is mapped in
+     * file {@code Log4j-charsets.properties} on the class path.
+     *
+     * @param name         the name of the property to look up
+     * @param defaultValue the default value to use if the property is undefined
+     * @return the Charset value of the property or {@code defaultValue} if undefined.
+     */
+    public Charset getCharsetProperty(final String name, final Charset defaultValue) {
+        final String charsetName = getStringProperty(name);
+        if (charsetName == null) {
+            return defaultValue;
+        }
+        if (Charset.isSupported(charsetName)) {
+            return Charset.forName(charsetName);
+        }
+        final ResourceBundle bundle = getCharsetsResourceBundle();
+        if (bundle.containsKey(name)) {
+            final String mapped = bundle.getString(name);
+            if (Charset.isSupported(mapped)) {
+                return Charset.forName(mapped);
+            }
+        }
+        LowLevelLogUtil.log("Unable to get Charset '" + charsetName + "' for property '" + name + "', using default "
+            + defaultValue + " and continuing.");
+        return defaultValue;
+    }
+
     /**
      * Gets the named property as a double.
      *
@@ -219,12 +319,144 @@ public class PropertiesUtil implements PropertyEnvironment {
             try {
                 return Double.parseDouble(prop);
             } catch (final Exception ignored) {
-                return defaultValue;
+                // returns default value
+            }
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Gets the named property as an integer.
+     *
+     * @param name         the name of the property to look up
+     * @param defaultValue the default value to use if the property is undefined
+     * @return the parsed integer value of the property or {@code defaultValue} if it was undefined or could not be
+     * parsed.
+     */
+    public int getIntegerProperty(final String name, final int defaultValue) {
+        final String prop = getStringProperty(name);
+        if (prop != null) {
+            try {
+                return Integer.parseInt(prop.trim());
+            } catch (final Exception ignored) {
+                // ignore
             }
         }
         return defaultValue;
     }
 
+    /**
+     * Retrieves a property that may be prefixed by more than one string.
+     * @param prefixes The array of prefixes.
+     * @param key The key to locate.
+     * @param supplier The method to call to derive the default value. If the value is null, null will be returned
+     * if no property is found.
+     * @return The value or null if it is not found.
+     * @since 2.13.0
+     */
+    @SuppressWarnings("deprecation")
+    public Integer getIntegerProperty(final String[] prefixes, final String key, final Supplier<Integer> supplier) {
+        for (String prefix : prefixes) {
+            if (hasProperty(prefix + key)) {
+                return getIntegerProperty(prefix + key, 0);
+            }
+        }
+        return supplier != null ? supplier.get() : null;
+    }
+
+    /**
+     * Gets the named property as a long.
+     *
+     * @param name         the name of the property to look up
+     * @param defaultValue the default value to use if the property is undefined
+     * @return the parsed long value of the property or {@code defaultValue} if it was undefined or could not be parsed.
+     */
+    public long getLongProperty(final String name, final long defaultValue) {
+        final String prop = getStringProperty(name);
+        if (prop != null) {
+            try {
+                return Long.parseLong(prop);
+            } catch (final Exception ignored) {
+                // returns the default value
+            }
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Retrieves a property that may be prefixed by more than one string.
+     * @param prefixes The array of prefixes.
+     * @param key The key to locate.
+     * @param supplier The method to call to derive the default value. If the value is null, null will be returned
+     * if no property is found.
+     * @return The value or null if it is not found.
+     * @since 2.13.0
+     */
+    @SuppressWarnings("deprecation")
+    public Long getLongProperty(final String[] prefixes, final String key, final Supplier<Long> supplier) {
+        for (String prefix : prefixes) {
+            if (hasProperty(prefix + key)) {
+                return getLongProperty(prefix + key, 0);
+            }
+        }
+        return supplier != null ? supplier.get() : null;
+    }
+
+    /**
+     * Retrieves a Duration where the String is of the format nnn[unit] where nnn represents an integer value
+     * and unit represents a time unit.
+     * @param name The property name.
+     * @param defaultValue The default value.
+     * @return The value of the String as a Duration or the default value, which may be null.
+     * @since 2.13.0
+     */
+    public Duration getDurationProperty(final String name, final Duration defaultValue) {
+        final String prop = getStringProperty(name);
+        if (prop != null) {
+            return TimeUnit.getDuration(prop);
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Retrieves a property that may be prefixed by more than one string.
+     * @param prefixes The array of prefixes.
+     * @param key The key to locate.
+     * @param supplier The method to call to derive the default value. If the value is null, null will be returned
+     * if no property is found.
+     * @return The value or null if it is not found.
+     * @since 2.13.0
+     */
+    @SuppressWarnings("deprecation")
+    public Duration getDurationProperty(final String[] prefixes, final String key, final Supplier<Duration> supplier) {
+        for (String prefix : prefixes) {
+            if (hasProperty(prefix + key)) {
+                return getDurationProperty(prefix + key, null);
+            }
+        }
+        return supplier != null ? supplier.get() : null;
+    }
+
+    /**
+     * Retrieves a property that may be prefixed by more than one string.
+     * @param prefixes The array of prefixes.
+     * @param key The key to locate.
+     * @param supplier The method to call to derive the default value. If the value is null, null will be returned
+     * if no property is found.
+     * @return The value or null if it is not found.
+     * @since 2.13.0
+     */
+    @SuppressWarnings("deprecation")
+    public String getStringProperty(final String[] prefixes, final String key, final Supplier<String> supplier) {
+        for (String prefix : prefixes) {
+            final String result = getStringProperty(prefix + key);
+            if (result != null) {
+                return result;
+            }
+        }
+        return supplier != null ? supplier.get() : null;
+    }
+
     /**
      * Gets the named property as a String.
      *
@@ -634,4 +866,50 @@ public class PropertiesUtil implements PropertyEnvironment {
         }
         return parts;
     }
+
+    /**
+     * Returns true if system properties tell us we are running on Windows.
+     *
+     * @return true if system properties tell us we are running on Windows.
+     */
+    public boolean isOsWindows() {
+        return getStringProperty("os.name", "").startsWith("Windows");
+    }
+
+    private enum TimeUnit {
+        NANOS("ns,nano,nanos,nanosecond,nanoseconds", ChronoUnit.NANOS),
+        MICROS("us,micro,micros,microsecond,microseconds", ChronoUnit.MICROS),
+        MILLIS("ms,milli,millis,millsecond,milliseconds", ChronoUnit.MILLIS),
+        SECONDS("s,second,seconds", ChronoUnit.SECONDS),
+        MINUTES("m,minute,minutes", ChronoUnit.MINUTES),
+        HOURS("h,hour,hours", ChronoUnit.HOURS),
+        DAYS("d,day,days", ChronoUnit.DAYS);
+
+        // descriptions is effectively immutable
+        @SuppressWarnings("ImmutableEnumChecker")
+        private final String[] descriptions;
+        private final ChronoUnit timeUnit;
+
+        TimeUnit(final String descriptions, final ChronoUnit timeUnit) {
+            this.descriptions = descriptions.split(",");
+            this.timeUnit = timeUnit;
+        }
+
+
+
+        static Duration getDuration(final String time) {
+            final String value = time.trim();
+            TemporalUnit temporalUnit = ChronoUnit.MILLIS;
+            long timeVal = 0;
+            for (TimeUnit timeUnit : values()) {
+                for (String suffix : timeUnit.descriptions) {
+                    if (value.endsWith(suffix)) {
+                        temporalUnit = timeUnit.timeUnit;
+                        timeVal = Long.parseLong(value.substring(0, value.length() - suffix.length()));
+                    }
+                }
+            }
+            return Duration.of(timeVal, temporalUnit);
+        }
+    }
 }
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertySource.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertySource.java
index 6af0c05122..8f6b4b434a 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertySource.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertySource.java
@@ -139,10 +139,12 @@ public interface PropertySource {
          * @param value property name
          * @return the property broken into lower case tokens
          */
+        // https://errorprone.info/bugpattern/CollectionUndefinedEquality
+        @SuppressWarnings("CollectionUndefinedEquality")
         public static List<CharSequence> tokenize(final CharSequence value) {
-            final String key = value.toString();
-            if (CACHE.containsKey(key)) {
-                return CACHE.get(key);
+            // `value` should be a `String`
+            if (CACHE.containsKey(value.toString())) {
+                return CACHE.get(value.toString());
             }
             final List<CharSequence> tokens = List.of(key.split("[._/]+"));
             CACHE.put(key, tokens);
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/Supplier.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/Supplier.java
index 960e9f6f2d..e1f6cf4c22 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/Supplier.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/Supplier.java
@@ -31,5 +31,6 @@ package org.apache.logging.log4j.util;
  *
  * @since 2.4
  */
+@Deprecated
 public interface Supplier<T> extends java.util.function.Supplier<T> {
 }
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/Unbox.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/Unbox.java
index d9022a6fef..b12d054bfc 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/Unbox.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/Unbox.java
@@ -64,6 +64,7 @@ public class Unbox {
      * Such memory leaks will not occur if only JDK classes are stored in ThreadLocals.
      * </p>
      */
+    @SuppressWarnings("ThreadLocalUsage")
     private static class WebSafeState {
         private final ThreadLocal<StringBuilder[]> ringBuffer = new ThreadLocal<>();
         private final ThreadLocal<int[]> current = new ThreadLocal<>();
@@ -84,18 +85,6 @@ public class Unbox {
             return result;
         }
 
-        public boolean isBoxedPrimitive(final StringBuilder text) {
-            final StringBuilder[] array = ringBuffer.get();
-            if (array == null) {
-                return false;
-            }
-            for (int i = 0; i < array.length; i++) {
-                if (text == array[i]) {
-                    return true;
-                }
-            }
-            return false;
-        }
     }
 
     private static class State {
@@ -113,14 +102,7 @@ public class Unbox {
             return result;
         }
 
-        public boolean isBoxedPrimitive(final StringBuilder text) {
-            for (int i = 0; i < ringBuffer.length; i++) {
-                if (text == ringBuffer[i]) {
-                    return true;
-                }
-            }
-            return false;
-        }
+
     }
     private static final ThreadLocal<State> threadLocalState = new ThreadLocal<>();
     private static final WebSafeState webSafeState = new WebSafeState();
diff --git a/log4j-core/pom.xml b/log4j-core/pom.xml
index b3903f7cad..cdfb614072 100644
--- a/log4j-core/pom.xml
+++ b/log4j-core/pom.xml
@@ -23,15 +23,11 @@
     <version>${revision}</version>
     <relativePath>../log4j-parent</relativePath>
   </parent>
-
   <artifactId>log4j-core</artifactId>
   <packaging>jar</packaging>
   <name>Apache Log4j Core</name>
   <description>The Apache Log4j Implementation</description>
   <properties>
-    <log4jParentDir>${basedir}/..</log4jParentDir>
-    <docLabel>Core Documentation</docLabel>
-    <projectDir>/core</projectDir>
     <maven.javadoc.skip>false</maven.javadoc.skip>
 
     <!--
@@ -207,6 +203,41 @@
         </configuration>
       </plugin>
 
+      <!-- Remove the following plugin executions after `2.22.0` release!
+     In `2.22.0`, we have removed *unused* `FastDateParser` due to LOG4J2-3672 and #1848.
+     Though `bnd-baseline-m-p` doesn't allow such breaking changes in non-major version upgrades.
+     Hence, we suppress it until `2.22.0` gets released. -->
+      <plugin>
+        <groupId>biz.aQute.bnd</groupId>
+        <artifactId>bnd-baseline-maven-plugin</artifactId>
+        <configuration>
+          <diffpackages>
+            <diffpackage>!org.apache.logging.log4j.core.util.datetime</diffpackage>
+            <diffpackage>*</diffpackage>
+          </diffpackages>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>remove-after-release</id>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+            <configuration>
+              <rules>
+                <requireProperty>
+                  <property>revision</property>
+                  <regex>2\.22\.0(-SNAPSHOT)?</regex>
+                  <regexMessage>Remove `bnd-baseline-maven-plugin` config in `log4j-core`.</regexMessage>
+                </requireProperty>
+              </rules>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 </project>
diff --git a/log4j-parent/pom.xml b/log4j-parent/pom.xml
index 93022ea559..4fb9129835 100644
--- a/log4j-parent/pom.xml
+++ b/log4j-parent/pom.xml
@@ -1128,6 +1128,13 @@
       <scope>provided</scope>
     </dependency>
 
+    <dependency>
+      <groupId>com.google.errorprone</groupId>
+      <artifactId>error_prone_annotations</artifactId>
+      <version>${error-prone.version}</version>
+      <scope>provided</scope>
+    </dependency>
+
     <dependency>
       <groupId>org.osgi</groupId>
       <artifactId>osgi.annotation</artifactId>


(logging-log4j2) 10/11: Use @BaselineIgnore instead of packages exclusions

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit fa0c52828ce7d639737a0a076e13eb743df8b4ec
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Tue Nov 14 13:06:46 2023 +0100

    Use @BaselineIgnore instead of packages exclusions
---
 .../org/apache/logging/log4j/package-info.java     |  2 +-
 log4j-core/pom.xml                                 | 35 ----------------------
 .../log4j/core/util/datetime/package-info.java     |  4 ++-
 3 files changed, 4 insertions(+), 37 deletions(-)

diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/package-info.java b/log4j-api/src/main/java/org/apache/logging/log4j/package-info.java
index d4e6e4f0df..5407f05f61 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/package-info.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/package-info.java
@@ -32,7 +32,7 @@
  * @see <a href="http://logging.apache.org/log4j/2.x/manual/api.html">Log4j 2 API manual</a>
  */
 @Export
-@Version("2.20.1")
+@Version("2.20.2")
 package org.apache.logging.log4j;
 
 import org.osgi.annotation.bundle.Export;
diff --git a/log4j-core/pom.xml b/log4j-core/pom.xml
index d444705e53..ba6f896b71 100644
--- a/log4j-core/pom.xml
+++ b/log4j-core/pom.xml
@@ -184,41 +184,6 @@
         </configuration>
       </plugin>
 
-      <!-- Remove the following plugin executions after `2.22.0` release!
-     In `2.22.0`, we have removed *unused* `FastDateParser` due to LOG4J2-3672 and #1848.
-     Though `bnd-baseline-m-p` doesn't allow such breaking changes in non-major version upgrades.
-     Hence, we suppress it until `2.22.0` gets released. -->
-      <plugin>
-        <groupId>biz.aQute.bnd</groupId>
-        <artifactId>bnd-baseline-maven-plugin</artifactId>
-        <configuration>
-          <diffpackages>
-            <diffpackage>!org.apache.logging.log4j.core.util.datetime</diffpackage>
-            <diffpackage>*</diffpackage>
-          </diffpackages>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-enforcer-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>remove-after-release</id>
-            <goals>
-              <goal>enforce</goal>
-            </goals>
-            <configuration>
-              <rules>
-                <requireProperty>
-                  <property>revision</property>
-                  <regex>2\.22\.0(-SNAPSHOT)?</regex>
-                  <regexMessage>Remove `bnd-baseline-maven-plugin` config in `log4j-core`.</regexMessage>
-                </requireProperty>
-              </rules>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
     </plugins>
   </build>
 </project>
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/package-info.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/package-info.java
index 8c9e3bb49a..dd5eea7461 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/package-info.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/package-info.java
@@ -18,8 +18,10 @@
  * Log4j 2 date formatting classes.
  */
 @Export
-@Version("2.21.0")
+@Version("2.21.1")
+@BaselineIgnore("2.22.0")
 package org.apache.logging.log4j.core.util.datetime;
 
+import aQute.bnd.annotation.baseline.BaselineIgnore;
 import org.osgi.annotation.bundle.Export;
 import org.osgi.annotation.versioning.Version;


(logging-log4j2) 05/11: Factories must be public

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 8192d7f6591c32955ed3445cba3a79e186f2e636
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Mon Nov 13 12:54:37 2023 +0100

    Factories must be public
---
 .../logging/log4j/core/async/AsyncQueueFullPolicyFactoryTest.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/async/AsyncQueueFullPolicyFactoryTest.java b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/async/AsyncQueueFullPolicyFactoryTest.java
index 79851ed91b..a4232e9501 100644
--- a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/async/AsyncQueueFullPolicyFactoryTest.java
+++ b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/async/AsyncQueueFullPolicyFactoryTest.java
@@ -91,7 +91,7 @@ public class AsyncQueueFullPolicyFactoryTest {
         }
     }
 
-    static class CustomRouterDefaultConstructor implements AsyncQueueFullPolicy {
+    public static class CustomRouterDefaultConstructor implements AsyncQueueFullPolicy {
         public CustomRouterDefaultConstructor() {
         }
 
@@ -101,7 +101,7 @@ public class AsyncQueueFullPolicyFactoryTest {
         }
     }
 
-    static class DoesNotImplementInterface {
+    public static class DoesNotImplementInterface {
     }
 
     @Test


(logging-log4j2) 06/11: Replace `getDeclaredConstructor().getInstance()` with `LoaderUtil`

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit d672923719f4f0e076deb06002838df12b9c00bf
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Mon Nov 13 13:13:10 2023 +0100

    Replace `getDeclaredConstructor().getInstance()` with `LoaderUtil`
---
 log4j-core/pom.xml                                    | 19 -------------------
 .../logging/log4j/core/impl/ContextDataFactory.java   | 15 +++++++++------
 .../log4j/core/net/MulticastDnsAdvertiser.java        |  2 +-
 3 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/log4j-core/pom.xml b/log4j-core/pom.xml
index cdfb614072..d444705e53 100644
--- a/log4j-core/pom.xml
+++ b/log4j-core/pom.xml
@@ -162,25 +162,6 @@
   <build>
     <plugins>
 
-      <plugin>
-        <groupId>biz.aQute.bnd</groupId>
-        <artifactId>bnd-baseline-maven-plugin</artifactId>
-        <configuration>
-          <!--
-            ~ These packages are documented as internal and were removed
-            ~ from the public OSGi exports.
-            -->
-          <diffpackages>
-            <diffpackage>!org.apache.logging.log4j.core.layout.internal</diffpackage>
-            <diffpackage>!org.apache.logging.log4j.core.message</diffpackage>
-            <diffpackage>!org.apache.logging.log4j.core.time.internal</diffpackage>
-            <diffpackage>!org.apache.logging.log4j.core.tools.picocli</diffpackage>
-            <diffpackage>!org.apache.logging.log4j.core.util.internal</diffpackage>
-            <diffpackage>*</diffpackage>
-          </diffpackages>
-        </configuration>
-      </plugin>
-
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ContextDataFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ContextDataFactory.java
index f792356743..40af516be1 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ContextDataFactory.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ContextDataFactory.java
@@ -56,8 +56,9 @@ public class ContextDataFactory {
      * In graalvm doc (https://github.com/oracle/graal/blob/master/substratevm/LIMITATIONS.md),
      * graalvm is not support MethodHandle now, so the Constructor need not to return MethodHandle.
      */
-    private static final Constructor<?> DEFAULT_CONSTRUCTOR = createDefaultConstructor(CACHED_CLASS);
-    private static final Constructor<?> INITIAL_CAPACITY_CONSTRUCTOR = createInitialCapacityConstructor(CACHED_CLASS);
+    private static final Constructor<? extends StringMap> DEFAULT_CONSTRUCTOR = createDefaultConstructor(CACHED_CLASS);
+    private static final Constructor<? extends StringMap> INITIAL_CAPACITY_CONSTRUCTOR =
+            createInitialCapacityConstructor(CACHED_CLASS);
 
     private static final StringMap EMPTY_STRING_MAP = createContextData(0);
 
@@ -76,7 +77,8 @@ public class ContextDataFactory {
         }
     }
 
-    private static Constructor<?> createDefaultConstructor(final Class<? extends StringMap> cachedClass){
+    private static Constructor<? extends StringMap> createDefaultConstructor(
+            final Class<? extends StringMap> cachedClass) {
         if (cachedClass == null) {
             return null;
         }
@@ -87,7 +89,8 @@ public class ContextDataFactory {
         }
     }
 
-    private static Constructor<?> createInitialCapacityConstructor(final Class<? extends StringMap> cachedClass){
+    private static Constructor<? extends StringMap> createInitialCapacityConstructor(
+            final Class<? extends StringMap> cachedClass) {
         if (cachedClass == null) {
             return null;
         }
@@ -103,7 +106,7 @@ public class ContextDataFactory {
             return new SortedArrayStringMap();
         }
         try {
-            return (IndexedStringMap) DEFAULT_CONSTRUCTOR.newInstance();
+            return DEFAULT_CONSTRUCTOR.newInstance();
         } catch (final Throwable ignored) {
             return new SortedArrayStringMap();
         }
@@ -114,7 +117,7 @@ public class ContextDataFactory {
             return new SortedArrayStringMap(initialCapacity);
         }
         try {
-            return (IndexedStringMap) INITIAL_CAPACITY_CONSTRUCTOR.newInstance(initialCapacity);
+            return INITIAL_CAPACITY_CONSTRUCTOR.newInstance(initialCapacity);
         } catch (final Throwable ignored) {
             return new SortedArrayStringMap(initialCapacity);
         }
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/MulticastDnsAdvertiser.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/MulticastDnsAdvertiser.java
index b573743c57..37417ff219 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/MulticastDnsAdvertiser.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/MulticastDnsAdvertiser.java
@@ -136,7 +136,7 @@ public class MulticastDnsAdvertiser implements Advertiser {
 
     private static Object createJmDnsVersion1() {
         try {
-            return jmDNSClass.getConstructor().newInstance();
+            return LoaderUtil.newInstanceOf(jmDNSClass);
         } catch (final InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
             LOGGER.warn("Unable to instantiate JMDNS", e);
         }


(logging-log4j2) 11/11: Fix compilation errors and remove deprecated methods

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit b7f2c4cb9c1e35ad5aa555fbac183b4d94de3ea0
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Thu Nov 16 09:20:08 2023 +0100

    Fix compilation errors and remove deprecated methods
---
 .../apache/logging/log4j/message/ParameterizedMessage.java |  2 +-
 .../org/apache/logging/log4j/message/StructuredDataId.java | 14 --------------
 .../java/org/apache/logging/log4j/util/PropertySource.java |  8 +++-----
 .../org/apache/logging/log4j/core/async/DisruptorUtil.java |  5 +++--
 4 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java
index 8410707b18..b6b0b2ff64 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java
@@ -230,7 +230,7 @@ public class ParameterizedMessage implements Message, StringBuilderFormattable {
             return false;
         }
         final ParameterizedMessage that = (ParameterizedMessage) object;
-        return Objects.equals(pattern, that.pattern) && Arrays.equals(args, that.args);
+        return Objects.equals(this.messagePattern, that.messagePattern) && Arrays.equals(this.argArray, that.argArray);
     }
 
     @Override
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java
index cf4c7b49d6..25b391f976 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java
@@ -201,20 +201,6 @@ public class StructuredDataId implements StringBuilderFormattable {
         return new StructuredDataId(id, anEnterpriseNumber, req, opt);
     }
 
-    /**
-     * Creates an id based on the current id.
-     *
-     * @param defaultId The default id to use if this StructuredDataId doesn't have a name.
-     * @param anEnterpriseNumber The enterprise number.
-     * @return a StructuredDataId.
-     * @deprecated Use {@link StructuredDataId#makeId(String, String)} instead
-     */
-    @Deprecated
-    @InlineMe(replacement = "this.makeId(defaultId, String.valueOf(anEnterpriseNumber))")
-    public StructuredDataId makeId(final String defaultId, final int anEnterpriseNumber) {
-        return makeId(defaultId, String.valueOf(anEnterpriseNumber));
-    }
-
     /**
      * Returns a list of required keys.
      *
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertySource.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertySource.java
index 8f6b4b434a..6af0c05122 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertySource.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertySource.java
@@ -139,12 +139,10 @@ public interface PropertySource {
          * @param value property name
          * @return the property broken into lower case tokens
          */
-        // https://errorprone.info/bugpattern/CollectionUndefinedEquality
-        @SuppressWarnings("CollectionUndefinedEquality")
         public static List<CharSequence> tokenize(final CharSequence value) {
-            // `value` should be a `String`
-            if (CACHE.containsKey(value.toString())) {
-                return CACHE.get(value.toString());
+            final String key = value.toString();
+            if (CACHE.containsKey(key)) {
+                return CACHE.get(key);
             }
             final List<CharSequence> tokens = List.of(key.split("[._/]+"));
             CACHE.put(key, tokens);
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java
index 9f3e390221..3fe334aedd 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java
@@ -16,10 +16,11 @@
  */
 package org.apache.logging.log4j.core.async;
 
-import com.lmax.disruptor.ExceptionHandler;
-import com.lmax.disruptor.WaitStrategy;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
+
+import com.lmax.disruptor.ExceptionHandler;
+import com.lmax.disruptor.WaitStrategy;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
 import org.apache.logging.log4j.core.util.Integers;


(logging-log4j2) 09/11: Add default value to `newCheckedInstanceOfProperty`

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 828c1f7c119379e4dbdb831bd88c55eada5db820
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Tue Nov 14 11:34:38 2023 +0100

    Add default value to `newCheckedInstanceOfProperty`
---
 .../org/apache/logging/log4j/util/LoaderUtil.java  |  1 +
 .../logging/log4j/core/async/DisruptorUtil.java    | 31 ++++++++++------------
 .../core/impl/ContextDataInjectorFactory.java      | 12 ++++-----
 3 files changed, 20 insertions(+), 24 deletions(-)

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 ec1299f326..638317a2b5 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
@@ -24,6 +24,7 @@ import java.util.Collection;
 import java.util.Enumeration;
 import java.util.LinkedHashSet;
 import java.util.Objects;
+import java.util.function.Supplier;
 
 import org.apache.logging.log4j.spi.LoggingSystemProperty;
 
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java
index 71c1261f65..9f3e390221 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java
@@ -16,11 +16,10 @@
  */
 package org.apache.logging.log4j.core.async;
 
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-
 import com.lmax.disruptor.ExceptionHandler;
 import com.lmax.disruptor.WaitStrategy;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
 import org.apache.logging.log4j.core.util.Integers;
@@ -29,6 +28,8 @@ import org.apache.logging.log4j.util.LoaderUtil;
 import org.apache.logging.log4j.util.PropertiesUtil;
 import org.apache.logging.log4j.util.PropertyKey;
 
+import static org.apache.logging.log4j.core.impl.Log4jPropertyKey.ASYNC_CONFIG_EXCEPTION_HANDLER_CLASS_NAME;
+import static org.apache.logging.log4j.core.impl.Log4jPropertyKey.ASYNC_LOGGER_EXCEPTION_HANDLER_CLASS_NAME;
 import static org.apache.logging.log4j.util.Constants.isThreadLocalsEnabled;
 
 /**
@@ -84,31 +85,27 @@ final class DisruptorUtil {
     }
 
     static ExceptionHandler<RingBufferLogEvent> getAsyncLoggerExceptionHandler() {
-        ExceptionHandler<RingBufferLogEvent> handler = null;
         try {
-            handler =
-                    LoaderUtil.newCheckedInstanceOfProperty(Log4jPropertyKey.ASYNC_LOGGER_EXCEPTION_HANDLER_CLASS_NAME, ExceptionHandler.class);
+            return LoaderUtil.newCheckedInstanceOfProperty(
+                    ASYNC_LOGGER_EXCEPTION_HANDLER_CLASS_NAME,
+                    ExceptionHandler.class,
+                    AsyncLoggerDefaultExceptionHandler::new);
         } catch (final ReflectiveOperationException e) {
             LOGGER.debug("Invalid AsyncLogger.ExceptionHandler value: {}", e.getMessage(), e);
+            return new AsyncLoggerDefaultExceptionHandler();
         }
-        if (handler != null) {
-            return handler;
-        }
-        return new AsyncLoggerDefaultExceptionHandler();
     }
 
     static ExceptionHandler<AsyncLoggerConfigDisruptor.Log4jEventWrapper> getAsyncLoggerConfigExceptionHandler() {
-        ExceptionHandler<AsyncLoggerConfigDisruptor.Log4jEventWrapper> handler = null;
         try {
-            handler = LoaderUtil.newCheckedInstanceOfProperty(
-                    Log4jPropertyKey.ASYNC_CONFIG_EXCEPTION_HANDLER_CLASS_NAME, ExceptionHandler.class);
+            return LoaderUtil.newCheckedInstanceOfProperty(
+                    ASYNC_CONFIG_EXCEPTION_HANDLER_CLASS_NAME,
+                    ExceptionHandler.class,
+                    AsyncLoggerConfigDefaultExceptionHandler::new);
         } catch (final ReflectiveOperationException e) {
             LOGGER.debug("Invalid AsyncLogger.ExceptionHandler value: {}", e.getMessage(), e);
+            return new AsyncLoggerConfigDefaultExceptionHandler();
         }
-        if (handler != null) {
-            return handler;
-        }
-        return new AsyncLoggerConfigDefaultExceptionHandler();
     }
 
     /**
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ContextDataInjectorFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ContextDataInjectorFactory.java
index ed014d9d52..13e16a8c87 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ContextDataInjectorFactory.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ContextDataInjectorFactory.java
@@ -65,17 +65,15 @@ public class ContextDataInjectorFactory {
      * @see ContextDataInjector
      */
     public static ContextDataInjector createInjector() {
-        ContextDataInjector injector = null;
         try {
-            injector =
-                    LoaderUtil.newCheckedInstanceOfProperty(Log4jPropertyKey.THREAD_CONTEXT_DATA_INJECTOR_CLASS_NAME, ContextDataInjector.class);
+            return LoaderUtil.newCheckedInstanceOfProperty(
+                    Log4jPropertyKey.THREAD_CONTEXT_DATA_INJECTOR_CLASS_NAME,
+                    ContextDataInjector.class,
+                    ContextDataInjectorFactory::createDefaultInjector);
         } catch (final ReflectiveOperationException e) {
             StatusLogger.getLogger().warn("Could not create ContextDataInjector: {}", e.getMessage(), e);
+            return createDefaultInjector();
         }
-        if (injector != null) {
-            return injector;
-        }
-        return createDefaultInjector();
     }
 
     private static ContextDataInjector createDefaultInjector() {


(logging-log4j2) 08/11: Fix code review problems #1961

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 58798fcbc2b858b5cacf8f1acbf6204ec516498e
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Tue Nov 14 11:12:27 2023 +0100

    Fix code review problems #1961
---
 .../main/java/org/apache/logging/log4j/message/StructuredDataId.java   | 1 +
 log4j-api/src/main/java/org/apache/logging/log4j/util/Constants.java   | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java
index 5aa6330cd1..cf4c7b49d6 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java
@@ -210,6 +210,7 @@ public class StructuredDataId implements StringBuilderFormattable {
      * @deprecated Use {@link StructuredDataId#makeId(String, String)} instead
      */
     @Deprecated
+    @InlineMe(replacement = "this.makeId(defaultId, String.valueOf(anEnterpriseNumber))")
     public StructuredDataId makeId(final String defaultId, final int anEnterpriseNumber) {
         return makeId(defaultId, String.valueOf(anEnterpriseNumber));
     }
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/Constants.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/Constants.java
index a8be1c1f4a..5c33dcff50 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/Constants.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/Constants.java
@@ -109,7 +109,8 @@ public final class Constants {
     }
 
     static int getMajorVersion(final String version) {
-        final String[] parts = version.split("-|\\.", -1);
+        // Split into `major.minor.rest`
+        final String[] parts = version.split("-|\\.", 3);
         boolean isJEP223;
         try {
             final int token = Integer.parseInt(parts[0]);