Re: RFR: 8304717: Declaration aliasing between boolean and jboolean is wrong [v2]

2023-03-23 Thread Quan Anh Mai
On Thu, 23 Mar 2023 22:23:00 GMT, Julian Waters wrote: >> A couple of spots wrongly refer to boolean and jboolean as the same thing. >> While this does still compile thanks to a happy accident and implicit >> conversions, they are not the same at all, and should be fixed before a >> future

Re: RFR: 8304717: Declaration aliasing between boolean and jboolean is wrong [v2]

2023-03-23 Thread David Holmes
On Thu, 23 Mar 2023 22:23:00 GMT, Julian Waters wrote: >> A couple of spots wrongly refer to boolean and jboolean as the same thing. >> While this does still compile thanks to a happy accident and implicit >> conversions, they are not the same at all, and should be fixed before a >> future

Re: RFR: 8304717: Declaration aliasing between boolean and jboolean is wrong [v2]

2023-03-23 Thread Julian Waters
On Thu, 23 Mar 2023 22:23:00 GMT, Julian Waters wrote: >> A couple of spots wrongly refer to boolean and jboolean as the same thing. >> While this does still compile thanks to a happy accident and implicit >> conversions, they are not the same at all, and should be fixed before a >> future

Re: RFR: 8304717: Declaration aliasing between boolean and jboolean is wrong [v2]

2023-03-23 Thread David Holmes
On Thu, 23 Mar 2023 22:23:00 GMT, Julian Waters wrote: >> A couple of spots wrongly refer to boolean and jboolean as the same thing. >> While this does still compile thanks to a happy accident and implicit >> conversions, they are not the same at all, and should be fixed before a >> future

Re: RFR: 8304006: jlink should create the jimage file in the native endian for the target platform [v13]

2023-03-23 Thread Jaikiran Pai
> Can I please get a review for this change which proposes to fix the issue > reported in https://bugs.openjdk.org/browse/JDK-8206890? > > The `jlink` command allows a `--endian` option to specify the byte order in > the generated image. Before this change, when such a image was being >

Re: RFR: 8304006: jlink should create the jimage file in the native endian for the target platform [v12]

2023-03-23 Thread Jaikiran Pai
On Thu, 23 Mar 2023 18:30:40 GMT, Mandy Chung wrote: >> Jaikiran Pai has updated the pull request incrementally with one additional >> commit since the last revision: >> >> ARM is 32 bit as per platform.m4 in OpenJDK build > >

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

2023-03-23 Thread Chen Liang
On Thu, 23 Mar 2023 22:50:28 GMT, Jonathan Gibbons wrote: >> Hannes Greule has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Apply suggestions from code review >> >> Co-authored-by: liach <7806504+li...@users.noreply.github.com> > >

Re: RFR: 8303485: Replacing os.name for operating system customization [v6]

2023-03-23 Thread Roger Riggs
> Improvements to support OS specific customization for JDK internal use: > - To select values and code; allowing elimination of unused code and values > - Optionally evaluated by build processes, compilation, or archiving (i.e. > CDS) > - Simple API to replace adhoc comparisons with `os.name`

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

2023-03-23 Thread Jonathan Gibbons
On Thu, 23 Mar 2023 22:34:24 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: 8304837: Classfile API throws IOOBE for MethodParameters attribute without parameter names [v2]

2023-03-23 Thread Jonathan Gibbons
On Thu, 23 Mar 2023 22:34:24 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: 8304837: Classfile API throws IOOBE for MethodParameters attribute without parameter names [v2]

2023-03-23 Thread Hannes Greule
> 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 constant pool index 0 if a > MethodParameters attribute has

Re: RFR: 8304717: Declaration aliasing between boolean and jboolean is wrong [v2]

2023-03-23 Thread Julian Waters
> A couple of spots wrongly refer to boolean and jboolean as the same thing. > While this does still compile thanks to a happy accident and implicit > conversions, they are not the same at all, and should be fixed before a > future compiler error happens if their declarations are touched

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

2023-03-23 Thread Julian Waters
On Thu, 23 Mar 2023 19:45:21 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: 8304761: Update IANA Language Subtag Registry to Version 2023-03-22 [v2]

2023-03-23 Thread Justin Lu
On Thu, 23 Mar 2023 20:21:32 GMT, Naoto Sato wrote: >> Justin Lu has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Revert incorrect weighting > > test/jdk/java/util/Locale/LanguageSubtagRegistryTest.java line 193: > >> 191:

Re: RFR: 8304761: Update IANA Language Subtag Registry to Version 2023-03-22 [v2]

