vy commented on code in PR #4124:
URL: https://github.com/apache/logging-log4j2/pull/4124#discussion_r3281418183
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java:
##########
@@ -55,13 +55,17 @@ final class DisruptorUtil {
// TODO: replace with LoaderUtil.isClassAvailable() when TCCL is removed
// See: https://github.com/apache/logging-log4j2/issues/3706
private static int detectDisruptorMajorVersion() {
+ final int version;
try {
Class.forName(
- "com.lmax.disruptor.SequenceReportingEventHandler", true,
DisruptorUtil.class.getClassLoader());
+ "com.lmax.disruptor.SequenceReportingEventHandler", false,
DisruptorUtil.class.getClassLoader());
+ version = 3;
return 3;
- } catch (final ClassNotFoundException e) {
- return 4;
+ } catch (final ClassNotFoundException ignored) {
+ version = 4;
}
Review Comment:
```suggestion
int version = 4;
try {
Class.forName(
"com.lmax.disruptor.SequenceReportingEventHandler",
false, DisruptorUtil.class.getClassLoader());
version = 3;
return 3;
} catch (final ClassNotFoundException ignored) {
// Do nothing
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]