Implementing JEP 400 on Windows 10 and Windows 11

2021-10-04 Thread John Platts
I wrote a test program (in C++) to detect the codepages that would be returned by the GetACP(), GetOEMCP(), and GetConsoleCP() functions when the UTF-8 setting is added to the manifest. The manifest element (supported on Windows 10 Version 1903 or later) is in the

Re: RFR: 8274397: [macOS] Stop setting env. var JAVA_MAIN_CLASS_ in launcher code [v4]

2021-10-04 Thread Phil Race
On Fri, 1 Oct 2021 21:10:27 GMT, Phil Race wrote: >> macOS launcher code sets JAVA_MAIN_CLASS_ which is read by AWT to set >> the name of the application in the system menu bar. >> >> Because this set shortly after the VM is running, it causes a thread safety >> issue described in

Re: RFR: 8274397: [macOS] Stop setting env. var JAVA_MAIN_CLASS_ in launcher code [v5]

2021-10-04 Thread Phil Race
> macOS launcher code sets JAVA_MAIN_CLASS_ which is read by AWT to set > the name of the application in the system menu bar. > > Because this set shortly after the VM is running, it causes a thread safety > issue described in https://bugs.openjdk.java.net/browse/JDK-8270549 > > Since the AWT

Integrated: 8274349: ForkJoinPool.commonPool() does not work with 1 CPU

2021-10-04 Thread David Holmes
On Fri, 1 Oct 2021 00:28:55 GMT, David Holmes wrote: > A regression introduced in Java 17 will give the default FJ pool a > parallelism of zero in a uniprocessor environment. The fix restores this to a > value of 1. See bug report for details. > > Testing: > - new regression test > - tiers

Re: RFR: 8274349: ForkJoinPool.commonPool() does not work with 1 CPU [v2]

2021-10-04 Thread David Holmes
On Fri, 1 Oct 2021 06:21:51 GMT, Aleksey Shipilev wrote: >> David Holmes has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Updated TCK test component from @martin > > Oh wow. Looks good! Thanks for the reviews @shipilev and

Re: RFR: 8274349: ForkJoinPool.commonPool() does not work with 1 CPU [v3]

2021-10-04 Thread David Holmes
> A regression introduced in Java 17 will give the default FJ pool a > parallelism of zero in a uniprocessor environment. The fix restores this to a > value of 1. See bug report for details. > > Testing: > - new regression test > - tiers 1-3 > > Thanks, > David David Holmes has updated the

Re: RFR: 8274346: Support for additional content in an app-image.

