Re: RFR: 8305734: BitSet.get(int, int) always returns the empty BitSet when the Integer.MAX VALUE is set

2023-04-21 Thread Stuart Marks
On Sat, 22 Apr 2023 01:26:08 GMT, Chen Liang wrote: >> @AlanBateman I would be happy to fill out the CSR, but unfortunately I don't >> think I am able to currently as I'm not an author on OpenJDK and as such >> don't have a JBS account. (I reported the bug through the Oracle site, >> rather th

Re: RFR: 8304837: Classfile API throws IOOBE for MethodParameters attribute without parameter names [v3]

2023-04-21 Thread Julian Waters
On Fri, 24 Mar 2023 06:42:30 GMT, Hannes Greule wrote: >> After merging master into https://github.com/openjdk/jdk/pull/9862, we >> encountered test failures (e.g., >> https://github.com/SirYwell/jdk/actions/runs/4500940829/jobs/7923018438#step:9:2541). >> The Classfile API tries to read from

Re: RFR: 8305734: BitSet.get(int, int) always returns the empty BitSet when the Integer.MAX VALUE is set

2023-04-21 Thread Chen Liang
On Fri, 21 Apr 2023 15:41:55 GMT, Andy-Tatman wrote: > I would be happy to fill out the CSR, but unfortunately I don't think I am > able to currently as I'm not an author on OpenJDK and as such don't have a > JBS account. (I reported the bug through the Oracle site, rather than through > bugs.

Re: RFR: 8266571: Sequenced Collections [v10]

2023-04-21 Thread Stuart Marks
> PR for Sequenced Collections implementation. Stuart Marks has updated the pull request incrementally with two additional commits since the last revision: - Wording tweaks to SequencedMap / NavigableMap. - Change "The implementation in this class" to "... interface." - Changes:

Re: RFR: 8266571: Sequenced Collections [v8]

2023-04-21 Thread Stuart Marks
On Thu, 20 Apr 2023 12:30:52 GMT, Nir Lisker wrote: >> Stuart Marks has updated the pull request incrementally with four additional >> commits since the last revision: >> >> - Add missing @throws and @since tags. >> - Convert code samples to snippets. >> - Various editorial changes. >> - Fi

Re: RFR: 8266571: Sequenced Collections [v8]

2023-04-21 Thread Stuart Marks
On Thu, 20 Apr 2023 12:09:52 GMT, Nir Lisker wrote: >> Stuart Marks has updated the pull request incrementally with four additional >> commits since the last revision: >> >> - Add missing @throws and @since tags. >> - Convert code samples to snippets. >> - Various editorial changes. >> - Fi

Re: RFR: JDK-8304036: Use CommandLine class from shared module [v2]

