We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
computIfAbsent
1 parent 773f654 commit 23cae42Copy full SHA for 23cae42
log4j-api/src/main/java/org/apache/logging/log4j/MarkerManager.java
@@ -60,12 +60,7 @@ public static boolean exists(final String key) {
60
* @throws IllegalArgumentException if the argument is {@code null}
61
*/
62
public static Marker getMarker(final String name) {
63
- Marker result = MARKERS.get(name);
64
- if (result == null) {
65
- MARKERS.putIfAbsent(name, new Log4jMarker(name));
66
- result = MARKERS.get(name);
67
- }
68
- return result;
+ return MARKERS.computeIfAbsent(name, Log4jMarker::new);
69
}
70
71
/**
0 commit comments