Browse Source

Merge pull request #17913 from justtreee

* pr/17913:
  Use putIfAbsent() instead of containsKey

Closes gh-17913
pull/17947/head
Stephane Nicoll 7 years ago
parent
commit
88c17b5cbc
  1. 8
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/AbstractLoggingSystem.java

8
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/AbstractLoggingSystem.java

@ -194,12 +194,8 @@ public abstract class AbstractLoggingSystem extends LoggingSystem { @@ -194,12 +194,8 @@ public abstract class AbstractLoggingSystem extends LoggingSystem {
}
public void map(LogLevel system, T nativeLevel) {
if (!this.systemToNative.containsKey(system)) {
this.systemToNative.put(system, nativeLevel);
}
if (!this.nativeToSystem.containsKey(nativeLevel)) {
this.nativeToSystem.put(nativeLevel, system);
}
this.systemToNative.putIfAbsent(system, nativeLevel);
this.nativeToSystem.putIfAbsent(nativeLevel, system);
}
public LogLevel convertNativeToSystem(T level) {

Loading…
Cancel
Save