2023-04-21 Thread Mandy Chung
On Fri, 21 Apr 2023 21:14:00 GMT, Christian Stein wrote: >> This pull request addresses the open ends left by >> [JDK-8236919](https://bugs.openjdk.org/browse/JDK-8236919): >> - #11272 >> >> Changes: >> - [x] Extend list of targeted exports of `jdk.internal.opt/jdk.internal.opt` >> to `jdk.com

Re: RFR: JDK-8304036: Use CommandLine class from shared module [v2]

2023-04-21 Thread Jonathan Gibbons
On Fri, 21 Apr 2023 21:14:00 GMT, Christian Stein wrote: >> This pull request addresses the open ends left by >> [JDK-8236919](https://bugs.openjdk.org/browse/JDK-8236919): >> - #11272 >> >> Changes: >> - [x] Extend list of targeted exports of `jdk.internal.opt/jdk.internal.opt` >> to `jdk.com

Re: Discussion: Prefer passing MethodHandles.Lookup over @CallerSensitive

2023-04-21 Thread mandy . chung
On 4/21/23 1:58 PM, Johannes Kuhn wrote: 5. Making existing methods @CallerSensitive can lead to small backwards compatibility issues - as the public lookup can't lookup those methods anymore. Can you explain what you observe about this?   Public lookup has access to public members of public

Re: RFR: JDK-8304036: Use CommandLine class from shared module [v2]

2023-04-21 Thread Christian Stein
> This pull request addresses the open ends left by > [JDK-8236919](https://bugs.openjdk.org/browse/JDK-8236919): > - #11272 > > Changes: > - [x] Extend list of targeted exports of `jdk.internal.opt/jdk.internal.opt` > to `jdk.compiler` and `jdk.javadoc` > - [x] Use shared `CommandLine.java` in

Re: RFR: JDK-8304036: Use CommandLine class from shared module

2023-04-21 Thread Jonathan Gibbons
On Mon, 13 Mar 2023 08:16:54 GMT, Christian Stein wrote: > This pull request addresses the open ends left by > [JDK-8236919](https://bugs.openjdk.org/browse/JDK-8236919): > - #11272 > > Changes: > - [x] Extend list of targeted exports of `jdk.internal.opt/jdk.internal.opt` > to `jdk.compiler`

Re: RFR: JDK-8304036: Use CommandLine class from shared module

2023-04-21 Thread Christian Stein
On Mon, 13 Mar 2023 08:16:54 GMT, Christian Stein wrote: > This pull request addresses the open ends left by > [JDK-8236919](https://bugs.openjdk.org/browse/JDK-8236919): > - #11272 > > Changes: > - [x] Extend list of targeted exports of `jdk.internal.opt/jdk.internal.opt` > to `jdk.compiler`

Re: Discussion: Prefer passing MethodHandles.Lookup over @CallerSensitive

2023-04-21 Thread Johannes Kuhn
Hi, to reiterate: I do not want to change existing APIs. Instead having a discussion that can guide the introduction of new APIs that may want to be @CS (but don't need to be). On 21-Apr-23 21:30, mandy.ch...@oracle.com wrote: On 4/21/23 6:44 AM, Johannes Kuhn wrote: Hi, Instead of making

Re: RFR: 8306678: Replace use of os.version with an internal Version record

2023-04-21 Thread Roger Riggs
On Fri, 21 Apr 2023 20:21:33 GMT, Christian Stein wrote: >> Create an internal Version record to hold and compare versions of the form >> (major, minor, micro). >> Add `OperatingSystem.version()` to return the version of the running OS. >> Replace uses of os.version in java.base. >> Subsequent P

Re: RFR: 8306678: Replace use of os.version with an internal Version record

2023-04-21 Thread Roger Riggs
On Fri, 21 Apr 2023 16:44:13 GMT, Roger Riggs wrote: > Create an internal Version record to hold and compare versions of the form > (major, minor, micro). > Add `OperatingSystem.version()` to return the version of the running OS. > Replace uses of os.version in java.base. > Subsequent PRs will a

Re: RFR: 8306678: Replace use of os.version with an internal Version record

2023-04-21 Thread Roger Riggs
On Fri, 21 Apr 2023 20:15:50 GMT, Christian Stein wrote: >> Create an internal Version record to hold and compare versions of the form >> (major, minor, micro). >> Add `OperatingSystem.version()` to return the version of the running OS. >> Replace uses of os.version in java.base. >> Subsequent P

Re: RFR: 8304915: Create jdk.internal.util.Architecture enum and apply [v17]

2023-04-21 Thread Roger Riggs
> Define an internal jdk.internal.util.Architecture enumeration and static > methods to replace uses of the system property `os.arch`. > The enumeration values are defined to match those used in the build. > The initial values are: `X64, X86, AARCH64, RISCV64, S390, PPC64` > Note that `amd64` and

Re: RFR: 8306678: Replace use of os.version with an internal Version record

2023-04-21 Thread Christian Stein
On Fri, 21 Apr 2023 16:44:13 GMT, Roger Riggs wrote: > Create an internal Version record to hold and compare versions of the form > (major, minor, micro). > Add `OperatingSystem.version()` to return the version of the running OS. > Replace uses of os.version in java.base. > Subsequent PRs will a

Re: RFR: 8306678: Replace use of os.version with an internal Version record

2023-04-21 Thread Christian Stein
On Fri, 21 Apr 2023 16:44:13 GMT, Roger Riggs wrote: > Create an internal Version record to hold and compare versions of the form > (major, minor, micro). > Add `OperatingSystem.version()` to return the version of the running OS. > Replace uses of os.version in java.base. > Subsequent PRs will a

Re: Discussion: Prefer passing MethodHandles.Lookup over @CallerSensitive

2023-04-21 Thread mandy . chung
On 4/21/23 6:44 AM, Johannes Kuhn wrote: Hi, Instead of making new and existing methods @CallerSensitive, such methods could instead take a MethodHandles.Lookup as method argument. Library authors are often told that they could ask their users to pass a MethodHandles.Lookup to obtain inter

Re: RFR: 8300818: Reduce complexity of padding with DateTimeFormatter [v7]

2023-04-21 Thread Roger Riggs
On Fri, 21 Apr 2023 17:45:50 GMT, Sergey Tsypanov wrote: >> Currently it's O(n) - we do `n` shifts of bytes within `StringBuilder`. This >> can be reduced to O(1) improving the code like: >> >> DateTimeFormatter dtf = new DateTimeFormatterBuilder() >> .appendLiteral("Date:") >> .padNext(20,

Re: RFR: 8300818: Reduce complexity of padding with DateTimeFormatter [v7]

2023-04-21 Thread Claes Redestad
On Fri, 21 Apr 2023 17:45:50 GMT, Sergey Tsypanov wrote: >> Currently it's O(n) - we do `n` shifts of bytes within `StringBuilder`. This >> can be reduced to O(1) improving the code like: >> >> DateTimeFormatter dtf = new DateTimeFormatterBuilder() >> .appendLiteral("Date:") >> .padNext(20,

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v5]

2023-04-21 Thread Vicente Romero
On Fri, 21 Apr 2023 16:25:04 GMT, Jan Lahoda wrote: >> This is the first draft of a patch for JEP 440 and JEP 441. Changes included: >> >> - the pattern matching for switch and record patterns features are made >> final, together with updates to tests. >> - parenthesized patterns are removed.

Re: RFR: 8302983: ZoneRulesProvider.registerProvider() twice will remove provider [v4]

2023-04-21 Thread Naoto Sato
On Tue, 28 Feb 2023 07:49:17 GMT, Madjosz wrote: >> Fixes JDK-8302983 (and duplicate JDK-8302898) > > Madjosz has updated the pull request incrementally with one additional commit > since the last revision: > > whitespace, remove stream() Marked as reviewed by naoto (Reviewer).

Re: RFR: 8300818: Reduce complexity of padding with DateTimeFormatter [v7]

2023-04-21 Thread Sergey Tsypanov
> Currently it's O(n) - we do `n` shifts of bytes within `StringBuilder`. This > can be reduced to O(1) improving the code like: > > DateTimeFormatter dtf = new DateTimeFormatterBuilder() > .appendLiteral("Date:") > .padNext(20, ' ') > .append(DateTimeFormatter.ISO_DATE) > .toFormatter();

Re: RFR: 8306031: Update IANA Language Subtag Registry to Version 2023-04-13 [v6]

2023-04-21 Thread Naoto Sato
On Thu, 20 Apr 2023 20:22:39 GMT, Justin Lu wrote: >> Update the registry and accompanying tests with the **IANA 4/13/2022** >> update. >> >> This update introduces the case where an IANA entry can have a preferred >> value, but that preferred value has a preferred value as well. >> >> This c

Re: RFR: 8306678: Replace use of os.version with an internal Version record

2023-04-21 Thread Alan Bateman
On Fri, 21 Apr 2023 16:44:13 GMT, Roger Riggs wrote: > Create an internal Version record to hold and compare versions of the form > (major, minor, micro). > Add `OperatingSystem.version()` to return the version of the running OS. > Replace uses of os.version in java.base. > Subsequent PRs will a

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v5]

2023-04-21 Thread Vicente Romero
On Fri, 21 Apr 2023 16:25:04 GMT, Jan Lahoda wrote: >> This is the first draft of a patch for JEP 440 and JEP 441. Changes included: >> >> - the pattern matching for switch and record patterns features are made >> final, together with updates to tests. >> - parenthesized patterns are removed.

RFR: 8306678 os version

2023-04-21 Thread Roger Riggs
Create an internal Version record to hold and compare versions of the form (major, minor, micro). Add `OperatingSystem.version()` to return the version of the running OS. Replace uses of os.version in java.base. Subsequent PRs will apply to uses in other modules including, jdk.jlink, jdk.jpackage

Re: RFR: 8304836: Make MALLOC_MIN4 macro more robust [v2]

2023-04-21 Thread Brent Christian
On Fri, 21 Apr 2023 16:22:02 GMT, Naoto Sato wrote: >> The current macro assumes the argument is `jint` because all locations pass >> `jint`. However, this would not work if a wider type such as `jlong` is >> passed. Removing the `unsigned` cast and make the condition explicit would >> make th

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v4]

2023-04-21 Thread Vicente Romero
On Fri, 21 Apr 2023 10:56:55 GMT, Jan Lahoda wrote: >> This is the first draft of a patch for JEP 440 and JEP 441. Changes included: >> >> - the pattern matching for switch and record patterns features are made >> final, together with updates to tests. >> - parenthesized patterns are removed.

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v4]

2023-04-21 Thread Maurizio Cimadamore
On Fri, 21 Apr 2023 15:34:32 GMT, Rémi Forax wrote: > > Which compiles correctly, but it doesn't look exhaustive to me (because of > > F) ? > > Can you expand a little more, because for me a Z either implement C or D or > both C and D. Please see my latest comment above. I was confused by the

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v4]

2023-04-21 Thread Jan Lahoda
On Fri, 21 Apr 2023 16:08:41 GMT, Maurizio Cimadamore wrote: >> Jan Lahoda has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Replacing use of mutable callsite with a mutable state. > > src/jdk.compiler/share/classes/com/sun/tools/javac/co

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v5]

