Use old syntax due to Javadoc 8 issue

Using @code on Java 17 is OK here
This commit is contained in:
Gary Gregory 2024-07-29 19:30:48 -04:00
parent 3a854b01f6
commit fa01994df1
1 changed files with 9 additions and 13 deletions

View File

@ -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&lt;java.lang.reflect.Method&gt; consumer = m -&gt; {
* 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 -&gt; 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