Skip to content

Commit c8db2fd

Browse files
committed
Make AsyncLogger constructor package-private
The constructor is effectively package-private, since it has a package-private class (`AsyncLoggerDisruptor`) in its signature.
1 parent 149fcae commit c8db2fd

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLogger.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717
package org.apache.logging.log4j.core.async;
1818

19+
import aQute.bnd.annotation.baseline.BaselineIgnore;
1920
import com.lmax.disruptor.EventTranslatorVararg;
2021
import com.lmax.disruptor.dsl.Disruptor;
2122
import java.util.List;
@@ -62,6 +63,8 @@
6263
* and they will flush to disk at the end of each batch. This means that even with immediateFlush=false, there will
6364
* never be any items left in the buffer; all log events will all be written to disk in a very efficient manner.
6465
*/
66+
// This constructor is effectively package-private, since {@link AsyncLoggerDisruptor} is package-private.
67+
@BaselineIgnore("2.24.3")
6568
public class AsyncLogger extends Logger implements EventTranslatorVararg<RingBufferLogEvent> {
6669
// Implementation note: many methods in this class are tuned for performance. MODIFY WITH CARE!
6770
// Specifically, try to keep the hot methods to 35 bytecodes or less:
@@ -85,16 +88,14 @@ public class AsyncLogger extends Logger implements EventTranslatorVararg<RingBuf
8588

8689
/**
8790
* Constructs an {@code AsyncLogger} with the specified context, name and message factory.
88-
* <p>
89-
* This method is effectively package-private, since {@link AsyncLoggerDisruptor} is package-private.
90-
* </p>
91+
*
9192
* @param context The {@link LoggerContext} this logger is associated with, never {@code null}.
9293
* @param name The logger name, never {@code null}.
9394
* @param messageFactory The message factory to be used.
9495
* Passing a {@code null} value is deprecated, but supported for backward compatibility.
9596
* @param loggerDisruptor Helper class that logging can be delegated to. This object owns the Disruptor.
9697
*/
97-
public AsyncLogger(
98+
AsyncLogger(
9899
LoggerContext context, String name, MessageFactory messageFactory, AsyncLoggerDisruptor loggerDisruptor) {
99100
super(context, name, messageFactory);
100101
this.loggerDisruptor = loggerDisruptor;
@@ -145,7 +146,7 @@ public void log(
145146
getTranslatorType().log(fqcn, location, level, marker, message, throwable);
146147
}
147148

148-
abstract class TranslatorType {
149+
abstract static class TranslatorType {
149150
abstract void log(
150151
final String fqcn,
151152
final StackTraceElement location,
@@ -400,7 +401,7 @@ private void logWithVarargTranslator(
400401
if (!isReused(message)) {
401402
InternalAsyncUtil.makeMessageImmutable(message);
402403
}
403-
StackTraceElement location = null;
404+
StackTraceElement location;
404405
// calls the translateTo method on this AsyncLogger
405406
if (!disruptor
406407
.getRingBuffer()

0 commit comments

Comments
 (0)