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

2021-09-27 Thread Claes Redestad
On Sat, 25 Sep 2021 10:15:11 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 416

Re: RFR: 8274242: Implement fast-path for ASCII-compatible CharsetEncoders on x86 [v3]

2021-09-27 Thread Claes Redestad
> This patch extends the `ISO_8859_1.implEncodeISOArray` intrinsic on x86 to > work also for ASCII encoding, which makes for example the `UTF_8$Encoder` > perform on par with (or outperform) similarly getting charset encoded bytes > from a String. The former took a small performance hit in JDK

RFR: 8274367: Re-indent stack-trace examples for Throwable.printStackTrace

2021-09-27 Thread Pavel Rappo
This PR fixes indentation in the examples in the doc comment for java.lang.Throwable#printStackTrace(). 1. Indentation in stack-trace output is significant. The cause of an exception is output on the same level of indentation as that of the exception. A suppressed exception is output at a

RFR: 8274333: Redundant null comparison after Pattern.split

2021-09-27 Thread Andrey Turbanov
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. - Commit messages: - [PATCH] Remove redundant 'null' comparison after Pattern.split

RFR: 8202056: Expand serial warning to check for bad overloads of serial-related methods and ineffectual fields

2021-09-27 Thread Joe Darcy
This is an initial PR for expanded lint warnings done under two bugs: 8202056: Expand serial warning to check for bad overloads of serial-related methods and ineffectual fields 8160675: Issue lint warning for non-serializable non-transient instance fields in serializable type to get feedback

Re: RFR: 8274242: Implement fast-path for ASCII-compatible CharsetEncoders on x86 [v2]

2021-09-27 Thread Claes Redestad
> This patch extends the `ISO_8859_1.implEncodeISOArray` intrinsic on x86 to > work also for ASCII encoding, which makes for example the `UTF_8$Encoder` > perform on par with (or outperform) similarly getting charset encoded bytes > from a String. The former took a small performance hit in JDK

Re: RFR: 8274242: Implement fast-path for ASCII-compatible CharsetEncoders on x86 [v3]

2021-09-27 Thread Claes Redestad
On Mon, 27 Sep 2021 09:34:21 GMT, Volker Simonis wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Add Matcher predicate to avoid changing shared code as non-x86 platforms >> implements support for the

Re: RFR: 8274242: Implement fast-path for ASCII-compatible CharsetEncoders on x86 [v2]

2021-09-27 Thread Claes Redestad
On Mon, 27 Sep 2021 06:36:50 GMT, Tobias Hartmann wrote: > Should we remove the "iso" part from the method/class names? I'm open to suggestions, but I've not been able to think of anything better. `encodeISOOrASCII` doesn't seem helpful and since ASCII is a subset of the ISO-8859-1 encoding

Re: RFR: 8274242: Implement fast-path for ASCII-compatible CharsetEncoders on x86 [v3]

2021-09-27 Thread Tobias Hartmann
On Mon, 27 Sep 2021 11:59:54 GMT, Claes Redestad wrote: > > Should we remove the "iso" part from the method/class names? > > I'm open to suggestions, but I've not been able to think of anything better. > `encodeISOOrASCII` doesn't seem helpful and since ASCII is a subset of the > ISO-8859-1

Re: Discussion: easier Stream closing

2021-09-27 Thread Tagir Valeev
Hello, Brian! Thanks for your thoughts. > The consumeAndClose approach is clever, in that it adds one API point that > works for all streams, rather than having to add a new API point for every > factory of a closeable stream; on the other hand, it is dramatically less > discoverable, and so

Re: RFR: 8274242: Implement fast-path for ASCII-compatible CharsetEncoders on x86

2021-09-27 Thread Tobias Hartmann
On Tue, 21 Sep 2021 21:58:48 GMT, Claes Redestad wrote: > This patch extends the `ISO_8859_1.implEncodeISOArray` intrinsic on x86 to > work also for ASCII encoding, which makes for example the `UTF_8$Encoder` > perform on par with (or outperform) similarly getting charset encoded bytes > from

Re: RFR: 8233674: JarURLConnection.getJarFile throws Exception if some process is holding the file

2021-09-27 Thread Alan Bateman
On Mon, 27 Sep 2021 07:40:26 GMT, Masanori Yano wrote: > It’s a good idea to ask the Microsoft folks about that, but I don't know the > way to ask. Could you tell me how to do it? > > As you say, CreateFile function is used in other parts of the JDK, but it > have a significant impact to fix

