Use Javadoc @code

This commit is contained in:
Gary Gregory 2024-07-29 19:37:34 -04:00
parent 9345437e0f
commit 16bce45fec
2 changed files with 7 additions and 7 deletions

View File

@ -53,7 +53,7 @@ import org.apache.commons.lang3.Functions.FailablePredicate;
* }</pre>
* Using a {@link FailableStream}, this can be rewritten as follows:
* <pre>{@code
* Streams.failable(stream).forEach((m) -> m.invoke(o, args));
* Streams.failable(stream).forEach(m -> m.invoke(o, args));
* }</pre>
* Obviously, the second version is much more concise and the spirit of
* Lambda expressions is met better than in the first version.

View File

@ -49,8 +49,8 @@ import org.apache.commons.lang3.function.FailablePredicate;
* attempts to address the fact that lambdas are supposed not to throw Exceptions, at least not checked Exceptions, AKA instances of {@link Exception}. This
* enforces the use of constructs like:
*
* <pre>
* Consumer&lt;java.lang.reflect.Method&gt; consumer = m -&gt; {
* <pre>{@code
* Consumer<java.lang.reflect.Method> consumer = m -> {
* try {
* m.invoke(o, args);
* } catch (Throwable t) {
@ -58,14 +58,14 @@ import org.apache.commons.lang3.function.FailablePredicate;
* }
* };
* stream.forEach(consumer);
* </pre>
* }</pre>
* <p>
* Using a {@link FailableStream}, this can be rewritten as follows:
* </p>
*
* <pre>
* Streams.failable(stream).forEach(m -&gt; m.invoke(o, args));
* </pre>
* <pre>{@code
* Streams.failable(stream).forEach(m -> m.invoke(o, args));
* }</pre>
* <p>
* Obviously, the second version is much more concise and the spirit of Lambda expressions is met better than in the first version.
* </p>