Remove CheckedValue.orElseThrow(Supplier)
[yangtools.git] / common / concepts / src / main / java / org / opendaylight / yangtools / concepts / CheckedValue.java
index 0afa14002a88a55b02a5e0379046f00daa579c6c..1d6e2ecf300ddbaad0e815864c96d66c6339aa1a 100644 (file)
@@ -204,25 +204,6 @@ public class CheckedValue<T, E extends Exception> extends Either<T, E> {
         throw exceptionMapper.apply(second());
     }
 
-    /**
-     * Return contained value if present or throw the exception supplied by supplier.
-     *
-     * @param supplier Exception supplier
-     * @param <X> Thrown exception type
-     * @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 <X extends Throwable> T orElseThrow(final Supplier<X> supplier) throws X {
-        requireNonNull(supplier);
-        if (isFirst()) {
-            return first();
-        }
-        throw supplier.get();
-    }
-
     /**
      * Complete target {@link CompletableFuture} either successfully or exceptionally based on the state of this object.
      *