Re: RFR: 8250678: ModuleDescriptor.Version parsing treats empty segments inconsistently

2021-09-27 Thread Alan Bateman
On Fri, 24 Sep 2021 11:28:09 GMT, Masanori Yano wrote: > Could you please review the 8250678 bug fixes? > > The `parse` method of ModuleDescriptor.Version class behaves incorrectly when > the input string contains consecutive delimiters. > > The `parse` method treats strings as three

Re: RFR: 8233674: JarURLConnection.getJarFile throws Exception if some process is holding the file

2021-09-27 Thread Masanori Yano
On Fri, 10 Sep 2021 09:23:52 GMT, Masanori Yano wrote: > Could you please review the 8233674 bug fixes? > This problem is caused by the antivirus software opening the file for a short > time, so CreateFile() should be retried. It’s a good idea to ask the Microsoft folks about that, but I don't

Re: RFR: 8274242: Implement fast-path for ASCII-compatible CharsetEncoders on x86

2021-09-27 Thread Volker Simonis
On Tue, 21 Sep 2021 21:58:48 GMT, Claes Redestad wrote: > This patch extends the `ISO_8859_1.implEncodeISOArray` intrinsic on x86 to > work also for ASCII encoding, which makes for example the `UTF_8$Encoder` > perform on par with (or outperform) similarly getting charset encoded bytes > from

Re: RFR: 8231640: (prop) Canonical property storage [v22]

2021-09-27 Thread Roger Riggs
On Wed, 22 Sep 2021 10:27:45 GMT, Jaikiran Pai wrote: >> The commit in this PR implements the proposal for enhancement that was >> discussed in the core-libs-dev mailing list recently[1], for >> https://bugs.openjdk.java.net/browse/JDK-8231640 >> >> At a high level - the `store()` APIs in

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

2021-09-27 Thread Sean Mullan
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. The AlgorithmDecomposer change

Re: RFR: 8202056: Expand serial warning to check for bad overloads of serial-related methods and ineffectual fields

2021-09-27 Thread Erik Joelsson
On Mon, 27 Sep 2021 01:00:18 GMT, Joe Darcy wrote: > This is an initial PR for expanded lint warnings done under two bugs: > > 8202056: Expand serial warning to check for bad overloads of serial-related > methods and ineffectual fields > 8160675: Issue lint warning for non-serializable

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

2021-09-27 Thread iaroslavski
> Sorting: > > - adopt radix sort for sequential and parallel sorts on int/long/float/double > arrays (almost random and length > 6K) > - fix tryMergeRuns() to better handle case when the last run is a single > element > - minor javadoc and comment changes > > Testing: > - add new data inputs

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

2021-09-27 Thread Mandy Chung
On Sat, 25 Sep 2021 10:15:11 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 416

Re: RFR: 8273790: Potential cyclic dependencies between Gregorian and CalendarSystem [v2]

2021-09-27 Thread Roger Riggs
On Sat, 25 Sep 2021 03:38:24 GMT, Jaikiran Pai wrote: >> Can I please get a review for this change which proposes to fix the issue >> reported in https://bugs.openjdk.java.net/browse/JDK-8273790? >> >> As noted in that issue, trying to class load >> `sun.util.calendar.CalendarSystem` and

Re: RFR: 8274276: Cache normalizedBase URL in URLClassPath.FileLoader [v2]

2021-09-27 Thread Daniel Fuchs
On Fri, 24 Sep 2021 11:50:21 GMT, Сергей Цыпанов wrote: >> Currently on each invocation of `URLClassPath.FileLoader.getResource()` >> `normalizedBase` URL is recalculated using same final `baseURL` from parent >> class. This can be avoided giving significant improvement in memory >>

Re: RFR: 8274367: Re-indent stack-trace examples for Throwable.printStackTrace

2021-09-27 Thread Mandy Chung
On Mon, 27 Sep 2021 12:04:48 GMT, Pavel Rappo wrote: > This PR fixes indentation in the examples in the doc comment for > java.lang.Throwable#printStackTrace(). > > 1. Indentation in stack-trace output is significant. The cause of an > exception is output on the same level of indentation as

