Re: RFR: 8339850: Restore the interrupt status in FileSystemPreferences.lockFile() [v3]

2024-10-02 Thread Vyom Tewari
On Mon, 30 Sep 2024 16:11:14 GMT, sbgoog wrote: >> FIleSystemPreferences.lockFile() catches an InterruptedException and just >> returns false, forgetting to re-interrupt the current thread. This leaves >> the caller with no way to observe that the thread was interrupted. This >> change restore

Re: RFR: 8339126: JNI exception pending in Inflater.c

2024-08-27 Thread Vyom Tewari
On Tue, 27 Aug 2024 21:26:52 GMT, Justin Lu wrote: > This PR addresses the JNI pending exception in Inflater.c, under > `Java_java_util_zip_Inflater_initIDs`. Looks OK to me. - Marked as reviewed by vtewari (Committer). PR Review: https://git.openjdk.org/jdk/pull/20735#pullreques

Re: RFR: 8336844: ZipConstants64 defines duplicate constants EXTID_ZIP64 and ZIP64_EXTID [v2]

2024-07-19 Thread Vyom Tewari
On Sat, 20 Jul 2024 02:18:11 GMT, Liam Miller-Cushon wrote: >> This change deduplicates constants in ZipConstants64 for the Zip64 Extended >> Information Extra Field Header ID (see APPNOTE.TXT 4.5.3). >> >> I think there are arguments for consolidating on either `EXTID_ZIP64` or >> `ZIP64_EXTI

Re: RFR: 8322772: Clean up code after JDK-8322417

2023-12-29 Thread Vyom Tewari
On Fri, 29 Dec 2023 13:44:27 GMT, Christoph Langer wrote: > In the review of the PR for JDK-8322417 it was noted that a fully qualified > class name "java.util.Arrays" is unnecessary but it was forgotten to clean it > up prior to integration. Looks OK - Marked as reviewed by vtew

Re: RFR: 8315351: Rid synchronization in PipedInputStream.close() in favour of benign race

2023-08-30 Thread Vyom Tewari
On Wed, 30 Aug 2023 09:49:39 GMT, Sergey Tsypanov wrote: > Assuming that the value written into `in` is always `-1` we can rid > synchronized block in favour of guarding `in = - 1` with writing into > volatile `closedByReader `: > > public void close() throws IOException { > closedByReader

Re: RFR: JDK-8314883: Java_java_util_prefs_FileSystemPreferences_lockFile0 write result errno in missing case

2023-08-24 Thread Vyom Tewari
On Wed, 23 Aug 2023 13:45:14 GMT, Matthias Baesken wrote: > There seems to be a codepath in > Java_java_util_prefs_FileSystemPreferences_lockFile0 where the errno is not > stored but potentially accessed in the calling Java code. Looks OK to me. - Marked as reviewed by vtewari (C

Re: RFR: 4799358: BufferOutputStream.write() should immediately throw IOException on closed stream [v2]

2023-08-24 Thread Vyom Tewari
On Wed, 23 Aug 2023 21:41:41 GMT, Brian Burkhalter wrote: >> Vyom Tewari has updated the pull request incrementally with one additional >> commit since the last revision: >> >> make the isOpen method to package private > > src/java.base/share/classes/java/io/Fi

Re: RFR: 4799358: BufferOutputStream.write() should immediately throw IOExcept on closed stream [v2]

2023-08-23 Thread Vyom Tewari
On Wed, 23 Aug 2023 21:54:31 GMT, Brian Burkhalter wrote: > The proposed change does not appear to add a great deal of value and breaks > longstanding behavior. In such cases, the preferred approach is usually to > modify the specification to match the current, albeit incorrect, behavior > rat

Re: RFR: 4799358: BufferOutputStream.write() should immediately throw IOExcept on closed stream [v2]

2023-08-23 Thread Vyom Tewari
o BufferedOutputStream which will > check if the underline stream is open. If the underline stream is closed > "ensureOpen" will throw the IOException. Vyom Tewari has updated the pull request incrementally with one additional commit since the last revision: mak

Re: RFR: 4799358: BufferOutputStream.write() should immediately throw IOExcept on closed stream

2023-08-21 Thread Vyom Tewari
On Mon, 21 Aug 2023 14:37:37 GMT, Alan Bateman wrote: >> With the current implementation of BufferedOutputStream if you close the >> stream and try to write to the closed stream BufferedOutputStream does not >> throw an IOException until the internal buffer is full. To fix this issue i >> add

RFR: 4799358: BufferOutputStream.write() should immediately throw IOExcept on closed stream

2023-08-21 Thread Vyom Tewari
With the current implementation of BufferedOutputStream if you close the stream and try to write to the closed stream BufferedOutputStream does not throw an IOException until the internal buffer is full. To fix this issue i added a private "ensureOpen" function to BufferedOutputStream which wi

Re: RFR: 8219567: Name of first parameter of RandomAccessFile(String,String) is inconsistent

2023-08-18 Thread Vyom Tewari
On Fri, 18 Aug 2023 23:14:20 GMT, Brian Burkhalter wrote: > Revise some verbiage about the `RandomAccessFile(String,String)` constructor > so that the string name of a file is referred to as _pathname string_ for > consistency with `java.io.File`. Looks OK to me - Marked as revie

Re: RFR: 8314063 : The socket is not closed in Connection::createSocket when the handshake failed for LDAP connection [v3]

2023-08-17 Thread Vyom Tewari
On Wed, 16 Aug 2023 23:11:11 GMT, Weibing Xiao wrote: >> Please refer to JDK-8314063. >> >> The failure scenario is due to the setting of connection timeout. It is >> either too small or not an optimal value for the system. When the client >> tries to connect to the server with LDAPs protocol.

Re: RFR: 8314321: Remove unused field jdk.internal.util.xml.impl.Attrs.mAttrIdx

2023-08-16 Thread Vyom Tewari
On Tue, 15 Aug 2023 20:13:18 GMT, Andrey Turbanov wrote: > A field `char mAttrIdx` in the `jdk.internal.util.xml.impl.Attrs` class is > unused and can be removed. Looks OK to me. - Marked as reviewed by vtewari (Committer). PR Review: https://git.openjdk.org/jdk/pull/15298#pullre

Re: RFR: 8313657 : com.sun.jndi.ldap.Connection.cleanup does not close connections on SocketTimeoutErrors [v5]

2023-08-09 Thread Vyom Tewari
On Wed, 9 Aug 2023 12:52:35 GMT, Weibing Xiao wrote: >> com.sun.jndi.ldap.Connection::leanup does not close the underlying socket if >> the is an IOException generation when the output stream was flushing the >> buffer. >> >> Please refer to the bug https://bugs.openjdk.org/browse/JDK-8313657.

Re: RFR: 8313657 : com.sun.jndi.ldap.Connection.cleanup does not close connections on SocketTimeoutErrors [v4]

2023-08-08 Thread Vyom Tewari
On Wed, 9 Aug 2023 00:21:55 GMT, Weibing Xiao wrote: >> com.sun.jndi.ldap.Connection::leanup does not close the underlying socket if >> the is an IOException generation when the output stream was flushing the >> buffer. >> >> Please refer to the bug https://bugs.openjdk.org/browse/JDK-8313657.

Re: RFR: 8313657 : com.sun.jndi.ldap.Connection.cleanup does not close connections on SocketTimeoutErrors [v4]

2023-08-08 Thread Vyom Tewari
On Wed, 9 Aug 2023 00:21:55 GMT, Weibing Xiao wrote: >> com.sun.jndi.ldap.Connection::leanup does not close the underlying socket if >> the is an IOException generation when the output stream was flushing the >> buffer. >> >> Please refer to the bug https://bugs.openjdk.org/browse/JDK-8313657.

Re: RFR: 8313657 : com.sun.jndi.ldap.Connection.cleanup does not close connections on SocketTimeoutErrors [v3]

2023-08-06 Thread Vyom Tewari
On Fri, 4 Aug 2023 19:09:58 GMT, Weibing Xiao wrote: >> com.sun.jndi.ldap.Connection::leanup does not close the underlying socket if >> the is an IOException generation when the output stream was flushing the >> buffer. >> >> Please refer to the bug https://bugs.openjdk.org/browse/JDK-8313657.

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available [v3]

2023-07-29 Thread Vyom Tewari
On Fri, 28 Jul 2023 19:59:15 GMT, Brian Burkhalter wrote: >> Limit native memory allocation and move write loop from the native layer >> into Java. This change should make the OOME reported in the issue much less >> likely. > > Brian Burkhalter has updated the pull request incrementally with on

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available [v2]

2023-07-26 Thread Vyom Tewari
On Wed, 26 Jul 2023 15:49:38 GMT, Brian Burkhalter wrote: >> src/java.base/share/native/libjava/io_util.c line 173: >> >>> 171: if (len > MAX_MALLOC_SIZE) >>> 172: len = MAX_MALLOC_SIZE; >>> 173: buf = (char*)malloc(len*sizeof(char)); >> >> please reformat line 173 >

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available [v2]

2023-07-25 Thread Vyom Tewari
On Tue, 25 Jul 2023 23:50:07 GMT, Brian Burkhalter wrote: >> Limit native memory allocation and move write loop from the native layer >> into Java. This change should make the OOME reported in the issue much less >> likely. > > Brian Burkhalter has updated the pull request incrementally with th

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available [v2]

2023-07-25 Thread Vyom Tewari
On Tue, 25 Jul 2023 23:50:07 GMT, Brian Burkhalter wrote: >> Limit native memory allocation and move write loop from the native layer >> into Java. This change should make the OOME reported in the issue much less >> likely. > > Brian Burkhalter has updated the pull request incrementally with th

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available [v2]

2023-07-25 Thread Vyom Tewari
On Tue, 25 Jul 2023 23:50:07 GMT, Brian Burkhalter wrote: >> Limit native memory allocation and move write loop from the native layer >> into Java. This change should make the OOME reported in the issue much less >> likely. > > Brian Burkhalter has updated the pull request incrementally with th

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available

2023-07-24 Thread Vyom Tewari
On Fri, 21 Jul 2023 22:40:00 GMT, Brian Burkhalter wrote: > Limit native memory allocation and move write loop from the native layer into > Java. This change should make the OOME reported in the issue much less likely. src/java.base/share/native/libjava/io_util.c line 99: > 97: return

Re: RFR: 8312164: Refactor Arrays.hashCode for long, boolean, and Object arrays

2023-07-17 Thread Vyom Tewari
On Mon, 17 Jul 2023 09:36:35 GMT, Pavel Rappo wrote: > Please review this PR to refactor Arrays.hashCode for long[], boolean[], and > Object[]. I've been told elsewhere that it shouldn't have significant > performance implications. Looks OK to me. - Marked as reviewed by vtewari

Re: RFR: 8312089: Simplify and modernize equals, hashCode, and compareTo in java.nio and implementation code [v3]

2023-07-16 Thread Vyom Tewari
On Fri, 14 Jul 2023 18:54:35 GMT, Pavel Rappo wrote: >> Please review this PR to use modern APIs and language features to simplify >> equals, hashCode, and compareTo for in java.nio and implementation code. >> >> Please note, test results are pending. >> >> Additional notes: >> >> * This PR s

Re: RFR: 8301214: Adjust handshakeTimeout value in test HandshakeTimeout.java after 8189338 [v2]

2023-02-07 Thread Vyom Tewari
On Tue, 7 Feb 2023 09:38:13 GMT, Daniel Jeliński wrote: >> Please review this patch that reduces the socket timeout used in >> HandshakeTimeout test to its minimum value of 1 millisecond. >> >> This change makes the test complete 10 seconds faster; before this change it >> took 5 seconds for t

Re: RFR: JDK-8301621: libzip should use pread instead of lseek+read

2023-02-06 Thread Vyom Tewari
On Fri, 3 Feb 2023 19:49:44 GMT, Justin King wrote: > Avoid using `lseek` + `read` in favor of `pread`. For Windows, we can do the > same thing by using `OVERLAPPED`, as we are in synchronous mode we can use > `Offset` and `OffsetHigh` to achieve the same thing. > > Additionally I updated open

Re: RFR: 8301367: Add exception handler method to the BaseLdapServer

2023-02-01 Thread Vyom Tewari
On Tue, 31 Jan 2023 16:19:34 GMT, Aleksei Efimov wrote: > The proposed change adds a new exception handler method to the > `test/jdk/com/sun/jndi/ldap/lib/BaseLdapServer.java` LDAP test library class. > It will allow LDAP tests to customize the handling of server-side exceptions. > > The cu

Re: RFR: 8301214: Adjust handshakeTimeout value in test HandshakeTimeout.java after 8189338

2023-01-30 Thread Vyom Tewari
On Mon, 30 Jan 2023 14:08:49 GMT, Daniel Jeliński wrote: >> test/jdk/java/rmi/transport/handshakeTimeout/HandshakeTimeout.java line 59: >> >>> 57: public static void main(String[] args) throws Exception { >>> 58: >>> 59: System.setProperty("sun.rmi.transport.tcp.handshakeTimeout",

Re: RFR: 8301214: Adjust handshakeTimeout value in test HandshakeTimeout.java after 8189338

2023-01-30 Thread Vyom Tewari
On Mon, 30 Jan 2023 11:06:05 GMT, Daniel Jeliński wrote: > Please review this patch that reduces the socket timeout used in > HandshakeTimeout test to its minimum value of 1 millisecond. > > This change makes the test complete 10 seconds faster; before this change it > took 5 seconds for the h

Re: RFR: 8298380: Clean up redundant array length checks in JDK code base

2022-12-08 Thread Vyom Tewari
On Thu, 8 Dec 2022 12:37:17 GMT, Sergey Tsypanov wrote: > Newer version of IntelliJ IDEA introduces new > [inspection](https://youtrack.jetbrains.com/issue/IDEA-301797/IDEA-should-report-redundant-array-length-check-in-certain-cases) > detecting redundant array length check in snippets like >

Re: RFR: 8295823: Use enhanced-for cycle instead of Enumeration in java.naming

2022-10-24 Thread Vyom Tewari
On Thu, 20 Oct 2022 20:28:37 GMT, Andrey Turbanov wrote: > `java.util.Enumeration` is a legacy interface from java 1.0. > There are couple of cycles which use it to iterate over collections. We can > replace this manual cycle with enchanced-for, which is shorter and easier to > read. Looks OK

Re: RFR: 8234262: Unmask SIGQUIT in a child process [v3]

2022-09-23 Thread Vyom Tewari
On Thu, 22 Sep 2022 22:41:21 GMT, Roger Riggs wrote: >> Clear the signal mask of the child when launching with posix_spawn. >> >> SIGQUIT signals are handled on non-Java Threads by the VM. >> For Java threads the signal mask blocks SIGQUIT. >> The ProcessBuilder uses posix_spawn on all platfor