Skip to content

Commit 9c1e0e6

Browse files
committed
Polish "Avoid using deprecated Log4J constructors"
See gh-46372
1 parent f7f049d commit 9c1e0e6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

core/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/ExtendedWhitespaceThrowablePatternConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
@ConverterKeys({ "xwEx", "xwThrowable", "xwException" })
3939
public final class ExtendedWhitespaceThrowablePatternConverter extends LogEventPatternConverter {
4040

41-
private final LogEventPatternConverter delegate;
41+
private final ExtendedThrowablePatternConverter delegate;
4242

4343
private final String separator;
4444

4545
@SuppressWarnings("deprecation") // https://github.com/apache/logging-log4j2/issues/3809
4646
private ExtendedWhitespaceThrowablePatternConverter(Configuration configuration, @Nullable String[] options) {
4747
super("WhitespaceExtendedThrowable", "throwable");
4848
this.delegate = ExtendedThrowablePatternConverter.newInstance(configuration, options);
49-
this.separator = ((ExtendedThrowablePatternConverter) this.delegate).getOptions().getSeparator();
49+
this.separator = this.delegate.getOptions().getSeparator();
5050
}
5151

5252
@Override

core/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/WhitespaceThrowablePatternConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737
@ConverterKeys({ "wEx", "wThrowable", "wException" })
3838
public final class WhitespaceThrowablePatternConverter extends LogEventPatternConverter {
3939

40-
private final LogEventPatternConverter delegate;
40+
private final ExtendedThrowablePatternConverter delegate;
4141

4242
private final String separator;
4343

4444
@SuppressWarnings("deprecation") // https://github.com/apache/logging-log4j2/issues/3809
4545
private WhitespaceThrowablePatternConverter(Configuration configuration, @Nullable String[] options) {
4646
super("WhitespaceThrowable", "throwable");
4747
this.delegate = ExtendedThrowablePatternConverter.newInstance(configuration, options);
48-
this.separator = ((ExtendedThrowablePatternConverter) this.delegate).getOptions().getSeparator();
48+
this.separator = this.delegate.getOptions().getSeparator();
4949
}
5050

5151
@Override

0 commit comments

Comments
 (0)