2023-03-23 Thread Justin Lu
> Update IANA LSR to 2023-03-22 > [update](https://mm.icann.org/pipermail/ietf-languages-announcements/2023-March/85.html). > Add all new preferred languages to `ACCEPT_LANGUAGES` except `gu`. Justin Lu has updated the pull request incrementally with one additional commit since the last

Integrated: 8303917: Update ISO 639 language codes table

2023-03-23 Thread Justin Lu
On Fri, 10 Mar 2023 17:27:11 GMT, Justin Lu wrote: > This PR modifies `java.util.LocaleISOData.isoLanguageTable` to include (name > only) changes from up-to-date [ISO 639 > data](http://www.loc.gov/standards/iso639-2/php/code_list.php.). > > In addition, this PR updates the ISO 639 data

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v2]

2023-03-23 Thread Eirik Bjorsnos
On Thu, 23 Mar 2023 19:27:04 GMT, Sergey Tsypanov wrote: >> By default `BufferedInputStream` is constructed with internal buffer with >> capacity 8192. In some cases this buffer is never used, e.g. when we call >> `IS.readNBytes()` or `IS.readAllBytes()` (relying on `BIS.read1()`) or when >>

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v2]

2023-03-23 Thread Eirik Bjorsnos
On Thu, 23 Mar 2023 19:48:40 GMT, Eirik Bjorsnos wrote: >> Sergey Tsypanov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Update src/java.base/share/classes/java/io/BufferedInputStream.java >> >> Co-authored-by: liach

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v2]

2023-03-23 Thread Sergey Tsypanov
On Thu, 23 Mar 2023 19:48:40 GMT, Eirik Bjorsnos wrote: >> Sergey Tsypanov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Update src/java.base/share/classes/java/io/BufferedInputStream.java >> >> Co-authored-by: liach

Re: RFR: JDK-8304557: java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java times out [v3]

2023-03-23 Thread Viktor Klang
On Thu, 23 Mar 2023 14:13:14 GMT, Viktor Klang wrote: >> Improves the stability of the memory leak test for CompletableFuture timeout >> cancellation by both reducing the count by 50% (which should still be above >> threshold to trigger given the ample margin set initially) as well as >>

Re: RFR: JDK-8304557: java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java times out

2023-03-23 Thread Viktor Klang
On Tue, 21 Mar 2023 11:02:52 GMT, Jaikiran Pai wrote: >> Improves the stability of the memory leak test for CompletableFuture timeout >> cancellation by both reducing the count by 50% (which should still be above >> threshold to trigger given the ample margin set initially) as well as >>

Integrated: JDK-8304557: java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java times out

2023-03-23 Thread Viktor Klang
On Tue, 21 Mar 2023 10:42:55 GMT, Viktor Klang wrote: > Improves the stability of the memory leak test for CompletableFuture timeout > cancellation by both reducing the count by 50% (which should still be above > threshold to trigger given the ample margin set initially) as well as >

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v2]

2023-03-23 Thread Sergey Tsypanov
On Thu, 23 Mar 2023 19:55:04 GMT, Alan Bateman wrote: >> src/java.base/share/classes/java/io/BufferedInputStream.java line 183: >> >>> 181: if (buffer == EMPTY) { >>> 182: buf = buffer = new byte[size]; >>> 183: } >> >> You should probably use compareAndSet here too

Re: RFR: JDK-8304557: java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java times out [v3]

2023-03-23 Thread Doug Lea
On Thu, 23 Mar 2023 14:13:14 GMT, Viktor Klang wrote: >> Improves the stability of the memory leak test for CompletableFuture timeout >> cancellation by both reducing the count by 50% (which should still be above >> threshold to trigger given the ample margin set initially) as well as >>

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

2023-03-23 Thread Chen Liang
On Thu, 23 Mar 2023 19:45:21 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: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v2]

2023-03-23 Thread Chen Liang
On Thu, 23 Mar 2023 19:27:04 GMT, Sergey Tsypanov wrote: >> By default `BufferedInputStream` is constructed with internal buffer with >> capacity 8192. In some cases this buffer is never used, e.g. when we call >> `IS.readNBytes()` or `IS.readAllBytes()` (relying on `BIS.read1()`) or when >>

Re: RFR: 8304761: Update IANA Language Subtag Registry to Version 2023-03-22

2023-03-23 Thread Naoto Sato
On Thu, 23 Mar 2023 19:07:05 GMT, Justin Lu wrote: > Update IANA LSR to 2023-03-22 > [update](https://mm.icann.org/pipermail/ietf-languages-announcements/2023-March/85.html). > Add all new preferred languages to `ACCEPT_LANGUAGES` except `gu`.

RFR: 8304837: Classfile API throws IOOBE for MethodParameters attribute without parameter names

2023-03-23 Thread Hannes Greule
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 constant pool index 0 if a MethodParameters attribute has an entry

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v2]

