Re: RFR: 8274412: Add a method to Stream API to consume and close the stream without using try-with-resources

2021-10-15 Thread Glavo
I don't think it is a perfect solution to combine the close operation with the terminator operation, because there are similar issues in the intermediate operation. Consider this use case (for example only): try (var stream = Files.list(path) .flatMap(dir -> { try {

Withdrawn: 8274412: Add a method to Stream API to consume and close the stream without using try-with-resources

2021-10-15 Thread Tagir F . Valeev
On Sun, 3 Oct 2021 11:00:25 GMT, Tagir F. Valeev wrote: > Currently, when the stream holds a resource, it's necessary to wrap it with > try-with-resources. This undermines the compact and fluent style of stream > API calls. For example, if we want to get the `List` of files inside the >

Re: RFR: 8274412: Add a method to Stream API to consume and close the stream without using try-with-resources

2021-10-15 Thread Tagir Valeev
Hello! > I am not really sure we’ve gotten the right idiom here yet. I’d like to slow > down a bit before making an API decision. > > What id suggest is capturing the proposed api and spec on list, and let’s let > this sit and bake for a bit longer. My sense is that something better may >

Re: RFR: 8271515: Integration of JEP 417: Vector API (Third Incubator) [v3]

2021-10-15 Thread Paul Sandoz
> This PR improves the performance of vector operations that accept masks on > architectures that support masking in hardware, specifically Intel AVX512 and > ARM SVE. > > On architectures that do not support masking in hardware the same technique > as before is applied to most operations,

Re: SourceVersion::feature

2021-10-15 Thread Joseph D. Darcy
PS See https://github.com/openjdk/jdk/pull/5973 -Joe On 10/14/2021 1:53 PM, Joseph D. Darcy wrote: On 10/14/2021 10:23 AM, Michael Bien wrote: is this the right mailing list for javax.lang.model.* discussions? The compiler-dev list would be appropriate as well, but core-libs will work.

Re: RFR: 8275167: x86 intrinsic for unsignedMultiplyHigh

2021-10-15 Thread Vamsi Parasa
On Fri, 15 Oct 2021 20:19:31 GMT, Vladimir Kozlov wrote: > > > How you verified correctness of results? I suggest to extend > > > `test/jdk//java/lang/Math/MultiplicationTests.java` test to cover > > > unsigned method. > > > > > > Tests for unsignedMultiplyHigh were already added in > >

Integrated: 8275163: Deflater::deflate methods omit javadoc for ReadOnlyBufferException

2021-10-15 Thread Lance Andersen
On Wed, 13 Oct 2021 17:43:29 GMT, Lance Andersen wrote: > Hi all, > > Please review the fix to address a javadoc issue for the Deflater::deflate > methods that were added as part of JDK-6341887 that could throw a > ReadOnlyBufferException. > > The` @throws ` clause for

Integrated: 8275145: file.encoding system property has an incorrect value on Windows

2021-10-15 Thread Naoto Sato
On Thu, 14 Oct 2021 15:50:28 GMT, Naoto Sato wrote: > Fixing a regression in which `file.encoding` was initialized by > `sprops->encoding` instead of `sprops->sun_jnu_encoding` on non macOS > platforms. tier1-3 tests passed on all platforms. This pull request has now been integrated.

Re: RFR: 8275167: x86 intrinsic for unsignedMultiplyHigh

2021-10-15 Thread Vladimir Kozlov
On Fri, 15 Oct 2021 19:19:13 GMT, Vamsi Parasa wrote: > > How you verified correctness of results? I suggest to extend > > `test/jdk//java/lang/Math/MultiplicationTests.java` test to cover unsigned > > method. > > Tests for unsignedMultiplyHigh were already added in >

Re: RFR: 8275342: Change nested classes in java.prefs to static nested classes

2021-10-15 Thread Andrey Turbanov
On Fri, 15 Oct 2021 18:51:44 GMT, Andrey Turbanov wrote: > Non-static classes hold a link to their parent classes, which can be avoided. src/java.prefs/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java line 102: > 100: } > 101: > 102: private class SyncTask extends TimerTask

RFR: 8275342: Change nested classes in java.prefs to static nested classes

2021-10-15 Thread Andrey Turbanov
Non-static classes hold a link to their parent classes, which can be avoided. - Commit messages: - [PATCH] Change nested classes in java.prefs to static nested classes Changes: https://git.openjdk.java.net/jdk/pull/5971/files Webrev:

