From: Robert Varga Date: Thu, 24 Mar 2022 11:26:28 +0000 (+0100) Subject: Deprecate CheckedValue.orElseThrow(Supplier) X-Git-Tag: v8.0.2~1 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=2aabca17445804c8d86ca830e7bbf5fa9308bba1;hp=4cd2b06b8c376671c3ce7a0de43442843ac09f39;p=yangtools.git Deprecate CheckedValue.orElseThrow(Supplier) While this method provides seamless transition from/to Optional, its use results in the original exception being lost. Deprecate it for removal. Change-Id: I062ee28917f7a1be583077009307f08c57a67acc Signed-off-by: Robert Varga --- diff --git a/common/concepts/src/main/java/org/opendaylight/yangtools/concepts/CheckedValue.java b/common/concepts/src/main/java/org/opendaylight/yangtools/concepts/CheckedValue.java index c1d2d2eca5..0afa14002a 100644 --- a/common/concepts/src/main/java/org/opendaylight/yangtools/concepts/CheckedValue.java +++ b/common/concepts/src/main/java/org/opendaylight/yangtools/concepts/CheckedValue.java @@ -212,7 +212,9 @@ public class CheckedValue extends Either { * @return Contained value * @throws NullPointerException if {@code exceptionMapper} is null * @throws X When there is no contained value + * @deprecated This method is losing the underlying failure cause. Use {@link #orElseThrow(Function)} instead. */ + @Deprecated(forRemoval = true, since = "8.0.2") public final T orElseThrow(final Supplier supplier) throws X { requireNonNull(supplier); if (isFirst()) {