Re: RFR: JDK-8277095 : Empty streams create too many objects [v2]

2022-02-09 Thread kabutz
On Tue, 16 Nov 2021 20:53:26 GMT, kabutz wrote: >> This is a draft proposal for how we could improve stream performance for the >> case where the streams are empty. Empty collections are common-place. If we >> iterate over them with an Iterator, we would have to create one small >> Iterator

Re: RFR: JDK-8277175 : Add a parallel multiply method to BigInteger [v10]

2022-02-09 Thread kabutz
On Wed, 9 Feb 2022 22:42:50 GMT, Paul Sandoz wrote: >> src/java.base/share/classes/java/math/BigInteger.java line 1603: >> >>> 1601: * parallel multiplication algorithm will use more CPU resources >>> 1602: * to compute the result faster, with no increase in memory >>> 1603: *

Re: RFR: JDK-8277175 : Add a parallel multiply method to BigInteger [v10]

2022-02-09 Thread kabutz
On Wed, 9 Feb 2022 22:48:57 GMT, Paul Sandoz wrote: > > A question about wording of the @implNote. In multiply() they say: "An > > implementation may offer better algorithmic ...", but we changed this to > > "This implementation may offer better algorithmic ..." I've kept it as > > "This

Re: RFR: JDK-8277175 : Add a parallel multiply method to BigInteger [v11]

2022-02-09 Thread kabutz
> BigInteger currently uses three different algorithms for multiply. The simple > quadratic algorithm, then the slightly better Karatsuba if we exceed a bit > count and then Toom Cook 3 once we go into the several thousands of bits. > Since Toom Cook 3 is a recursive algorithm, it is trivial to

RFR: JDK-8281462: Annotation toString output for enum not reusable for source input

