Re: RFR: 8274835: Remove unnecessary castings in java.base

2021-10-06 Thread Brian Burkhalter
On Thu, 9 Sep 2021 20:12:47 GMT, Andrey Turbanov wrote: > Redundant castings make code harder to read. > Found them by IntelliJ IDEA. > I tried to select only casts which are definitely safe to remove. Also didn't > touch primitive types casts. `java.io` change looks all right. -

Re: RFR: 8273910: Redundant condition and assignment in java.net.URI

2021-10-06 Thread Daniel Fuchs
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; The updated logic looks

Re: RFR: 8274809: Update java.base classes to use try-with-resources [v4]

2021-10-06 Thread Andrey Turbanov
On Wed, 6 Oct 2021 16:00:26 GMT, Bradford Wetmore wrote: >> Andrey Turbanov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8274809: Update java.base classes to use try-with-resources >> fix review comments > > src/java.base/share/clas

Re: RFR: 8274809: Update java.base classes to use try-with-resources [v4]

2021-10-06 Thread Andrey Turbanov
> 8274809: Update java.base classes to use try-with-resources Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: 8274809: Update java.base classes to use try-with-resources fix review comments - Changes: - all: https

Re: HttpClient Send Method Guaranteed Completion

2021-10-06 Thread Elliot Barlas
Thank you for pointing that out! That addresses my immediate concern. This ought to work just fine. From: Daniel Fuchs Sent: Wednesday, October 6, 2021 12:08 PM To: Elliot Barlas ; net-dev@openjdk.java.net Subject: Re: HttpClient Send Method Guaranteed Completio

Re: RFR: 8274809: Update java.base classes to use try-with-resources [v3]

2021-10-06 Thread Bradford Wetmore
On Wed, 6 Oct 2021 18:47:26 GMT, Andrey Turbanov wrote: >> 8274809: Update java.base classes to use try-with-resources > > Andrey Turbanov has updated the pull request incrementally with one > additional commit since the last revision: > > 8274809: Update java.base classes to use try-with-re

Re: RFR: 8274809: Update java.base classes to use try-with-resources [v3]

2021-10-06 Thread Bradford Wetmore
On Wed, 6 Oct 2021 18:47:26 GMT, Andrey Turbanov wrote: >> 8274809: Update java.base classes to use try-with-resources > > Andrey Turbanov has updated the pull request incrementally with one > additional commit since the last revision: > > 8274809: Update java.base classes to use try-with-re

Re: RFR: 8274809: Update java.base classes to use try-with-resources [v3]

2021-10-06 Thread Bradford Wetmore
On Wed, 6 Oct 2021 16:07:12 GMT, Bradford Wetmore wrote: >> Andrey Turbanov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8274809: Update java.base classes to use try-with-resources >> update copyright year > > src/java.base/share/cl

Re: HttpClient Send Method Guaranteed Completion

