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

2021-12-07 Thread Alan Bateman
On Wed, 6 Oct 2021 20:37:29 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-res

Re: RFR: 8277120: Use Optional.isEmpty instead of !Optional.isPresent in java.net.http

2021-12-07 Thread Alan Bateman
On Mon, 15 Nov 2021 13:20:30 GMT, Daniel Fuchs wrote: >> I propose to replace usages of !Optional.isPresent() with Optional.isEmpty >> method. >> It's makes code a bit easier to read. > > LGTM I suspect @dfuch will sponsor this once he's had a chance to run the tests. - PR: https:

Re: RFR: 8277412: Use String.isBlank to simplify code in sun.net.www.protocol.mailto.Handler

2021-12-07 Thread Alan Bateman
On Fri, 12 Nov 2021 19:11:36 GMT, Andrey Turbanov wrote: > All this manually written code actually can be replaced with single > String.isBlank() call. > `file` variable is guaranteed to be non-null. src/java.base/share/classes/sun/net/www/protocol/mailto/Handler.java line 125: > 123:

Re: RFR: 8277868: Use Comparable.compare() instead of surrogate code [v2]

2021-12-07 Thread Сергей Цыпанов
On Mon, 6 Dec 2021 17:46:22 GMT, Phil Race wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8277868: Use Integer.signum() in BasicTableUI > > src/java.desktop/share/classes/java/awt/geom/Line2D.java line 115: > >

Re: RFR: 8277868: Use Comparable.compare() instead of surrogate code [v3]

2021-12-07 Thread Сергей Цыпанов
> Instead of something like > > long x; > long y; > return (x < y) ? -1 : ((x == y) ? 0 : 1); > > we can use `return Long.compare(x, y);` > > All replacements are done with IDE. Сергей Цыпанов has updated the pull request incrementally with one additional commit since the last revision: 827

Integrated: 8278270: ServerSocket is not thread safe

2021-12-07 Thread Alan Bateman
On Sun, 5 Dec 2021 16:44:05 GMT, Alan Bateman wrote: > There are several thread safety issues in java.net.ServerSocket, issues that > go back to at least JDK 1.4. > > The issue of most concern is async close of a ServerSocket that is initially > created unbound and where close may be called at

Re: RFR: 8277868: Use Comparable.compare() instead of surrogate code [v2]

2021-12-07 Thread Сергей Цыпанов
On Mon, 6 Dec 2021 17:48:37 GMT, Phil Race wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8277868: Use Integer.signum() in BasicTableUI > > src/java.desktop/share/classes/sun/java2d/Spans.java line 322: > >> 32

RFR: 8278158: jwebserver should set request timeout

2021-12-07 Thread Julia Boes
This change sets a maximum request time for the `jwebserver` (and `java -m jdk.httpserver`), unless it has already been set. While here, I removed a comment from the implementation classes, a left-over from the pre-module era that is not needed and should not have been included in the first pl

Re: RFR: 8277412: Use String.isBlank to simplify code in sun.net.www.protocol.mailto.Handler

2021-12-07 Thread Andrey Turbanov
On Tue, 7 Dec 2021 08:07:22 GMT, Alan Bateman wrote: >> All this manually written code actually can be replaced with single >> String.isBlank() call. >> `file` variable is guaranteed to be non-null. > > src/java.base/share/classes/sun/net/www/protocol/mailto/Handler.java line 125: > >> 123:

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

2021-12-07 Thread Daniel Fuchs
On Wed, 6 Oct 2021 20:37:29 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-res

Re: RFR: 8278158: jwebserver should set request timeout

2021-12-07 Thread Daniel Fuchs
On Tue, 7 Dec 2021 10:24:31 GMT, Julia Boes wrote: > This change sets a maximum request time for the `jwebserver` (and `java -m > jdk.httpserver`), unless it has already been set. > > While here, I removed a comment from the implementation classes, a left-over > from the pre-module era that i

Re: RFR: 8277868: Use Comparable.compare() instead of surrogate code [v3]

