Re: Illegal field name when trying to compile with a javax.swing.Action

2023-07-17 Thread David Alayachew
Ok, ty for the heads up. On Tue, Jul 18, 2023 at 1:18 AM - wrote: > Hi David, > Please do not ask for technical support in the development mailing list. > There's no proof that this issue is with the core libraries instead of the > Java compiler or another component. > I have already downloaded

Re: Illegal field name when trying to compile with a javax.swing.Action

2023-07-17 Thread -
Hi David, Please do not ask for technical support in the development mailing list. There's no proof that this issue is with the core libraries instead of the Java compiler or another component. I have already downloaded your zip, compiled the 4 files with JDK 22 (my local dev build for another unre

Integrated: 8312127: FileDescriptor.sync should temporarily increase parallelism

2023-07-17 Thread Alan Bateman
On Sat, 15 Jul 2023 13:54:46 GMT, Alan Bateman wrote: > If FileDescriptor::sync is invoked by a virtual thread then it doesn't > release its carrier to do other work while modifications are written to the > file system. For cases like this, parallelism should be temporarily increased > for the

Re: RFR: JDK-8312203: Improve specification of Array.newInstance

2023-07-17 Thread Chen Liang
On Tue, 18 Jul 2023 04:42:31 GMT, Joe Darcy wrote: > Change one overload of java.lang.reflect.Array.newInstance to have an > `@implSpec` of calling the other method. > > I choose not to use a snippet tag here is this code is semantically only one > line and doesn't need to be cut-and-pasted. >

RFR: JDK-8312203: Improve specification of Array.newInstance

2023-07-17 Thread Joe Darcy
Change one overload of java.lang.reflect.Array.newInstance to have an `@implSpec` of calling the other method. I choose not to use a snippet tag here is this code is semantically only one line and doesn't need to be cut-and-pasted. As adding an `@implSpec` is technically a (small) specification

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v26]

2023-07-17 Thread Chen Liang
On Tue, 18 Jul 2023 01:57:56 GMT, Chen Liang wrote: >> As John Rose has pointed out in this issue, the current j.l.r.Proxy based >> implementation of MethodHandleProxies.asInterface has a few issues: >> 1. Exposes too much information via Proxy supertype (and WrapperInstance >> interface) >> 2.

Re: Illegal field name when trying to compile with a javax.swing.Action

2023-07-17 Thread David Alayachew
Wait, nevermind. Don't ignore. I was able to recreate this issue on the command line using the abovementioned JDK. Could someone come back and take a look at this please? Sorry for jerking everyone around here. I have multiple JDK's and got mixed up on which one I was using. On Sun, Jul 16, 2023

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v26]

2023-07-17 Thread Jorn Vernee
On Tue, 18 Jul 2023 01:57:56 GMT, Chen Liang wrote: >> As John Rose has pointed out in this issue, the current j.l.r.Proxy based >> implementation of MethodHandleProxies.asInterface has a few issues: >> 1. Exposes too much information via Proxy supertype (and WrapperInstance >> interface) >> 2.

Questions about using `assert` in Java

2023-07-17 Thread Daohan Qu
> Then I wonder if we should consider the size of a function with > assertions removed when making JIT inline decisions? Since > at JIT time I presume whether assertions are turned on or off > is known – or is it too inefficient to calculate this metric? Hi Andrew, This is also a good suggestion

RE: Questions about using `assert` in Java

2023-07-17 Thread Andrew Luo
Thanks, I see. Then I wonder if we should consider the size of a function with assertions removed when making JIT inline decisions? Since at JIT time I presume whether assertions are turned on or off is known – or is it too inefficient to calculate this metric? Thanks, -Andrew From: Daohan Q

Re: RFR: 8302987: Add uniform and spatially equidistributed bounded double streams to RandomGenerator [v10]