2023-03-23 Thread Alan Bateman
On Thu, 23 Mar 2023 19:41:24 GMT, Daniel Fuchs wrote: >> Sergey Tsypanov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Update src/java.base/share/classes/java/io/BufferedInputStream.java >> >> Co-authored-by: liach

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v2]

2023-03-23 Thread Chen Liang
On Thu, 23 Mar 2023 19:27:04 GMT, Sergey Tsypanov wrote: >> By default `BufferedInputStream` is constructed with internal buffer with >> capacity 8192. In some cases this buffer is never used, e.g. when we call >> `IS.readNBytes()` or `IS.readAllBytes()` (relying on `BIS.read1()`) or when >>

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v2]

2023-03-23 Thread Daniel Fuchs
On Thu, 23 Mar 2023 19:53:13 GMT, Chen Liang wrote: > The lazy creation only happens if it's the exact BufferedInputStream class, > which is already handled like the internal lock. Maybe, but how does it play with asynchronous close? - PR Comment:

Re: RFR: 8300979: Lazily initialize (byte, char)arr in java.io.DataInputStream [v3]

2023-03-23 Thread altrisi
On Wed, 22 Mar 2023 10:12:26 GMT, Per Minborg wrote: >> This PR proposed to lazily initialize the scratch arrays only if/when needed. > > Per Minborg has updated the pull request with a new target base due to a > merge or a rebase. The incremental webrev excludes the unrelated changes >

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v2]

2023-03-23 Thread Eirik Bjorsnos
On Thu, 23 Mar 2023 19:27:04 GMT, Sergey Tsypanov wrote: >> By default `BufferedInputStream` is constructed with internal buffer with >> capacity 8192. In some cases this buffer is never used, e.g. when we call >> `IS.readNBytes()` or `IS.readAllBytes()` (relying on `BIS.read1()`) or when >>

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v2]

2023-03-23 Thread Daniel Fuchs
On Thu, 23 Mar 2023 19:27:04 GMT, Sergey Tsypanov wrote: >> By default `BufferedInputStream` is constructed with internal buffer with >> capacity 8192. In some cases this buffer is never used, e.g. when we call >> `IS.readNBytes()` or `IS.readAllBytes()` (relying on `BIS.read1()`) or when >>

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v2]

2023-03-23 Thread Sergey Tsypanov
> By default `BufferedInputStream` is constructed with internal buffer with > capacity 8192. In some cases this buffer is never used, e.g. when we call > `IS.readNBytes()` or `IS.readAllBytes()` (relying on `BIS.read1()`) or when > `BufferedInputStream` is cascaded. Sergey Tsypanov has updated

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream

2023-03-23 Thread Sergey Tsypanov
On Thu, 23 Mar 2023 14:51:40 GMT, Sergey Tsypanov wrote: >> src/java.base/share/classes/java/io/BufferedInputStream.java line 211: >> >>> 209: throw new IllegalArgumentException("Buffer size <= 0"); >>> 210: } >>> 211: buf = new byte[0]; >> >> Two recommendations:

Integrated: 8304691: Remove jlink --post-process-path option

2023-03-23 Thread Ian Graves
On Tue, 21 Mar 2023 20:39:38 GMT, Ian Graves wrote: > Removing the hidden `jlink --post-process-path` option. This pull request has now been integrated. Changeset: af0504e3 Author:Ian Graves URL: https://git.openjdk.org/jdk/commit/af0504e3f3de4ba40fa6187e48b584854b8e41f3 Stats:

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream

2023-03-23 Thread Sergey Tsypanov
On Wed, 22 Mar 2023 23:01:32 GMT, Chen Liang wrote: > This change exposes the CLOSED array Otherwise we have to either call `getInIfOpen()`/`getBufIfOpen` making them at least protected or dodge this somehow via `SharedSecrets` > I mean that additional API exposure is acceptable and backward

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream

2023-03-23 Thread Sergey Tsypanov
On Thu, 23 Mar 2023 15:18:54 GMT, Chen Liang wrote: >> But it's just comment clean up > > No? The one above is API specification (Javadoc); the one below is comments. Right, I'll revert it - PR Review Comment: https://git.openjdk.org/jdk/pull/13150#discussion_r1146370513

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream

2023-03-23 Thread Chen Liang
On Thu, 23 Mar 2023 14:48:32 GMT, Sergey Tsypanov wrote: >> src/java.base/share/classes/java/io/BufferedInputStream.java line 78: >> >>> 76: private final InternalLock lock; >>> 77: >>> 78: /** >> >> These should be reverted, now that the subclasses will see the same behavior >> as

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream

2023-03-23 Thread Chen Liang
On Thu, 23 Mar 2023 15:06:46 GMT, Sergey Tsypanov wrote: >> Good point, done! > > Btw, maybe it'd be better to rename `getBufIfOpen()` into e.g. `getBuffer()` > to make it less confusing? I'd say feel free to rename these private methods. I believe this patch is mature enough for public

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream

2023-03-23 Thread Chen Liang
On Wed, 22 Mar 2023 20:34:08 GMT, Sergey Tsypanov wrote: > By default `BufferedInputStream` is constructed with internal buffer with > capacity 8192. In some cases this buffer is never used, e.g. when we call > `IS.readNBytes()` or `IS.readAllBytes()` (relying on `BIS.read1()`) or when >

RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream

2023-03-23 Thread Sergey Tsypanov
By default `BufferedInputStream` is constructed with internal buffer with capacity 8192. In some cases this buffer is never used, e.g. when we call `IS.readNBytes()` or `IS.readAllBytes()` (relying on `BIS.read1()`) or when `BufferedInputStream` is cascaded. - Commit messages: -

RFR: 8304761: Update IANA Language Subtag Registry to Version 2023-03-22

2023-03-23 Thread Justin Lu
Update IANA LSR to 2023-03-22 [update](https://mm.icann.org/pipermail/ietf-languages-announcements/2023-March/85.html). Add all new preferred languages to `ACCEPT_LANGUAGES` except `gu`. - Commit messages: - Update ACCEPT_LANGUAGE and EXPECTED_RANGE_LIST - Test headers - Lsr

Re: RFR: 8304006: jlink should create the jimage file in the native endian for the target platform [v12]

2023-03-23 Thread Mandy Chung
On Thu, 23 Mar 2023 01:46:47 GMT, Jaikiran Pai wrote: >> Can I please get a review for this change which proposes to fix the issue >> reported in https://bugs.openjdk.org/browse/JDK-8206890? >> >> The `jlink` command allows a `--endian` option to specify the byte order in >> the generated

Integrated: 8294137: Review running times of java.math tests

2023-03-23 Thread Brian Burkhalter
On Wed, 1 Mar 2023 23:36:04 GMT, Brian Burkhalter wrote: > Break up `BigIntegerTest` and `SymmetricRangeTests` into subsets which are > run quasi-randomly as a function of second within the minute at the time the > test is running. `LargeValueExceptions` does not appear amenable to this >

Re: RFR: 8294137: Review running times of java.math tests [v3]

2023-03-23 Thread Joe Darcy
On Fri, 17 Mar 2023 15:18:07 GMT, Brian Burkhalter wrote: >> Break up `BigIntegerTest` and `SymmetricRangeTests` into subsets which are >> run quasi-randomly as a function of second within the minute at the time the >> test is running. `LargeValueExceptions` does not appear amenable to this

Re: RFR: 8304691: Remove jlink --post-process-path option [v5]

2023-03-23 Thread Mandy Chung
On Thu, 23 Mar 2023 16:56:33 GMT, Ian Graves wrote: >> Removing the hidden `jlink --post-process-path` option. > > Ian Graves has updated the pull request incrementally with one additional > commit since the last revision: > > Removing last bits of post process test Good to see this code

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v46]

2023-03-23 Thread Jim Laskey
On Thu, 23 Mar 2023 16:21:56 GMT, Rémi Forax wrote: >> It's coming back to me why we didn't do this in the first place (these >> projects tend to go on for months and years). `SimpleProcessor` exists >> because of that ugly second parameter, `E`, in `Processor`, when a >> majority of the time

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v48]

2023-03-23 Thread Jim Laskey
> Enhance the Java programming language with string templates, which are > similar to string literals but contain embedded expressions. A string > template is interpreted at run time by replacing each expression with the > result of evaluating that expression, possibly after further validation

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v46]

2023-03-23 Thread Jim Laskey
On Thu, 23 Mar 2023 16:25:22 GMT, Rémi Forax wrote: >> The values list can't be null-hostile for the same reason that string >> concatenation can't be null-hostile. Please point to examples of >> null-hostile lists (other that fragments) being used in the template code. >> Apologies if I

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v46]

2023-03-23 Thread Jim Laskey
On Thu, 23 Mar 2023 16:30:42 GMT, Chen Liang wrote: >> Jim Laskey has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Tidy javadoc >> - Rename StringTemplate classes > >

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v11]

2023-03-23 Thread Adam Sotona
> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes > and this patch converts it to use Classfile API. > > Please review. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:

Re: RFR: 8304691: Remove jlink --post-process-path option [v5]

2023-03-23 Thread Ian Graves
> Removing the hidden `jlink --post-process-path` option. Ian Graves has updated the pull request incrementally with one additional commit since the last revision: Removing last bits of post process test - Changes: - all: https://git.openjdk.org/jdk/pull/13126/files - new:

Re: RFR: 8303485: Replacing os.name for operating system customization [v5]

2023-03-23 Thread Michael Osipov
On Thu, 23 Mar 2023 15:51:48 GMT, Roger Riggs wrote: >> src/java.base/share/classes/jdk/internal/util/OperatingSystem.java line 81: >> >>> 79: */ >>> 80: AIX, >>> 81: ; >> >> While browsing another PR I noticed that jlink also has an [OperatingSystem >>

Re: RFR: 8303923: ZipOutStream::putEntry should include an apiNote to indicate that the STORED compression method should be used when writing directory entries [v3]

2023-03-23 Thread Lance Andersen
On Thu, 23 Mar 2023 07:16:32 GMT, Eirik Bjorsnos wrote: > > The example code works without setting the compressed size on the entry? > > Yes, this is the minimal code required and is also how the `jar` tool does it. > > The current behaviour does feel a bit underspecified though. In the >

Re: RFR: 8304691: Remove jlink --post-process-path option [v4]

2023-03-23 Thread Mandy Chung
On Thu, 23 Mar 2023 01:08:43 GMT, Ian Graves wrote: >> Removing the hidden `jlink --post-process-path` option. > > Ian Graves has updated the pull request incrementally with one additional > commit since the last revision: > > Removing post process opt reference

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v46]