2023-04-21 Thread Jan Lahoda
> This is the first draft of a patch for JEP 440 and JEP 441. Changes included: > > - the pattern matching for switch and record patterns features are made > final, together with updates to tests. > - parenthesized patterns are removed. > - qualified enum constants are supported for case label

Re: RFR: 8304836: Make MALLOC_MIN4 macro more robust [v2]

2023-04-21 Thread Naoto Sato
On Fri, 21 Apr 2023 12:42:24 GMT, David Schlosnagle wrote: >> Naoto Sato has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update src/java.base/share/native/libjava/jni_util.c >> >> Co-authored-by: David Schlosnagle > > src/java.base

Re: RFR: 8304836: Make MALLOC_MIN4 macro more robust [v2]

2023-04-21 Thread Naoto Sato
> The current macro assumes the argument is `jint` because all locations pass > `jint`. However, this would not work if a wider type such as `jlong` is > passed. Removing the `unsigned` cast and make the condition explicit would > make the macro more robust. Naoto Sato has updated the pull requ

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v4]

2023-04-21 Thread Maurizio Cimadamore
On Fri, 21 Apr 2023 10:56:55 GMT, Jan Lahoda wrote: >> This is the first draft of a patch for JEP 440 and JEP 441. Changes included: >> >> - the pattern matching for switch and record patterns features are made >> final, together with updates to tests. >> - parenthesized patterns are removed.

