Skip to content

Commit 8a013c2

Browse files
committed
Minor tweaks
1 parent 079c567 commit 8a013c2

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/main/java/com/nordstrom/automation/junit/ArtifactCollector.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ public ArtifactCollector(Object instance, T provider) {
4747
@Override
4848
public void starting(Description description) {
4949
super.starting(description);
50-
List<ArtifactCollector<? extends ArtifactType>> watcherList = LifecycleHooks.computeIfAbsent(watcherMap, description, newInstance);
50+
List<ArtifactCollector<? extends ArtifactType>> watcherList =
51+
LifecycleHooks.computeIfAbsent(watcherMap, description, newInstance);
5152
watcherList.add(this);
5253
}
5354

src/main/java/com/nordstrom/automation/junit/LifecycleHooks.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,18 @@ public static <T extends RunListener> Optional<T> getAttachedListener(Class<T> l
414414
return Run.getAttachedListener(listenerType);
415415
}
416416

417+
/**
418+
* If the specified key is not already associated with a value (or is mapped to {@code null}), attempts
419+
* to compute its value using the given mapping function and enters it into this map unless {@code null}.
420+
*
421+
* @param <K> data type of map keys
422+
* @param <T> data type of map values
423+
* @param map concurrent map to be manipulated
424+
* @param key key with which the specified value is to be associated
425+
* @param fun the function to compute a value
426+
* @return the current (existing or computed) value associated with the specified key;
427+
* {@code null} if the computed value is {@code null}
428+
*/
417429
static <K, T> T computeIfAbsent(ConcurrentMap<K, T> map, K key, Function<K, T> fun) {
418430
T val = map.get(key);
419431
if (val == null) {

0 commit comments

Comments
 (0)