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/01/26 04:46:25 UTC

[logging-log4j2] 01/03: [LOG4J2-3615] Fix `log4j-api` OSGI encapsulation problem

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

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

commit f165c135e8e8a4486114a3d023a1259b829a20a0
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Fri Oct 7 00:08:28 2022 +0200

    [LOG4J2-3615] Fix `log4j-api` OSGI encapsulation problem
    
    The protected `AbstractLogger.logBuilder` field leaks the internal
    `DefaultLogBuilder` class into the public API. This causes a warning in
    the upgraded `maven-bundle-plugin`.
    
    Since this is a breaking change, I think that a larger consensus is
    necessary.
---
 .../src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 f6d5a22077..2f6ddd2262 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
@@ -84,7 +84,7 @@ public abstract class AbstractLogger implements ExtendedLogger {
     private final MessageFactory messageFactory;
     private final FlowMessageFactory flowMessageFactory;
     private static final ThreadLocal<int[]> recursionDepthHolder = new ThreadLocal<>(); // LOG4J2-1518, LOG4J2-2031
-    protected final transient ThreadLocal<DefaultLogBuilder> logBuilder;
+    private final transient ThreadLocal<DefaultLogBuilder> logBuilder;
 
 
     /**