2023-07-17 Thread Joe Darcy
On Wed, 31 May 2023 11:57:19 GMT, Raffaello Giulietti wrote: >> The `default` method `nextDouble(double origin, double bound)` in >> `java.util.random.RandomGenerator` aims at generating a uniformly and >> spatially equidistributed random `double` in the left-closed and right-open >> range [`

答复: Questions about using `assert` in Java

2023-07-17 Thread Daohan Qu
> This makes me wonder if it is worth introducing a compiler flag > that would omit assert statements from the compiled bytecode > for this scenario. Hi Andrew, Maybe the first one of this FAQ could answer your question: https://docs.oracle.com/javase/8/docs/technotes/guides/language/assert.html

RE: Questions about using `assert` in Java

2023-07-17 Thread Andrew Luo
This makes me wonder if it is worth introducing a compiler flag that would omit assert statements from the compiled bytecode for this scenario. Forgive me if this has been discussed and decided before though… Thanks, -Andrew From: core-libs-dev On Behalf Of Alan Bateman Sent: Monday, July 17

Re: RFR: 8310929: Optimization for Integer.toString [v12]

2023-07-17 Thread Chen Liang
On Tue, 18 Jul 2023 01:52:35 GMT, 温绍锦 wrote: >> I think he means to check the `charPos` to ensure it is not out of bounds. > > Oh, I see, charPos needs to do bound checks, I added assert with reference > to the implementation of StringUTF16#putChar, is this safe enough? I think we might need t

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v25]

2023-07-17 Thread Chen Liang
On Mon, 17 Jul 2023 17:29:09 GMT, Mandy Chung wrote: >> test/jdk/java/lang/invoke/MethodHandleProxies/WrapperHiddenClassTest.java >> line 165: >> >>> 163: () -> "incorrect dynamic module name: " + >>> implModule.getName()); >>> 164: >>> 165: assertSame(implClass.getCla

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v26]

2023-07-17 Thread Chen Liang
> As John Rose has pointed out in this issue, the current j.l.r.Proxy based > implementation of MethodHandleProxies.asInterface has a few issues: > 1. Exposes too much information via Proxy supertype (and WrapperInstance > interface) > 2. Does not allow future expansion to support SAM[^1] abstrac

Re: RFR: 8310929: Optimization for Integer.toString [v12]

2023-07-17 Thread 温绍锦
On Tue, 18 Jul 2023 01:38:47 GMT, Chen Liang wrote: >> The value range of the r variable is 0-99, and the length of PACKED_DIGITS >> is 100, There is no need to check the array boundary here. > > I think he means to check the `charPos` to ensure it is not out of bounds. Oh, I see, charPos needs

Re: RFR: 8310929: Optimization for Integer.toString [v13]

2023-07-17 Thread 温绍锦
> Optimization for: > Integer.toString > Long.toString > StringBuilder#append(int) > > # Benchmark Result > > > sh make/devkit/createJMHBundle.sh > bash configure --with-jmh=build/jmh/jars > make test TEST="micro:java.lang.Integers.toString*" > make test TEST="micro:java.lang.Longs.toString*"

Re: RFR: 8310929: Optimization for Integer.toString [v12]

2023-07-17 Thread Chen Liang
On Tue, 18 Jul 2023 01:26:55 GMT, 温绍锦 wrote: >> src/java.base/share/classes/java/lang/Integer.java line 528: >> >>> 526: i = q; >>> 527: charPos -= 2; >>> 528: UNSAFE.putShortUnaligned(buf, >>> Unsafe.ARRAY_BYTE_BASE_OFFSET + charPos, PACKED_DIGITS[r], false)

Re: RFR: 8310929: Optimization for Integer.toString [v12]

2023-07-17 Thread 温绍锦
On Mon, 17 Jul 2023 20:53:23 GMT, Roger Riggs wrote: >> 温绍锦 has updated the pull request incrementally with one additional commit >> since the last revision: >> >> Integer/Long toString test against compact strings >> >> Co-authored-by: liach > > src/java.base/share/classes/java/lang/In

Withdrawn: 8305538: Avoid redundant HashMap.containsKey call in ModuleDescriptor.Builder

2023-07-17 Thread duke
On Mon, 3 Apr 2023 08:08:45 GMT, Andrey Turbanov wrote: > `Map.containsKey` call is sometimes unnecessary, when it's known that `Map` > doesn't contain `null` values. > Instead of pair containsKey+put we can use putIfAbsent and compare result > with null. > Result code is shorter and a bit fast

Integrated: 8291065: Creating a VarHandle for a static field triggers class initialization

2023-07-17 Thread Chen Liang
On Fri, 5 May 2023 04:48:09 GMT, Chen Liang wrote: > This patch implements lazy initialization for VarHandle working on static > fields. It has a good initial call performance. > > We introduce a new internal API, `target()` to unpack a lazy VarHandle in VH > implementation methods. If called

Re: RFR: 8311188: Simplify and modernize equals and hashCode in java.text [v5]

2023-07-17 Thread Pavel Rappo
On Wed, 12 Jul 2023 22:26:14 GMT, John R Rose wrote: > Yes, it would be, because `rp` has a statically observable type, > `BigInteger`. And that observation will flow across the call to the helper > method. After all, my mental model is incorrect; sigh. I read your write-up as though once we

Re: RFR: 8311188: Simplify and modernize equals and hashCode in java.text [v5]

2023-07-17 Thread Pavel Rappo
> Please review this PR to use modern APIs and language features to simplify > `equals` and `hashCode` in the java.text area. > > * Some changes to `equals` and `hashCode` are refactoring rather than > modernization. Such changes can be as trivial as rearranging, adding, or > commenting checks.

Re: Questions about using `assert` in Java

2023-07-17 Thread John Rose
On 17 Jul 2023, at 2:08, Alan Bateman wrote: On 15/07/2023 17:53, Daohan Qu wrote: You will find places in the JDK code, esp. in performance critical code, where assertions are commented out. The reason is that asserts, even if disabled, increase the method size and can impact inlining by th

Re: RFR: 8283660: Convert com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java finalizer to Cleaner [v16]

2023-07-17 Thread Brent Christian
On Fri, 22 Jul 2022 20:51:59 GMT, Brent Christian wrote: >> Please review this change to replace the finalizer in >> `AbstractLdapNamingEnumeration` with a Cleaner. >> >> The pieces of state required for cleanup (`LdapCtx homeCtx`, `LdapResult >> res`, and `LdapClient enumClnt`) are moved to a

Integrated: 8312089: Simplify and modernize equals, hashCode, and compareTo in java.nio and implementation code

2023-07-17 Thread Pavel Rappo
On Fri, 14 Jul 2023 12:06:29 GMT, Pavel Rappo wrote: > Please review this PR to use modern APIs and language features to simplify > equals, hashCode, and compareTo for in java.nio and implementation code. > > Please note, test results are pending. > > Additional notes: > > * This PR saves a v

Re: RFR: JDK-8310814: Clarify the targetName parameter of Lookup::findClass [v2]

2023-07-17 Thread Mandy Chung
On Mon, 26 Jun 2023 23:13:19 GMT, Mandy Chung wrote: >> This PR updates the spec of `Lookup::findClass` to reflect the current >> behavior that requires a binary name or a string representing an array class >> in the form as returned by `Class::getName`. >> >> `test/jdk/java/lang/invoke/ac

Re: RFR: JDK-8310814: Clarify the targetName parameter of Lookup::findClass [v2]

2023-07-17 Thread Roger Riggs
On Mon, 26 Jun 2023 23:13:19 GMT, Mandy Chung wrote: >> This PR updates the spec of `Lookup::findClass` to reflect the current >> behavior that requires a binary name or a string representing an array class >> in the form as returned by `Class::getName`. >> >> `test/jdk/java/lang/invoke/ac

Re: RFR: JDK-8310814: Clarify the targetName parameter of Lookup::findClass [v2]

2023-07-17 Thread Brent Christian
On Mon, 26 Jun 2023 23:13:19 GMT, Mandy Chung wrote: >> This PR updates the spec of `Lookup::findClass` to reflect the current >> behavior that requires a binary name or a string representing an array class >> in the form as returned by `Class::getName`. >> >> `test/jdk/java/lang/invoke/ac

Re: RFR: 8039165: [Doc] MessageFormat null locale generates NullPointerException

2023-07-17 Thread Naoto Sato
On Mon, 17 Jul 2023 21:04:48 GMT, Justin Lu wrote: > Please review this PR and [CSR](https://bugs.openjdk.org/browse/JDK-8312197) > which updates the javadoc for the constructor of MessageFormat regarding a > `null` locale, > > `MessageFormat` when created with a `null` locale may throw a > `

Re: RFR: 8306582: Remove MetaspaceShared::exit_after_static_dump()

2023-07-17 Thread Ioi Lam
On Mon, 17 Jul 2023 17:14:01 GMT, Ioi Lam wrote: >> Currently we exit the VM after static dumping with >> `MetaspaceShared::exit_after_static_dump()`. >> >> >> // We have finished dumping the static archive. At this point, there may be >> pending VM >> // operations. We have changed some g

Re: RFR: 8306582: Remove MetaspaceShared::exit_after_static_dump()

2023-07-17 Thread David Holmes
On Thu, 13 Jul 2023 21:25:17 GMT, Matias Saavedra Silva wrote: > Currently we exit the VM after static dumping with > `MetaspaceShared::exit_after_static_dump()`. > > > // We have finished dumping the static archive. At this point, there may be > pending VM > // operations. We have change

Re: RFR: 8311663: Additional refactoring of Locale tests to JUnit [v2]

2023-07-17 Thread Naoto Sato
On Mon, 17 Jul 2023 21:31:33 GMT, Justin Lu wrote: >> Please review this PR which refactors more java.util.Locale tests to JUnit >> with some minor cleanup as well. >> >> Although some of the files could benefit from being renamed bugNNN to >> something more descriptive, this makes reviewi

Re: RFR: 8311663: Additional refactoring of Locale tests to JUnit [v2]

2023-07-17 Thread Justin Lu
On Mon, 17 Jul 2023 10:58:12 GMT, Andrey Turbanov wrote: >> Justin Lu has updated the pull request incrementally with six additional >> commits since the last revision: >> >> - Review: Explicitly run via othervm and pass locale args in cmdline >> - Review: ws removal in Bug8179071.java >> -

Re: RFR: 8311663: Additional refactoring of Locale tests to JUnit [v2]

2023-07-17 Thread Justin Lu
On Fri, 14 Jul 2023 21:59:40 GMT, Naoto Sato wrote: >> Justin Lu has updated the pull request incrementally with six additional >> commits since the last revision: >> >> - Review: Explicitly run via othervm and pass locale args in cmdline >> - Review: ws removal in Bug8179071.java >> - Revie

Re: RFR: 8311663: Additional refactoring of Locale tests to JUnit [v2]

2023-07-17 Thread Justin Lu
> Please review this PR which refactors more java.util.Locale tests to JUnit > with some minor cleanup as well. > > Although some of the files could benefit from being renamed bugNNN to > something more descriptive, this makes reviewing harder, and will be handled > separately. Justin Lu h

RFR: 8039165: [Doc] MessageFormat null locale generates NullPointerException

2023-07-17 Thread Justin Lu
Please review this PR and [CSR](https://bugs.openjdk.org/browse/JDK-8312197) which updates the javadoc for the constructor of MessageFormat regarding a `null` locale, `MessageFormat` when created with a `null` locale may throw a `NullPointerException` either during the object creation, or later

Re: RFR: 8310929: Optimization for Integer.toString [v12]

2023-07-17 Thread Roger Riggs
On Mon, 3 Jul 2023 03:49:01 GMT, 温绍锦 wrote: >> Optimization for: >> Integer.toString >> Long.toString >> StringBuilder#append(int) >> >> # Benchmark Result >> >> >> sh make/devkit/createJMHBundle.sh >> bash configure --with-jmh=build/jmh/jars >> make test TEST="micro:java.lang.Integers.toStrin

Integrated: 8311968: Clarify Three-letter time zone IDs in java.util.TimeZone

2023-07-17 Thread Justin Lu
On Thu, 13 Jul 2023 06:34:09 GMT, Justin Lu wrote: > Please review this PR and associated > [CSR](https://bugs.openjdk.org/browse/JDK-8311979) which links the full list > of deprecated three-letter IDs in java.util.TimeZone > > Although it is made apparent in TimeZone that certain 3-letter IDs

Re: RFR: 8308591: JLine as the default Console provider [v5]

2023-07-17 Thread Naoto Sato
> This is to bring the JLine-based Console implementation as the default, which > was the initial intention in > [JDK-8295803](https://bugs.openjdk.org/browse/JDK-8295803). A corresponding > CSR has also been drafted. Naoto Sato has updated the pull request incrementally with one additional co

RFR: JDK-8309032: jpackage does not work for module projects unless --module-path is specified

2023-07-17 Thread airsquared
[JDK-8309032](https://bugs.openjdk.org/browse/JDK-8309032), [JDK-8306488](https://bugs.openjdk.org/browse/JDK-8306488) - Commit messages: - Minor code cleanup in LauncherData.java - Fix ClassCastException in getPathListParameter: ImmutableCollections$List12 cannot be cast to class

Re: RFR: 8308591: JLine as the default Console provider [v4]

2023-07-17 Thread Naoto Sato
> This is to bring the JLine-based Console implementation as the default, which > was the initial intention in > [JDK-8295803](https://bugs.openjdk.org/browse/JDK-8295803). A corresponding > CSR has also been drafted. Naoto Sato has updated the pull request incrementally with one additional co

Re: RFR: 8308591: JLine as the default Console provider [v3]

2023-07-17 Thread Naoto Sato
> This is to bring the JLine-based Console implementation as the default, which > was the initial intention in > [JDK-8295803](https://bugs.openjdk.org/browse/JDK-8295803). A corresponding > CSR has also been drafted. Naoto Sato has updated the pull request incrementally with one additional co

Re: Integrated: JDK-8312195: Changes in JDK-8284493 use wrong copyright syntax

2023-07-17 Thread Roger Riggs
On Mon, 17 Jul 2023 19:40:42 GMT, Joe Darcy wrote: > Update to conform to accepted syntax. Marked as reviewed by rriggs (Reviewer). - PR Review: https://git.openjdk.org/jdk/pull/14908#pullrequestreview-1533548769

Integrated: JDK-8312195: Changes in JDK-8284493 use wrong copyright syntax

2023-07-17 Thread Joe Darcy
On Mon, 17 Jul 2023 19:40:42 GMT, Joe Darcy wrote: > Update to conform to accepted syntax. This pull request has now been integrated. Changeset: 295ae119 Author:Joe Darcy URL: https://git.openjdk.org/jdk/commit/295ae1190dfb6ac3d00d3cf2d8c8c131f5c319b5 Stats: 2 lines in 2 files c

Integrated: JDK-8312195: Changes in JDK-8284493 use wrong copyright syntax

2023-07-17 Thread Joe Darcy
Update to conform to accepted syntax. - Commit messages: - JDK-8312195: Changes in JDK-8284493 use wrong copyright synta Changes: https://git.openjdk.org/jdk/pull/14908/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14908&range=00 Issue: https://bugs.openjdk.org/browse/JD

Re: RFR: 8308591: JLine as the default Console provider [v2]

2023-07-17 Thread Naoto Sato
> This is to bring the JLine-based Console implementation as the default, which > was the initial intention in > [JDK-8295803](https://bugs.openjdk.org/browse/JDK-8295803). A corresponding > CSR has also been drafted. Naoto Sato has updated the pull request with a new target base due to a merge

Integrated: 8284493: Improve computeNextExponential tail performance and accuracy

2023-07-17 Thread Chris Hennick
On Wed, 6 Apr 2022 17:47:53 GMT, Chris Hennick wrote: > This PR improves both the worst-case performance of `nextExponential` and > `nextGaussian` and the distribution of output at the tails. It fixes the > following imperfections: > > * Repeatedly adding DoubleZigguratTables.exponentialX0 to

Withdrawn: 8301552: Use AtomicReferenceArray for caching instead of CHM in ZoneOffset

2023-07-17 Thread duke
On Tue, 31 Jan 2023 15:57:43 GMT, Per Minborg wrote: > `ZoneOffset` instances are cached by the `ZoneOffset` class itself for values > in the range [-18h, 18h] for each second that is on an even quarter of an > hour (i.e. at most 2*18*4+1 = 145 values). > > Instead of using a `ConcurrentHashM

Re: RFR: 8284493: Improve computeNextExponential tail performance and accuracy [v22]

2023-07-17 Thread Chris Hennick
> This PR improves both the worst-case performance of `nextExponential` and > `nextGaussian` and the distribution of output at the tails. It fixes the > following imperfections: > > * Repeatedly adding DoubleZigguratTables.exponentialX0 to extra causes a > rounding error to accumulate at the ta

Re: RFR: 8284493: Improve computeNextExponential tail performance and accuracy [v21]

2023-07-17 Thread Chris Hennick
On Fri, 14 Jul 2023 20:42:03 GMT, Joe Darcy wrote: >> @JimLaskey @jddarcy @turbanoff @rgiulietti Could this please be merged? > > @Pr0methean , please update your branch with the current contents of the > master before issuing the integrate command. Assuming that succeeds as > expected, myself

Integrated: JDK-8308398 Move SunEC crypto provider into java.base

2023-07-17 Thread Anthony Scarpino
On Tue, 13 Jun 2023 20:36:28 GMT, Anthony Scarpino wrote: > Hi, > > I need a code review for moving the contents of the jdk.crypto.ec module into > java.base. This moves the SunEC JCE Provider (Elliptic Curve) into > java.base. EC has always been separate from the base module/pkg because of

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v25]

2023-07-17 Thread Mandy Chung
On Mon, 17 Jul 2023 17:21:50 GMT, Jorn Vernee wrote: >> Chen Liang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Review changees > > test/jdk/java/lang/invoke/MethodHandleProxies/WrapperHiddenClassTest.java > line 165: > >> 163:

Re: RFR: 8308591: JLine as the default Console provider

2023-07-17 Thread Naoto Sato
On Thu, 1 Jun 2023 18:53:21 GMT, Naoto Sato wrote: > This is to bring the JLine-based Console implementation as the default, which > was the initial intention in > [JDK-8295803](https://bugs.openjdk.org/browse/JDK-8295803). A corresponding > CSR has also been drafted. Thanks, Alan. > This lo

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v25]

2023-07-17 Thread Jorn Vernee
On Tue, 11 Jul 2023 19:22:58 GMT, Chen Liang wrote: >> As John Rose has pointed out in this issue, the current j.l.r.Proxy based >> implementation of MethodHandleProxies.asInterface has a few issues: >> 1. Exposes too much information via Proxy supertype (and WrapperInstance >> interface) >> 2.

Re: RFR: 8306582: Remove MetaspaceShared::exit_after_static_dump()

2023-07-17 Thread Ioi Lam
On Thu, 13 Jul 2023 21:25:17 GMT, Matias Saavedra Silva wrote: > Currently we exit the VM after static dumping with > `MetaspaceShared::exit_after_static_dump()`. > > > // We have finished dumping the static archive. At this point, there may be > pending VM > // operations. We have change

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v25]

2023-07-17 Thread Mandy Chung
On Tue, 11 Jul 2023 19:22:58 GMT, Chen Liang wrote: >> As John Rose has pointed out in this issue, the current j.l.r.Proxy based >> implementation of MethodHandleProxies.asInterface has a few issues: >> 1. Exposes too much information via Proxy supertype (and WrapperInstance >> interface) >> 2.

Re: RFR: 8312127: FileDescriptor.sync should temporarily increase parallelism

2023-07-17 Thread Brian Burkhalter
On Sat, 15 Jul 2023 13:54:46 GMT, Alan Bateman wrote: > If FileDescriptor::sync is invoked by a virtual thread then it doesn't > release its carrier to do other work while modifications are written to the > file system. For cases like this, parallelism should be temporarily increased > for the

Re: RFR: 8312127: FileDescriptor.sync should temporarily increase parallelism

2023-07-17 Thread Aleksey Shipilev
On Sat, 15 Jul 2023 13:54:46 GMT, Alan Bateman wrote: > If FileDescriptor::sync is invoked by a virtual thread then it doesn't > release its carrier to do other work while modifications are written to the > file system. For cases like this, parallelism should be temporarily increased > for the

RFR: 8312127: FileDescriptor.sync should temporarily increase parallelism

2023-07-17 Thread Alan Bateman
If FileDescriptor::sync is invoked by a virtual thread then it doesn't release its carrier to do other work while modifications are written to the file system. For cases like this, parallelism should be temporarily increased for the duration of the operation. This one is somewhat legacy as it's

Re: RFR: 8312164: Refactor Arrays.hashCode for long, boolean, and Object arrays

2023-07-17 Thread Vyom Tewari
On Mon, 17 Jul 2023 09:36:35 GMT, Pavel Rappo wrote: > Please review this PR to refactor Arrays.hashCode for long[], boolean[], and > Object[]. I've been told elsewhere that it shouldn't have significant > performance implications. Looks OK to me. - Marked as reviewed by vtewari

Integrated: 8310157: Allow void-returning filters for MethodHandles::collectCoordinates

2023-07-17 Thread Jorn Vernee
On Thu, 15 Jun 2023 15:44:04 GMT, Jorn Vernee wrote: > This patch changes the implementation of `MethodHandles::collectCoordinates` > to allow using filters that return `void`. This brings the behavior in line > with the previously existing `MethodHandles::collectArgument` which operates > on

Re: RFR: 8301341: LinkedTransferQueue does not respect timeout for poll() [v6]

2023-07-17 Thread Andrey Turbanov
On Thu, 13 Jul 2023 19:21:01 GMT, Doug Lea wrote: >> This now uses Thread.isVirtual to distinguish spin vs immediate block cases, >> enabling re-introduction of spin control from the previous version, removing >> anomalies like this one. > > Doug Lea has updated the pull request with a new targ

Re: RFR: 8312164: Refactor Arrays.hashCode for long, boolean, and Object arrays

2023-07-17 Thread Roger Riggs
On Mon, 17 Jul 2023 09:36:35 GMT, Pavel Rappo wrote: > Please review this PR to refactor Arrays.hashCode for long[], boolean[], and > Object[]. I've been told elsewhere that it shouldn't have significant > performance implications. Marked as reviewed by rriggs (Reviewer). - PR Re

Re: RFR: 8308591: JLine as the default Console provider

2023-07-17 Thread Alan Bateman
On Thu, 1 Jun 2023 18:53:21 GMT, Naoto Sato wrote: > This is to bring the JLine-based Console implementation as the default, which > was the initial intention in > [JDK-8295803](https://bugs.openjdk.org/browse/JDK-8295803). A corresponding > CSR has also been drafted. This looks quite good. I

Re: Questions about using `assert` in Java

2023-07-17 Thread Daohan Qu
Hi Pavel, > There have been studies looking into correlation between assertion density > and fault/defect density. Here's one such study: "Assessing the Relationship > between Software Assertions and Code Quality: An Empirical Investigation". Thanks and yes! And there are also some more recent st

Re: Questions about using `assert` in Java

2023-07-17 Thread Daohan Qu
Hi John, > I believe this can be partially alleviated by extracting the asserts to a > method (partially as the call also increases method size). The optimizer > seems to be smart enough to not call the method if it does nothing > (when ea is disabled). Thanks a lot! Good to know that. I'm not su

Re: Questions about using `assert` in Java

2023-07-17 Thread Daohan Qu
Hi Alan, > You will find places in the JDK code, esp. in performance critical code, > where assertions are commented out. The reason is that asserts, even if > disabled, increase the method size and can impact inlining by the > compiler at run-time. So while useful when debugging some issue in suc

Re: RFR: 8294969: Convert jdk.jdeps javap to use the Classfile API [v10]

2023-07-17 Thread Adam Sotona
> javap uses proprietary com.sun.tools.classfile library to parse class files. > > This patch converts javap to use Classfile API. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 226

Re: Questions about using `assert` in Java

2023-07-17 Thread Daohan Qu
Hi Liang, Thank you for your response! The provided guidelines are quite helpful. I have noticed that different packages in JDK use the assert​ keyword to varying degrees. I wonder if this is more a matter of developer preference (if it is not the performance reason mentioned by Alan). :P Regar

Re: Questions about using `assert` in Java

2023-07-17 Thread Daohan Qu

Integrated: 8311172: Classfile.PREVIEW_MINOR_VERSION doesn't match that read from class files

2023-07-17 Thread Chen Liang
On Fri, 30 Jun 2023 13:10:55 GMT, Chen Liang wrote: > `Classfile.PREVIEW_MINOR_VERSION`, currently -1, is correct when passed to > `ClassBuilder::withVersion`, but is incorrect when compared to > `ClassModel::minorVersion`, which only sets the bits of 2 lowest bytes to 1 > (65536). Discovered

Re: Questions about using `assert` in Java

2023-07-17 Thread Pavel Rappo
In this thread, Alan has already pointed out possible runtime cost of Java assertions. But as far as the general idea goes, I find assertions to be very helpful. There have been studies looking into correlation between assertion density and fault/defect density. Here's one such study: "Assessin

Re: RFR: 8311500: StackWalker.getCallerClass() throws UOE if invoked reflectively [v3]

2023-07-17 Thread Volker Simonis
On Tue, 11 Jul 2023 15:47:35 GMT, Volker Simonis wrote: >> As the included jtreg test demonstrates, `StackWalker.getCallerClass()` can >> throw an `UnsupportedOperationException` if called reflectively. Currently >> this only happens if we invoke `StackWalker.getCallerClass()` recursively >> r

Re: RFR: 8311663: Additional refactoring of Locale tests to JUnit

2023-07-17 Thread Andrey Turbanov
On Thu, 13 Jul 2023 23:23:42 GMT, Justin Lu wrote: > Please review this PR which refactors more java.util.Locale tests to JUnit > with some minor cleanup as well. > > Although some of the files could benefit from being renamed bugNNN to > something more descriptive, this makes reviewing ha

Re: Questions about using `assert` in Java

2023-07-17 Thread John Hendrikx
On 17/07/2023 11:08, Alan Bateman wrote: On 15/07/2023 17:53, Daohan Qu wrote: : Although the |assert|​ keyword has been around for a long time and is handy for invariant checks, it does not seem to be widely used. For example, in the famous |j.u.c|​ packages, nearly all |assert|​ statements ar

RFR: 8312164: Refactor Arrays.hashCode for long, boolean, and Object arrays

2023-07-17 Thread Pavel Rappo
Please review this PR to refactor Arrays.hashCode for long[], boolean[], and Object[]. I've been told elsewhere that it shouldn't have significant performance implications. - Commit messages: - Initial commit Changes: https://git.openjdk.org/jdk/pull/14900/files Webrev: https://w

Re: Questions about using `assert` in Java

2023-07-17 Thread Alan Bateman
On 15/07/2023 17:53, Daohan Qu wrote: : Although the |assert|​ keyword has been around for a long time and is handy for invariant checks, it does not seem to be widely used. For example, in the famous |j.u.c|​ packages, nearly all |assert|​ statements are commented out [1]. My questions are, sh

Integrated: 8310201: Reduce verbose locale output in -XshowSettings launcher option

2023-07-17 Thread Sean Coffey
On Fri, 14 Jul 2023 10:01:16 GMT, Sean Coffey wrote: > Simple tweak to remove the "available locales" section from default > `-XshowSettings` output. > > Instead, it remains available with the `-XshowSettings:locale` option This pull request has now been integrated. Changeset: f6e23ae4 Author

Re: RFR: 8311172: Classfile.PREVIEW_MINOR_VERSION doesn't match that read from class files

2023-07-17 Thread Adam Sotona
On Fri, 30 Jun 2023 13:10:55 GMT, Chen Liang wrote: > `Classfile.PREVIEW_MINOR_VERSION`, currently -1, is correct when passed to > `ClassBuilder::withVersion`, but is incorrect when compared to > `ClassModel::minorVersion`, which only sets the bits of 2 lowest bytes to 1 > (65536). Discovered