Polishing

This commit is contained in:
Juergen Hoeller 2024-10-21 18:13:42 +02:00
parent 09fe0adb40
commit e235e661d8
3 changed files with 3 additions and 12 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -85,17 +85,14 @@ public interface ThrowingBiFunction<T, U, R> extends BiFunction<T, U, R> {
*/
default ThrowingBiFunction<T, U, R> throwing(BiFunction<String, Exception, RuntimeException> exceptionWrapper) {
return new ThrowingBiFunction<>() {
@Override
public R applyWithException(T t, U u) throws Exception {
return ThrowingBiFunction.this.applyWithException(t, u);
}
@Override
public R apply(T t, U u) {
return apply(t, u, exceptionWrapper);
}
};
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -77,17 +77,14 @@ public interface ThrowingConsumer<T> extends Consumer<T> {
*/
default ThrowingConsumer<T> throwing(BiFunction<String, Exception, RuntimeException> exceptionWrapper) {
return new ThrowingConsumer<>() {
@Override
public void acceptWithException(T t) throws Exception {
ThrowingConsumer.this.acceptWithException(t);
}
@Override
public void accept(T t) {
accept(t, exceptionWrapper);
}
};
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -80,17 +80,14 @@ public interface ThrowingFunction<T, R> extends Function<T, R> {
*/
default ThrowingFunction<T, R> throwing(BiFunction<String, Exception, RuntimeException> exceptionWrapper) {
return new ThrowingFunction<>() {
@Override
public R applyWithException(T t) throws Exception {
return ThrowingFunction.this.applyWithException(t);
}
@Override
public R apply(T t) {
return apply(t, exceptionWrapper);
}
};
}