11/*
2- * Copyright 2023-2024 the original author or authors.
2+ * Copyright 2023-2025 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -35,25 +35,11 @@ public interface CheckedCallable<T, E extends Throwable> {
3535 T call () throws E ;
3636
3737 /**
38- * Wrap the {@link #call()} into unchecked {@link Runnable} (by mistake) .
38+ * Wrap the {@link #call()} into unchecked {@link Callable<T>} .
3939 * Re-throw its exception wrapped with a {@link IllegalStateException}.
40- * @return the Runnable (by mistake).
41- * @deprecated since 6.3.7 in favor of {@link #uncheckedCallable()}.
42- * Will be restored back, but with a proper {@link Callable} return type.
40+ * @return the unchecked {@link Callable<T>}.
4341 */
44- @ Deprecated
45- default Runnable unchecked () {
46- return this ::uncheckedCallable ;
47- }
48-
49- /**
50- * Wrap the {@link #call()} into unchecked {@link Callable}.
51- * Re-throw its exception wrapped with a {@link IllegalStateException}.
52- * Will be replaced with a proper {@link #unchecked()} implementation in 6.5.
53- * @return the unchecked {@link Callable}.
54- * @since 6.3.7
55- */
56- default Callable <T > uncheckedCallable () {
42+ default Callable <T > unchecked () {
5743 return () -> {
5844 try {
5945 return call ();
@@ -72,4 +58,16 @@ else if (t instanceof Error error) { // NOSONAR
7258 };
7359 }
7460
61+ /**
62+ * Wrap the {@link #call()} into unchecked {@link Callable<T>}.
63+ * Re-throw its exception wrapped with a {@link IllegalStateException}.
64+ * @return the unchecked {@link Callable<T>}.
65+ * @deprecated since 6.5 in favor of {@link #unchecked()}.
66+ * @since 6.3.7
67+ */
68+ @ Deprecated (since = "6.5" , forRemoval = true )
69+ default Callable <T > uncheckedCallable () {
70+ return unchecked ();
71+ }
72+
7573}
0 commit comments