@@ -283,26 +283,26 @@ public static <L, R> Either<L, R> fromMaybe(Maybe<R> maybe, Supplier<L> leftFn)
283
283
*
284
284
* @param supplier the supplier of the right value
285
285
* @param leftFn a function mapping E to L
286
- * @param <E > the most contravariant exception that the supplier might throw
286
+ * @param <T > the most contravariant exception that the supplier might throw
287
287
* @param <L> the left parameter type
288
288
* @param <R> the right parameter type
289
289
* @return the supplier result as a right value, or leftFn's mapping result as a left value
290
290
*/
291
- public static <E extends Exception , L , R > Either <L , R > trying (CheckedSupplier <E , ? extends R > supplier ,
292
- Function <? super E , ? extends L > leftFn ) {
293
- return Try .<E , R >trying (supplier ::get ).toEither (leftFn );
291
+ public static <T extends Throwable , L , R > Either <L , R > trying (CheckedSupplier <T , ? extends R > supplier ,
292
+ Function <? super T , ? extends L > leftFn ) {
293
+ return Try .<T , R >trying (supplier ::get ).toEither (leftFn );
294
294
}
295
295
296
296
/**
297
297
* Attempt to execute the {@link CheckedSupplier}, returning its result in a right value. If the supplier throws an
298
298
* exception, wrap it in a left value and return it.
299
299
*
300
300
* @param supplier the supplier of the right value
301
- * @param <E > the left parameter type (the most contravariant exception that supplier might throw)
301
+ * @param <T > the left parameter type (the most contravariant exception that supplier might throw)
302
302
* @param <R> the right parameter type
303
303
* @return the supplier result as a right value, or a left value of the thrown exception
304
304
*/
305
- public static <E extends Exception , R > Either <E , R > trying (CheckedSupplier <E , R > supplier ) {
305
+ public static <T extends Throwable , R > Either <T , R > trying (CheckedSupplier <T , R > supplier ) {
306
306
return trying (supplier , id ());
307
307
}
308
308
@@ -312,12 +312,12 @@ public static <E extends Exception, R> Either<E, R> trying(CheckedSupplier<E, R>
312
312
*
313
313
* @param runnable the runnable
314
314
* @param leftFn a function mapping E to L
315
- * @param <E > the most contravariant exception that the runnable might throw
315
+ * @param <T > the most contravariant exception that the runnable might throw
316
316
* @param <L> the left parameter type
317
317
* @return {@link Unit} as a right value, or leftFn's mapping result as a left value
318
318
*/
319
- public static <E extends Exception , L > Either <L , Unit > trying (CheckedRunnable <E > runnable ,
320
- Function <? super E , ? extends L > leftFn ) {
319
+ public static <T extends Throwable , L > Either <L , Unit > trying (CheckedRunnable <T > runnable ,
320
+ Function <? super T , ? extends L > leftFn ) {
321
321
return Try .trying (runnable ).toEither (leftFn );
322
322
}
323
323
@@ -326,10 +326,10 @@ public static <E extends Exception, L> Either<L, Unit> trying(CheckedRunnable<E>
326
326
* exception, wrap it in a left value and return it.
327
327
*
328
328
* @param runnable the runnable
329
- * @param <E > the left parameter type (the most contravariant exception that runnable might throw)
329
+ * @param <T > the left parameter type (the most contravariant exception that runnable might throw)
330
330
* @return {@link Unit} as a right value, or a left value of the thrown exception
331
331
*/
332
- public static <E extends Exception > Either <E , Unit > trying (CheckedRunnable <E > runnable ) {
332
+ public static <T extends Throwable > Either <T , Unit > trying (CheckedRunnable <T > runnable ) {
333
333
return trying (runnable , id ());
334
334
}
335
335
0 commit comments