Re: RFR: 8274367: Re-indent stack-trace examples for Throwable.printStackTrace

2021-09-27 Thread Iris Clark
On Mon, 27 Sep 2021 12:04:48 GMT, Pavel Rappo wrote: > This PR fixes indentation in the examples in the doc comment for > java.lang.Throwable#printStackTrace(). > > 1. Indentation in stack-trace output is significant. The cause of an > exception is output on the same level of indentation as

Re: RFR: 8273790: Potential cyclic dependencies between Gregorian and CalendarSystem [v2]

2021-09-27 Thread Naoto Sato
On Sat, 25 Sep 2021 03:38:24 GMT, Jaikiran Pai wrote: >> Can I please get a review for this change which proposes to fix the issue >> reported in https://bugs.openjdk.java.net/browse/JDK-8273790? >> >> As noted in that issue, trying to class load >> `sun.util.calendar.CalendarSystem` and

Integrated: JDK-8274311: Make build.tools.jigsaw.GenGraphs more configurable

2021-09-27 Thread Mandy Chung
On Fri, 24 Sep 2021 23:07:33 GMT, Mandy Chung wrote: > GenGraphs tool generates the module graph. It currently supports the > configuration via javadoc-graphs.properties. However, > `make/jdk/src/classes/build/tools/jigsaw/javadoc-graphs.properties` only > documents two properties. It should

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

2021-09-27 Thread Mandy Chung
On Mon, 27 Sep 2021 11:23:43 GMT, Claes Redestad wrote: > This looks good, assuming Mandy is OK with extracting and adding to the > microbenchmarks from JEP 416 I'm okay to include these microbenchmarks in this patch. I will merge the change with JEP 416. > A stray thought is why not most

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

2021-09-27 Thread Mandy Chung
On Sat, 25 Sep 2021 10:15:11 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 416

Re: RFR: 8274391: Suppress more warnings on non-serializable non-transient instance fields in java.util.concurrent

2021-09-27 Thread Lance Andersen
On Mon, 27 Sep 2021 18:40:10 GMT, Joe Darcy wrote: > Follow-up change to JDK-8232230, augmentations to javac's Xlint:serial > checking are out for review (https://github.com/openjdk/jdk/pull/5709) and > java.util.concurrent would need some changes to pass under the expanded > checks. > > The

Re: RFR: 8266936: Add a finalization JFR event [v14]

2021-09-27 Thread Mandy Chung
On Sat, 25 Sep 2021 14:22:28 GMT, Markus Grönlund wrote: >> Greetings, >> >> Object.finalize() was deprecated in JDK9. There is an ongoing effort to >> replace and mitigate Object.finalize() uses in the JDK libraries; please see >> https://bugs.openjdk.java.net/browse/JDK-8253568 for more

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

2021-09-27 Thread Mandy Chung
On Mon, 27 Sep 2021 11:23:43 GMT, Claes Redestad wrote: > A stray thought is why not most fields in `Field`/`Method`/`Constructor` are > `final`, as my IDE suggests. I can't find any hotspot code that injects > values to these fields. Experimentally changing most fields in `Field` to > final

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

2021-09-27 Thread Claes Redestad
On Mon, 27 Sep 2021 17:21:09 GMT, Mandy Chung wrote: > This reminds to double check [1] and realized that `java.lang.reflect` is not > in the list of trusted packages for `@Stable`. I'll add that in JEP 416. > > [1] >

Re: RFR: 8274391: Suppress more warnings on non-serializable non-transient instance fields in java.util.concurrent

2021-09-27 Thread Brian Burkhalter
On Mon, 27 Sep 2021 18:40:10 GMT, Joe Darcy wrote: > Follow-up change to JDK-8232230, augmentations to javac's Xlint:serial > checking are out for review (https://github.com/openjdk/jdk/pull/5709) and > java.util.concurrent would need some changes to pass under the expanded > checks. > > The

Re: RFR: 8274392: Suppress more warnings on non-serializable non-transient instance fields in java.sql.rowset

2021-09-27 Thread Lance Andersen
On Mon, 27 Sep 2021 18:51:37 GMT, Joe Darcy wrote: > Follow-up change to JDK-8231442, augmentations to javac's Xlint:serial > checking are out for review (#5709) and java.sql.rowset would need some > changes to pass under the expanded checks. > > The changes are to suppress warnings where

