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

Reply via email to