2023-03-23 Thread Chen Liang
On Mon, 20 Mar 2023 20:31:46 GMT, Jim Laskey wrote: >> Enhance the Java programming language with string templates, which are >> similar to string literals but contain embedded expressions. A string >> template is interpreted at run time by replacing each expression with the >> result of

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v46]

2023-03-23 Thread Rémi Forax
On Thu, 23 Mar 2023 12:17:55 GMT, Jim Laskey wrote: >> src/java.base/share/classes/java/lang/runtime/TemplateRuntime.java line 204: >> >>> 202: Object[] values >>> 203: ) throws Throwable { >>> 204: List asList = Collections.unmodifiableList(new >>>

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v46]

2023-03-23 Thread Rémi Forax
On Thu, 23 Mar 2023 15:49:37 GMT, Jim Laskey wrote: >> On the flip side, for those that don't use `var`; >> >> >> Processor simple = Processor.of(st-> new >> JSONObject(st.interpolate())); >> Processor string = >> Processor.of(StringTemplate::interpolate); >> >> >> vs. >> >> >>

Re: RFR: 8304448: Kitchensink failed: assert(!thread->is_in_any_VTMS_transition()) failed: class prepare events are not allowed in any VTMS transition

2023-03-23 Thread Ron Pressler
On Thu, 23 Mar 2023 09:10:26 GMT, Serguei Spitsyn wrote: > The fix was suggested/provided by @AlanBateman. > Continuation should use Unsafe.compareAndSetReference rather than a VH here. > We had to change CHM and VT back to Unsafe for similar reasons. > > Testing: Mach5 runs of tiers 1-6 are in

Re: RFR: 8303485: Replacing os.name for operating system customization [v5]

2023-03-23 Thread Roger Riggs
On Thu, 23 Mar 2023 15:33:59 GMT, Daniel Fuchs wrote: >> Roger Riggs has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Group imports for jdk.internal.util > > src/java.base/share/classes/jdk/internal/util/OperatingSystem.java line 81: >

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v46]

2023-03-23 Thread Jim Laskey
On Thu, 23 Mar 2023 15:01:27 GMT, Jim Laskey wrote: >> You can, of course, reduce this to; >> >> >> interface Processor { >> >> ... >> >> static StringTemplate.Processor >> of(Function function) { >> return function::apply; >> } >> >> ... >> >> } >> >>

Re: RFR: 8303485: Replacing os.name for operating system customization [v5]

2023-03-23 Thread Daniel Fuchs
On Thu, 23 Mar 2023 13:56:52 GMT, Roger Riggs wrote: >> Improvements to support OS specific customization for JDK internal use: >> - To select values and code; allowing elimination of unused code and values >> - Optionally evaluated by build processes, compilation, or archiving (i.e. >> CDS)

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v46]

