Use old syntax due to Javadoc 8 issue
Using @code on Java 17 is OK here
This commit is contained in:
parent
3a854b01f6
commit
fa01994df1
|
@ -45,13 +45,12 @@ import org.apache.commons.lang3.function.FailableFunction;
|
||||||
import org.apache.commons.lang3.function.FailablePredicate;
|
import org.apache.commons.lang3.function.FailablePredicate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides utility functions, and classes for working with the {@link java.util.stream} package, or more generally,
|
* Provides utility functions, and classes for working with the {@link java.util.stream} package, or more generally, with Java 8 lambdas. More specifically, it
|
||||||
* with Java 8 lambdas. More specifically, it attempts to address the fact that lambdas are supposed not to throw
|
* attempts to address the fact that lambdas are supposed not to throw Exceptions, at least not checked Exceptions, AKA instances of {@link Exception}. This
|
||||||
* Exceptions, at least not checked Exceptions, AKA instances of {@link Exception}. This enforces the use of constructs
|
* enforces the use of constructs like:
|
||||||
* like:
|
|
||||||
*
|
*
|
||||||
* <pre>{@code
|
* <pre>
|
||||||
* Consumer<java.lang.reflect.Method> consumer = m -> {
|
* Consumer<java.lang.reflect.Method> consumer = m -> {
|
||||||
* try {
|
* try {
|
||||||
* m.invoke(o, args);
|
* m.invoke(o, args);
|
||||||
* } catch (Throwable t) {
|
* } catch (Throwable t) {
|
||||||
|
@ -59,20 +58,17 @@ import org.apache.commons.lang3.function.FailablePredicate;
|
||||||
* }
|
* }
|
||||||
* };
|
* };
|
||||||
* stream.forEach(consumer);
|
* stream.forEach(consumer);
|
||||||
* }
|
|
||||||
* </pre>
|
* </pre>
|
||||||
* <p>
|
* <p>
|
||||||
* Using a {@link FailableStream}, this can be rewritten as follows:
|
* Using a {@link FailableStream}, this can be rewritten as follows:
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* {@code
|
* Streams.failable(stream).forEach(m -> m.invoke(o, args));
|
||||||
* Streams.failable(stream).forEach((m) -> m.invoke(o, args));
|
|
||||||
* }
|
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
* <p>
|
||||||
* Obviously, the second version is much more concise and the spirit of Lambda expressions is met better than in the
|
* Obviously, the second version is much more concise and the spirit of Lambda expressions is met better than in the first version.
|
||||||
* first version.
|
* </p>
|
||||||
*
|
*
|
||||||
* @see Stream
|
* @see Stream
|
||||||
* @see Failable
|
* @see Failable
|
||||||
|
|
Loading…
Reference in New Issue