Re: RFR: 8153490: Cannot setBytes() if incoming buffer's length is bigger than number of elements we want to insert. [v5]

2021-10-15 Thread Lance Andersen
On Fri, 15 Oct 2021 09:30:18 GMT, Mitsuru Kariya wrote: >> Fix `SerialBlob.setBytes(long pos, byte[] bytes, int offset, int length)` in >> the following cases: >> >> 1. `pos - 1 + bytes.length - offset > this.length() && pos - 1 + length <= >> this.length()` >>The original implementation

Re: RFR: 8275167: x86 intrinsic for unsignedMultiplyHigh

2021-10-15 Thread Vamsi Parasa
On Fri, 15 Oct 2021 16:14:25 GMT, Andrew Haley wrote: >> Optimize the new Math.unsignedMultiplyHigh using the x86 mul instruction. >> This change show 1.87X improvement on a micro benchmark. > > src/hotspot/share/opto/mulnode.cpp line 468: > >> 466: } >> 467: >> 468: >>

Re: RFR: 8275167: x86 intrinsic for unsignedMultiplyHigh

2021-10-15 Thread Vamsi Parasa
On Fri, 15 Oct 2021 18:45:41 GMT, Vladimir Kozlov wrote: > How you verified correctness of results? I suggest to extend > `test/jdk//java/lang/Math/MultiplicationTests.java` test to cover unsigned > method. Tests for unsignedMultiplyHigh were already added in

Re: RFR: 8275167: x86 intrinsic for unsignedMultiplyHigh

2021-10-15 Thread Vladimir Kozlov
On Wed, 13 Oct 2021 18:55:10 GMT, Vamsi Parasa wrote: > Optimize the new Math.unsignedMultiplyHigh using the x86 mul instruction. > This change show 1.87X improvement on a micro benchmark. How you verified correctness of results? I suggest to extend

Re: RFR: 8266936: Add a finalization JFR event [v17]

2021-10-15 Thread Coleen Phillimore
On Fri, 15 Oct 2021 09:27:54 GMT, Markus Grönlund wrote: >> Greetings, >> >> Object.finalize() was deprecated in JDK9. There is an ongoing effort to >> replace and mitigate Object.finalize() uses in the JDK libraries; please see >> https://bugs.openjdk.java.net/browse/JDK-8253568 for more

Integrated: JDK-8275249: Suppress warnings on non-serializable array component types in jdk.jlink

2021-10-15 Thread Joe Darcy
On Wed, 13 Oct 2021 21:08:41 GMT, Joe Darcy wrote: > After a refinement to the checks under development in #5709, the new checks > examine array types of serial fields and warn if the underlying component > type is not serializable. Per the JLS, all array types are serializable, but > if the

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

2021-10-15 Thread Daniel Fuchs
On Tue, 12 Oct 2021 15:43:24 GMT, Aleksei Efimov wrote: >> 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

Re: RFR: 8275167: x86 intrinsic for unsignedMultiplyHigh

2021-10-15 Thread Andrew Haley
On Wed, 13 Oct 2021 18:55:10 GMT, Vamsi Parasa wrote: > Optimize the new Math.unsignedMultiplyHigh using the x86 mul instruction. > This change show 1.87X improvement on a micro benchmark. test/micro/org/openjdk/bench/java/lang/MathBench.java line 547: > 545: return

Re: RFR: 8275063: Implementation of Foreign Function & Memory API (Second incubator) [v5]

2021-10-15 Thread Maurizio Cimadamore
On Fri, 15 Oct 2021 16:54:58 GMT, Maurizio Cimadamore wrote: >> This PR contains the API and implementation changes for JEP-419 [1]. A more >> detailed description of such changes, to avoid repetitions during the review >> process, is included as a separate comment. >> >> [1] -

Re: RFR: 8275063: Implementation of Foreign Function & Memory API (Second incubator) [v5]

2021-10-15 Thread Maurizio Cimadamore
> This PR contains the API and implementation changes for JEP-419 [1]. A more > detailed description of such changes, to avoid repetitions during the review > process, is included as a separate comment. > > [1] - https://openjdk.java.net/jeps/419 Maurizio Cimadamore has updated the pull

Integrated: 8275013: Improve discussion of serialization method declarations in java.io.Object{Input, Output}Stream

