Polishing
This commit is contained in:
parent
40f9fe0874
commit
c58c827291
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -100,10 +100,10 @@ public interface ThrowingBiFunction<T, U, R> extends BiFunction<T, U, R> {
|
|||
}
|
||||
|
||||
/**
|
||||
* 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 <T> the type of the first argument to the function
|
||||
* @param <U> the type of the second argument to the function
|
||||
* @param <R> the type of the result of the function
|
||||
|
|
@ -115,7 +115,7 @@ public interface ThrowingBiFunction<T, U, R> extends BiFunction<T, U, R> {
|
|||
}
|
||||
|
||||
/**
|
||||
* 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}.
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public interface ThrowingConsumer<T> extends Consumer<T> {
|
|||
* @param exceptionWrapper {@link BiFunction} that wraps the given message
|
||||
* and checked exception into a runtime exception
|
||||
*/
|
||||
default void accept(T t,BiFunction<String, Exception, RuntimeException> exceptionWrapper) {
|
||||
default void accept(T t, BiFunction<String, Exception, RuntimeException> exceptionWrapper) {
|
||||
try {
|
||||
acceptWithException(t);
|
||||
}
|
||||
|
|
@ -92,9 +92,10 @@ public interface ThrowingConsumer<T> extends Consumer<T> {
|
|||
}
|
||||
|
||||
/**
|
||||
* 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 <T> 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<T> extends Consumer<T> {
|
|||
}
|
||||
|
||||
/**
|
||||
* 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 <T> the type of the input to the operation
|
||||
|
|
|
|||
|
|
@ -95,9 +95,10 @@ public interface ThrowingFunction<T, R> extends Function<T, R> {
|
|||
}
|
||||
|
||||
/**
|
||||
* 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 <T> the type of the input to the function
|
||||
* @param <R> the type of the result of the function
|
||||
* @param function the source function
|
||||
|
|
@ -108,7 +109,7 @@ public interface ThrowingFunction<T, R> extends Function<T, R> {
|
|||
}
|
||||
|
||||
/**
|
||||
* 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 <T> the type of the input to the function
|
||||
|
|
|
|||
|
|
@ -91,9 +91,9 @@ public interface ThrowingSupplier<T> extends Supplier<T> {
|
|||
}
|
||||
|
||||
/**
|
||||
* 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 <T> the type of results supplied by this supplier
|
||||
* @param supplier the source supplier
|
||||
* @return a new {@link ThrowingSupplier} instance
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class ThrowingConsumerTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
void ofModifiesThrowException() {
|
||||
void ofModifiesThrownException() {
|
||||
ThrowingConsumer<Object> consumer = ThrowingConsumer.of(this::throwIOException,
|
||||
IllegalStateException::new);
|
||||
assertThatIllegalStateException().isThrownBy(
|
||||
|
|
|
|||
Loading…
Reference in New Issue