using pattern-matching instanceof where applicable

This commit is contained in:
Sebastian Stenzel
2021-03-17 09:22:16 +01:00
parent f73ae9759f
commit 4e075ab0ca
6 changed files with 10 additions and 12 deletions
@@ -47,8 +47,8 @@ public class LoggerModule {
@Singleton
static LoggerContext provideLoggerContext() {
ILoggerFactory loggerFactory = LoggerFactory.getILoggerFactory();
if (loggerFactory instanceof LoggerContext) {
return (LoggerContext) loggerFactory;
if (loggerFactory instanceof LoggerContext context) {
return context;
} else {
throw new IllegalStateException("SLF4J not bound to Logback.");
}