2023-03-23 Thread Jim Laskey
On Thu, 23 Mar 2023 14:39:39 GMT, Jim Laskey wrote: >> Worth considering. Thank you. > > You can, of course, reduce this to; > > > interface Processor { > > ... > > static StringTemplate.Processor > of(Function function) { > return function::apply; > } > >

Re: RFR: JDK-8304557: java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java times out

2023-03-23 Thread Viktor Klang
On Tue, 21 Mar 2023 11:02:52 GMT, Jaikiran Pai wrote: >> Improves the stability of the memory leak test for CompletableFuture timeout >> cancellation by both reducing the count by 50% (which should still be above >> threshold to trigger given the ample margin set initially) as well as >>

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v46]

2023-03-23 Thread Jim Laskey
On Thu, 23 Mar 2023 12:12:36 GMT, Jim Laskey wrote: >> src/java.base/share/classes/java/lang/StringTemplate.java line 679: >> >>> 677: @PreviewFeature(feature=PreviewFeature.Feature.STRING_TEMPLATES) >>> 678: @FunctionalInterface >>> 679: public interface StringProcessor extends

Re: RFR: JDK-8304557: java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java times out [v3]

2023-03-23 Thread Jaikiran Pai
On Thu, 23 Mar 2023 14:13:14 GMT, Viktor Klang wrote: >> Improves the stability of the memory leak test for CompletableFuture timeout >> cancellation by both reducing the count by 50% (which should still be above >> threshold to trigger given the ample margin set initially) as well as >>

Re: RFR: JDK-8304557: java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java times out [v3]

2023-03-23 Thread Viktor Klang
> Improves the stability of the memory leak test for CompletableFuture timeout > cancellation by both reducing the count by 50% (which should still be above > threshold to trigger given the ample margin set initially) as well as > extending the default timeout of the test run. Viktor Klang has

Re: RFR: 8304265: Implementation of Foreign Function and Memory API (Third Preview) [v8]

2023-03-23 Thread Jorn Vernee
On Thu, 23 Mar 2023 10:31:27 GMT, Maurizio Cimadamore wrote: >> Just did a test with jshell: >> >> >> jshell> Linker linker = Linker.nativeLinker(); >> >> jshell> MethodHandle handleValue = >> linker.downcallHandle(FunctionDescriptor.ofVoid(MemoryLayout.structLayout(ValueLayout.JAVA_INT)));

Re: RFR: JDK-8304557: java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java times out [v3]

2023-03-23 Thread Viktor Klang
On Thu, 23 Mar 2023 12:04:34 GMT, Alan Bateman wrote: >> If there isn't any value running this test with a debug build then you could >> have it skip (`@requires vm.debug == false`) to save resources. >> (fixed typo in original message) > >> @AlanBateman @pavelrappo Does the new approach seem

Re: RFR: 8300979: Lazily initialize (byte, char)arr in java.io.DataInputStream [v3]

2023-03-23 Thread Eirik Bjorsnos
On Thu, 23 Mar 2023 13:51:35 GMT, Eirik Bjorsnos wrote: > The reason this puzzles me is that the `readInt` benchmark don't involve the > UTF code paths at all. So why would it become slower, just because two fields > are no longer initialized with the default arrays? Could there be some JIT

Re: RFR: 8303485: Replacing os.name for operating system customization [v5]

2023-03-23 Thread Roger Riggs
> Improvements to support OS specific customization for JDK internal use: > - To select values and code; allowing elimination of unused code and values > - Optionally evaluated by build processes, compilation, or archiving (i.e. > CDS) > - Simple API to replace adhoc comparisons with `os.name`

Re: RFR: 8300979: Lazily initialize (byte, char)arr in java.io.DataInputStream [v3]

2023-03-23 Thread Eirik Bjorsnos
On Wed, 22 Mar 2023 10:12:26 GMT, Per Minborg wrote: >> This PR proposed to lazily initialize the scratch arrays only if/when needed. > > Per Minborg has updated the pull request with a new target base due to a > merge or a rebase. The incremental webrev excludes the unrelated changes >

Re: RFR: 8304498: JShell does not switch to raw mode when there is no /bin/test [v2]

2023-03-23 Thread Sean Coffey
On Wed, 22 Mar 2023 18:38:08 GMT, Jan Lahoda wrote: >> If JShell is run on a system that does not have `/bin/test` (which is, >> apparently, possible for some systems, which only have `/usr/bin/test`), it >> won't switch the terminal into the raw mode, and the input will not work >> properly.

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v47]

2023-03-23 Thread Jim Laskey
> Enhance the Java programming language with string templates, which are > similar to string literals but contain embedded expressions. A string > template is interpreted at run time by replacing each expression with the > result of evaluating that expression, possibly after further validation

Re: RFR: JDK-8304557: java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java times out [v2]