Re: Discussion: easier Stream closing

2021-09-27 Thread Brian Goetz
In Java 8, I think we were reluctant to lean on the idiom of "pass me a lambda and I'll pass it the confined data"), because Java developers were already struggling to understand lambdas.  But now that we're mostly over that hurdle, API points that accept Consumer are a powerful way to gain

Re: RFR: 8231640: (prop) Canonical property storage [v22]

2021-09-27 Thread Magnus Ihse Bursie
On Wed, 22 Sep 2021 10:27:45 GMT, Jaikiran Pai wrote: >> The commit in this PR implements the proposal for enhancement that was >> discussed in the core-libs-dev mailing list recently[1], for >> https://bugs.openjdk.java.net/browse/JDK-8231640 >> >> At a high level - the `store()` APIs in

RFR: 8274392: Suppress more warnings on non-serializable non-transient instance fields in java.sql.rowset

2021-09-27 Thread Joe Darcy
Follow-up change to JDK-8231442, augmentations to javac's Xlint:serial checking are out for review (#5709) and java.sql.rowset would need some changes to pass under the expanded checks. The changes are to suppress warnings where non-transient fields in serializable types are not declared with

Re: RFR: 8274392: Suppress more warnings on non-serializable non-transient instance fields in java.sql.rowset

2021-09-27 Thread Brian Burkhalter
On Mon, 27 Sep 2021 18:51:37 GMT, Joe Darcy wrote: > Follow-up change to JDK-8231442, augmentations to javac's Xlint:serial > checking are out for review (#5709) and java.sql.rowset would need some > changes to pass under the expanded checks. > > The changes are to suppress warnings where

RFR: 8274394: Use Optional.isEmpty instead of !Optional.isPresent in jdk.jlink

2021-09-27 Thread Andrey Turbanov
I propose to replace usages of !Optional.isPresent() with Optional.isEmpty method. It's makes code a bit easier to read. Noticing negation before long chain of method calls is hard. - Commit messages: - [PATCH] Use Optional.isEmpty instead of !Optional.isPresent in jdk.jlink

Integrated: 8274392: Suppress more warnings on non-serializable non-transient instance fields in java.sql.rowset

2021-09-27 Thread Joe Darcy
On Mon, 27 Sep 2021 18:51:37 GMT, Joe Darcy wrote: > Follow-up change to JDK-8231442, augmentations to javac's Xlint:serial > checking are out for review (#5709) and java.sql.rowset would need some > changes to pass under the expanded checks. > > The changes are to suppress warnings where

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

2021-09-27 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 already looks

RFR: 8274391: Suppress more warnings on non-serializable non-transient instance fields in java.util.concurrent

2021-09-27 Thread Joe Darcy
Follow-up change to JDK-8232230, augmentations to javac's Xlint:serial checking are out for review (https://github.com/openjdk/jdk/pull/5709) and java.util.concurrent would need some changes to pass under the expanded checks. The changes are to suppress warnings where non-transient fields in

Re: RFR: 8274392: Suppress more warnings on non-serializable non-transient instance fields in java.sql.rowset [v2]

2021-09-27 Thread Joe Darcy
> Follow-up change to JDK-8231442, augmentations to javac's Xlint:serial > checking are out for review (#5709) and java.sql.rowset would need some > changes to pass under the expanded checks. > > The changes are to suppress warnings where non-transient fields in > serializable types are not

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

2021-09-27 Thread Claes Redestad
On Mon, 27 Sep 2021 19:59:00 GMT, Mandy Chung wrote: > One thing I'm puzzling is why the performance result is better but > `java.lang.reflect` is not in the TNSFF package list. I think for deciding if a field can be treated as constant, `@Stable` has equal weight as a final in a TNSFF

RFR: 8217501: Matcher.hitEnd returns false for incomplete surrogate pairs

2021-09-27 Thread Ian Graves
Fixing a bug where character matcher doesn't mark hitEnd as true if it's a code point with more than one character. - Commit messages: - 8217501: Matcher.hitEnd returns false for incomplete surrogate pairs Changes: https://git.openjdk.java.net/jdk/pull/5725/files Webrev:

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

2021-09-27 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

Re: RFR: 8274367: Re-indent stack-trace examples for Throwable.printStackTrace