2022-02-09 Thread Joe Darcy
Two changes to the toString output for annotations to give better source fidelity: 1) For enum constants, call their name method rather than their toString method. An enum class can override the toString method to print something other than the name. 2) Switch from using binary names (names

Re: RFR: 8280915: Better parallelization for AbstractSpliterator and IteratorSpliterator when size is unknown [v4]

2022-02-09 Thread Tagir F . Valeev
On Thu, 10 Feb 2022 03:22:42 GMT, Tagir F. Valeev wrote: >> See the bug description for details. >> >> I propose a simple solution. Let's allow ArraySpliterator to be non-SIZED >> and report artificial estimatedSize(), much bigger than the real one. This >> will allow AbstractSpliterator and

Re: RFR: 8280915: Better parallelization for AbstractSpliterator and IteratorSpliterator when size is unknown [v5]

2022-02-09 Thread Tagir F . Valeev
> See the bug description for details. > > I propose a simple solution. Let's allow ArraySpliterator to be non-SIZED and > report artificial estimatedSize(), much bigger than the real one. This will > allow AbstractSpliterator and IteratorSpliterator to produce prefix whose > size is

Re: RFR: 8280915: Better parallelization for AbstractSpliterator and IteratorSpliterator when size is unknown [v4]

2022-02-09 Thread Tagir F . Valeev
> See the bug description for details. > > I propose a simple solution. Let's allow ArraySpliterator to be non-SIZED and > report artificial estimatedSize(), much bigger than the real one. This will > allow AbstractSpliterator and IteratorSpliterator to produce prefix whose > size is

Re: RFR: 8280825: Modules that "provide" ToolProvider should document the name that can be used

2022-02-09 Thread Christian Stein
On Thu, 10 Feb 2022 02:19:36 GMT, Jonathan Gibbons wrote: >> src/jdk.jartool/share/classes/module-info.java line 45: >> >>> 43: * Pass {@code "jar"} as the name to >>> 44: * {@link java.util.spi.ToolProvider#findFirst >>> ToolProvider.findFirst} >>> 45: * in order to

Re: RFR: 8261407: ReflectionFactory.checkInitted() is not thread-safe [v5]

2022-02-09 Thread liach
> Upon review of [8261407](https://bugs.openjdk.java.net/browse/JDK-8261407), > by design, duplicate initialization of ReflectionFactory should be safe as it > performs side-effect-free property read actions, and the suggesting of making > the `initted` field volatile cannot prevent concurrent

Re: RFR: 8280825: Modules that "provide" ToolProvider should document the name that can be used

2022-02-09 Thread Jonathan Gibbons
On Wed, 9 Feb 2022 20:33:02 GMT, Alan Bateman wrote: >> A number of modules declare that the "provide" ToolProvider. >> >> These modules now specify the "name" of the argument used by >> `ToolProvider.findFirst` to access an instance of the tool provider within >> the description part of a

Re: RFR: 8278173: [vectorapi] Add x64 intrinsics for unsigned (zero extended) casts

2022-02-09 Thread Sandhya Viswanathan
On Sat, 5 Feb 2022 15:34:08 GMT, Quan Anh Mai wrote: > Hi, > > This patch implements the unsigned upcast intrinsics in x86, which are used > in vector lane-wise reinterpreting operations. > > Thank you very much. src/hotspot/cpu/x86/assembler_x86.cpp line 4782: > 4780: vector_len ==

Re: RFR: 8281294: [vectorapi] FIRST_NONZERO reduction operation throws IllegalArgumentExcept on zero vectors

2022-02-09 Thread John R Rose
On Wed, 9 Feb 2022 21:36:01 GMT, Paul Sandoz wrote: > …ArgumentExcept on zero vectors > > This PR fixes issues for reduction using FIRST_NONZERO and adds tests. The > testing infrastructure is generalized to reduction functions and tests for > min/max reductions are updated to use that.

Re: RFR: JDK-8277175 : Add a parallel multiply method to BigInteger [v10]

2022-02-09 Thread Paul Sandoz
On Thu, 3 Feb 2022 05:33:52 GMT, kabutz wrote: > A question about wording of the @implNote. In multiply() they say: "An > implementation may offer better algorithmic ...", but we changed this to > "This implementation may offer better algorithmic ..." I've kept it as "This > implementation

Re: RFR: 8281294: [vectorapi] FIRST_NONZERO reduction operation throws IllegalArgumentExcept on zero vectors

2022-02-09 Thread John R Rose
On Wed, 9 Feb 2022 21:36:01 GMT, Paul Sandoz wrote: > …ArgumentExcept on zero vectors > > This PR fixes issues for reduction using FIRST_NONZERO and adds tests. The > testing infrastructure is generalized to reduction functions and tests for > min/max reductions are updated to use that. Wow

Re: RFR: JDK-8277175 : Add a parallel multiply method to BigInteger [v10]

2022-02-09 Thread Paul Sandoz
On Thu, 3 Feb 2022 05:29:51 GMT, kabutz wrote: >> BigInteger currently uses three different algorithms for multiply. The >> simple quadratic algorithm, then the slightly better Karatsuba if we exceed >> a bit count and then Toom Cook 3 once we go into the several thousands of >> bits. Since

Re: RFR: JDK-8277175 : Add a parallel multiply method to BigInteger [v10]

2022-02-09 Thread Paul Sandoz
On Thu, 3 Feb 2022 06:35:47 GMT, Joe Darcy wrote: >> kabutz has updated the pull request incrementally with one additional commit >> since the last revision: >> >> Updated comment to include information about performance > > src/java.base/share/classes/java/math/BigInteger.java line 1603: >

Re: [External] : Re: HashMap.putAll can cause redundant space waste

2022-02-09 Thread Stuart Marks
On 2/8/22 5:51 PM, Xeno Amess wrote: I agree that it would be preferable for the expression to be something like this:      (int) Math.ceil(expected / 0.75) Agree. If we don't add a Java SE utility like "newHashMapWithExpectedSize", fallbacks would be to introduce an

RFR: 8281294: [vectorapi] FIRST_NONZERO reduction operation throws IllegalArgumentExcept on zero vectors

2022-02-09 Thread Paul Sandoz
…ArgumentExcept on zero vectors This PR fixes issues for reduction using FIRST_NONZERO and add tests. The testing infrastructure is generalized to reduction functions and tests for min/max reductions are updated to use that. - Commit messages: - 8281294: [vectorapi] FIRST_NONZERO

Re: RFR: 8280409: JarFile::verifiableEntry can fail with NPE accessing ze.getName() [v2]

2022-02-09 Thread Lance Andersen
On Tue, 8 Feb 2022 18:06:04 GMT, Lance Andersen wrote: >>> ze can't be null here. >> >> Actually it can be: Consider the following: >> >> >> try (JarFile jf = new JarFile(SIGNED_VALID_ENTRY_NAME_JAR.toFile(), >> true)) { >> var ze = new

Re: RFR: 8261407: ReflectionFactory.checkInitted() is not thread-safe [v4]

2022-02-09 Thread Mandy Chung
On Sat, 22 Jan 2022 00:05:49 GMT, liach wrote: >> Upon review of [8261407](https://bugs.openjdk.java.net/browse/JDK-8261407), >> by design, duplicate initialization of ReflectionFactory should be safe as >> it performs side-effect-free property read actions, and the suggesting of >> making

Re: RFR: 8280825: Modules that "provide" ToolProvider should document the name that can be used

2022-02-09 Thread Alan Bateman
On Wed, 9 Feb 2022 16:37:00 GMT, Christian Stein wrote: > A number of modules declare that the "provide" ToolProvider. > > These modules now specify the "name" of the argument used by > `ToolProvider.findFirst` to access an instance of the tool provider within > the description part of a

Re: RFR: 8280825: Modules that "provide" ToolProvider should document the name that can be used

2022-02-09 Thread Christian Stein
On Wed, 9 Feb 2022 16:37:00 GMT, Christian Stein wrote: > A number of modules declare that the "provide" ToolProvider. > > These modules now specify the "name" of the argument used by > `ToolProvider.findFirst` to access an instance of the tool provider within > the description part of a

Re: RFR: 8280825: Modules that "provide" ToolProvider should document the name that can be used

2022-02-09 Thread Jonathan Gibbons
On Wed, 9 Feb 2022 16:37:00 GMT, Christian Stein wrote: > A number of modules declare that the "provide" ToolProvider. > > These modules now specify the "name" of the argument used by > `ToolProvider.findFirst` to access an instance of the tool provider within > the description part of a

Re: RFR: 8275535: Retrying a failed authentication on multiple LDAP servers can lead to users blocked

2022-02-09 Thread Martin Balao
On Wed, 9 Feb 2022 19:12:34 GMT, Daniel Fuchs wrote: > The concerns are two folds: > > * without a regression test, you have to trust that the source changes > actually work, and there's typically no verification possible > * without a regression test, the next refactoring change in this area

Re: RFR: 8279995: jpackage --add-launcher option should allow overriding description

2022-02-09 Thread Alexey Semenyuk
On Wed, 9 Feb 2022 07:37:42 GMT, Alexander Matveev wrote: > Added ability to override description for additional launchers via > "description" property. Unfortunately, manual testing adds zero value to automated test runs. This feature can be covered with automated tests so it should be.

Re: RFR: 8261407: ReflectionFactory.checkInitted() is not thread-safe [v4]

2022-02-09 Thread liach
On Sat, 22 Jan 2022 00:05:49 GMT, liach wrote: >> Upon review of [8261407](https://bugs.openjdk.java.net/browse/JDK-8261407), >> by design, duplicate initialization of ReflectionFactory should be safe as >> it performs side-effect-free property read actions, and the suggesting of >> making

Re: RFR: 8280825: Modules that "provide" ToolProvider should document the name that can be used

2022-02-09 Thread Lance Andersen
On Wed, 9 Feb 2022 16:37:00 GMT, Christian Stein wrote: > A number of modules declare that the "provide" ToolProvider. > > These modules now specify the "name" of the argument used by > `ToolProvider.findFirst` to access an instance of the tool provider within > the description part of a

Re: RFR: 8279995: jpackage --add-launcher option should allow overriding description

2022-02-09 Thread Alexey Semenyuk
On Wed, 9 Feb 2022 18:53:35 GMT, Alexander Matveev wrote: >> test/jdk/tools/jpackage/share/AddLauncherTest.java line 93: >> >>> 91: new AdditionalLauncher("Baz2") >>> 92: .setDefaultArguments() >>> 93: .addRawProperties(Map.entry("description", "Baz2 >>>

Re: RFR: 8280825: Modules that "provide" ToolProvider should document the name that can be used

2022-02-09 Thread Jonathan Gibbons
On Wed, 9 Feb 2022 16:37:00 GMT, Christian Stein wrote: > A number of modules declare that the "provide" ToolProvider. > > These modules now specify the "name" of the argument used by > `ToolProvider.findFirst` to access an instance of the tool provider within > the description part of a

RFR: 8280825: Modules that "provide" ToolProvider should document the name that can be used

2022-02-09 Thread Christian Stein
A number of modules declare that the "provide" ToolProvider. These modules now specify the "name" of the argument used by `ToolProvider.findFirst` to access an instance of the tool provider within the description part of a `@provides` API tag. - Commit messages: - Separate

Re: RFR: 8275535: Retrying a failed authentication on multiple LDAP servers can lead to users blocked

2022-02-09 Thread Daniel Fuchs
On Wed, 20 Oct 2021 13:35:22 GMT, Martin Balao wrote: > I'd like to propose a fix for JDK-8275535. This fix reverts the behavior to > the state previous to JDK-8160768, where an authentication failure stops from > trying other LDAP servers with the same credentials [1]. After JDK-8160768 we >

Re: RFR: 8279995: jpackage --add-launcher option should allow overriding description

2022-02-09 Thread Alexander Matveev
On Wed, 9 Feb 2022 07:37:42 GMT, Alexander Matveev wrote: > Added ability to override description for additional launchers via > "description" property. AddLauncherArguments.java class reads parameters for additional launcher from property file and if this class contains particular property

Re: RFR: 8279995: jpackage --add-launcher option should allow overriding description

2022-02-09 Thread Alexander Matveev
On Wed, 9 Feb 2022 12:35:59 GMT, Alexey Semenyuk wrote: >> Added ability to override description for additional launchers via >> "description" property. > > test/jdk/tools/jpackage/share/AddLauncherTest.java line 93: > >> 91: new AdditionalLauncher("Baz2") >> 92:

Re: RFR: 8275535: Retrying a failed authentication on multiple LDAP servers can lead to users blocked

2022-02-09 Thread Martin Balao
On Wed, 20 Oct 2021 13:35:22 GMT, Martin Balao wrote: > I'd like to propose a fix for JDK-8275535. This fix reverts the behavior to > the state previous to JDK-8160768, where an authentication failure stops from > trying other LDAP servers with the same credentials [1]. After JDK-8160768 we >

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

2022-02-09 Thread Andrey Turbanov
On Tue, 8 Feb 2022 22:11:34 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: 8261407: ReflectionFactory.checkInitted() is not thread-safe [v3]

2022-02-09 Thread Peter Levart
On Sat, 22 Jan 2022 00:00:18 GMT, liach wrote: >> liach has updated the pull request with a new target base due to a merge or >> a rebase. The incremental webrev excludes the unrelated changes brought in >> by the merge/rebase. The pull request contains four additional commits since >> the

Re: RFR: 8275535: Retrying a failed authentication on multiple LDAP servers can lead to users blocked

2022-02-09 Thread Aleksei Efimov
On Wed, 20 Oct 2021 13:35:22 GMT, Martin Balao wrote: > I'd like to propose a fix for JDK-8275535. This fix reverts the behavior to > the state previous to JDK-8160768, where an authentication failure stops from > trying other LDAP servers with the same credentials [1]. After JDK-8160768 we >

Re: RFR: 8275535: Retrying a failed authentication on multiple LDAP servers can lead to users blocked

2022-02-09 Thread Daniel Fuchs
On Wed, 20 Oct 2021 13:35:22 GMT, Martin Balao wrote: > I'd like to propose a fix for JDK-8275535. This fix reverts the behavior to > the state previous to JDK-8160768, where an authentication failure stops from > trying other LDAP servers with the same credentials [1]. After JDK-8160768 we >

Re: RFR: 8275535: Retrying a failed authentication on multiple LDAP servers can lead to users blocked

2022-02-09 Thread Michael Osipov
On Wed, 9 Feb 2022 15:05:24 GMT, Martin Balao wrote: >>> > @martinuy, I am the reporter of JDK-8160768. Regarding this PR, isn't >>> > everything protocol related a fail-fast issue? E.g., if the socket is up >>> > and running, but the LDAP message is rejected can we assume that all >>> >

Re: RFR: 8275535: Retrying a failed authentication on multiple LDAP servers can lead to users blocked

2022-02-09 Thread Martin Balao
On Wed, 9 Feb 2022 11:10:14 GMT, Michael Osipov wrote: >>> @martinuy, I am the reporter of JDK-8160768. Regarding this PR, isn't >>> everything protocol related a fail-fast issue? E.g., if the socket is up >>> and running, but the LDAP message is rejected can we assume that all >>> subsequent

RFR: 8281146: Replace StringCoding.hasNegatives with countPositives

2022-02-09 Thread Claes Redestad
I'm requesting comments and, hopefully, some help with this patch to replace `StringCoding.hasNegatives` with `countPositives`. The new method does a very similar pass, but alters the intrinsic to return the number of leading bytes in the `byte[]` range which only has positive bytes. This

Re: RFR: 8279995: jpackage --add-launcher option should allow overriding description

2022-02-09 Thread Kevin Rushforth
On Wed, 9 Feb 2022 07:37:42 GMT, Alexander Matveev wrote: > Added ability to override description for additional launchers via > "description" property. This will need a CSR. - PR: https://git.openjdk.java.net/jdk/pull/7399

Re: RFR: 8279995: jpackage --add-launcher option should allow overriding description

2022-02-09 Thread Alexey Semenyuk
On Wed, 9 Feb 2022 07:37:42 GMT, Alexander Matveev wrote: > Added ability to override description for additional launchers via > "description" property. I don't quite understand how these changes affect the description of launcher executables on Windows. I'd expect changes at least in

Integrated: 8281470: tools/jar/CreateMissingParentDirectories.java fails with "Should have failed creating jar file"

2022-02-09 Thread Christian Stein
On Wed, 9 Feb 2022 06:42:51 GMT, Christian Stein wrote: > This PR removes the redundant and failing test-case. > It also removes the test class from the problem list. > > Adds additional test-cases using long form option names of `jar`. This pull request has now been integrated. Changeset:

Re: RFR: 8281470: tools/jar/CreateMissingParentDirectories.java fails with "Should have failed creating jar file"

2022-02-09 Thread Lance Andersen
On Wed, 9 Feb 2022 06:42:51 GMT, Christian Stein wrote: > This PR removes the redundant and failing test-case. > It also removes the test class from the problem list. > > Adds additional test-cases using long form option names of `jar`. Looks good. Thank you for addressing this hiccup!

RFR: 8281470: tools/jar/CreateMissingParentDirectories.java fails with "Should have failed creating jar file"

2022-02-09 Thread Christian Stein
This PR removes the redundant and failing test-case. It also removes the test class from the problem list. Adds additional test-cases using long form option names of `jar`. - Commit messages: - Only assert non-zero exit code on failure - 8281470:

Re: RFR: 8275535: Retrying a failed authentication on multiple LDAP servers can lead to users blocked

2022-02-09 Thread Michael Osipov
On Tue, 8 Feb 2022 13:51:57 GMT, Martin Balao wrote: > > @martinuy, I am the reporter of JDK-8160768. Regarding this PR, isn't > > everything protocol related a fail-fast issue? E.g., if the socket is up > > and running, but the LDAP message is rejected can we assume that all > > subsequent