From abimpoudis at openjdk.org Wed Nov 1 15:55:44 2023 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 1 Nov 2023 15:55:44 GMT Subject: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v28] In-Reply-To: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: > This is the proposed patch for Primitive types in patterns, instanceof, and switch (Preview). > > Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/jep455-20231030/specs/instanceof-jls.html Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision: Add test for instanceof as a pattern on with record patterns ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15638/files - new: https://git.openjdk.org/jdk/pull/15638/files/b437373b..a7f778ca Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=27 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=26-27 Stats: 192 lines in 4 files changed: 162 ins; 18 del; 12 mod Patch: https://git.openjdk.org/jdk/pull/15638.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15638/head:pull/15638 PR: https://git.openjdk.org/jdk/pull/15638 From asotona at openjdk.org Fri Nov 3 08:39:37 2023 From: asotona at openjdk.org (Adam Sotona) Date: Fri, 3 Nov 2023 08:39:37 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v24] In-Reply-To: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> Message-ID: > Classfile API is an internal library under package `jdk.internal.classfile`?in JDK 21. > This pull request turns the Classfile API into a preview feature and moves it into `java.lang.classfile`. > It repackages all uses across JDK and tests and adds lots of missing Javadoc. > > This PR goes in sync with?[JDK-8308754](https://bugs.openjdk.org/browse/JDK-8308754): Class-File API (Preview) (CSR) > and?[JDK-8280389](https://bugs.openjdk.org/browse/JDK-8280389): Class-File API (Preview) (JEP). > > Online javadoc is available at:? > https://cr.openjdk.org/~asotona/JDK-8308753-preview/api/java.base/java/lang/classfile/package-summary.html > > In addition to the primary transition to preview, this pull request also includes: > - All?Classfile*?classes ranamed to?ClassFile*?(based on JEP discussion). > - A new preview feature, `CLASSFILE_API`, has been added. > - Buildsystem tool required a little patch to support annotated modules. > - All JDK modules using the Classfile API are newly participating in the preview. > - All tests that use the Classfile API now have preview enabled. > - A few Javac tests not allowing preview have been partially reverted; their conversion can be re-applied when the Classfile API leaves preview mode. > > Despite the number of affected files, this pull request is relatively straight-forward. The preview version of the Classfile API is based on the internal version of the library from the JDK master branch, and there are no API features added. > > Please review this pull request to help the Classfile API turn into a preview. > > Any comments are welcome. > > 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 358 commits: - Merge branch 'master' into JDK-8308753-preview # Conflicts: # test/jdk/tools/lib/tests/JImageValidator.java - fixed jdk.jfr - Merge branch 'master' into JDK-8308753-preview # Conflicts: # src/java.base/share/classes/module-info.java - applied javadoc fix suggestions - fixed new benchmark - Merge branch 'master' into JDK-8308753-preview # Conflicts: # src/java.base/share/classes/jdk/internal/classfile/impl/AbstractPoolEntry.java - removed trailing space - Merge branch 'master' into JDK-8308753-preview # Conflicts: # src/java.base/share/classes/module-info.java - package info javadoc improvements - removed obsolete exports from BuildMicrobenchmark.gmk - ... and 348 more: https://git.openjdk.org/jdk/compare/ec79ab4b...5f4f47c4 ------------- Changes: https://git.openjdk.org/jdk/pull/15706/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15706&range=23 Stats: 32167 lines in 768 files changed: 14623 ins; 14055 del; 3489 mod Patch: https://git.openjdk.org/jdk/pull/15706.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15706/head:pull/15706 PR: https://git.openjdk.org/jdk/pull/15706 From jlahoda at openjdk.org Mon Nov 6 16:48:17 2023 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 6 Nov 2023 16:48:17 GMT Subject: RFR: 8319532: jshell - Non-sealed declarations sometimes break a snippet evaluation Message-ID: JShell does not understand "non-sealed" modifier when splitting input into snippets. The reason is that `CompletenessAnalyzer.parseDeclaration` (https://github.com/openjdk/jdk/blob/cdf337357a62dd52c00e56e75912565e15b6adfd/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java#L687) is skipping through the declaration's initial tokens, but does not know it should ignore the `-` in the `non-sealed`. This patch fixes that by making `-` part of the declaration. ------------- Commit messages: - Cleanup. - 8319532: jshell - Non-sealed declarations sometimes break a snippet evaluation Changes: https://git.openjdk.org/jdk/pull/16523/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16523&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8319532 Stats: 10 lines in 2 files changed: 7 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/16523.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16523/head:pull/16523 PR: https://git.openjdk.org/jdk/pull/16523 From acobbs at openjdk.org Mon Nov 6 21:14:07 2023 From: acobbs at openjdk.org (Archie Cobbs) Date: Mon, 6 Nov 2023 21:14:07 GMT Subject: RFR: 8194743: Compiler implementation for Statements before super() [v20] In-Reply-To: References: Message-ID: > This is a first draft of a patch for JEP 447. > > Summary of changes: > > 1. Track when we're within a constructor "prologue" via new flag `AttrContext.ctorPrologue` > 1. Add checks for illegal early access to `this` in constructor prologues, and update existing checks to distinguish between static context vs. constructor prologue context > 1. Verify allowed placement of `super()`/`this()` calls via new method `Check.checkSuperInitCalls()` > 1. Remove/refactor assumptions in several places that `super()`/`this()` was always the first statement > > The changes in `Flow.java` are an example of #4. `Flow.FlowAnalyzer` checks for uncaught checked exceptions. For initializer blocks, this was previously done by requiring that any checked exceptions thrown be declared as thrown by all constructors containing `super()`. This list of checked exceptions was being pre-calculated before recursing into the initial constructors. This worked because initializer blocks were executed at the beginning of each initial constructor right after `super()` is called. > > Now initializer blocks are traversed as each `super()` invocation is encountered, reflecting what actually happens at runtime. Similarly, final fields are marked as DA after encountering `this()`, not automatically at the beginning of those constructors. These changes produce equivalent checks, but are compatible with the new flexibility of placement of `super()`/`this()` as well as possible future changes that could occur along these same lines. Archie Cobbs has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 40 commits: - Merge branch 'master' into SuperInit - Merge branch 'master' into SuperInit - Reword new errors to use the JLS term for "explicit constructor invocation". - After further review, revert 599d761 to avoid mutable state lying around. - Address review comments relating to error messages. - Have RefBeforeCtorCalledError extend StaticError and customize debug strings. - Change variable name "statik" -> "isStatic" per review recommendation. - Remove obsolete flag "constructorArgs". - Change the error message to match the applicable spec rule. - Merge branch 'master' into SuperInit - ... and 30 more: https://git.openjdk.org/jdk/compare/e4803e0c...bbdb814f ------------- Changes: https://git.openjdk.org/jdk/pull/13656/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13656&range=19 Stats: 1498 lines in 27 files changed: 1156 ins; 225 del; 117 mod Patch: https://git.openjdk.org/jdk/pull/13656.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/13656/head:pull/13656 PR: https://git.openjdk.org/jdk/pull/13656 From asotona at openjdk.org Tue Nov 7 10:27:30 2023 From: asotona at openjdk.org (Adam Sotona) Date: Tue, 7 Nov 2023 10:27:30 GMT Subject: RFR: 8319532: jshell - Non-sealed declarations sometimes break a snippet evaluation In-Reply-To: References: Message-ID: On Mon, 6 Nov 2023 16:42:49 GMT, Jan Lahoda wrote: > JShell does not understand "non-sealed" modifier when splitting input into snippets. The reason is that `CompletenessAnalyzer.parseDeclaration` (https://github.com/openjdk/jdk/blob/cdf337357a62dd52c00e56e75912565e15b6adfd/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java#L687) is skipping through the declaration's initial tokens, but does not know it should ignore the `-` in the `non-sealed`. This patch fixes that by making `-` part of the declaration. Looks good. ------------- Marked as reviewed by asotona (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/16523#pullrequestreview-1717341561 From jlahoda at openjdk.org Tue Nov 7 15:30:41 2023 From: jlahoda at openjdk.org (Jan Lahoda) Date: Tue, 7 Nov 2023 15:30:41 GMT Subject: Integrated: 8319532: jshell - Non-sealed declarations sometimes break a snippet evaluation In-Reply-To: References: Message-ID: On Mon, 6 Nov 2023 16:42:49 GMT, Jan Lahoda wrote: > JShell does not understand "non-sealed" modifier when splitting input into snippets. The reason is that `CompletenessAnalyzer.parseDeclaration` (https://github.com/openjdk/jdk/blob/cdf337357a62dd52c00e56e75912565e15b6adfd/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java#L687) is skipping through the declaration's initial tokens, but does not know it should ignore the `-` in the `non-sealed`. This patch fixes that by making `-` part of the declaration. This pull request has now been integrated. Changeset: 45e68ae2 Author: Jan Lahoda URL: https://git.openjdk.org/jdk/commit/45e68ae2079336cea45dcbc39189639c06a05e0c Stats: 10 lines in 2 files changed: 7 ins; 0 del; 3 mod 8319532: jshell - Non-sealed declarations sometimes break a snippet evaluation Reviewed-by: asotona ------------- PR: https://git.openjdk.org/jdk/pull/16523 From abimpoudis at openjdk.org Tue Nov 7 18:24:59 2023 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Tue, 7 Nov 2023 18:24:59 GMT Subject: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v29] In-Reply-To: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: > This is the proposed patch for Primitive types in patterns, instanceof, and switch (Preview). > > Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/jep455-20231030/specs/instanceof-jls.html Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision: Small cleanup in PrimitivePatternsSwitch ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15638/files - new: https://git.openjdk.org/jdk/pull/15638/files/a7f778ca..e81f023a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=28 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=27-28 Stats: 2 lines in 1 file changed: 1 ins; 1 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/15638.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15638/head:pull/15638 PR: https://git.openjdk.org/jdk/pull/15638 From duke at openjdk.org Wed Nov 8 13:40:21 2023 From: duke at openjdk.org (Konrad Windszus) Date: Wed, 8 Nov 2023 13:40:21 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v24] In-Reply-To: References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> Message-ID: On Fri, 3 Nov 2023 08:39:37 GMT, Adam Sotona wrote: >> Classfile API is an internal library under package `jdk.internal.classfile`?in JDK 21. >> This pull request turns the Classfile API into a preview feature and moves it into `java.lang.classfile`. >> It repackages all uses across JDK and tests and adds lots of missing Javadoc. >> >> This PR goes in sync with?[JDK-8308754](https://bugs.openjdk.org/browse/JDK-8308754): Class-File API (Preview) (CSR) >> and?[JDK-8280389](https://bugs.openjdk.org/browse/JDK-8280389): Class-File API (Preview) (JEP). >> >> Online javadoc is available at:? >> https://cr.openjdk.org/~asotona/JDK-8308753-preview/api/java.base/java/lang/classfile/package-summary.html >> >> In addition to the primary transition to preview, this pull request also includes: >> - All?Classfile*?classes ranamed to?ClassFile*?(based on JEP discussion). >> - A new preview feature, `CLASSFILE_API`, has been added. >> - Buildsystem tool required a little patch to support annotated modules. >> - All JDK modules using the Classfile API are newly participating in the preview. >> - All tests that use the Classfile API now have preview enabled. >> - A few Javac tests not allowing preview have been partially reverted; their conversion can be re-applied when the Classfile API leaves preview mode. >> >> Despite the number of affected files, this pull request is relatively straight-forward. The preview version of the Classfile API is based on the internal version of the library from the JDK master branch, and there are no API features added. >> >> Please review this pull request to help the Classfile API turn into a preview. >> >> Any comments are welcome. >> >> 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 358 commits: > > - Merge branch 'master' into JDK-8308753-preview > > # Conflicts: > # test/jdk/tools/lib/tests/JImageValidator.java > - fixed jdk.jfr > - Merge branch 'master' into JDK-8308753-preview > > # Conflicts: > # src/java.base/share/classes/module-info.java > - applied javadoc fix suggestions > - fixed new benchmark > - Merge branch 'master' into JDK-8308753-preview > > # Conflicts: > # src/java.base/share/classes/jdk/internal/classfile/impl/AbstractPoolEntry.java > - removed trailing space > - Merge branch 'master' into JDK-8308753-preview > > # Conflicts: > # src/java.base/share/classes/module-info.java > - package info javadoc improvements > - removed obsolete exports from BuildMicrobenchmark.gmk > - ... and 348 more: https://git.openjdk.org/jdk/compare/ec79ab4b...5f4f47c4 I would appreciate a hint in the javadocs why `Classfile.of` requires a byte array and cannot deal with inputstreams (iiuc this is due to the lazy reading which requires adjusting the offset back and forth potentially) ------------- PR Comment: https://git.openjdk.org/jdk/pull/15706#issuecomment-1801897871 From liach at openjdk.org Wed Nov 8 14:10:15 2023 From: liach at openjdk.org (Chen Liang) Date: Wed, 8 Nov 2023 14:10:15 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v24] In-Reply-To: References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> Message-ID: On Wed, 8 Nov 2023 13:31:32 GMT, Konrad Windszus wrote: > I would appreciate a hint in the javadocs why `Classfile.of` requires a byte array and cannot deal with inputstreams (iiuc this is due to the lazy reading which requires adjusting the offset back and forth potentially) You can simply call `ClassFile.of().parse(inputStream.readAllBytes())` instead. ------------- PR Comment: https://git.openjdk.org/jdk/pull/15706#issuecomment-1801960923 From asotona at openjdk.org Wed Nov 8 14:32:52 2023 From: asotona at openjdk.org (Adam Sotona) Date: Wed, 8 Nov 2023 14:32:52 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v25] In-Reply-To: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> Message-ID: > Classfile API is an internal library under package `jdk.internal.classfile`?in JDK 21. > This pull request turns the Classfile API into a preview feature and moves it into `java.lang.classfile`. > It repackages all uses across JDK and tests and adds lots of missing Javadoc. > > This PR goes in sync with?[JDK-8308754](https://bugs.openjdk.org/browse/JDK-8308754): Class-File API (Preview) (CSR) > and?[JDK-8280389](https://bugs.openjdk.org/browse/JDK-8280389): Class-File API (Preview) (JEP). > > Online javadoc is available at:? > https://cr.openjdk.org/~asotona/JDK-8308753-preview/api/java.base/java/lang/classfile/package-summary.html > > In addition to the primary transition to preview, this pull request also includes: > - All?Classfile*?classes ranamed to?ClassFile*?(based on JEP discussion). > - A new preview feature, `CLASSFILE_API`, has been added. > - Buildsystem tool required a little patch to support annotated modules. > - All JDK modules using the Classfile API are newly participating in the preview. > - All tests that use the Classfile API now have preview enabled. > - A few Javac tests not allowing preview have been partially reverted; their conversion can be re-applied when the Classfile API leaves preview mode. > > Despite the number of affected files, this pull request is relatively straight-forward. The preview version of the Classfile API is based on the internal version of the library from the JDK master branch, and there are no API features added. > > Please review this pull request to help the Classfile API turn into a preview. > > Any comments are welcome. > > 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 360 commits: - fixed condy tests - Merge branch 'master' into JDK-8308753-preview - Merge branch 'master' into JDK-8308753-preview # Conflicts: # test/jdk/tools/lib/tests/JImageValidator.java - fixed jdk.jfr - Merge branch 'master' into JDK-8308753-preview # Conflicts: # src/java.base/share/classes/module-info.java - applied javadoc fix suggestions - fixed new benchmark - Merge branch 'master' into JDK-8308753-preview # Conflicts: # src/java.base/share/classes/jdk/internal/classfile/impl/AbstractPoolEntry.java - removed trailing space - Merge branch 'master' into JDK-8308753-preview # Conflicts: # src/java.base/share/classes/module-info.java - ... and 350 more: https://git.openjdk.org/jdk/compare/7bc8e4c8...29c8fad3 ------------- Changes: https://git.openjdk.org/jdk/pull/15706/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15706&range=24 Stats: 32301 lines in 783 files changed: 14623 ins; 14111 del; 3567 mod Patch: https://git.openjdk.org/jdk/pull/15706.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15706/head:pull/15706 PR: https://git.openjdk.org/jdk/pull/15706 From liach at openjdk.org Wed Nov 8 15:26:21 2023 From: liach at openjdk.org (Chen Liang) Date: Wed, 8 Nov 2023 15:26:21 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v25] In-Reply-To: References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> Message-ID: <1O6wmxmmlST1cR3SkMDbz6AQPxQPQzR9LQ2lLX-Gfn4=.04c03978-f129-496e-831e-fdbfe8adf255@github.com> On Wed, 8 Nov 2023 14:32:52 GMT, Adam Sotona wrote: >> Classfile API is an internal library under package `jdk.internal.classfile`?in JDK 21. >> This pull request turns the Classfile API into a preview feature and moves it into `java.lang.classfile`. >> It repackages all uses across JDK and tests and adds lots of missing Javadoc. >> >> This PR goes in sync with?[JDK-8308754](https://bugs.openjdk.org/browse/JDK-8308754): Class-File API (Preview) (CSR) >> and?[JDK-8280389](https://bugs.openjdk.org/browse/JDK-8280389): Class-File API (Preview) (JEP). >> >> Online javadoc is available at:? >> https://cr.openjdk.org/~asotona/JDK-8308753-preview/api/java.base/java/lang/classfile/package-summary.html >> >> In addition to the primary transition to preview, this pull request also includes: >> - All?Classfile*?classes ranamed to?ClassFile*?(based on JEP discussion). >> - A new preview feature, `CLASSFILE_API`, has been added. >> - Buildsystem tool required a little patch to support annotated modules. >> - All JDK modules using the Classfile API are newly participating in the preview. >> - All tests that use the Classfile API now have preview enabled. >> - A few Javac tests not allowing preview have been partially reverted; their conversion can be re-applied when the Classfile API leaves preview mode. >> >> Despite the number of affected files, this pull request is relatively straight-forward. The preview version of the Classfile API is based on the internal version of the library from the JDK master branch, and there are no API features added. >> >> Please review this pull request to help the Classfile API turn into a preview. >> >> Any comments are welcome. >> >> 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 360 commits: > > - fixed condy tests > - Merge branch 'master' into JDK-8308753-preview > - Merge branch 'master' into JDK-8308753-preview > > # Conflicts: > # test/jdk/tools/lib/tests/JImageValidator.java > - fixed jdk.jfr > - Merge branch 'master' into JDK-8308753-preview > > # Conflicts: > # src/java.base/share/classes/module-info.java > - applied javadoc fix suggestions > - fixed new benchmark > - Merge branch 'master' into JDK-8308753-preview > > # Conflicts: > # src/java.base/share/classes/jdk/internal/classfile/impl/AbstractPoolEntry.java > - removed trailing space > - Merge branch 'master' into JDK-8308753-preview > > # Conflicts: > # src/java.base/share/classes/module-info.java > - ... and 350 more: https://git.openjdk.org/jdk/compare/7bc8e4c8...29c8fad3 test/jdk/jdk/classfile/SignaturesTest.java line 1: > 1: /* The new test in this file for classDesc bug needs a migration too. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15706#discussion_r1386795420 From duke at openjdk.org Wed Nov 8 15:49:18 2023 From: duke at openjdk.org (Konrad Windszus) Date: Wed, 8 Nov 2023 15:49:18 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v24] In-Reply-To: References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> Message-ID: <83E89Gq0Rn3H-WTsUJPx6L37WggoVHo7piExlpMSmMg=.82768fa9-9262-4fad-b87b-7c94a71d2d84@github.com> On Wed, 8 Nov 2023 14:07:04 GMT, Chen Liang wrote: > You can simply call `ClassFile.of().parse(inputStream.readAllBytes())` instead. I know, but for memory consumption reasons everyone should prefer just passing an InputStream. Is the memory consumption with `ClassFile.of().parse(Path)` any better (i.e. are you using a `java.io.RandomAccessFile` or `java.nio.channels.SeekableByteChannel` under the hood)? I think that deserves a sentence in the javadoc. ------------- PR Comment: https://git.openjdk.org/jdk/pull/15706#issuecomment-1802159417 From asotona at openjdk.org Wed Nov 8 16:20:19 2023 From: asotona at openjdk.org (Adam Sotona) Date: Wed, 8 Nov 2023 16:20:19 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v26] In-Reply-To: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> Message-ID: <1Tzm6V5U8360jlN6QksTfSxpCswVhEFbfpNcgNtOvzs=.0c0a444c-f5a6-4207-9e5e-a292eb514304@github.com> > Classfile API is an internal library under package `jdk.internal.classfile`?in JDK 21. > This pull request turns the Classfile API into a preview feature and moves it into `java.lang.classfile`. > It repackages all uses across JDK and tests and adds lots of missing Javadoc. > > This PR goes in sync with?[JDK-8308754](https://bugs.openjdk.org/browse/JDK-8308754): Class-File API (Preview) (CSR) > and?[JDK-8280389](https://bugs.openjdk.org/browse/JDK-8280389): Class-File API (Preview) (JEP). > > Online javadoc is available at:? > https://cr.openjdk.org/~asotona/JDK-8308753-preview/api/java.base/java/lang/classfile/package-summary.html > > In addition to the primary transition to preview, this pull request also includes: > - All?Classfile*?classes ranamed to?ClassFile*?(based on JEP discussion). > - A new preview feature, `CLASSFILE_API`, has been added. > - Buildsystem tool required a little patch to support annotated modules. > - All JDK modules using the Classfile API are newly participating in the preview. > - All tests that use the Classfile API now have preview enabled. > - A few Javac tests not allowing preview have been partially reverted; their conversion can be re-applied when the Classfile API leaves preview mode. > > Despite the number of affected files, this pull request is relatively straight-forward. The preview version of the Classfile API is based on the internal version of the library from the JDK master branch, and there are no API features added. > > Please review this pull request to help the Classfile API turn into a preview. > > Any comments are welcome. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: fixed SignaturesTest ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15706/files - new: https://git.openjdk.org/jdk/pull/15706/files/29c8fad3..af441580 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15706&range=25 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15706&range=24-25 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/15706.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15706/head:pull/15706 PR: https://git.openjdk.org/jdk/pull/15706 From asotona at openjdk.org Wed Nov 8 16:20:23 2023 From: asotona at openjdk.org (Adam Sotona) Date: Wed, 8 Nov 2023 16:20:23 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v25] In-Reply-To: <1O6wmxmmlST1cR3SkMDbz6AQPxQPQzR9LQ2lLX-Gfn4=.04c03978-f129-496e-831e-fdbfe8adf255@github.com> References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> <1O6wmxmmlST1cR3SkMDbz6AQPxQPQzR9LQ2lLX-Gfn4=.04c03978-f129-496e-831e-fdbfe8adf255@github.com> Message-ID: On Wed, 8 Nov 2023 15:22:54 GMT, Chen Liang wrote: >> Adam Sotona has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 360 commits: >> >> - fixed condy tests >> - Merge branch 'master' into JDK-8308753-preview >> - Merge branch 'master' into JDK-8308753-preview >> >> # Conflicts: >> # test/jdk/tools/lib/tests/JImageValidator.java >> - fixed jdk.jfr >> - Merge branch 'master' into JDK-8308753-preview >> >> # Conflicts: >> # src/java.base/share/classes/module-info.java >> - applied javadoc fix suggestions >> - fixed new benchmark >> - Merge branch 'master' into JDK-8308753-preview >> >> # Conflicts: >> # src/java.base/share/classes/jdk/internal/classfile/impl/AbstractPoolEntry.java >> - removed trailing space >> - Merge branch 'master' into JDK-8308753-preview >> >> # Conflicts: >> # src/java.base/share/classes/module-info.java >> - ... and 350 more: https://git.openjdk.org/jdk/compare/7bc8e4c8...29c8fad3 > > test/jdk/jdk/classfile/SignaturesTest.java line 1: > >> 1: /* > > The new test in this file for classDesc bug needs a migration too. Good point, thank you. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15706#discussion_r1386878583 From liach at openjdk.org Thu Nov 9 00:23:15 2023 From: liach at openjdk.org (Chen Liang) Date: Thu, 9 Nov 2023 00:23:15 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v24] In-Reply-To: <83E89Gq0Rn3H-WTsUJPx6L37WggoVHo7piExlpMSmMg=.82768fa9-9262-4fad-b87b-7c94a71d2d84@github.com> References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> <83E89Gq0Rn3H-WTsUJPx6L37WggoVHo7piExlpMSmMg=.82768fa9-9262-4fad-b87b-7c94a71d2d84@github.com> Message-ID: On Wed, 8 Nov 2023 15:45:56 GMT, Konrad Windszus wrote: > I know, but for memory consumption reasons everyone should prefer just passing an InputStream. Is the memory consumption with `ClassFile.of().parse(Path)` any better (i.e. are you using a `java.io.RandomAccessFile` or `java.nio.channels.SeekableByteChannel` under the hood)? I think that deserves a sentence in the javadoc. FYI `parse(Path)` is just a shortcut to read all bytes from a file, like `parse(Files.readAllBytes(path))`. Classfile implementation fetches the byte array very often (constant pool reading, lazy expansion) so keeping the bytes in a in-memory array is better. ------------- PR Comment: https://git.openjdk.org/jdk/pull/15706#issuecomment-1802967277 From asotona at openjdk.org Thu Nov 9 08:52:57 2023 From: asotona at openjdk.org (Adam Sotona) Date: Thu, 9 Nov 2023 08:52:57 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v27] In-Reply-To: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> Message-ID: > Classfile API is an internal library under package `jdk.internal.classfile`?in JDK 21. > This pull request turns the Classfile API into a preview feature and moves it into `java.lang.classfile`. > It repackages all uses across JDK and tests and adds lots of missing Javadoc. > > This PR goes in sync with?[JDK-8308754](https://bugs.openjdk.org/browse/JDK-8308754): Class-File API (Preview) (CSR) > and?[JDK-8280389](https://bugs.openjdk.org/browse/JDK-8280389): Class-File API (Preview) (JEP). > > Online javadoc is available at:? > https://cr.openjdk.org/~asotona/JDK-8308753-preview/api/java.base/java/lang/classfile/package-summary.html > > In addition to the primary transition to preview, this pull request also includes: > - All?Classfile*?classes ranamed to?ClassFile*?(based on JEP discussion). > - A new preview feature, `CLASSFILE_API`, has been added. > - Buildsystem tool required a little patch to support annotated modules. > - All JDK modules using the Classfile API are newly participating in the preview. > - All tests that use the Classfile API now have preview enabled. > - A few Javac tests not allowing preview have been partially reverted; their conversion can be re-applied when the Classfile API leaves preview mode. > > Despite the number of affected files, this pull request is relatively straight-forward. The preview version of the Classfile API is based on the internal version of the library from the JDK master branch, and there are no API features added. > > Please review this pull request to help the Classfile API turn into a preview. > > Any comments are welcome. > > 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 363 commits: - fixed lambda tests - Merge branch 'master' into JDK-8308753-preview - fixed SignaturesTest - fixed condy tests - Merge branch 'master' into JDK-8308753-preview - Merge branch 'master' into JDK-8308753-preview # Conflicts: # test/jdk/tools/lib/tests/JImageValidator.java - fixed jdk.jfr - Merge branch 'master' into JDK-8308753-preview # Conflicts: # src/java.base/share/classes/module-info.java - applied javadoc fix suggestions - fixed new benchmark - ... and 353 more: https://git.openjdk.org/jdk/compare/b0fc8082...8c80afff ------------- Changes: https://git.openjdk.org/jdk/pull/15706/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15706&range=26 Stats: 32311 lines in 785 files changed: 14623 ins; 14113 del; 3575 mod Patch: https://git.openjdk.org/jdk/pull/15706.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15706/head:pull/15706 PR: https://git.openjdk.org/jdk/pull/15706 From jlahoda at openjdk.org Mon Nov 13 07:58:17 2023 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 13 Nov 2023 07:58:17 GMT Subject: RFR: 8319311: JShell Process Builder should be configurable Message-ID: JShell has a two parts: the main process, which compiles the user's snippets, and possibly interacts with the user, and an "agent" that executes the executable code produced from the snippets. Then "agent" is typically (although not necessarily) a separate process. The clients of the JShell API are free to override the agent behavior, selecting either from the list of existing agents, or creating their own. There is, however, a desire to use agent that is mostly equivalent to the default JDI-based agent, but with some adjustments. This patch proposes to limit the amount of code needed to create an agent derived from the default agent. The solution has two parts: - a new interface, JdiStarter is created, which the API client can use to provide code that starts the external JVM for snippet execution - the existing JdiInitiator is enhanced so that the user can override the process creation itself. Please also review the CSR: https://bugs.openjdk.org/browse/JDK-8319923 ------------- Commit messages: - adding test - Various fixes - Fixing behavior when parameters map does not contain entry for the launch parameter. - Adding javadoc. - Making listen process overridable in JdiInitiator. - 8319311: JShell Process Builder should be configurable Changes: https://git.openjdk.org/jdk/pull/16627/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16627&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8319311 Stats: 262 lines in 4 files changed: 226 ins; 21 del; 15 mod Patch: https://git.openjdk.org/jdk/pull/16627.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16627/head:pull/16627 PR: https://git.openjdk.org/jdk/pull/16627 From jlahoda at openjdk.org Mon Nov 13 15:30:16 2023 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 13 Nov 2023 15:30:16 GMT Subject: RFR: 8314614: jdk/jshell/ImportTest.java failed with "InternalError: Failed remote listen" Message-ID: <7LUwT_LBHKmEbzUA1Si3LncwV6TeaCnFydqZO8kpyeM=.8bbcf199-ca9b-4ce9-a43b-a7f65a2e80c4@github.com> JShell by default runs the user's snippets in a separate JVM. This is usually reliable, but during tests, it sometimes happens the remote/separate JVM does not start properly, and the tests fail. This patch tries to change the default JShell execution in tests so that if the start of the separate JVM fails, the "local" (in process) execution is used. This should improve the stability of the tests. Non-test JShell execution remains unmodified. Note that individual tests can override this behavior, for example when they want to test a specific execution. ------------- Commit messages: - Fixing tests. - Only modifying tests. - 8314614: jdk/jshell/ImportTest.java failed with "InternalError: Failed remote listen" Changes: https://git.openjdk.org/jdk/pull/16632/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16632&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8314614 Stats: 74 lines in 9 files changed: 66 ins; 0 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/16632.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16632/head:pull/16632 PR: https://git.openjdk.org/jdk/pull/16632 From asotona at openjdk.org Mon Nov 13 17:43:57 2023 From: asotona at openjdk.org (Adam Sotona) Date: Mon, 13 Nov 2023 17:43:57 GMT Subject: RFR: 8314614: jdk/jshell/ImportTest.java failed with "InternalError: Failed remote listen" In-Reply-To: <7LUwT_LBHKmEbzUA1Si3LncwV6TeaCnFydqZO8kpyeM=.8bbcf199-ca9b-4ce9-a43b-a7f65a2e80c4@github.com> References: <7LUwT_LBHKmEbzUA1Si3LncwV6TeaCnFydqZO8kpyeM=.8bbcf199-ca9b-4ce9-a43b-a7f65a2e80c4@github.com> Message-ID: On Mon, 13 Nov 2023 15:23:05 GMT, Jan Lahoda wrote: > JShell by default runs the user's snippets in a separate JVM. This is usually reliable, but during tests, it sometimes happens the remote/separate JVM does not start properly, and the tests fail. > > This patch tries to change the default JShell execution in tests so that if the start of the separate JVM fails, the "local" (in process) execution is used. This should improve the stability of the tests. > > Non-test JShell execution remains unmodified. > > Note that individual tests can override this behavior, for example when they want to test a specific execution. Looks good. ------------- Marked as reviewed by asotona (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/16632#pullrequestreview-1727867345 From jlahoda at openjdk.org Tue Nov 14 12:09:51 2023 From: jlahoda at openjdk.org (Jan Lahoda) Date: Tue, 14 Nov 2023 12:09:51 GMT Subject: RFR: 8314614: jdk/jshell/ImportTest.java failed with "InternalError: Failed remote listen" [v2] In-Reply-To: <7LUwT_LBHKmEbzUA1Si3LncwV6TeaCnFydqZO8kpyeM=.8bbcf199-ca9b-4ce9-a43b-a7f65a2e80c4@github.com> References: <7LUwT_LBHKmEbzUA1Si3LncwV6TeaCnFydqZO8kpyeM=.8bbcf199-ca9b-4ce9-a43b-a7f65a2e80c4@github.com> Message-ID: > JShell by default runs the user's snippets in a separate JVM. This is usually reliable, but during tests, it sometimes happens the remote/separate JVM does not start properly, and the tests fail. > > This patch tries to change the default JShell execution in tests so that if the start of the separate JVM fails, the "local" (in process) execution is used. This should improve the stability of the tests. > > Non-test JShell execution remains unmodified. > > Note that individual tests can override this behavior, for example when they want to test a specific execution. Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision: Stabilization of FailOver tests. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16632/files - new: https://git.openjdk.org/jdk/pull/16632/files/b9565b27..8c6edd4c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16632&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16632&range=00-01 Stats: 32 lines in 6 files changed: 0 ins; 18 del; 14 mod Patch: https://git.openjdk.org/jdk/pull/16632.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16632/head:pull/16632 PR: https://git.openjdk.org/jdk/pull/16632 From jlahoda at openjdk.org Tue Nov 14 12:14:30 2023 From: jlahoda at openjdk.org (Jan Lahoda) Date: Tue, 14 Nov 2023 12:14:30 GMT Subject: RFR: 8314614: jdk/jshell/ImportTest.java failed with "InternalError: Failed remote listen" [v2] In-Reply-To: References: <7LUwT_LBHKmEbzUA1Si3LncwV6TeaCnFydqZO8kpyeM=.8bbcf199-ca9b-4ce9-a43b-a7f65a2e80c4@github.com> Message-ID: <-OjQRvDWGhG_lmHzCl8SAg6jpniSb2UyxwrSmRCvFbY=.4f29174c-f5b2-4a04-95fc-5b76bd8d6c59@github.com> On Tue, 14 Nov 2023 12:09:51 GMT, Jan Lahoda wrote: >> JShell by default runs the user's snippets in a separate JVM. This is usually reliable, but during tests, it sometimes happens the remote/separate JVM does not start properly, and the tests fail. >> >> This patch tries to change the default JShell execution in tests so that if the start of the separate JVM fails, the "local" (in process) execution is used. This should improve the stability of the tests. >> >> Non-test JShell execution remains unmodified. >> >> Note that individual tests can override this behavior, for example when they want to test a specific execution. > > Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision: > > Stabilization of FailOver tests. I've updated the `FailOver*` tests to use `local` execution as the actual execution that should succeed (after those that intentionally fail). I believe the tests still perform the tests they are supposed to perform, but the local execution should be much more reliable. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16632#issuecomment-1810089891 From abimpoudis at openjdk.org Thu Nov 16 18:23:02 2023 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Thu, 16 Nov 2023 18:23:02 GMT Subject: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v30] In-Reply-To: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: > This is the proposed patch for Primitive types in patterns, instanceof, and switch (Preview). > > Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/jep455-20231030/specs/instanceof-jls.html Aggelos Biboudis has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 36 commits: - Merge branch 'master' into primitive-patterns - Small cleanup in PrimitivePatternsSwitch - Add test for instanceof as a pattern on with record patterns - Merge branch 'master' into primitive-patterns # Conflicts: # src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java # src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java - Add tests for new data types in switch statements - Fix Bootstrap initialization error by using `explicitCastArguments` for integral tests - Fix SwitchBootstraps for pattern matching over longs - Merge branch 'master' into primitive-patterns - Improve javadoc of ExactConversionsSupport Co-authored-by: Raffaello Giulietti - Adjust javadoc on ExactConversionsSupport - ... and 26 more: https://git.openjdk.org/jdk/compare/9727f4bd...0a07af94 ------------- Changes: https://git.openjdk.org/jdk/pull/15638/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=29 Stats: 3199 lines in 41 files changed: 2943 ins; 111 del; 145 mod Patch: https://git.openjdk.org/jdk/pull/15638.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15638/head:pull/15638 PR: https://git.openjdk.org/jdk/pull/15638 From abimpoudis at openjdk.org Fri Nov 17 23:26:56 2023 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Fri, 17 Nov 2023 23:26:56 GMT Subject: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v31] In-Reply-To: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: > This is the proposed patch for Primitive types in patterns, instanceof, and switch (Preview). > > Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ Aggelos Biboudis has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 37 commits: - Merge branch 'master' into primitive-patterns - Merge branch 'master' into primitive-patterns - Small cleanup in PrimitivePatternsSwitch - Add test for instanceof as a pattern on with record patterns - Merge branch 'master' into primitive-patterns # Conflicts: # src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java # src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java - Add tests for new data types in switch statements - Fix Bootstrap initialization error by using `explicitCastArguments` for integral tests - Fix SwitchBootstraps for pattern matching over longs - Merge branch 'master' into primitive-patterns - Improve javadoc of ExactConversionsSupport Co-authored-by: Raffaello Giulietti - ... and 27 more: https://git.openjdk.org/jdk/compare/99570fbe...ca7cc2a6 ------------- Changes: https://git.openjdk.org/jdk/pull/15638/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=30 Stats: 3199 lines in 41 files changed: 2943 ins; 111 del; 145 mod Patch: https://git.openjdk.org/jdk/pull/15638.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15638/head:pull/15638 PR: https://git.openjdk.org/jdk/pull/15638 From abimpoudis at openjdk.org Mon Nov 20 09:36:25 2023 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Mon, 20 Nov 2023 09:36:25 GMT Subject: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v32] In-Reply-To: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: > This is the proposed patch for Primitive types in patterns, instanceof, and switch (Preview). > > Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ Aggelos Biboudis has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 38 commits: - Merge branch 'master' into primitive-patterns - Merge branch 'master' into primitive-patterns - Merge branch 'master' into primitive-patterns - Small cleanup in PrimitivePatternsSwitch - Add test for instanceof as a pattern on with record patterns - Merge branch 'master' into primitive-patterns # Conflicts: # src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java # src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java - Add tests for new data types in switch statements - Fix Bootstrap initialization error by using `explicitCastArguments` for integral tests - Fix SwitchBootstraps for pattern matching over longs - Merge branch 'master' into primitive-patterns - ... and 28 more: https://git.openjdk.org/jdk/compare/de51aa19...584a4a30 ------------- Changes: https://git.openjdk.org/jdk/pull/15638/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=31 Stats: 3199 lines in 41 files changed: 2943 ins; 111 del; 145 mod Patch: https://git.openjdk.org/jdk/pull/15638.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15638/head:pull/15638 PR: https://git.openjdk.org/jdk/pull/15638 From asotona at openjdk.org Mon Nov 20 19:13:51 2023 From: asotona at openjdk.org (Adam Sotona) Date: Mon, 20 Nov 2023 19:13:51 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v28] In-Reply-To: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> Message-ID: > Classfile API is an internal library under package `jdk.internal.classfile`?in JDK 21. > This pull request turns the Classfile API into a preview feature and moves it into `java.lang.classfile`. > It repackages all uses across JDK and tests and adds lots of missing Javadoc. > > This PR goes in sync with?[JDK-8308754](https://bugs.openjdk.org/browse/JDK-8308754): Class-File API (Preview) (CSR) > and?[JDK-8280389](https://bugs.openjdk.org/browse/JDK-8280389): Class-File API (Preview) (JEP). > > Online javadoc is available at:? > https://cr.openjdk.org/~asotona/JDK-8308753-preview/api/java.base/java/lang/classfile/package-summary.html > > In addition to the primary transition to preview, this pull request also includes: > - All?Classfile*?classes ranamed to?ClassFile*?(based on JEP discussion). > - A new preview feature, `CLASSFILE_API`, has been added. > - Buildsystem tool required a little patch to support annotated modules. > - All JDK modules using the Classfile API are newly participating in the preview. > - All tests that use the Classfile API now have preview enabled. > - A few Javac tests not allowing preview have been partially reverted; their conversion can be re-applied when the Classfile API leaves preview mode. > > Despite the number of affected files, this pull request is relatively straight-forward. The preview version of the Classfile API is based on the internal version of the library from the JDK master branch, and there are no API features added. > > Please review this pull request to help the Classfile API turn into a preview. > > Any comments are welcome. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: added new package-info snippets and fixed ClassFile::parse throws javadoc description ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15706/files - new: https://git.openjdk.org/jdk/pull/15706/files/8c80afff..3860e6c9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15706&range=27 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15706&range=26-27 Stats: 43 lines in 3 files changed: 36 ins; 0 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/15706.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15706/head:pull/15706 PR: https://git.openjdk.org/jdk/pull/15706 From asotona at openjdk.org Mon Nov 20 19:27:01 2023 From: asotona at openjdk.org (Adam Sotona) Date: Mon, 20 Nov 2023 19:27:01 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v29] In-Reply-To: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> Message-ID: > Classfile API is an internal library under package `jdk.internal.classfile`?in JDK 21. > This pull request turns the Classfile API into a preview feature and moves it into `java.lang.classfile`. > It repackages all uses across JDK and tests and adds lots of missing Javadoc. > > This PR goes in sync with?[JDK-8308754](https://bugs.openjdk.org/browse/JDK-8308754): Class-File API (Preview) (CSR) > and?[JDK-8280389](https://bugs.openjdk.org/browse/JDK-8280389): Class-File API (Preview) (JEP). > > Online javadoc is available at:? > https://cr.openjdk.org/~asotona/JDK-8308753-preview/api/java.base/java/lang/classfile/package-summary.html > > In addition to the primary transition to preview, this pull request also includes: > - All?Classfile*?classes ranamed to?ClassFile*?(based on JEP discussion). > - A new preview feature, `CLASSFILE_API`, has been added. > - Buildsystem tool required a little patch to support annotated modules. > - All JDK modules using the Classfile API are newly participating in the preview. > - All tests that use the Classfile API now have preview enabled. > - A few Javac tests not allowing preview have been partially reverted; their conversion can be re-applied when the Classfile API leaves preview mode. > > Despite the number of affected files, this pull request is relatively straight-forward. The preview version of the Classfile API is based on the internal version of the library from the JDK master branch, and there are no API features added. > > Please review this pull request to help the Classfile API turn into a preview. > > Any comments are welcome. > > 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 365 commits: - Merge branch 'master' into JDK-8308753-preview # Conflicts: # test/langtools/tools/javac/7199823/InnerClassCannotBeVerified.java - added new package-info snippets and fixed ClassFile::parse throws javadoc description - fixed lambda tests - Merge branch 'master' into JDK-8308753-preview - fixed SignaturesTest - fixed condy tests - Merge branch 'master' into JDK-8308753-preview - Merge branch 'master' into JDK-8308753-preview # Conflicts: # test/jdk/tools/lib/tests/JImageValidator.java - fixed jdk.jfr - Merge branch 'master' into JDK-8308753-preview # Conflicts: # src/java.base/share/classes/module-info.java - ... and 355 more: https://git.openjdk.org/jdk/compare/6b96bb64...46ad6906 ------------- Changes: https://git.openjdk.org/jdk/pull/15706/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15706&range=28 Stats: 32339 lines in 784 files changed: 14659 ins; 14109 del; 3571 mod Patch: https://git.openjdk.org/jdk/pull/15706.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15706/head:pull/15706 PR: https://git.openjdk.org/jdk/pull/15706 From asotona at openjdk.org Tue Nov 21 09:54:03 2023 From: asotona at openjdk.org (Adam Sotona) Date: Tue, 21 Nov 2023 09:54:03 GMT Subject: RFR: 8319311: JShell Process Builder should be configurable In-Reply-To: References: Message-ID: On Mon, 13 Nov 2023 07:52:35 GMT, Jan Lahoda wrote: > JShell has a two parts: the main process, which compiles the user's snippets, and possibly interacts with the user, and an "agent" that executes the executable code produced from the snippets. Then "agent" is typically (although not necessarily) a separate process. The clients of the JShell API are free to override the agent behavior, selecting either from the list of existing agents, or creating their own. > > There is, however, a desire to use agent that is mostly equivalent to the default JDI-based agent, but with some adjustments. > > This patch proposes to limit the amount of code needed to create an agent derived from the default agent. > > The solution has two parts: > > - a new interface, JdiStarter is created, which the API client can use to provide code that starts the external JVM for snippet execution > - the existing JdiInitiator is enhanced so that the user can override the process creation itself. > > Please also review the CSR: > https://bugs.openjdk.org/browse/JDK-8319923 Looks good. ------------- Marked as reviewed by asotona (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/16627#pullrequestreview-1741551612 From asotona at openjdk.org Tue Nov 21 10:33:22 2023 From: asotona at openjdk.org (Adam Sotona) Date: Tue, 21 Nov 2023 10:33:22 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v30] In-Reply-To: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> Message-ID: > Classfile API is an internal library under package `jdk.internal.classfile`?in JDK 21. > This pull request turns the Classfile API into a preview feature and moves it into `java.lang.classfile`. > It repackages all uses across JDK and tests and adds lots of missing Javadoc. > > This PR goes in sync with?[JDK-8308754](https://bugs.openjdk.org/browse/JDK-8308754): Class-File API (Preview) (CSR) > and?[JDK-8280389](https://bugs.openjdk.org/browse/JDK-8280389): Class-File API (Preview) (JEP). > > Online javadoc is available at:? > https://cr.openjdk.org/~asotona/JDK-8308753-preview/api/java.base/java/lang/classfile/package-summary.html > > In addition to the primary transition to preview, this pull request also includes: > - All?Classfile*?classes ranamed to?ClassFile*?(based on JEP discussion). > - A new preview feature, `CLASSFILE_API`, has been added. > - Buildsystem tool required a little patch to support annotated modules. > - All JDK modules using the Classfile API are newly participating in the preview. > - All tests that use the Classfile API now have preview enabled. > - A few Javac tests not allowing preview have been partially reverted; their conversion can be re-applied when the Classfile API leaves preview mode. > > Despite the number of affected files, this pull request is relatively straight-forward. The preview version of the Classfile API is based on the internal version of the library from the JDK master branch, and there are no API features added. > > Please review this pull request to help the Classfile API turn into a preview. > > Any comments are welcome. > > 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 366 commits: - Merge branch 'master' into JDK-8308753-preview # Conflicts: # test/jdk/jdk/classfile/StackMapsTest.java - Merge branch 'master' into JDK-8308753-preview # Conflicts: # test/langtools/tools/javac/7199823/InnerClassCannotBeVerified.java - added new package-info snippets and fixed ClassFile::parse throws javadoc description - fixed lambda tests - Merge branch 'master' into JDK-8308753-preview - fixed SignaturesTest - fixed condy tests - Merge branch 'master' into JDK-8308753-preview - Merge branch 'master' into JDK-8308753-preview # Conflicts: # test/jdk/tools/lib/tests/JImageValidator.java - fixed jdk.jfr - ... and 356 more: https://git.openjdk.org/jdk/compare/e055fae1...48aa8ba8 ------------- Changes: https://git.openjdk.org/jdk/pull/15706/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15706&range=29 Stats: 32342 lines in 784 files changed: 14659 ins; 14109 del; 3574 mod Patch: https://git.openjdk.org/jdk/pull/15706.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15706/head:pull/15706 PR: https://git.openjdk.org/jdk/pull/15706 From abimpoudis at openjdk.org Tue Nov 21 17:21:33 2023 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Tue, 21 Nov 2023 17:21:33 GMT Subject: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v33] In-Reply-To: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: > This is the proposed patch for Primitive types in patterns, instanceof, and switch (Preview). > > Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ Aggelos Biboudis has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 39 commits: - Merge branch 'master' into primitive-patterns - Merge branch 'master' into primitive-patterns - Merge branch 'master' into primitive-patterns - Merge branch 'master' into primitive-patterns - Small cleanup in PrimitivePatternsSwitch - Add test for instanceof as a pattern on with record patterns - Merge branch 'master' into primitive-patterns # Conflicts: # src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java # src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java - Add tests for new data types in switch statements - Fix Bootstrap initialization error by using `explicitCastArguments` for integral tests - Fix SwitchBootstraps for pattern matching over longs - ... and 29 more: https://git.openjdk.org/jdk/compare/61d81d64...2b2405cc ------------- Changes: https://git.openjdk.org/jdk/pull/15638/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=32 Stats: 3199 lines in 41 files changed: 2943 ins; 111 del; 145 mod Patch: https://git.openjdk.org/jdk/pull/15638.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15638/head:pull/15638 PR: https://git.openjdk.org/jdk/pull/15638 From jlahoda at openjdk.org Thu Nov 23 07:18:20 2023 From: jlahoda at openjdk.org (Jan Lahoda) Date: Thu, 23 Nov 2023 07:18:20 GMT Subject: Integrated: 8314614: jdk/jshell/ImportTest.java failed with "InternalError: Failed remote listen" In-Reply-To: <7LUwT_LBHKmEbzUA1Si3LncwV6TeaCnFydqZO8kpyeM=.8bbcf199-ca9b-4ce9-a43b-a7f65a2e80c4@github.com> References: <7LUwT_LBHKmEbzUA1Si3LncwV6TeaCnFydqZO8kpyeM=.8bbcf199-ca9b-4ce9-a43b-a7f65a2e80c4@github.com> Message-ID: <_UOOKPTm587sfmhVmZj25ErgvzHxfeLqAjbUiyuSF7k=.629f1b5e-e28e-4412-bb1e-e988c343f0de@github.com> On Mon, 13 Nov 2023 15:23:05 GMT, Jan Lahoda wrote: > JShell by default runs the user's snippets in a separate JVM. This is usually reliable, but during tests, it sometimes happens the remote/separate JVM does not start properly, and the tests fail. > > This patch tries to change the default JShell execution in tests so that if the start of the separate JVM fails, the "local" (in process) execution is used. This should improve the stability of the tests. > > Non-test JShell execution remains unmodified. > > Note that individual tests can override this behavior, for example when they want to test a specific execution. This pull request has now been integrated. Changeset: 14193a04 Author: Jan Lahoda URL: https://git.openjdk.org/jdk/commit/14193a049ebcbd3639962729c631293b8d3a9114 Stats: 106 lines in 15 files changed: 66 ins; 18 del; 22 mod 8314614: jdk/jshell/ImportTest.java failed with "InternalError: Failed remote listen" 8312140: jdk/jshell tests failed with JDI socket timeouts Reviewed-by: asotona ------------- PR: https://git.openjdk.org/jdk/pull/16632 From asotona at openjdk.org Mon Nov 27 09:20:34 2023 From: asotona at openjdk.org (Adam Sotona) Date: Mon, 27 Nov 2023 09:20:34 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v31] In-Reply-To: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> Message-ID: <96gFYL2iQI4xJubLzYNfxYbB2_D7xXqrR9FSWd4zN0s=.f11bc6d0-4c67-44be-820a-3e1f76fd9a49@github.com> > Classfile API is an internal library under package `jdk.internal.classfile`?in JDK 21. > This pull request turns the Classfile API into a preview feature and moves it into `java.lang.classfile`. > It repackages all uses across JDK and tests and adds lots of missing Javadoc. > > This PR goes in sync with?[JDK-8308754](https://bugs.openjdk.org/browse/JDK-8308754): Class-File API (Preview) (CSR) > and?[JDK-8280389](https://bugs.openjdk.org/browse/JDK-8280389): Class-File API (Preview) (JEP). > > Online javadoc is available at:? > https://cr.openjdk.org/~asotona/JDK-8308753-preview/api/java.base/java/lang/classfile/package-summary.html > > In addition to the primary transition to preview, this pull request also includes: > - All?Classfile*?classes ranamed to?ClassFile*?(based on JEP discussion). > - A new preview feature, `CLASSFILE_API`, has been added. > - Buildsystem tool required a little patch to support annotated modules. > - All JDK modules using the Classfile API are newly participating in the preview. > - All tests that use the Classfile API now have preview enabled. > - A few Javac tests not allowing preview have been partially reverted; their conversion can be re-applied when the Classfile API leaves preview mode. > > Despite the number of affected files, this pull request is relatively straight-forward. The preview version of the Classfile API is based on the internal version of the library from the JDK master branch, and there are no API features added. > > Please review this pull request to help the Classfile API turn into a preview. > > Any comments are welcome. > > 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 369 commits: - fixed SwitchBootstrap and StackMapsTest - fixed SwtichBootstrapTest and ModuleVersionTest - Merge branch 'master' into JDK-8308753-preview - Merge branch 'master' into JDK-8308753-preview # Conflicts: # test/jdk/jdk/classfile/StackMapsTest.java - Merge branch 'master' into JDK-8308753-preview # Conflicts: # test/langtools/tools/javac/7199823/InnerClassCannotBeVerified.java - added new package-info snippets and fixed ClassFile::parse throws javadoc description - fixed lambda tests - Merge branch 'master' into JDK-8308753-preview - fixed SignaturesTest - fixed condy tests - ... and 359 more: https://git.openjdk.org/jdk/compare/28d3762b...deb064fc ------------- Changes: https://git.openjdk.org/jdk/pull/15706/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15706&range=30 Stats: 32361 lines in 787 files changed: 14660 ins; 14113 del; 3588 mod Patch: https://git.openjdk.org/jdk/pull/15706.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15706/head:pull/15706 PR: https://git.openjdk.org/jdk/pull/15706 From asotona at openjdk.org Mon Nov 27 10:01:50 2023 From: asotona at openjdk.org (Adam Sotona) Date: Mon, 27 Nov 2023 10:01:50 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v32] In-Reply-To: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> Message-ID: <9-Fm-UXpDT0FLAxTw9xve00qurpqv01xw1uJwG0IXKQ=.06a9e0da-7a8c-462b-9b7a-b1be1b9bff5f@github.com> > Classfile API is an internal library under package `jdk.internal.classfile`?in JDK 21. > This pull request turns the Classfile API into a preview feature and moves it into `java.lang.classfile`. > It repackages all uses across JDK and tests and adds lots of missing Javadoc. > > This PR goes in sync with?[JDK-8308754](https://bugs.openjdk.org/browse/JDK-8308754): Class-File API (Preview) (CSR) > and?[JDK-8280389](https://bugs.openjdk.org/browse/JDK-8280389): Class-File API (Preview) (JEP). > > Online javadoc is available at:? > https://cr.openjdk.org/~asotona/JDK-8308753-preview/api/java.base/java/lang/classfile/package-summary.html > > In addition to the primary transition to preview, this pull request also includes: > - All?Classfile*?classes ranamed to?ClassFile*?(based on JEP discussion). > - A new preview feature, `CLASSFILE_API`, has been added. > - Buildsystem tool required a little patch to support annotated modules. > - All JDK modules using the Classfile API are newly participating in the preview. > - All tests that use the Classfile API now have preview enabled. > - A few Javac tests not allowing preview have been partially reverted; their conversion can be re-applied when the Classfile API leaves preview mode. > > Despite the number of affected files, this pull request is relatively straight-forward. The preview version of the Classfile API is based on the internal version of the library from the JDK master branch, and there are no API features added. > > Please review this pull request to help the Classfile API turn into a preview. > > Any comments are welcome. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: fixed SwitchBootstrapTest ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15706/files - new: https://git.openjdk.org/jdk/pull/15706/files/deb064fc..dd9a4aa7 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15706&range=31 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15706&range=30-31 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/15706.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15706/head:pull/15706 PR: https://git.openjdk.org/jdk/pull/15706 From mcimadamore at openjdk.org Mon Nov 27 17:07:15 2023 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Mon, 27 Nov 2023 17:07:15 GMT Subject: RFR: 8194743: Compiler implementation for Statements before super() [v20] In-Reply-To: References: Message-ID: On Mon, 6 Nov 2023 21:14:07 GMT, Archie Cobbs wrote: >> This is a first draft of a patch for JEP 447. >> >> Summary of changes: >> >> 1. Track when we're within a constructor "prologue" via new flag `AttrContext.ctorPrologue` >> 1. Add checks for illegal early access to `this` in constructor prologues, and update existing checks to distinguish between static context vs. constructor prologue context >> 1. Verify allowed placement of `super()`/`this()` calls via new method `Check.checkSuperInitCalls()` >> 1. Remove/refactor assumptions in several places that `super()`/`this()` was always the first statement >> >> The changes in `Flow.java` are an example of #4. `Flow.FlowAnalyzer` checks for uncaught checked exceptions. For initializer blocks, this was previously done by requiring that any checked exceptions thrown be declared as thrown by all constructors containing `super()`. This list of checked exceptions was being pre-calculated before recursing into the initial constructors. This worked because initializer blocks were executed at the beginning of each initial constructor right after `super()` is called. >> >> Now initializer blocks are traversed as each `super()` invocation is encountered, reflecting what actually happens at runtime. Similarly, final fields are marked as DA after encountering `this()`, not automatically at the beginning of those constructors. These changes produce equivalent checks, but are compatible with the new flexibility of placement of `super()`/`this()` as well as possible future changes that could occur along these same lines. > > Archie Cobbs has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 40 commits: > > - Merge branch 'master' into SuperInit > - Merge branch 'master' into SuperInit > - Reword new errors to use the JLS term for "explicit constructor invocation". > - After further review, revert 599d761 to avoid mutable state lying around. > - Address review comments relating to error messages. > - Have RefBeforeCtorCalledError extend StaticError and customize debug strings. > - Change variable name "statik" -> "isStatic" per review recommendation. > - Remove obsolete flag "constructorArgs". > - Change the error message to match the applicable spec rule. > - Merge branch 'master' into SuperInit > - ... and 30 more: https://git.openjdk.org/jdk/compare/e4803e0c...bbdb814f Marked as reviewed by mcimadamore (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/13656#pullrequestreview-1750941148 From acobbs at openjdk.org Mon Nov 27 17:30:34 2023 From: acobbs at openjdk.org (Archie Cobbs) Date: Mon, 27 Nov 2023 17:30:34 GMT Subject: Integrated: 8194743: Compiler implementation for Statements before super() In-Reply-To: References: Message-ID: On Tue, 25 Apr 2023 20:40:18 GMT, Archie Cobbs wrote: > This is a first draft of a patch for JEP 447. > > Summary of changes: > > 1. Track when we're within a constructor "prologue" via new flag `AttrContext.ctorPrologue` > 1. Add checks for illegal early access to `this` in constructor prologues, and update existing checks to distinguish between static context vs. constructor prologue context > 1. Verify allowed placement of `super()`/`this()` calls via new method `Check.checkSuperInitCalls()` > 1. Remove/refactor assumptions in several places that `super()`/`this()` was always the first statement > > The changes in `Flow.java` are an example of #4. `Flow.FlowAnalyzer` checks for uncaught checked exceptions. For initializer blocks, this was previously done by requiring that any checked exceptions thrown be declared as thrown by all constructors containing `super()`. This list of checked exceptions was being pre-calculated before recursing into the initial constructors. This worked because initializer blocks were executed at the beginning of each initial constructor right after `super()` is called. > > Now initializer blocks are traversed as each `super()` invocation is encountered, reflecting what actually happens at runtime. Similarly, final fields are marked as DA after encountering `this()`, not automatically at the beginning of those constructors. These changes produce equivalent checks, but are compatible with the new flexibility of placement of `super()`/`this()` as well as possible future changes that could occur along these same lines. This pull request has now been integrated. Changeset: 12e983a7 Author: Archie Cobbs Committer: Vicente Romero URL: https://git.openjdk.org/jdk/commit/12e983a72e72ed56741ddc45e47d337716a8da65 Stats: 1499 lines in 27 files changed: 1156 ins; 227 del; 116 mod 8194743: Compiler implementation for Statements before super() Reviewed-by: vromero, jwaters, mcimadamore ------------- PR: https://git.openjdk.org/jdk/pull/13656 From pminborg at openjdk.org Tue Nov 28 10:24:39 2023 From: pminborg at openjdk.org (Per Minborg) Date: Tue, 28 Nov 2023 10:24:39 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v32] In-Reply-To: <9-Fm-UXpDT0FLAxTw9xve00qurpqv01xw1uJwG0IXKQ=.06a9e0da-7a8c-462b-9b7a-b1be1b9bff5f@github.com> References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> <9-Fm-UXpDT0FLAxTw9xve00qurpqv01xw1uJwG0IXKQ=.06a9e0da-7a8c-462b-9b7a-b1be1b9bff5f@github.com> Message-ID: <8aNWssZUAmka3xQNMbRvY8P8ruJ0-7Eo5NTLeQGPko4=.ac8f1a19-8f0a-42fc-85cf-2fb540d194a7@github.com> On Mon, 27 Nov 2023 10:01:50 GMT, Adam Sotona wrote: >> Classfile API is an internal library under package `jdk.internal.classfile`?in JDK 21. >> This pull request turns the Classfile API into a preview feature and moves it into `java.lang.classfile`. >> It repackages all uses across JDK and tests and adds lots of missing Javadoc. >> >> This PR goes in sync with?[JDK-8308754](https://bugs.openjdk.org/browse/JDK-8308754): Class-File API (Preview) (CSR) >> and?[JDK-8280389](https://bugs.openjdk.org/browse/JDK-8280389): Class-File API (Preview) (JEP). >> >> Online javadoc is available at:? >> https://cr.openjdk.org/~asotona/JDK-8308753-preview/api/java.base/java/lang/classfile/package-summary.html >> >> In addition to the primary transition to preview, this pull request also includes: >> - All?Classfile*?classes ranamed to?ClassFile*?(based on JEP discussion). >> - A new preview feature, `CLASSFILE_API`, has been added. >> - Buildsystem tool required a little patch to support annotated modules. >> - All JDK modules using the Classfile API are newly participating in the preview. >> - All tests that use the Classfile API now have preview enabled. >> - A few Javac tests not allowing preview have been partially reverted; their conversion can be re-applied when the Classfile API leaves preview mode. >> >> Despite the number of affected files, this pull request is relatively straight-forward. The preview version of the Classfile API is based on the internal version of the library from the JDK master branch, and there are no API features added. >> >> Please review this pull request to help the Classfile API turn into a preview. >> >> Any comments are welcome. >> >> Thanks, >> Adam > > Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: > > fixed SwitchBootstrapTest src/java.base/share/classes/java/lang/classfile/ClassFile.java line 1404: > (failed to retrieve contents of file, check the PR for context) Is there a more scalable way to express the major class version? The current approach means we have to add two fields per year. Maybe a lookup function would be better? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15706#discussion_r1407534887 From jlahoda at openjdk.org Tue Nov 28 12:35:20 2023 From: jlahoda at openjdk.org (Jan Lahoda) Date: Tue, 28 Nov 2023 12:35:20 GMT Subject: Integrated: 8319311: JShell Process Builder should be configurable In-Reply-To: References: Message-ID: <4A0mmnuzs-U5fRVwtKMCIyNXZQoKXSLThm4M-YcgC5g=.ea1020c8-c5b3-482c-8b4a-621b57239c84@github.com> On Mon, 13 Nov 2023 07:52:35 GMT, Jan Lahoda wrote: > JShell has a two parts: the main process, which compiles the user's snippets, and possibly interacts with the user, and an "agent" that executes the executable code produced from the snippets. Then "agent" is typically (although not necessarily) a separate process. The clients of the JShell API are free to override the agent behavior, selecting either from the list of existing agents, or creating their own. > > There is, however, a desire to use agent that is mostly equivalent to the default JDI-based agent, but with some adjustments. > > This patch proposes to limit the amount of code needed to create an agent derived from the default agent. > > The solution has two parts: > > - a new interface, JdiStarter is created, which the API client can use to provide code that starts the external JVM for snippet execution > - the existing JdiInitiator is enhanced so that the user can override the process creation itself. > > Please also review the CSR: > https://bugs.openjdk.org/browse/JDK-8319923 This pull request has now been integrated. Changeset: 2fae07f5 Author: Jan Lahoda URL: https://git.openjdk.org/jdk/commit/2fae07f53f84b71df80ff95d858e8bbef281672f Stats: 262 lines in 4 files changed: 226 ins; 21 del; 15 mod 8319311: JShell Process Builder should be configurable Reviewed-by: asotona ------------- PR: https://git.openjdk.org/jdk/pull/16627 From asotona at openjdk.org Tue Nov 28 13:06:31 2023 From: asotona at openjdk.org (Adam Sotona) Date: Tue, 28 Nov 2023 13:06:31 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v32] In-Reply-To: <8aNWssZUAmka3xQNMbRvY8P8ruJ0-7Eo5NTLeQGPko4=.ac8f1a19-8f0a-42fc-85cf-2fb540d194a7@github.com> References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> <9-Fm-UXpDT0FLAxTw9xve00qurpqv01xw1uJwG0IXKQ=.06a9e0da-7a8c-462b-9b7a-b1be1b9bff5f@github.com> <8aNWssZUAmka3xQNMbRvY8P8ruJ0-7Eo5NTLeQGPko4=.ac8f1a19-8f0a-42fc-85cf-2fb540d194a7@github.com> Message-ID: On Tue, 28 Nov 2023 10:21:25 GMT, Per Minborg wrote: >> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: >> >> fixed SwitchBootstrapTest > > src/java.base/share/classes/java/lang/classfile/ClassFile.java line 1404: > >> (failed to retrieve contents of file, check the PR for context) > Is there a more scalable way to express the major class version? The current approach means we have to add two fields per year. Maybe a lookup function would be better? This is explicit list of supported class file versions, so I don't see any other way. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15706#discussion_r1407726710 From ihse at openjdk.org Tue Nov 28 17:07:20 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 28 Nov 2023 17:07:20 GMT Subject: RFR: 8320915: Update copyright year in build files Message-ID: <-4RrV3-LPfsh3BT-qwj3WtF1szg-_6Tt3RxnysPpNeo=.f2b0fee1-7d0c-4c43-bc4f-39ad9fec1150@github.com> Over the year, even though we have tried to be diligent, there have been commits that modify files without updating the copyright year. Here is a mass update of the copyright years in the build system (`make/**`, `.github/**`). Feel free to verify that these files have indeed been modified in 2023 :-), or trust my tools + manual verification. Also, as far as I (and my tools) can tell, this is the only files modified in 2023 that have not had their header updated. ------------- Commit messages: - 8320915: Update copyright year in build files Changes: https://git.openjdk.org/jdk/pull/16858/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16858&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8320915 Stats: 69 lines in 69 files changed: 0 ins; 0 del; 69 mod Patch: https://git.openjdk.org/jdk/pull/16858.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16858/head:pull/16858 PR: https://git.openjdk.org/jdk/pull/16858 From pminborg at openjdk.org Wed Nov 29 08:49:28 2023 From: pminborg at openjdk.org (Per Minborg) Date: Wed, 29 Nov 2023 08:49:28 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v32] In-Reply-To: References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> <9-Fm-UXpDT0FLAxTw9xve00qurpqv01xw1uJwG0IXKQ=.06a9e0da-7a8c-462b-9b7a-b1be1b9bff5f@github.com> <8aNWssZUAmka3xQNMbRvY8P8ruJ0-7Eo5NTLeQGPko4=.ac8f1a19-8f0a-42fc-85cf-2fb540d194a7@github.com> Message-ID: On Tue, 28 Nov 2023 13:03:48 GMT, Adam Sotona wrote: >> src/java.base/share/classes/java/lang/classfile/ClassFile.java line 1404: >> >>> (failed to retrieve contents of file, check the PR for context) >> Is there a more scalable way to express the major class version? The current approach means we have to add two fields per year. Maybe a lookup function would be better? > > This is explicit list of supported class file versions, so I don't see any other way. Would it not be possible to expose an immutable `Map` that maps from Java version to major class version? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15706#discussion_r1408941961