2021-10-04 Thread Alexey Semenyuk
On Thu, 30 Sep 2021 18:51:49 GMT, Andy Herrick wrote: > 8274346: Support for additional content in an app-image. Changes requested by asemenyuk (Reviewer). test/jdk/tools/jpackage/share/AppContentTest.java line 97: > 95: for (String p : paths) { > 96:

Re: RFR: 8274299: Make Method/Constructor/Field accessors @Stable [v5]

2021-10-04 Thread Mandy Chung
On Mon, 4 Oct 2021 22:24:39 GMT, Peter Levart wrote: >> This patch improves reflective access speed as shown by the included >> benchmarks: >> >> https://jmh.morethan.io/?gists=902f4b43519c4f96c7abcd14cdc2d27d,ac490481e3001c710d75d6071c10b23a >> >> ... and is also a prerequisite to make JEP

Re: RFR: 8274299: Make Method/Constructor/Field accessors @Stable [v4]

2021-10-04 Thread Peter Levart
On Mon, 4 Oct 2021 15:49:43 GMT, Peter Levart wrote: >> This patch improves reflective access speed as shown by the included >> benchmarks: >> >> https://jmh.morethan.io/?gists=902f4b43519c4f96c7abcd14cdc2d27d,ac490481e3001c710d75d6071c10b23a >> >> ... and is also a prerequisite to make JEP

Re: RFR: 8274299: Make Method/Constructor/Field accessors @Stable [v5]

2021-10-04 Thread Peter Levart
> This patch improves reflective access speed as shown by the included > benchmarks: > > https://jmh.morethan.io/?gists=902f4b43519c4f96c7abcd14cdc2d27d,ac490481e3001c710d75d6071c10b23a > > ... and is also a prerequisite to make JEP 416 (Reimplement Core Reflection > with Method Handle)

Re: RFR: 8274397: [macOS] Stop setting env. var JAVA_MAIN_CLASS_ in launcher code [v4]

2021-10-04 Thread Sergey Bylokhov
On Fri, 1 Oct 2021 21:10:27 GMT, Phil Race wrote: >> macOS launcher code sets JAVA_MAIN_CLASS_ which is read by AWT to set >> the name of the application in the system menu bar. >> >> Because this set shortly after the VM is running, it causes a thread safety >> issue described in

RFR: JDK-8274686 : java.util.UUID#hashCode() should use Long.hashCode()

2021-10-04 Thread PROgrm_JARvis
This is trivial fix of [JDK-8274686](https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8274686) which replaces manually-computed `int`-based `long` hash-code. Because `Long#hashCode(long)` uses other hashing function than the one currently used here:

Re: Windows 10 (since Windows 10 version 1903) and Windows 11 support UTF-8 as the default codepage through an executable manifest option

2021-10-04 Thread Bernd Eckenfels
John do you know if this also switches a console window into utf8 for such a launcher? (And if so, also for a already open console?) The problem will be similar to initial jep400 that some still might need to know the legacy ansi codepage for the OS, and I guess the new method won’t give us

Re: RFR: 8274299: Make Method/Constructor/Field accessors @Stable [v4]

2021-10-04 Thread Rémi Forax
On Mon, 4 Oct 2021 15:49:43 GMT, Peter Levart wrote: >> This patch improves reflective access speed as shown by the included >> benchmarks: >> >> https://jmh.morethan.io/?gists=902f4b43519c4f96c7abcd14cdc2d27d,ac490481e3001c710d75d6071c10b23a >> >> ... and is also a prerequisite to make JEP

Re: RFR: 8274299: Make Method/Constructor/Field accessors @Stable [v4]

2021-10-04 Thread Mandy Chung
On Mon, 4 Oct 2021 15:49:43 GMT, Peter Levart wrote: >> This patch improves reflective access speed as shown by the included >> benchmarks: >> >> https://jmh.morethan.io/?gists=902f4b43519c4f96c7abcd14cdc2d27d,ac490481e3001c710d75d6071c10b23a >> >> ... and is also a prerequisite to make JEP

Re: RFR: 8274299: Make Method/Constructor/Field accessors @Stable [v4]

2021-10-04 Thread Rémi Forax
On Mon, 4 Oct 2021 15:49:43 GMT, Peter Levart wrote: >> This patch improves reflective access speed as shown by the included >> benchmarks: >> >> https://jmh.morethan.io/?gists=902f4b43519c4f96c7abcd14cdc2d27d,ac490481e3001c710d75d6071c10b23a >> >> ... and is also a prerequisite to make JEP

Re: Windows 10 (since Windows 10 version 1903) and Windows 11 support UTF-8 as the default codepage through an executable manifest option

2021-10-04 Thread Naoto Sato
Hi John, Please see the JEP 400, which changes the default charset to UTF-8 across platforms: https://openjdk.java.net/jeps/400 HTH, Naoto On 10/4/21 8:47 AM, John Platts wrote: Windows 10 (since Windows 10 version 1903) and Windows 11 support UTF-8 as the default codepage by setting an

Re: RFR: 8274299: Make Method/Constructor/Field accessors @Stable [v2]

2021-10-04 Thread Mandy Chung
On Mon, 4 Oct 2021 15:51:18 GMT, Peter Levart wrote: > One way this could be improved is to "stamp" the modifiers field with an > additional bit (say 0x8000_) to always hold a non-zero value. > Method::getModifiers() would then clear that bit in a returned value to stay > compatible.

Re: RFR: 8274346: Support for additional content in an app-image.

2021-10-04 Thread Andy Herrick
On Thu, 30 Sep 2021 18:51:49 GMT, Andy Herrick wrote: > 8274346: Support for additional content in an app-image. CSR is at: https://bugs.openjdk.java.net/browse/JDK-8274717 - PR: https://git.openjdk.java.net/jdk/pull/5780

RFR: 8274346: Support for additional content in an app-image.

2021-10-04 Thread Andy Herrick
8274346: Support for additional content in an app-image. - Commit messages: - JDK-8274346: Support for additional content in an app-image. - JDK-8274346: Support for additional content in an app-image. - JDK-8274346: Support for additional content in an app-image. Changes:

Re: RFR: 8274715: Implement forEach in Collections.CopiesList

2021-10-04 Thread Martin Buchholz
On Thu, 11 Feb 2021 13:28:49 GMT, Сергей Цыпанов wrote: > Originally was proposed by Zheka Kozlov here: > http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-December/057192.html > > Just a tiny optimization: we can use for-i loop instead of > `Iterable.forEach()` which is relying on

Re: RFR: 8274544: Langtools command's usage were garbled on Japanese Windows [v2]

2021-10-04 Thread Naoto Sato
On Mon, 4 Oct 2021 07:13:37 GMT, Ichiroh Takiguchi wrote: >> JEP-400 (UTF-8 by Default) was eabled on JDK18-b13. >> After JDK18-b13, javac and some other langtool command's usage were garbled >> on Japanese Windows. >> These commands use PrintWriter instead of standard out/err with

Re: RFR: 8274299: Make Method/Constructor/Field accessors @Stable [v2]

2021-10-04 Thread Peter Levart
On Sat, 2 Oct 2021 15:31:35 GMT, Peter Levart wrote: > > I'm fine with going back to the previous iteration. I'd add `@Stable` to > > the same fields in `Constructor`, too, though. > > Good catch. I'll add @stable to select Constructor fields. They are important > for optimizing `Const` use

Re: RFR: 8274299: Make Method/Constructor/Field accessors @Stable [v4]

2021-10-04 Thread Peter Levart
> This patch improves reflective access speed as shown by the included > benchmarks: > > https://jmh.morethan.io/?gists=902f4b43519c4f96c7abcd14cdc2d27d,ac490481e3001c710d75d6071c10b23a > > ... and is also a prerequisite to make JEP 416 (Reimplement Core Reflection > with Method Handle)

Windows 10 (since Windows 10 version 1903) and Windows 11 support UTF-8 as the default codepage through an executable manifest option

2021-10-04 Thread John Platts
Windows 10 (since Windows 10 version 1903) and Windows 11 support UTF-8 as the default codepage by setting an option in the application manifest. To enable UTF-8 as the default codepage for JDK executables on Windows 10 (starting with the May 2019 update) and Windows 11, the following

Integrated: 8274658: ISO 4217 Amendment 170 Update

2021-10-04 Thread Naoto Sato
On Fri, 1 Oct 2021 18:57:28 GMT, Naoto Sato wrote: > This is to incorporate the ISO 4217 amendment #170, which has been released > today, effective immediately. This pull request has now been integrated. Changeset: f2404d60 Author:Naoto Sato URL:

Re: RFR: 8274333: Redundant null comparison after Pattern.split

2021-10-04 Thread Weijun Wang
On Sun, 26 Sep 2021 15:10:52 GMT, Andrey Turbanov wrote: > In couple of classes, result part of arrays of Pattern.split is compared with > `null`. Pattern.split (and hence String.split) never returns `null` in array > elements. Such comparisons are redundant. Marked as reviewed by weijun

RFR: 8274716: JDWP Spec: the description for the Dispose command confuses suspend with resume.

2021-10-04 Thread Richard Reingruber
The following sentence in the JDWP Specification describing the Dispose command confuses resume with suspend [1]: All threads suspended by the thread-level **resume** command or the VM-level **resume** command are resumed as many times as necessary for them to run. It should be changed to

Re: RFR: 8274715: Implement forEach in Collections.CopiesList

2021-10-04 Thread liach
On Thu, 11 Feb 2021 13:28:49 GMT, Сергей Цыпанов wrote: > Originally was proposed by Zheka Kozlov here: > http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-December/057192.html > > Just a tiny optimization: we can use for-i loop instead of > `Iterable.forEach()` which is relying on

RFR: 8274715: Implement forEach in Collections.CopiesList

2021-10-04 Thread Сергей Цыпанов
Originally was proposed by Zheka Kozlov here: http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-December/057192.html Just a tiny optimization: we can use for-i loop instead of `Iterable.forEach()` which is relying on iterator. Simple benchmark demonstrates slight improvement:

Integrated: 8274606: Fix jaxp/javax/xml/jaxp/unittest/transform/SurrogateTest.java test

2021-10-04 Thread Alex Kasko
On Thu, 30 Sep 2021 18:32:17 GMT, Alex Kasko wrote: > I was working on backporting JDK-8268457 and found minor problems with the > test introduced there: > > 1. `compareWith*` helper methods are used without `Assert.assertTrue()` > wrapping, so they are effectively ignored > > 2.

Optimization (?) of HashSet(Collection)

2021-10-04 Thread Сергей Цыпанов
Hello, 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 c.forEach(this::add): public

Re: RFR: 8274544: Langtools command's usage were garbled on Japanese Windows

2021-10-04 Thread Jan Lahoda
On Mon, 4 Oct 2021 08:47:26 GMT, Ichiroh Takiguchi wrote: >> The encoding used in `Log.java` should first check whether it is run within >> console or not. If `System.console()` returns the console, its `.charset()` >> should be used instead of `native.encoding` value. >> As to the jshell

Re: RFR: 8274544: Langtools command's usage were garbled on Japanese Windows

2021-10-04 Thread Ichiroh Takiguchi
On Fri, 1 Oct 2021 18:14:11 GMT, Naoto Sato wrote: >> JEP-400 (UTF-8 by Default) was eabled on JDK18-b13. >> After JDK18-b13, javac and some other langtool command's usage were garbled >> on Japanese Windows. >> These commands use PrintWriter instead of standard out/err with PrintStream. > >

Re: RFR: 8274544: Langtools command's usage were garbled on Japanese Windows [v2]

2021-10-04 Thread Ichiroh Takiguchi
> JEP-400 (UTF-8 by Default) was eabled on JDK18-b13. > After JDK18-b13, javac and some other langtool command's usage were garbled > on Japanese Windows. > These commands use PrintWriter instead of standard out/err with PrintStream. Ichiroh Takiguchi has updated the pull request incrementally

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

2021-10-04 Thread Tagir F . Valeev
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 directory and timely close the underlying filehandle, we should use

Re: RFR: 8274299: Make Method/Constructor/Field accessors @Stable [v3]

2021-10-04 Thread Peter Levart
> This patch improves reflective access speed as shown by the included > benchmarks: > > https://jmh.morethan.io/?gists=902f4b43519c4f96c7abcd14cdc2d27d,ac490481e3001c710d75d6071c10b23a > > ... and is also a prerequisite to make JEP 416 (Reimplement Core Reflection > with Method Handle)

Re: RFR: 8274299: Make Method/Constructor/Field accessors @Stable [v2]

2021-10-04 Thread Peter Levart
On Tue, 28 Sep 2021 22:41:23 GMT, Claes Redestad wrote: > I'm fine with going back to the previous iteration. I'd add `@Stable` to the > same fields in `Constructor`, too, though. Good catch. I'll add @stable to select Constructor fields. They are important for optimizing `Const` use cases.