2021-10-06 Thread Daniel Fuchs
On 06/10/2021 10:42, Daniel Fuchs wrote:   } catch (TimeoutException x) {   // timeout: cancel request to free up   //   any related resources   cf.cancel(); Correction: that should be `cf.cancel(true)`

Re: RFR: 8274809: Update java.base classes to use try-with-resources [v3]

2021-10-06 Thread Andrey Turbanov
> 8274809: Update java.base classes to use try-with-resources Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: 8274809: Update java.base classes to use try-with-resources update copyright year - Changes: - all: htt

Re: RFR: 8274809: Update java.base classes to use try-with-resources [v3]

2021-10-06 Thread Andrey Turbanov
On Wed, 6 Oct 2021 16:11:25 GMT, Bradford Wetmore wrote: >Files like HttpTimestamper need the copyright dates updated to 2021. Updated - PR: https://git.openjdk.java.net/jdk/pull/5818

Re: Re: HttpClient Send Method Guaranteed Completion

2021-10-06 Thread Daniel Fuchs
Hi Eliot, On 06/10/2021 18:22, Elliot Barlas wrote: Thanks for the reply, Daniel. This was an HTTP 1.1 connection. The code snippet for building the URL and configuring the HttpClient was included in my previous email for reference. I can't make any claims about what was happening with pack

Re: RFR: 8274809: Update java.base classes to use try-with-resources [v2]

2021-10-06 Thread Andrey Turbanov
On Wed, 6 Oct 2021 16:20:48 GMT, Pavel Rappo wrote: >> src/java.base/share/classes/sun/security/timestamp/HttpTimestamper.java line >> 127: >> >>> 125: // Receive the reply >>> 126: byte[] replyBuffer = null; >>> 127: try (BufferedInputStream input = new >>> BufferedInp

Re: RFR: 8274809: Update java.base classes to use try-with-resources [v2]

2021-10-06 Thread Andrey Turbanov
> 8274809: Update java.base classes to use try-with-resources Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: 8274809: Update java.base classes to use try-with-resources fix post-review comment - Changes: - all: h

Re: RFR: 8273910: Redundant condition and assignment in java.net.URI

2021-10-06 Thread Daniel Fuchs
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; I have sent this patch

Re: HttpClient Send Method Guaranteed Completion

2021-10-06 Thread Elliot Barlas
Thanks for the reply, Daniel. This was an HTTP 1.1 connection. The code snippet for building the URL and configuring the HttpClient was included in my previous email for reference. I can't make any claims about what was happening with packet transmissions at the network level. It's entirely pos

Re: RFR: 8274835: Remove unnecessary castings in java.base

2021-10-06 Thread Joe Darcy
On Thu, 9 Sep 2021 20:12:47 GMT, Andrey Turbanov wrote: > Redundant castings make code harder to read. > Found them by IntelliJ IDEA. > I tried to select only casts which are definitely safe to remove. Also didn't > touch primitive types casts. Curious. The JDK build is done with javac -Xlint:

Re: RFR: 8274835: Remove unnecessary castings in java.base

2021-10-06 Thread Lance Andersen
On Thu, 9 Sep 2021 20:12:47 GMT, Andrey Turbanov wrote: > Redundant castings make code harder to read. > Found them by IntelliJ IDEA. > I tried to select only casts which are definitely safe to remove. Also didn't > touch primitive types casts. Marked as reviewed by lancea (Reviewer). ---

Re: RFR: 8274835: Remove unnecessary castings in java.base

2021-10-06 Thread Naoto Sato
On Thu, 9 Sep 2021 20:12:47 GMT, Andrey Turbanov wrote: > Redundant castings make code harder to read. > Found them by IntelliJ IDEA. > I tried to select only casts which are definitely safe to remove. Also didn't > touch primitive types casts. Calendar-related changes look good to me. --

Re: RFR: 8274809: Update java.base classes to use try-with-resources

2021-10-06 Thread Andrey Turbanov
On Wed, 6 Oct 2021 16:24:03 GMT, Andrey Turbanov wrote: >> src/java.base/share/classes/sun/net/NetProperties.java line 71: >> >>> 69: f = new File(f, "net.properties"); >>> 70: fname = f.getCanonicalPath(); >>> 71: try (FileInputStream fis = new FileInputStre

Re: RFR: 8274809: Update java.base classes to use try-with-resources

2021-10-06 Thread Pavel Rappo
On Wed, 6 Oct 2021 16:00:41 GMT, Bradford Wetmore wrote: >> 8274809: Update java.base classes to use try-with-resources > > src/java.base/share/classes/sun/security/timestamp/HttpTimestamper.java line > 127: > >> 125: // Receive the reply >> 126: byte[] replyBuffer = null; >> 12

Re: RFR: 8274809: Update java.base classes to use try-with-resources

2021-10-06 Thread Andrey Turbanov
On Wed, 6 Oct 2021 16:04:54 GMT, Bradford Wetmore wrote: >> 8274809: Update java.base classes to use try-with-resources > > src/java.base/share/classes/sun/net/NetProperties.java line 71: > >> 69: f = new File(f, "net.properties"); >> 70: fname = f.getCanonicalPath(); >>

Re: RFR: 8274809: Update java.base classes to use try-with-resources

2021-10-06 Thread Bradford Wetmore
On Tue, 5 Oct 2021 09:36:23 GMT, Andrey Turbanov wrote: > 8274809: Update java.base classes to use try-with-resources I checked the rest. The one BufferedInputStream change is puzzling. Please explain or address. Files like HttpTimestamper need the copyright dates updated to 2021. src/java

Re: RFR: 8274809: Update java.base classes to use try-with-resources

2021-10-06 Thread Bradford Wetmore
On Tue, 5 Oct 2021 09:36:23 GMT, Andrey Turbanov wrote: > 8274809: Update java.base classes to use try-with-resources Reviewed the crypto/security files. src/java.base/share/classes/sun/security/timestamp/HttpTimestamper.java line 115: > 113: > 114: // Send the request > 115:

Re: RFR: 8274809: Update java.base classes to use try-with-resources

2021-10-06 Thread Sean Mullan
On Tue, 5 Oct 2021 09:36:23 GMT, Andrey Turbanov wrote: > 8274809: Update java.base classes to use try-with-resources The security related files look fine. - Marked as reviewed by mullan (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/5818

Re: RFR: 8274835: Remove unnecessary castings in java.base

2021-10-06 Thread Sean Mullan
On Thu, 9 Sep 2021 20:12:47 GMT, Andrey Turbanov wrote: > Redundant castings make code harder to read. > Found them by IntelliJ IDEA. > I tried to select only casts which are definitely safe to remove. Also didn't > touch primitive types casts. The security related files look fine. --

RFR: 8274835: Remove unnecessary castings in java.base

2021-10-06 Thread Andrey Turbanov
Redundant castings make code harder to read. Found them by IntelliJ IDEA. I tried to select only casts which are definitely safe to remove. Also didn't touch primitive types casts. - Commit messages: - [PATCH] Remove unnecessary castings in java.base - [PATCH] Remove unnecessary ca

Re: RFR: 8233674: JarURLConnection.getJarFile throws Exception if some process is holding the file

2021-10-06 Thread Masanori Yano
On Fri, 10 Sep 2021 09:23:52 GMT, Masanori Yano wrote: > Could you please review the 8233674 bug fixes? > This problem is caused by the antivirus software opening the file for a short > time, so CreateFile() should be retried. I inquired of the Microsoft Technical Support about this problem. Th

Re: HttpClient Send Method Guaranteed Completion

2021-10-06 Thread Daniel Fuchs
Hi Eliot, Unless the server keeps the connection open, and fails to send all the body bytes it has promised to send, the send operation should eventually terminate. The behavior you describe looks indeed like a bug. Could you please log a ticket with: https://bugreport.java.com/bugreport/ That

RFR: 8274809: Update java.base classes to use try-with-resources

2021-10-06 Thread Andrey Turbanov
8274809: Update java.base classes to use try-with-resources - Commit messages: - [PATCH] Use try-with-resources to close FileInputStream in java.base Changes: https://git.openjdk.java.net/jdk/pull/5818/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5818&range=00 Issu