[13] RFR: 8216561: HttpClient: The logic of retry on connect exception is inverted

Andrej Golovnin andrej.golovnin at gmail.com
Fri Jan 18 14:03:55 UTC 2019


Hi Daniel,

Yes that looks like my first implementation. But then
> I reflected that avoiding to map Optional to Duration
> and then back to a new Optional containing the same
> duration could be avoided by simply storing the original
> optional obtained from the HttpClient.
>
> The current code only creates a new instance of Optional
> when it needs to.
>

Is creating new Optionals a real problem? And before you answer please
remember what Donald Knuth said: The real problem is that programmers have
spent far too much time worrying about efficiency in the wrong places and
at the wrong times; premature optimization is the root of all evil (or at
least most of it) in programming. ;-)

Best regards and have a nice weekend,
Andrej Golovnin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20190118/a4111492/attachment.html>


More information about the net-dev mailing list