Re: RFR: 8305734: BitSet.get(int, int) always returns the empty BitSet when the Integer.MAX VALUE is set

2023-04-21 Thread Andy-Tatman
On Fri, 14 Apr 2023 15:53:41 GMT, Alan Bateman wrote: >> @AlanBateman >> It is a known issue that size() may return a negative integer, see >> [JDK-8230557](https://bugs.openjdk.org/browse/JDK-8230557), and the accepted >> workaround is to interpret the returned integer as an unsigned value an

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v4]

2023-04-21 Thread Rémi Forax
On Fri, 21 Apr 2023 15:30:24 GMT, Maurizio Cimadamore wrote: >> Also, surprisingly, if I make C and D classes (instead of interfaces): >> >> class Test { >> sealed interface I permits C, D { } >> final class C implements I { } >> final class D implements I { } >> >> interface F

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v4]

2023-04-21 Thread Maurizio Cimadamore
On Fri, 21 Apr 2023 15:17:37 GMT, Maurizio Cimadamore wrote: >> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java line 915: >> >>> 913: */ >>> 914: private List reduceBindingPatterns(Type >>> selectorType, List patterns) { >>> 915: Set existingBindi

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v4]

2023-04-21 Thread Maurizio Cimadamore
On Fri, 21 Apr 2023 10:56:55 GMT, Jan Lahoda wrote: >> This is the first draft of a patch for JEP 440 and JEP 441. Changes included: >> >> - the pattern matching for switch and record patterns features are made >> final, together with updates to tests. >> - parenthesized patterns are removed.

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v4]

2023-04-21 Thread Maurizio Cimadamore
On Fri, 21 Apr 2023 15:16:03 GMT, Maurizio Cimadamore wrote: >> Jan Lahoda has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Replacing use of mutable callsite with a mutable state. > > src/jdk.compiler/share/classes/com/sun/tools/javac/co