2023-03-23 Thread Viktor Klang
On Thu, 23 Mar 2023 12:32:58 GMT, Pavel Rappo wrote: >>> @AlanBateman @pavelrappo Does the new approach seem acceptable? >> >> I don't have a strong opinion on this. The advantage is that the test is >> probably sub-second as it just needs one CF to complete exceptionally. The >>

Re: RFR: 8300979: Lazily initialize (byte, char)arr in java.io.DataInputStream

2023-03-23 Thread Alan Bateman
On Wed, 22 Mar 2023 10:17:36 GMT, Per Minborg wrote: > > Nice idea. Just wonder could we do the same for `BufferedInputStream`? > > I think it is doable but would require some more work as nullity is used as a > "closed flag". I would nervous about changing BIS. The buf field is a protected

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v46]

2023-03-23 Thread Jim Laskey
On Thu, 23 Mar 2023 01:31:13 GMT, Chen Liang wrote: >> Jim Laskey has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Tidy javadoc >> - Rename StringTemplate classes > >

Re: RFR: JDK-8304557: java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java times out [v2]

2023-03-23 Thread Pavel Rappo
On Thu, 23 Mar 2023 12:04:34 GMT, Alan Bateman wrote: >> If there isn't any value running this test with a debug build then you could >> have it skip (`@requires vm.debug == false`) to save resources. >> (fixed typo in original message) > >> @AlanBateman @pavelrappo Does the new approach seem

Re: RFR: JDK-8304557: java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java times out [v2]

2023-03-23 Thread Andrey Turbanov
On Thu, 23 Mar 2023 11:43:33 GMT, Viktor Klang wrote: >> Improves the stability of the memory leak test for CompletableFuture timeout >> cancellation by both reducing the count by 50% (which should still be above >> threshold to trigger given the ample margin set initially) as well as >>

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v46]

2023-03-23 Thread Jim Laskey
On Thu, 23 Mar 2023 01:36:14 GMT, Chen Liang wrote: >> Jim Laskey has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Tidy javadoc >> - Rename StringTemplate classes > > src/java.base/share/classes/java/util/Digits.java line 68: > >>

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v46]

2023-03-23 Thread Jim Laskey
On Thu, 23 Mar 2023 01:45:54 GMT, Chen Liang wrote: >> Jim Laskey has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Tidy javadoc >> - Rename StringTemplate classes > > src/java.base/share/classes/java/lang/StringTemplate.java line 592:

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v46]

2023-03-23 Thread Jim Laskey
On Thu, 23 Mar 2023 01:33:59 GMT, Chen Liang wrote: >> Jim Laskey has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Tidy javadoc >> - Rename StringTemplate classes > > src/java.base/share/classes/java/lang/runtime/TemplateRuntime.java

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v46]

2023-03-23 Thread Jim Laskey
On Wed, 22 Mar 2023 23:23:38 GMT, Chen Liang wrote: >> Jim Laskey has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Tidy javadoc >> - Rename StringTemplate classes > > src/java.base/share/classes/java/lang/StringTemplate.java line 679:

Re: RFR: 8304448: Kitchensink failed: assert(!thread->is_in_any_VTMS_transition()) failed: class prepare events are not allowed in any VTMS transition

2023-03-23 Thread Alan Bateman
On Thu, 23 Mar 2023 09:10:26 GMT, Serguei Spitsyn wrote: > The fix was suggested/provided by @AlanBateman. > Continuation should use Unsafe.compareAndSetReference rather than a VH here. > We had to change CHM and VT back to Unsafe for similar reasons. > > Testing: Mach5 runs of tiers 1-6 are in

Re: RFR: JDK-8304557: java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java times out [v2]

2023-03-23 Thread Alan Bateman
On Tue, 21 Mar 2023 11:56:57 GMT, Alan Bateman wrote: >> test/jdk/java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java >> line 28: >> >>> 26: * @bug 8303742 >>> 27: * @summary CompletableFuture.orTimeout can leak memory if completed >>> exceptionally >>>

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v46]

2023-03-23 Thread Jim Laskey
On Wed, 22 Mar 2023 23:16:11 GMT, Chen Liang wrote: >> Jim Laskey has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Tidy javadoc >> - Rename StringTemplate classes > > src/java.base/share/classes/java/lang/StringTemplate.java line 550:

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v46]

2023-03-23 Thread Jim Laskey
On Wed, 22 Mar 2023 23:12:02 GMT, Chen Liang wrote: >> Jim Laskey has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Tidy javadoc >> - Rename StringTemplate classes > > src/java.base/share/classes/java/lang/StringTemplate.java line 449:

Re: RFR: JDK-8304557: java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java times out [v2]