2021-09-27 Thread Joe Darcy
On Mon, 27 Sep 2021 12:04:48 GMT, Pavel Rappo wrote: > This PR fixes indentation in the examples in the doc comment for > java.lang.Throwable#printStackTrace(). > > 1. Indentation in stack-trace output is significant. The cause of an > exception is output on the same level of indentation as

Re: RFR: 8274367: Re-indent stack-trace examples for Throwable.printStackTrace

2021-09-27 Thread Brian Burkhalter
On Mon, 27 Sep 2021 12:04:48 GMT, Pavel Rappo wrote: > This PR fixes indentation in the examples in the doc comment for > java.lang.Throwable#printStackTrace(). > > 1. Indentation in stack-trace output is significant. The cause of an > exception is output on the same level of indentation as

Integrated: 8274367: Re-indent stack-trace examples for Throwable.printStackTrace

2021-09-27 Thread Pavel Rappo
On Mon, 27 Sep 2021 12:04:48 GMT, Pavel Rappo wrote: > This PR fixes indentation in the examples in the doc comment for > java.lang.Throwable#printStackTrace(). > > 1. Indentation in stack-trace output is significant. The cause of an > exception is output on the same level of indentation as

Integrated: 8273790: Potential cyclic dependencies between Gregorian and CalendarSystem

2021-09-27 Thread Jaikiran Pai
On Fri, 24 Sep 2021 14:36:07 GMT, Jaikiran Pai wrote: > Can I please get a review for this change which proposes to fix the issue > reported in https://bugs.openjdk.java.net/browse/JDK-8273790? > > As noted in that issue, trying to class load > `sun.util.calendar.CalendarSystem` and

Re: RFR: 8273790: Potential cyclic dependencies between Gregorian and CalendarSystem [v2]

2021-09-27 Thread Jaikiran Pai
On Sat, 25 Sep 2021 03:38:24 GMT, Jaikiran Pai wrote: >> Can I please get a review for this change which proposes to fix the issue >> reported in https://bugs.openjdk.java.net/browse/JDK-8273790? >> >> As noted in that issue, trying to class load >> `sun.util.calendar.CalendarSystem` and

Re: RFR: 8231640: (prop) Canonical property storage [v22]

2021-09-27 Thread Jaikiran Pai
On Wed, 22 Sep 2021 10:27:45 GMT, Jaikiran Pai wrote: >> The commit in this PR implements the proposal for enhancement that was >> discussed in the core-libs-dev mailing list recently[1], for >> https://bugs.openjdk.java.net/browse/JDK-8231640 >> >> At a high level - the `store()` APIs in

Integrated: 8231640: (prop) Canonical property storage

2021-09-27 Thread Jaikiran Pai
On Sat, 4 Sep 2021 15:25:59 GMT, Jaikiran Pai wrote: > The commit in this PR implements the proposal for enhancement that was > discussed in the core-libs-dev mailing list recently[1], for > https://bugs.openjdk.java.net/browse/JDK-8231640 > > At a high level - the `store()` APIs in

Re: RFR: 8269559: AArch64: Implement string_compare intrinsic in SVE [v2]

2021-09-27 Thread TatWai Chong
On Mon, 23 Aug 2021 21:48:01 GMT, TatWai Chong wrote: >> This patch implements string_compare intrinsic in SVE. >> It supports all LL, LU, UL and UU comparisons. >> >> As we haven't found an existing benchmark to measure performance impact, >> we created a benchmark derived from the test [1]

Re: RFR: 4890732: GZIPOutputStream doesn't support optional GZIP fields [v12]

2021-09-27 Thread Lin Zang
On Mon, 6 Sep 2021 07:20:11 GMT, Lin Zang wrote: >> 4890732: GZIPOutputStream doesn't support optional GZIP fields > > Lin Zang has updated the pull request with a new target base due to a merge > or a rebase. The pull request now contains 17 commits: > > - Merge branch 'master' into

Re: RFR: 4890732: GZIPOutputStream doesn't support optional GZIP fields [v12]

2021-09-27 Thread liach
On Mon, 6 Sep 2021 07:20:11 GMT, Lin Zang wrote: >> 4890732: GZIPOutputStream doesn't support optional GZIP fields > > Lin Zang has updated the pull request with a new target base due to a merge > or a rebase. The pull request now contains 17 commits: > > - Merge branch 'master' into