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

2023-01-22 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: 8300818: Reduce complexity of padding with DateTimeFormatter [v2]

2023-01-22 Thread Claes Redestad
On Sun, 22 Jan 2023 09:50:21 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,

Integrated: 8300207: Add a pre-check for the number of canonical equivalent permutations in j.u.r.Pattern

2023-01-22 Thread Raffaello Giulietti
On Tue, 17 Jan 2023 09:44:17 GMT, Raffaello Giulietti wrote: > - Strengthen a computation that could overflow. > - Specify that use of CANON_EQ could exhaust memory in the compilation phase. This pull request has now been integrated. Changeset: 030b071d Author:Raffaello Giulietti URL:

Re: RFR: 8300487: Store cardinality as a field in BitSet [v7]

2023-01-22 Thread fabioromano1
> The enanchment is useful for applications that make heavy use of BitSet > objects as sets of integers, and therefore they need to make a lot of calls > to cardinality() method, which actually require linear time in the number of > words in use by the bit set. > This optimization reduces the co

Withdrawn: 8300487: Store cardinality as a field in BitSet

2023-01-22 Thread fabioromano1
On Tue, 3 Jan 2023 23:25:39 GMT, fabioromano1 wrote: > The enanchment is useful for applications that make heavy use of BitSet > objects as sets of integers, and therefore they need to make a lot of calls > to cardinality() method, which actually require linear time in the number of > words in

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

2023-01-22 Thread Sergey Tsypanov
On Sun, 22 Jan 2023 10:56:11 GMT, Claes Redestad wrote: >> Sergey Tsypanov 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 two additional >> com

New subclass of BitSet "NaturalsBitSet" to store cardinality in a field

2023-01-22 Thread Fabio Romano
This enanchment is useful for applications that make heavy use of BitSet objects as sets of integers, and therefore they need to make a lot of calls to cardinality() method, which in BitSet class require linear time in the number of words in use by the bit set. This optimization reduces the cost of

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

2023-01-22 Thread Sergey Tsypanov
On Sun, 22 Jan 2023 11:36:34 GMT, Claes Redestad wrote: >> Sergey Tsypanov 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 two additional >> com

Re: RFR: 8299852: Modernize ConcurrentHashMap [v2]

2023-01-22 Thread Attila Szegedi
On Thu, 12 Jan 2023 09:28:46 GMT, Per Minborg wrote: >> `java.util.concurrent.ConcurrentHashMap` is relatively old and has not been >> updated to reflect the current state of Java and can be modernized: >> >> * Add `@Serial` annotations >> * Seal classes and restrict subclassing for internal

Re: RFR: 8299444 java.util.Set.copyOf allocates needlessly for empty input collections [v2]

2023-01-22 Thread Attila Szegedi
On Mon, 9 Jan 2023 08:33:09 GMT, Viktor Klang wrote: >> Currently Set.copyOf allocates both a HashSet and a new empty array when the >> input collection is empty. >> >> This patch avoids allocating anything for the case where the parameter >> collection's isEmpty returns true. > > Viktor Klang

RFR: 8300819: -Dfile.encoding=Cp943C option does not work as expected since jdk18