2023-03-23 Thread Viktor Klang
On Thu, 23 Mar 2023 10:35:15 GMT, Jaikiran Pai wrote: >> @pavelrappo I agree with that. I have the same experience. With that said, I >> have implemented a whitebox test which reaches in an monitors the task queue >> of the Delayer. @AlanBateman & @jaikiran any preference here? > > Hello

Re: RFR: JDK-8304557: java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java times out [v2]

2023-03-23 Thread Viktor Klang
> Improves the stability of the memory leak test for CompletableFuture timeout > cancellation by both reducing the count by 50% (which should still be above > threshold to trigger given the ample margin set initially) as well as > extending the default timeout of the test run. Viktor Klang has

Re: RFR: JDK-8304557: java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java times out

2023-03-23 Thread Jaikiran Pai
On Wed, 22 Mar 2023 16:49:26 GMT, Viktor Klang wrote: >>> The other alternative I see would be to reach into the implementation of >>> CompletableFuture's `Delayer`'s `ScheduledThreadPoolExecutor delayer` and >>> make sure that it's `getQueue()` eventually goes empty. >> >> From what I've

Re: RFR: 8304265: Implementation of Foreign Function and Memory API (Third Preview) [v8]

2023-03-23 Thread Maurizio Cimadamore
On Thu, 23 Mar 2023 10:28:23 GMT, Maurizio Cimadamore wrote: >> Yes - although there is a distinction between passed by value and by ref. I >> wouldn't be surprised if we just threw NPE for by-value. > > Just did a test with jshell: > > > jshell> Linker linker = Linker.nativeLinker(); > >

Re: RFR: 8304265: Implementation of Foreign Function and Memory API (Third Preview) [v8]

2023-03-23 Thread Maurizio Cimadamore
On Wed, 22 Mar 2023 20:07:01 GMT, Maurizio Cimadamore wrote: >> Ah. True. This is true about all the MS parameters as well. > > Yes - although there is a distinction between passed by value and by ref. I > wouldn't be surprised if we just threw NPE for by-value. Just did a test with jshell:

RFR: 8304448: Kitchensink failed: assert(!thread->is_in_any_VTMS_transition()) failed: class prepare events are not allowed in any VTMS transition

2023-03-23 Thread Serguei Spitsyn
The fix was suggested/provided by @AlanBateman. Continuation should use Unsafe.compareAndSetReference rather than a VH here. We had to change CHM and VT back to Unsafe for similar reasons. Testing: Mach5 runs of tiers 1-6 are in progress - Commit messages: - 8304448: Kitchensink

Re: RFR: 8304450: [vectorapi] Refactor VectorShuffle implementation [v4]

2023-03-23 Thread Xiaohong Gong
On Wed, 22 Mar 2023 12:46:33 GMT, Quan Anh Mai wrote: >> Hi, >> >> This patch reimplements `VectorShuffle` implementations to be a vector of >> the bit type. Currently, VectorShuffle is stored as a byte array, and would >> be expanded upon usage. This poses several drawbacks: >> >> 1.

Re: RFR: 8303923: ZipOutStream::putEntry should include an apiNote to indicate that the STORED compression method should be used when writing directory entries [v3]

2023-03-23 Thread Eirik Bjorsnos
On Wed, 22 Mar 2023 23:45:43 GMT, jmehrens wrote: > The example code works without setting the compressed size on the entry? Yes, this is the minimal code required and is also how the `jar` tool does it. The current behaviour does feel a bit underspecified though. In the `ZipEntry` and

Re: RFR: 8266571: Sequenced Collections

2023-03-23 Thread Chen Liang
On Tue, 8 Feb 2022 17:23:38 GMT, Stuart Marks wrote: > PR for Sequenced Collections implementation. src/java.base/share/classes/java/util/Collections.java line 5887: > 5885: */ > 5886: public static Set newSetFromMap(Map map) { > 5887: if (! map.isEmpty()) Suggestion:

Re: RFR: 8303214: Typo in java.util.Collections#synchronizedNavigableMap javadoc

2023-03-23 Thread Andrey Turbanov
On Wed, 14 Dec 2022 17:43:08 GMT, nbauma109 wrote: > I think this is a typo Marked as reviewed by aturbanov (Committer). - PR Review: https://git.openjdk.org/jdk/pull/11679#pullrequestreview-1353917356

Re: Proposal: track zlib native memory usage with NMTThomas Stüfe thomas.stuefe at gmail.com

2023-03-23 Thread Thomas Stüfe
I always meant to ask, why is it that we chose to dedicate the beginning of > the memory chunk to NMT, and not the end? > > If we used the end, then in this case with an unbalanced malloc/free, we > would still be OK. > > The end seems more natural to me and either way we need to track the size, >

  1   2   >