diff --git a/spring-core/src/main/java/org/springframework/aot/generate/GeneratedClasses.java b/spring-core/src/main/java/org/springframework/aot/generate/GeneratedClasses.java index c2c5c761fd..27be83e168 100644 --- a/spring-core/src/main/java/org/springframework/aot/generate/GeneratedClasses.java +++ b/spring-core/src/main/java/org/springframework/aot/generate/GeneratedClasses.java @@ -16,7 +16,6 @@ package org.springframework.aot.generate; -import java.io.IOException; import java.util.ArrayList; import java.util.Comparator; import java.util.List; @@ -157,7 +156,6 @@ public class GeneratedClasses { * Write the {@link GeneratedClass generated classes} using the given * {@link GeneratedFiles} instance. * @param generatedFiles where to write the generated classes - * @throws IOException on IO error */ void writeTo(GeneratedFiles generatedFiles) { Assert.notNull(generatedFiles, "'generatedFiles' must not be null"); diff --git a/spring-core/src/main/java/org/springframework/util/function/ThrowingBiFunction.java b/spring-core/src/main/java/org/springframework/util/function/ThrowingBiFunction.java index 9f5f4ef564..fd1717ea4f 100644 --- a/spring-core/src/main/java/org/springframework/util/function/ThrowingBiFunction.java +++ b/spring-core/src/main/java/org/springframework/util/function/ThrowingBiFunction.java @@ -100,10 +100,10 @@ public interface ThrowingBiFunction extends BiFunction { } /** - * Lambda friendly convenience method that can be used to create + * Lambda friendly convenience method that can be used to create a * {@link ThrowingBiFunction} where the {@link #apply(Object, Object)} - * method wraps any thrown checked exceptions using the given - * {@code exceptionWrapper}. + * method wraps any checked exception thrown by the supplied lambda expression + * or method reference. * @param the type of the first argument to the function * @param the type of the second argument to the function * @param the type of the result of the function @@ -115,7 +115,7 @@ public interface ThrowingBiFunction extends BiFunction { } /** - * Lambda friendly convenience method that can be used to create + * Lambda friendly convenience method that can be used to create a * {@link ThrowingBiFunction} where the {@link #apply(Object, Object)} * method wraps any thrown checked exceptions using the given * {@code exceptionWrapper}. diff --git a/spring-core/src/main/java/org/springframework/util/function/ThrowingConsumer.java b/spring-core/src/main/java/org/springframework/util/function/ThrowingConsumer.java index a8c4f4778d..09848791bb 100644 --- a/spring-core/src/main/java/org/springframework/util/function/ThrowingConsumer.java +++ b/spring-core/src/main/java/org/springframework/util/function/ThrowingConsumer.java @@ -55,7 +55,7 @@ public interface ThrowingConsumer extends Consumer { * @param exceptionWrapper {@link BiFunction} that wraps the given message * and checked exception into a runtime exception */ - default void accept(T t,BiFunction exceptionWrapper) { + default void accept(T t, BiFunction exceptionWrapper) { try { acceptWithException(t); } @@ -92,9 +92,10 @@ public interface ThrowingConsumer extends Consumer { } /** - * Lambda friendly convenience method that can be used to create + * Lambda friendly convenience method that can be used to create a * {@link ThrowingConsumer} where the {@link #accept(Object)} method wraps - * any thrown checked exceptions using the given {@code exceptionWrapper}. + * any checked exception thrown by the supplied lambda expression or method + * reference. * @param the type of the input to the operation * @param consumer the source consumer * @return a new {@link ThrowingConsumer} instance @@ -104,7 +105,7 @@ public interface ThrowingConsumer extends Consumer { } /** - * Lambda friendly convenience method that can be used to create + * Lambda friendly convenience method that can be used to create a * {@link ThrowingConsumer} where the {@link #accept(Object)} method wraps * any thrown checked exceptions using the given {@code exceptionWrapper}. * @param the type of the input to the operation diff --git a/spring-core/src/main/java/org/springframework/util/function/ThrowingFunction.java b/spring-core/src/main/java/org/springframework/util/function/ThrowingFunction.java index a0baadb81f..5d68f4e0f3 100644 --- a/spring-core/src/main/java/org/springframework/util/function/ThrowingFunction.java +++ b/spring-core/src/main/java/org/springframework/util/function/ThrowingFunction.java @@ -95,9 +95,10 @@ public interface ThrowingFunction extends Function { } /** - * Lambda friendly convenience method that can be used to create + * Lambda friendly convenience method that can be used to create a * {@link ThrowingFunction} where the {@link #apply(Object)} method wraps - * any thrown checked exceptions using the given {@code exceptionWrapper}. + * any checked exception thrown by the supplied lambda expression or method + * reference. * @param the type of the input to the function * @param the type of the result of the function * @param function the source function @@ -108,7 +109,7 @@ public interface ThrowingFunction extends Function { } /** - * Lambda friendly convenience method that can be used to create + * Lambda friendly convenience method that can be used to create a * {@link ThrowingFunction} where the {@link #apply(Object)} method wraps * any thrown checked exceptions using the given {@code exceptionWrapper}. * @param the type of the input to the function diff --git a/spring-core/src/main/java/org/springframework/util/function/ThrowingSupplier.java b/spring-core/src/main/java/org/springframework/util/function/ThrowingSupplier.java index f2b1af87de..89887fbd4b 100644 --- a/spring-core/src/main/java/org/springframework/util/function/ThrowingSupplier.java +++ b/spring-core/src/main/java/org/springframework/util/function/ThrowingSupplier.java @@ -91,9 +91,9 @@ public interface ThrowingSupplier extends Supplier { } /** - * Lambda friendly convenience method that can be used to create - * {@link ThrowingSupplier} where the {@link #get()} method wraps any - * thrown checked exceptions. + * Lambda friendly convenience method that can be used to create a + * {@link ThrowingSupplier} where the {@link #get()} method wraps any checked + * exception thrown by the supplied lambda expression or method reference. * @param the type of results supplied by this supplier * @param supplier the source supplier * @return a new {@link ThrowingSupplier} instance diff --git a/spring-core/src/test/java/org/springframework/util/function/ThrowingConsumerTests.java b/spring-core/src/test/java/org/springframework/util/function/ThrowingConsumerTests.java index 536c5b86c7..d1892d1d5a 100644 --- a/spring-core/src/test/java/org/springframework/util/function/ThrowingConsumerTests.java +++ b/spring-core/src/test/java/org/springframework/util/function/ThrowingConsumerTests.java @@ -69,7 +69,7 @@ class ThrowingConsumerTests { } @Test - void ofModifiesThrowException() { + void ofModifiesThrownException() { ThrowingConsumer consumer = ThrowingConsumer.of(this::throwIOException, IllegalStateException::new); assertThatIllegalStateException().isThrownBy(