Re: HttpClient Send Method Guaranteed Completion

2021-10-07 Thread Elliot Barlas
That would be great. There are many synchronous, threaded applications that want to ensure eventual completion and the work around is cumbersome and non-obvious. It looks like there are already several related enhancement requests. Thanks again for the help. Fro

Integrated: 8273910: Redundant condition and assignment in java.net.URI

2021-10-07 Thread Andrey Turbanov
On Thu, 19 Aug 2021 19:08:59 GMT, Andrey Turbanov wrote: > 1. Assignment `ru.host = child.host;` is duplicated and hence redundant. > 2. Condition `q > p` is always `true`, because it just bellow inverse check > > if (q <= p) > break; This pull request has n

Re: RFR: 8274879: Replace uses of StringBuffer with StringBuilder within java.base classes

2021-10-07 Thread Naoto Sato
On Thu, 9 Sep 2021 06:50:21 GMT, Andrey Turbanov wrote: > StringBuffer is a legacy synchronized class. There are more modern > alternatives which perform better: > 1. Plain String concatenation should be preferred > 2. StringBuilder is a direct replacement to StringBuffer which generally have

Re: RFR: 8274894: Use Optional.empty() instead of ofNullable(null) in HttpResponse.BodySubscribers.discarding

2021-10-07 Thread Daniel Fuchs
On Wed, 18 Aug 2021 07:55:35 GMT, Andrey Turbanov wrote: > 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. hmm... looks like something went wrong. Maybe you should /

Re: HttpClient Send Method Guaranteed Completion

2021-10-07 Thread Michael McMahon
I think we should at least clarify the behavior of HttpRequest.Builder.timeout() ie. that it is specifically related to the response headers, and maybe consider adding a timeout variant that sets the timeout for the entire response, including the body. - Michael. On 06/10/2021 10:42, Daniel F

Re: RFR: 8244202: Implementation of JEP 418: Internet-Address Resolution SPI [v2]

2021-10-07 Thread Aleksei Efimov
> This change implements a new service provider interface for host name and > address resolution, so that java.net.InetAddress API can make use of > resolvers other than the platform's built-in resolver. > > The following API classes are added to `java.net.spi` package to facilitate > this: > -

Re: RFR: 8274894: Use Optional.empty() instead of ofNullable(null) in HttpResponse.BodySubscribers.discarding

2021-10-07 Thread Daniel Fuchs
On Wed, 18 Aug 2021 07:55:35 GMT, Andrey Turbanov wrote: > 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. LGTM - Marked as reviewed by dfuchs (Reviewe

Re: RFR: 8274894: Use Optional.empty() instead of ofNullable(null) in HttpResponse.BodySubscribers.discarding

2021-10-07 Thread Daniel Fuchs
On Wed, 18 Aug 2021 07:55:35 GMT, Andrey Turbanov wrote: > 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. If you integrate I will sponsor. - PR: https

Re: RFR: 8274894: Use Optional.empty() instead of ofNullable(null) in HttpResponse.BodySubscribers.discarding

2021-10-07 Thread Andrey Turbanov
On Wed, 18 Aug 2021 07:55:35 GMT, Andrey Turbanov wrote: > 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. Not sure if it worth separate issue. But this this is smal

RFR: 8274894: Use Optional.empty() instead of ofNullable(null) in HttpResponse.BodySubscribers.discarding

2021-10-07 Thread Andrey Turbanov
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

RFR: 8274879: Replace uses of StringBuffer with StringBuilder within java.base classes

2021-10-07 Thread Andrey Turbanov
StringBuffer is a legacy synchronized class. There are more modern alternatives which perform better: 1. Plain String concatenation should be preferred 2. StringBuilder is a direct replacement to StringBuffer which generally have better performance In [JDK-8264029](https://bugs.openjdk.java.net/