2021-12-07 Thread Alexey Ivanov
On Tue, 7 Dec 2021 08:28:47 GMT, Сергей Цыпанов wrote: >> Instead of something like >> >> long x; >> long y; >> return (x < y) ? -1 : ((x == y) ? 0 : 1); >> >> we can use `return Long.compare(x, y);` >> >> All replacements are done with IDE. > > Сергей Цыпанов has updated the pull request incr

Re: RFR: 8277868: Use Comparable.compare() instead of surrogate code [v2]

2021-12-07 Thread Alexey Ivanov
On Tue, 7 Dec 2021 08:16:08 GMT, Сергей Цыпанов wrote: >> src/java.desktop/share/classes/java/awt/geom/Line2D.java line 115: >> >>> 113: */ >>> 114: public double getX1() { >>> 115: return x1; >> >> What do these changes have to do with the subject of the PR ? > > J

RFR: 8269258: java/net/httpclient/ManyRequestsLegacy.java failed with connection timeout

2021-12-07 Thread Daniel Fuchs
The three tests: test/jdk/java/net/httpclient/ManyRequests.java test/jdk/java/net/httpclient/ManyRequests2.java test/jdk/java/net/httpclient/ManyRequestsLegacy.java have been observed failing intermittently with ConnectException on windows 10 machines in our CI. These tests open 20 concurrent r

RFR: 8278339: ServerSocket::isClosed may return false after accept throws

2021-12-07 Thread Alan Bateman
JDK-8278270 introduces a small regression. If a ServerSocket is closed while another thread is blocked in the accept method then the other thread may observe isClosed returning false, i.e. code may catch IOException and check isClosed before the "closed" flag gets to true. I've changed the clos

Re: RFR: 8278339: ServerSocket::isClosed may return false after accept throws

2021-12-07 Thread Daniel Fuchs
On Tue, 7 Dec 2021 12:29:09 GMT, Alan Bateman wrote: > JDK-8278270 introduces a small regression. If a ServerSocket is closed while > another thread is blocked in the accept method then the other thread may > observe isClosed returning false, i.e. code may catch IOException and check > isClose

Integrated: 8278339: ServerSocket::isClosed may return false after accept throws

2021-12-07 Thread Alan Bateman
On Tue, 7 Dec 2021 12:29:09 GMT, Alan Bateman wrote: > JDK-8278270 introduces a small regression. If a ServerSocket is closed while > another thread is blocked in the accept method then the other thread may > observe isClosed returning false, i.e. code may catch IOException and check > isClose

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

2021-12-07 Thread Andrey Turbanov
On Tue, 7 Dec 2021 11:41:12 GMT, Daniel Fuchs 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/classes/

Re: RFR: 8277868: Use Comparable.compare() instead of surrogate code [v4]

2021-12-07 Thread Сергей Цыпанов
> Instead of something like > > long x; > long y; > return (x < y) ? -1 : ((x == y) ? 0 : 1); > > we can use `return Long.compare(x, y);` > > All replacements are done with IDE. Сергей Цыпанов has updated the pull request incrementally with two additional commits since the last revision: - 8

Re: RFR: 8277868: Use Comparable.compare() instead of surrogate code [v3]

2021-12-07 Thread Сергей Цыпанов
On Tue, 7 Dec 2021 12:01:27 GMT, Alexey Ivanov wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8277868: Inline local var > > src/java.base/share/classes/java/util/Calendar.java line 3420: > >> 3418: private

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

2021-12-07 Thread Daniel Fuchs
On Wed, 6 Oct 2021 20:37:29 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-res

Re: RFR: 8278158: jwebserver should set request timeout

2021-12-07 Thread Michael McMahon
On Tue, 7 Dec 2021 10:24:31 GMT, Julia Boes wrote: > This change sets a maximum request time for the `jwebserver` (and `java -m > jdk.httpserver`), unless it has already been set. > > While here, I removed a comment from the implementation classes, a left-over > from the pre-module era that i

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

2021-12-07 Thread Daniel Fuchs
On Tue, 7 Dec 2021 14:24:41 GMT, Andrey Turbanov wrote: >> src/java.base/share/classes/sun/net/www/MimeTable.java line 385: >> >>> 383: >>> 384: protected boolean saveAsProperties(File file) { >>> 385: try (FileOutputStream os = new FileOutputStream(file)) { >> >> This is not stric