2023-01-22 Thread Ichiroh Takiguchi
On jdk17, following testcase works fine on Linux platform. Testcase $ cat cstest1.java import java.nio.charset.*; public class cstest1 { public static void main(String[] args) throws Exception { Charset cs = Charset.defaultCharset(); System.out.println(cs + ", " + cs.getClass() + ", "

Re: RFR: 8300819: -Dfile.encoding=Cp943C option does not work as expected since jdk18

2023-01-22 Thread Alan Bateman
On Sun, 22 Jan 2023 09:18:37 GMT, Ichiroh Takiguchi wrote: > On jdk17, following testcase works fine on Linux platform. > > Testcase > > $ cat cstest1.java > import java.nio.charset.*; > > public class cstest1 { > public static void main(String[] args) throws Exception { > Charset cs =

Re: RFR: 8300693: Lower the compile threshold and reduce the iterations of warmup loop in VarHandles tests [v2]

2023-01-22 Thread David Holmes
On Fri, 20 Jan 2023 17:45:46 GMT, Mandy Chung wrote: >> `java/lang/invoke/VarHandles` tests run with C1, C2 and tiered compilations >> and the test cases are executed in the warm up loop with 2 iterations to >> verify C1, C2 intrinsics. Default Tier4CompileThreshold is 15000. >> >> This P

Re: RFR: 8300819: -Dfile.encoding=Cp943C option does not work as expected since jdk18 [v2]

2023-01-22 Thread Ichiroh Takiguchi
> On jdk17, following testcase works fine on Linux platform. > > Testcase > > $ cat cstest1.java > import java.nio.charset.*; > > public class cstest1 { > public static void main(String[] args) throws Exception { > Charset cs = Charset.defaultCharset(); > System.out.println(cs + ", " +

Re: RFR: 8300819: -Dfile.encoding=Cp943C option does not work as expected since jdk18 [v2]

2023-01-22 Thread Ichiroh Takiguchi
On Sun, 22 Jan 2023 23:17:10 GMT, Ichiroh Takiguchi wrote: >> On jdk17, following testcase works fine on Linux platform. >> >> Testcase >> >> $ cat cstest1.java >> import java.nio.charset.*; >> >> public class cstest1 { >> public static void main(String[] args) throws Exception { >> Cha

Re: RFR: 8300819: -Dfile.encoding=Cp943C option does not work as expected since jdk18 [v2]

2023-01-22 Thread Bernd
The alternative is to specify the charset you want to use in code explicitely and no longer rely on a platform encoding since it made all kinds of problems for being configurable and therefore intentionally removed.GrussBernd-- http://bernd.eckenfels.net  Von: cor

RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException

2023-01-22 Thread Tingjun Yuan
Modify `java.util.Arrays.ArrayList.{set,replaceAll}` to throw a `ClassCastException` (as documented in `java.util.List`) when attempting to set an element with a wrong type. - Commit messages: - Modify Arrays.java Changes: https://git.openjdk.org/jdk/pull/12135/files Webrev: http

[jdk20] RFR: 8290919: Update nroff pages in JDK 20 before RC

2023-01-22 Thread David Holmes
There was one missing update in javac.1 from: [JDK-8245246](https://bugs.openjdk.org/browse/JDK-8245246): Deprecate -profile option in javac otherwise the change is limited to dropping the "-ea". Thanks. - Commit messages: - Merge branch 'master' into 8290919-manpages - 8290919:

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException

2023-01-22 Thread Stuart Marks
On Mon, 23 Jan 2023 02:35:19 GMT, Tingjun Yuan wrote: > Modify `java.util.Arrays.ArrayList.{set,replaceAll}` to throw a > `ClassCastException` (as documented in `java.util.List`) when attempting to > set an element with a wrong type. We don't want to change long-standing exception-throwing beh

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v2]

2023-01-22 Thread Tingjun Yuan
> Modify `java.util.Arrays.ArrayList.{set,replaceAll}` to throw a > `ClassCastException` (as documented in `java.util.List`) when attempting to > set an element with a wrong type. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revision: Rest

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v3]

2023-01-22 Thread Tingjun Yuan
> Modify `java.util.Arrays.ArrayList.{set,replaceAll}` to throw a > `ClassCastException` (as documented in `java.util.List`) when attempting to > set an element with a wrong type. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revision: Upda

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException

2023-01-22 Thread Tingjun Yuan
On Mon, 23 Jan 2023 06:29:47 GMT, Stuart Marks wrote: > We don't want to change long-standing exception-throwing behavior for these > cases. See my comments in > [JDK-8296935](https://bugs.openjdk.org/browse/JDK-8296935). Understand that, so I restored the current behavior and documented about

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v4]

2023-01-22 Thread Tingjun Yuan
> Modify `java.util.Arrays.ArrayList.{set,replaceAll}` to throw a > `ClassCastException` (as documented in `java.util.List`) when attempting to > set an element with a wrong type. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revision: Fix

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v5]

2023-01-22 Thread Tingjun Yuan
> Modify `java.util.Arrays.ArrayList.{set,replaceAll}` to throw a > `ClassCastException` (as documented in `java.util.List`) when attempting to > set an element with a wrong type. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revision: Chan

Re: [jdk20] RFR: 8290919: Update nroff pages in JDK 20 before RC

2023-01-22 Thread Iris Clark
On Mon, 23 Jan 2023 02:59:42 GMT, David Holmes wrote: > There was one missing update in javac.1 from: > > [JDK-8245246](https://bugs.openjdk.org/browse/JDK-8245246): Deprecate > -profile option in javac > > otherwise the change is limited to dropping the "-ea". > > Thanks. Marked as reviewed

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v6]

2023-01-22 Thread David Holmes
On Mon, 23 Jan 2023 07:20:39 GMT, Tingjun Yuan wrote: >> Document `java.util.Arrays.asList` that the list will throw an >> `ArrayStoreException` when attempting to set an element with a wrong type. > > Tingjun Yuan has updated the pull request incrementally with two additional > commits since t

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v4]

2023-01-22 Thread David Holmes
On Mon, 23 Jan 2023 07:08:28 GMT, Tingjun Yuan wrote: >> Document `java.util.Arrays.asList` that the list will throw an >> `ArrayStoreException` when attempting to set an element with a wrong type. > > Tingjun Yuan has updated the pull request incrementally with one additional > commit since th

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v6]

2023-01-22 Thread Tingjun Yuan
> Document `java.util.Arrays.asList` that the list will throw an > `ArrayStoreException` when attempting to set an element with a wrong type. Tingjun Yuan has updated the pull request incrementally with two additional commits since the last revision: - Restore List.java - Fix whitespace error

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v7]

2023-01-22 Thread Tingjun Yuan
> Document `java.util.Arrays.asList` that the list will throw an > `ArrayStoreException` when attempting to set an element with a wrong type. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revision: Update `implSpec` and remove the docs of th

Re: [jdk20] RFR: 8290919: Update nroff pages in JDK 20 before RC

2023-01-22 Thread Alan Bateman
On Mon, 23 Jan 2023 02:59:42 GMT, David Holmes wrote: > There was one missing update in javac.1 from: > > [JDK-8245246](https://bugs.openjdk.org/browse/JDK-8245246): Deprecate > -profile option in javac > > otherwise the change is limited to dropping the "-ea". > > Thanks. Marked as reviewed

Re: [jdk20] RFR: 8290919: Update nroff pages in JDK 20 before RC

2023-01-22 Thread David Holmes
On Mon, 23 Jan 2023 07:15:08 GMT, Iris Clark wrote: >> There was one missing update in javac.1 from: >> >> [JDK-8245246](https://bugs.openjdk.org/browse/JDK-8245246): Deprecate >> -profile option in javac >> >> otherwise the change is limited to dropping the "-ea". >> >> Thanks. > > Marked as

Re: RFR: 8300819: -Dfile.encoding=Cp943C option does not work as expected since jdk18 [v2]

2023-01-22 Thread Alan Bateman
On Sun, 22 Jan 2023 23:17:10 GMT, Ichiroh Takiguchi wrote: >> On jdk17, following testcase works fine on Linux platform. >> >> Testcase >> >> $ cat cstest1.java >> import java.nio.charset.*; >> >> public class cstest1 { >> public static void main(String[] args) throws Exception { >> Cha