2021-10-15 Thread Joe Darcy
On Sun, 10 Oct 2021 20:25:43 GMT, Joe Darcy wrote: > The java.io.ObjectInputStream and java.io.ObjectOuputStream classes are part > of the serialization feature. These classes contain brief descriptions of > some of the methods serializable classes can define to interact with the >

Re: RFR: 8275167: x86 intrinsic for unsignedMultiplyHigh

2021-10-15 Thread Andrew Haley
On Wed, 13 Oct 2021 18:55:10 GMT, Vamsi Parasa wrote: > Optimize the new Math.unsignedMultiplyHigh using the x86 mul instruction. > This change show 1.87X improvement on a micro benchmark. src/hotspot/share/opto/mulnode.cpp line 468: > 466: } > 467: > 468: >

Re: RFR: 8275167: x86 intrinsic for unsignedMultiplyHigh

2021-10-15 Thread Brian Burkhalter
On Wed, 13 Oct 2021 18:55:10 GMT, Vamsi Parasa wrote: > Optimize the new Math.unsignedMultiplyHigh using the x86 mul instruction. > This change show 1.87X improvement on a micro benchmark. The `java.lang.Math` change looks good, of course. On the rest I cannot comment but it is good to see

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

2021-10-15 Thread Daniel Fuchs
On Tue, 12 Oct 2021 15:43:24 GMT, Aleksei Efimov wrote: >> 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

Re: RFR: 8271820: Implementation of JEP 416: Reimplement Core Reflection with Method Handle [v13]

2021-10-15 Thread Peter Levart
On Thu, 14 Oct 2021 16:05:19 GMT, Mandy Chung wrote: >> src/java.base/share/classes/jdk/internal/reflect/DirectMethodHandleAccessor.java >> line 86: >> >>> 84: } >>> 85: >>> 86: private static final int PARAM_COUNT_MASK = 0x00FF; >> >> Is this packing logic required? I get it that it

Re: RFR: 8275013: Improve discussion of serialization method declarations in java.io.Object{Input, Output}Stream

2021-10-15 Thread Roger Riggs
On Sun, 10 Oct 2021 20:25:43 GMT, Joe Darcy wrote: > The java.io.ObjectInputStream and java.io.ObjectOuputStream classes are part > of the serialization feature. These classes contain brief descriptions of > some of the methods serializable classes can define to interact with the >

Re: RFR: 8275293: A change done with JDK-8268764 mismatches the java.rmi.server.ObjID.hashCode spec

2021-10-15 Thread Roger Riggs
On Fri, 15 Oct 2021 07:17:52 GMT, Сергей Цыпанов wrote: > It looks like we cannot use `Long.hashCode(long)` for > `java.rmi.server.ObjID.hashCode()` due to specification: > https://docs.oracle.com/en/java/javase/17/docs/api/java.rmi/java/rmi/server/ObjID.html#hashCode(). Marked as reviewed by

RFR: 8275167: x86 intrinsic for unsignedMultiplyHigh

2021-10-15 Thread Vamsi Parasa
Optimize the new Math.unsignedMultiplyHigh using the x86 mul instruction. This change show 1.87X improvement on a micro benchmark. - Commit messages: - fix typo in function name - 8275167: x86 intrinsic for unsignedMultiplyHigh Changes:

Re: RFR: 8275293: A change done with JDK-8268764 mismatches the java.rmi.server.ObjID.hashCode spec

2021-10-15 Thread Сергей Цыпанов
On Fri, 15 Oct 2021 11:43:53 GMT, Pavel Rappo wrote: >> It looks like we cannot use `Long.hashCode(long)` for >> `java.rmi.server.ObjID.hashCode()` due to specification: >> https://docs.oracle.com/en/java/javase/17/docs/api/java.rmi/java/rmi/server/ObjID.html#hashCode(). > > It's important to

Re: RFR: 8275293: A change done with JDK-8268764 mismatches the java.rmi.server.ObjID.hashCode spec

2021-10-15 Thread Pavel Rappo
On Fri, 15 Oct 2021 07:17:52 GMT, Сергей Цыпанов wrote: > It looks like we cannot use `Long.hashCode(long)` for > `java.rmi.server.ObjID.hashCode()` due to JavaDoc: > https://docs.oracle.com/en/java/javase/17/docs/api/java.rmi/java/rmi/server/ObjID.html#hashCode(). It's important to be

Re: RFR: 8273111: Default timezone should return zone ID if /etc/localtime is valid but not canonicalization on linux [v4]