Re: RFR: 8300818: Reduce complexity of padding with DateTimeFormatter [v6]

2023-04-21 Thread Claes Redestad
On Thu, 20 Apr 2023 15:05:18 GMT, Sergey Tsypanov wrote: >> Currently it's O(n) - we do `n` shifts of bytes within `StringBuilder`. This >> can be reduced to O(1) improving the code like: >> >> DateTimeFormatter dtf = new DateTimeFormatterBuilder() >> .appendLiteral("Date:") >> .padNext(20,

Discussion: Prefer passing MethodHandles.Lookup over @CallerSensitive

2023-04-21 Thread Johannes Kuhn
Hi, Instead of making new and existing methods @CallerSensitive, such methods could instead take a MethodHandles.Lookup as method argument. Library authors are often told that they could ask their users to pass a MethodHandles.Lookup to obtain internal access instead of using things like Acc

Re: RFR: JDK-8077371: Binary files in JAXP test should be removed [v3]

2023-04-21 Thread Mahendra Chhipa
On Thu, 20 Apr 2023 10:06:33 GMT, Mahendra Chhipa wrote: >> Test is updated to create the binary files during test execution. > > Mahendra Chhipa has updated the pull request incrementally with one > additional commit since the last revision: > > Implemented the review comment. Thanks for yo

Re: RFR: 8305092: Improve Thread.sleep(millis, nanos) for sub-millisecond granularity [v10]

2023-04-21 Thread Aleksey Shipilev
> Java API has the `Thread.sleep(millis, nanos)` method exposed to users. The > documentation for that method clearly says the precision and accuracy are > dependent on the underlying system behavior. However, it always rounds up > `nanos` to 1ms when doing the actual sleep. This means users can

Re: RFR: 8304836: Make MALLOC_MIN4 macro more robust

2023-04-21 Thread David Schlosnagle
On Thu, 20 Apr 2023 18:39:29 GMT, Naoto Sato wrote: > The current macro assumes the argument is `jint` because all locations pass > `jint`. However, this would not work if a wider type such as `jlong` is > passed. Removing the `unsigned` cast and make the condition explicit would > make the ma

Re: RFR: JDK-8266431: Dual-Pivot Quicksort improvements (Radix sort) [v2]

2023-04-21 Thread Laurent Bourgès
On Thu, 20 Apr 2023 22:04:42 GMT, Laurent Bourgès wrote: >> * Optimized mixed insertion sort >> * Optimized insertion sort >> * Optimized Radix sort >> * Updated microbenchmark >> >> I am going on previous PR by Vladimir Yaroslavskyi: >> https://github.com/openjdk/jdk/pull/3938 > >

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v4]

2023-04-21 Thread Jan Lahoda
> This is the first draft of a patch for JEP 440 and JEP 441. Changes included: > > - the pattern matching for switch and record patterns features are made > final, together with updates to tests. > - parenthesized patterns are removed. > - qualified enum constants are supported for case label

Integrated: 8306075: Micro-optimize Enum.hashCode

2023-04-21 Thread olivergillespie
On Mon, 17 Apr 2023 10:59:34 GMT, olivergillespie wrote: > Improve the speed of Enum.hashCode by caching the identity hashcode on first > use. I've seen an application where Enum.hashCode is a hot path, and this is > fairly simple speedup. The memory overhead is low; in enums with no extra > f

Re: RFR: 8302983: ZoneRulesProvider.registerProvider() twice will remove provider [v4]

2023-04-21 Thread Madjosz
On Tue, 28 Feb 2023 07:49:17 GMT, Madjosz wrote: >> Fixes JDK-8302983 (and duplicate JDK-8302898) > > Madjosz has updated the pull request incrementally with one additional commit > since the last revision: > > whitespace, remove stream() Is this ready to merge now? - PR Commen

Re: RFR: 8305092: Improve Thread.sleep(millis, nanos) for sub-millisecond granularity [v7]

2023-04-21 Thread Alan Bateman
On Thu, 20 Apr 2023 08:12:50 GMT, Aleksey Shipilev wrote: >> src/java.base/share/classes/java/lang/Thread.java line 1: >> >>> 1: /* >> >> Why doesn't `Thread.sleep(long millis)` simply call `Thread.sleep(millis, >> 0)` instead of duplicating most of the code? > > That would change the stack de