We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fc4e100 commit 9b25947Copy full SHA for 9b25947
1 file changed
src/main/java/io/github/aplotnikov/java_8_misuses/optional/OptionalOrThrow.java
@@ -11,7 +11,7 @@ class OptionalOrThrow {
11
12
@Ugly
13
class ManualCheckForPresenceToThrowException {
14
- Loan getLoan(Client client) {
+ Loan getLastLoan(Client client) {
15
if (client.findLastLoan().isPresent()) {
16
return client.findLastLoan().get();
17
}
@@ -37,7 +37,7 @@ private void delete(Loan loan) {
37
38
@Good
39
class OrElseThrowUsage {
40
41
return client.findLastLoan()
42
.orElseThrow(() -> new IllegalStateException("Client does not have any loans"));
43
0 commit comments