Skip to content

Commit 23cae42

Browse files
JarvisCraftppkarwasz
authored andcommitted
chore: use computIfAbsent in `MarkerManager
1 parent 773f654 commit 23cae42

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

log4j-api/src/main/java/org/apache/logging/log4j/MarkerManager.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,7 @@ public static boolean exists(final String key) {
6060
* @throws IllegalArgumentException if the argument is {@code null}
6161
*/
6262
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;
63+
return MARKERS.computeIfAbsent(name, Log4jMarker::new);
6964
}
7065

7166
/**

0 commit comments

Comments
 (0)