RFR: 8274894: Use Optional.empty() instead of ofNullable(null) in HttpResponse.BodySubscribers.discarding
Andrey Turbanov
github.com+741251+turbanoff at openjdk.java.net
Thu Oct 7 10:26:28 UTC 2021
Usage of `Optional.ofNullable` is unnecessary when value is known. If it's `null` value Optional.empty() should be preferred, as it doesn't perform redundant `null` check.
-------------
Commit messages:
- [PATCH] Cleanup Optional usage in HttpResponse.BodySubscribers.discarding
Changes: https://git.openjdk.java.net/jdk/pull/5159/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5159&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8274894
Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
Patch: https://git.openjdk.java.net/jdk/pull/5159.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/5159/head:pull/5159
PR: https://git.openjdk.java.net/jdk/pull/5159
More information about the net-dev
mailing list