2021-10-15 Thread Hamlin Li
On Thu, 14 Oct 2021 02:08:45 GMT, Wu Yan wrote: >> Hi, >> Please help me review the change to enhance getting time zone ID from >> /etc/localtime on linux. >> >> We use `realpath` instead of `readlink` to obtain the link name of >> /etc/localtime, because `readlink` can only read the value

Re: RFR: 8266936: Add a finalization JFR event [v16]

2021-10-15 Thread Markus Grönlund
On Thu, 14 Oct 2021 21:43:27 GMT, Coleen Phillimore wrote: >> Markus Grönlund has refreshed the contents of this pull request, and >> previous commits have been removed. The incremental views will show >> differences compared to the previous content of the PR. > >

Re: RFR: 8266936: Add a finalization JFR event [v16]

2021-10-15 Thread Markus Grönlund
On Thu, 14 Oct 2021 22:36:30 GMT, Markus Grönlund wrote: >> src/hotspot/share/jfr/support/jfrSymbolTable.hpp line 68: >> >>> 66: template class, >>> typename, size_t> >>> 67: friend class HashTableHost; >>> 68: typedef HashTableHost>> JfrSymbolTable> SymbolTable; >> >> Oh here it is.

Re: RFR: 8153490: Cannot setBytes() if incoming buffer's length is bigger than number of elements we want to insert. [v5]

2021-10-15 Thread Mitsuru Kariya
> Fix `SerialBlob.setBytes(long pos, byte[] bytes, int offset, int length)` in > the following cases: > > 1. `pos - 1 + bytes.length - offset > this.length() && pos - 1 + length <= > this.length()` >The original implementation throws `ArrayIndexOutOfBoundsException` but > this case should

Re: RFR: 8266936: Add a finalization JFR event [v17]

2021-10-15 Thread Markus Grönlund
> Greetings, > > Object.finalize() was deprecated in JDK9. There is an ongoing effort to > replace and mitigate Object.finalize() uses in the JDK libraries; please see > https://bugs.openjdk.java.net/browse/JDK-8253568 for more information. > > We also like to assist users in replacing and

Re: Optimization (?) of HashSet(Collection)

2021-10-15 Thread Andrew Haley
On 10/4/21 12:57, Сергей Цыпанов wrote: in the code of HashSet(Collection) we have an optimization opportunity: public HashSet(Collection c) { map = new HashMap<>(Math.max((int) (c.size()/.75f) + 1, 16)); addAll(c); } instead of using addAll() inherited from j.u.Collection we can use

Re: RFR: 4511638: Double.toString(double) sometimes produces incorrect results [v2]

2021-10-15 Thread zimmermann6
On Thu, 14 Oct 2021 16:51:42 GMT, Raffaello Giulietti wrote: > All have the form 2^q*10^(-k) not quite, for example 0x1.3eaba12cap-804 = 2251808225167717/2^855 is not of this form, but these cases come from the continued fraction expansion of 2^q*10^(-k). - PR:

Re: RFR: 4511638: Double.toString(double) sometimes produces incorrect results [v2]

2021-10-15 Thread Raffaello Giulietti
On Fri, 16 Apr 2021 11:30:32 GMT, Raffaello Giulietti wrote: >> Hello, >> >> here's a PR for a patch submitted on March 2020 >> [1](https://cr.openjdk.java.net/~bpb/4511638/webrev.04/) when Mercurial was >> a thing. >> >> The patch has been edited to adhere to OpenJDK code conventions about

Re: RFR: 8275293: A change done with JDK-8268764 mismatches the java.rmi.server.ObjID.hashCode spec

2021-10-15 Thread Сергей Цыпанов
On Fri, 15 Oct 2021 07:17:52 GMT, Сергей Цыпанов wrote: > It looks like we cannot use `Long.hashCode(long)` for > `java.rmi.server.ObjID.hashCode()` due to JavaDoc: > https://docs.oracle.com/en/java/javase/17/docs/api/java.rmi/java/rmi/server/ObjID.html#hashCode(). @stuart-marks FYI

RFR: 8275293: A change done with JDK-8268764 mismatches the java.rmi.server.ObjID.hashCode spec

2021-10-15 Thread Сергей Цыпанов
It looks like we cannot use `Long.hashCode(long)` for `java.rmi.server.ObjID.hashCode()` due to JavaDoc: https://docs.oracle.com/en/java/javase/17/docs/api/java.rmi/java/rmi/server/ObjID.html#hashCode(). - Commit messages: - 8275293: A change done with JDK-8268764 mismatches the