From db47616ab4ccf38ff63e8bff41050d5102c9ff15 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Tue, 7 May 2024 14:24:53 +0300 Subject: [PATCH] Polishing --- .../support/store/NamespacedHierarchicalStore.java | 12 ++++++------ .../store/NamespacedHierarchicalStoreException.java | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/store/NamespacedHierarchicalStore.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/store/NamespacedHierarchicalStore.java index eed491c89519..ec99791e13fe 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/store/NamespacedHierarchicalStore.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/store/NamespacedHierarchicalStore.java @@ -98,7 +98,7 @@ public boolean isClosed() { } /** - * If a close action is configured, it will be called with all successfully + * If a {@link CloseAction} is configured, it will be called with all successfully * stored values in reverse insertion order. * *

Closing a store does not close its parent or any of its children. @@ -218,8 +218,8 @@ public V getOrComputeIfAbsent(N namespace, K key, Function defaultC * @param key the key; never {@code null} * @param value the value to store; may be {@code null} * @return the previously stored value; may be {@code null} - * @throws NamespacedHierarchicalStoreException if the stored value cannot - * be cast to the required type + * @throws NamespacedHierarchicalStoreException if an error occurs while + * storing the value * @throws IllegalStateException if this store has already been closed */ public Object put(N namespace, Object key, Object value) throws NamespacedHierarchicalStoreException { @@ -348,7 +348,7 @@ private static class StoredValue { private EvaluatedValue evaluateSafely(CompositeKey compositeKey) { try { - return new EvaluatedValue<>(compositeKey, order, evaluate()); + return new EvaluatedValue<>(compositeKey, this.order, evaluate()); } catch (Throwable t) { UnrecoverableExceptions.rethrowIfUnrecoverable(t); @@ -357,7 +357,7 @@ private EvaluatedValue evaluateSafely(CompositeKey compositeKey) { } private Object evaluate() { - return supplier.get(); + return this.supplier.get(); } static Object evaluateIfNotNull(StoredValue value) { @@ -444,7 +444,7 @@ public Failure(Throwable throwable) { /** * Called for each successfully stored non-null value in the store when a * {@link NamespacedHierarchicalStore} is - * {@link NamespacedHierarchicalStore#close() closed}. + * {@linkplain NamespacedHierarchicalStore#close() closed}. */ @FunctionalInterface public interface CloseAction { diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/store/NamespacedHierarchicalStoreException.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/store/NamespacedHierarchicalStoreException.java index 90256f4ba004..bf9dfefa1d16 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/store/NamespacedHierarchicalStoreException.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/store/NamespacedHierarchicalStoreException.java @@ -29,7 +29,6 @@ public NamespacedHierarchicalStoreException(String message) { super(message); } - @SuppressWarnings("unused") public NamespacedHierarchicalStoreException(String message, Throwable cause) { super(message, cause); }