Skip to content

Commit 2d9b7c0

Browse files
eleonoveleonov
authored andcommitted
Updated README.md
1 parent a6697ad commit 2d9b7c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Stream.of("https://www.google.com").map(URL::new);
1616
Must be coded as:
1717

1818
```java
19-
Stream.of("https://www.google.com").map(t -> {
19+
Stream.of("https://www.google.com").map(url -> {
2020
try {
21-
return new URL(t);
21+
return new URL(url);
2222
} catch (final MalformedURLException e) {
2323
throw new RuntimeException(e);
2424
}
@@ -28,7 +28,7 @@ Stream.of("https://www.google.com").map(t -> {
2828
Besides the extra boiler-plate code, we are also required to obfuscate the original exception by wrapping it in a `RuntimeException` which adds unnecessary bloat to the stack trace. Using Unchecked Java we can again write concise code afforded to us by lambda expressions, without wrapping checked exceptions in runtime exceptions:
2929

3030
```java
31-
import static software.leonov.common.util.function.CheckedFunction.evalUnchecked;
31+
import static software.leonov.common.util.function.CheckedFunction.unchecked;
3232
...
3333
Stream.of("https://www.google.com").map(unchecked(URL::new));
3434
```

0 commit comments

Comments
 (0)