From jlahoda at openjdk.java.net Mon Jan 4 17:43:11 2021 From: jlahoda at openjdk.java.net (Jan Lahoda) Date: Mon, 4 Jan 2021 17:43:11 GMT Subject: Withdrawn: 8255273: jshell crashes with UnsupportedOperationException: Should not get here. In-Reply-To: References: Message-ID: <-inP-9AWi3U1wOF1BNNoEo1c_-PCBD7aHWyjf-ncDNc=.2fa3e92e-7522-471e-b9e5-7ea0b9d28524@github.com> On Mon, 9 Nov 2020 13:05:54 GMT, Jan Lahoda wrote: > Consider JShell interaction like: > > jshell> import java.time.*; > > jshell> new Instant > > This will crash the JShell with an `UnsupportedOperationException`. The ultimately reason is that: > -completions are computed, and are `InstantiationError(` and `InstantiationException(`, with a common prefix `InstantiationE` > -documentation is computed, and is for java.time.Instant > > The completion machine then gets into a state where it fills in the common prefix, and that it would like say something along the lines of "Press tab once more to see signature/documentation.", but that does not make much sense (as the documentation is computed for a wrong input - the new input is `new InstantiationE`, not `Instant`, so the documentation is already invalid for that. > > (The `UnsupportedOperationException` is in place where the "Press tab once more to see signature/documentation." should happen, because the code should not get into a state like this.) > > The proposed solution is to cancel the documentation if a prefix is (to be) filled. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.java.net/jdk/pull/1125 From jlahoda at openjdk.java.net Thu Jan 7 20:23:16 2021 From: jlahoda at openjdk.java.net (Jan Lahoda) Date: Thu, 7 Jan 2021 20:23:16 GMT Subject: RFR: JDK-8250768: javac should be adapted to changes in JEP 12 [v13] In-Reply-To: References: Message-ID: <1Hv0w0gv07ik40DRi5JBB-G6opt0v3HjdbJc8Y-8kXs=.756df108-047c-414b-9e34-ca73ade932a4@github.com> > This is an update to javac and javadoc, to introduce support for Preview APIs, and generally improve javac and javadoc behavior to more closely adhere to JEP 12. > > The notable changes are: > > * adding support for Preview APIs (javac until now supported primarily only preview language features, and APIs associated with preview language features). This includes: > * the @PreviewFeature annotation has boolean attribute "reflective", which should be true for reflective Preview APIs, false otherwise. This replaces the existing "essentialAPI" attribute with roughly inverted meaning. > * the preview warnings for preview APIs are auto-suppressed as described in the JEP 12. E.g. the module that declares the preview API is free to use it without warnings > * improving error/warning messages. Please see [1] for a list of cases/examples. > * class files are only marked as preview if they are using a preview feature. [1] also shows if a class file is marked as preview or not. > * the PreviewFeature annotation has been moved to jdk.internal.javac package (originally was in the jdk.internal package). > * Preview API in JDK's javadoc no longer needs to specify @preview tag in the source files. javadoc will auto-generate a note for @PreviewFeature elements, see e.g. [2] and [3] (non-reflective and reflective API, respectively). A summary of preview elements is also provided [4]. Existing uses of @preview have been updated/removed. > * non-JDK javadoc is also enhanced to auto-generate preview notes for uses of Preview elements, and for declaring elements using preview language features [5]. > > Please also see the CSR [6] for more information. > > [1] http://cr.openjdk.java.net/~jlahoda/8250768/JEP12-errors-warnings-v6.html > [2] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/java.base/java/lang/Record.html > [3] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/java.compiler/javax/lang/model/element/RecordComponentElement.html > [4] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/preview-list.html > [5] http://cr.openjdk.java.net/~jlahoda/8250768/test.javadoc.00/ > [6] https://bugs.openjdk.java.net/browse/JDK-8250769 Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 57 commits: - Fixing tests after a merge. - Merging master into JDK-8250768 - Merging recent master changes into JDK-8250768 - Fixing navigator for the PREVIEW page. - Fixing typo. - Removing obsolette @PreviewFeature. - Merging master into JDK-8250768 - Removing unnecessary property keys. - Cleanup - removing unnecessary code. - Merging master into JDK-8250768-dev4 - ... and 47 more: https://git.openjdk.java.net/jdk/compare/81c06242...a8046dde ------------- Changes: https://git.openjdk.java.net/jdk/pull/703/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=703&range=12 Stats: 3719 lines in 134 files changed: 2724 ins; 695 del; 300 mod Patch: https://git.openjdk.java.net/jdk/pull/703.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/703/head:pull/703 PR: https://git.openjdk.java.net/jdk/pull/703 From jlahoda at openjdk.java.net Thu Jan 7 20:23:17 2021 From: jlahoda at openjdk.java.net (Jan Lahoda) Date: Thu, 7 Jan 2021 20:23:17 GMT Subject: RFR: JDK-8250768: javac should be adapted to changes in JEP 12 [v12] In-Reply-To: References: Message-ID: <8Op-CSXTHItDGmtN_VyoyOdZe1WR9g4JkRe852pe274=.367211a5-5f71-473b-be53-ee3706e50786@github.com> On Wed, 9 Dec 2020 13:30:14 GMT, Magnus Ihse Bursie wrote: >> Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 55 commits: >> >> - Merging recent master changes into JDK-8250768 >> - Fixing navigator for the PREVIEW page. >> - Fixing typo. >> - Removing obsolette @PreviewFeature. >> - Merging master into JDK-8250768 >> - Removing unnecessary property keys. >> - Cleanup - removing unnecessary code. >> - Merging master into JDK-8250768-dev4 >> - Reflecting review comments. >> - Removing trailing whitespace. >> - ... and 45 more: https://git.openjdk.java.net/jdk/compare/044616bd...0c1c4d57 > > Build changes still good. I've merged the PR with the recent mainline, and I'd like to integrate sometime soon. Please let me know if there's any issue with that. Thanks! ------------- PR: https://git.openjdk.java.net/jdk/pull/703 From jjg at openjdk.java.net Fri Jan 8 02:01:06 2021 From: jjg at openjdk.java.net (Jonathan Gibbons) Date: Fri, 8 Jan 2021 02:01:06 GMT Subject: RFR: JDK-8250768: javac should be adapted to changes in JEP 12 [v13] In-Reply-To: <1Hv0w0gv07ik40DRi5JBB-G6opt0v3HjdbJc8Y-8kXs=.756df108-047c-414b-9e34-ca73ade932a4@github.com> References: <1Hv0w0gv07ik40DRi5JBB-G6opt0v3HjdbJc8Y-8kXs=.756df108-047c-414b-9e34-ca73ade932a4@github.com> Message-ID: On Thu, 7 Jan 2021 20:23:16 GMT, Jan Lahoda wrote: >> This is an update to javac and javadoc, to introduce support for Preview APIs, and generally improve javac and javadoc behavior to more closely adhere to JEP 12. >> >> The notable changes are: >> >> * adding support for Preview APIs (javac until now supported primarily only preview language features, and APIs associated with preview language features). This includes: >> * the @PreviewFeature annotation has boolean attribute "reflective", which should be true for reflective Preview APIs, false otherwise. This replaces the existing "essentialAPI" attribute with roughly inverted meaning. >> * the preview warnings for preview APIs are auto-suppressed as described in the JEP 12. E.g. the module that declares the preview API is free to use it without warnings >> * improving error/warning messages. Please see [1] for a list of cases/examples. >> * class files are only marked as preview if they are using a preview feature. [1] also shows if a class file is marked as preview or not. >> * the PreviewFeature annotation has been moved to jdk.internal.javac package (originally was in the jdk.internal package). >> * Preview API in JDK's javadoc no longer needs to specify @preview tag in the source files. javadoc will auto-generate a note for @PreviewFeature elements, see e.g. [2] and [3] (non-reflective and reflective API, respectively). A summary of preview elements is also provided [4]. Existing uses of @preview have been updated/removed. >> * non-JDK javadoc is also enhanced to auto-generate preview notes for uses of Preview elements, and for declaring elements using preview language features [5]. >> >> Please also see the CSR [6] for more information. >> >> [1] http://cr.openjdk.java.net/~jlahoda/8250768/JEP12-errors-warnings-v6.html >> [2] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/java.base/java/lang/Record.html >> [3] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/java.compiler/javax/lang/model/element/RecordComponentElement.html >> [4] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/preview-list.html >> [5] http://cr.openjdk.java.net/~jlahoda/8250768/test.javadoc.00/ >> [6] https://bugs.openjdk.java.net/browse/JDK-8250769 > > Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 57 commits: > > - Fixing tests after a merge. > - Merging master into JDK-8250768 > - Merging recent master changes into JDK-8250768 > - Fixing navigator for the PREVIEW page. > - Fixing typo. > - Removing obsolette @PreviewFeature. > - Merging master into JDK-8250768 > - Removing unnecessary property keys. > - Cleanup - removing unnecessary code. > - Merging master into JDK-8250768-dev4 > - ... and 47 more: https://git.openjdk.java.net/jdk/compare/81c06242...a8046dde I've looked at all the files that were marked as changed since I last looked at them. There's one suggested enhancement to reduce string bashing between `Utils` and `ClassWriterImpl` that could be done now or later. There's a pending conflict with a PR of mine to change to use a new type `HtmlId` for HTML ids. This JEP12 work has been in progress for a while, and so it would be good to get it in before the `HtmlId` work, and I'll deal with the merge conflict in due course. src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java line 194: > 192: > 193: @Override @SuppressWarnings("preview") > 194: public void addClassSignature(String modifiers, Content classInfoTree) { It seems less than ideal for this method to take a `String` and to then have to take it apart and reassemble it. It looks like it should be possible (and conceptually better) to change the signature to `List` and to make the corresponding change to `utils.modifiersToString`, probably renaming it as `utils.modifiersToStrings` or something like that, and dropping the always-`true` argument for `trailingSpace`. But, the code is OK as is, and the suggestion is just for an enhancement, so is OK to defer it, if you would prefer. src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SummaryListWriter.java line 2: > 1: /* > 2: * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. (minor) now 2021 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SummaryListWriter.java line 61: > 59: public abstract class SummaryListWriter extends SubWriterHolderWriter { > 60: > 61: private String getAnchorName(SummaryElementKind kind) { Heads-up: at some point this will conflict with another change in progress/review, to introduce a new type `HtmlId` to use instead of `String` for ids. src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SummaryListWriter.java line 227: > 225: * @param contentTree the content tree to which the summary table will be added > 226: */ > 227: protected void addSummaryAPI(SortedSet apiList, String id, Heads-up, here's another occurrence of where there will be a conflict for ids. src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties line 154: > 152: doclet.Errors=Errors > 153: doclet.Classes=Classes > 154: doclet.Records=Records I guess I'm mildly surprised to see all these items being removed... src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/SummaryAPIListBuilder.java line 2: > 1: /* > 2: * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. Year test/langtools/jdk/javadoc/doclet/testPreview/TestPreview.java line 2: > 1: /* > 2: * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. 2021. I assume you will do a bulk update for affected files. ------------- Marked as reviewed by jjg (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/703 From jjg at openjdk.java.net Fri Jan 8 04:14:04 2021 From: jjg at openjdk.java.net (Jonathan Gibbons) Date: Fri, 8 Jan 2021 04:14:04 GMT Subject: RFR: JDK-8250768: javac should be adapted to changes in JEP 12 [v13] In-Reply-To: References: <1Hv0w0gv07ik40DRi5JBB-G6opt0v3HjdbJc8Y-8kXs=.756df108-047c-414b-9e34-ca73ade932a4@github.com> Message-ID: On Fri, 8 Jan 2021 01:58:07 GMT, Jonathan Gibbons wrote: >> Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 57 commits: >> >> - Fixing tests after a merge. >> - Merging master into JDK-8250768 >> - Merging recent master changes into JDK-8250768 >> - Fixing navigator for the PREVIEW page. >> - Fixing typo. >> - Removing obsolette @PreviewFeature. >> - Merging master into JDK-8250768 >> - Removing unnecessary property keys. >> - Cleanup - removing unnecessary code. >> - Merging master into JDK-8250768-dev4 >> - ... and 47 more: https://git.openjdk.java.net/jdk/compare/81c06242...a8046dde > > I've looked at all the files that were marked as changed since I last looked at them. > > There's one suggested enhancement to reduce string bashing between `Utils` and `ClassWriterImpl` that could be done now or later. > > There's a pending conflict with a PR of mine to change to use a new type `HtmlId` for HTML ids. This JEP12 work has been in progress for a while, and so it would be good to get it in before the `HtmlId` work, and I'll deal with the merge conflict in due course. +1 -- Jon On 1/7/21 12:19 PM, Jan Lahoda wrote: > > I've merged the PR with the recent mainline, and I'd like to integrate > sometime soon. Please let me know if there's any issue with that. Thanks! > > ? > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > , > or unsubscribe > . > ------------- PR: https://git.openjdk.java.net/jdk/pull/703 From jlahoda at openjdk.java.net Fri Jan 8 15:26:04 2021 From: jlahoda at openjdk.java.net (Jan Lahoda) Date: Fri, 8 Jan 2021 15:26:04 GMT Subject: RFR: JDK-8250768: javac should be adapted to changes in JEP 12 [v13] In-Reply-To: References: <1Hv0w0gv07ik40DRi5JBB-G6opt0v3HjdbJc8Y-8kXs=.756df108-047c-414b-9e34-ca73ade932a4@github.com> Message-ID: On Fri, 8 Jan 2021 01:51:52 GMT, Jonathan Gibbons wrote: >> Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 57 commits: >> >> - Fixing tests after a merge. >> - Merging master into JDK-8250768 >> - Merging recent master changes into JDK-8250768 >> - Fixing navigator for the PREVIEW page. >> - Fixing typo. >> - Removing obsolette @PreviewFeature. >> - Merging master into JDK-8250768 >> - Removing unnecessary property keys. >> - Cleanup - removing unnecessary code. >> - Merging master into JDK-8250768-dev4 >> - ... and 47 more: https://git.openjdk.java.net/jdk/compare/81c06242...a8046dde > > src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties line 154: > >> 152: doclet.Errors=Errors >> 153: doclet.Classes=Classes >> 154: doclet.Records=Records > > I guess I'm mildly surprised to see all these items being removed... These were used from DeprecatedListWriter.getSummaryKey which is removed by this patch (and is unused in the current mainline, as far as I know). ------------- PR: https://git.openjdk.java.net/jdk/pull/703 From jlahoda at openjdk.java.net Fri Jan 8 15:29:22 2021 From: jlahoda at openjdk.java.net (Jan Lahoda) Date: Fri, 8 Jan 2021 15:29:22 GMT Subject: RFR: JDK-8250768: javac should be adapted to changes in JEP 12 [v14] In-Reply-To: References: Message-ID: <5yqRThkGhxW8tDtwfkBzOB8k6-CoWkengMWAgeGogr0=.fa0c0a28-abe8-47bb-86f8-cd18b1ed3aa0@github.com> > This is an update to javac and javadoc, to introduce support for Preview APIs, and generally improve javac and javadoc behavior to more closely adhere to JEP 12. > > The notable changes are: > > * adding support for Preview APIs (javac until now supported primarily only preview language features, and APIs associated with preview language features). This includes: > * the @PreviewFeature annotation has boolean attribute "reflective", which should be true for reflective Preview APIs, false otherwise. This replaces the existing "essentialAPI" attribute with roughly inverted meaning. > * the preview warnings for preview APIs are auto-suppressed as described in the JEP 12. E.g. the module that declares the preview API is free to use it without warnings > * improving error/warning messages. Please see [1] for a list of cases/examples. > * class files are only marked as preview if they are using a preview feature. [1] also shows if a class file is marked as preview or not. > * the PreviewFeature annotation has been moved to jdk.internal.javac package (originally was in the jdk.internal package). > * Preview API in JDK's javadoc no longer needs to specify @preview tag in the source files. javadoc will auto-generate a note for @PreviewFeature elements, see e.g. [2] and [3] (non-reflective and reflective API, respectively). A summary of preview elements is also provided [4]. Existing uses of @preview have been updated/removed. > * non-JDK javadoc is also enhanced to auto-generate preview notes for uses of Preview elements, and for declaring elements using preview language features [5]. > > Please also see the CSR [6] for more information. > > [1] http://cr.openjdk.java.net/~jlahoda/8250768/JEP12-errors-warnings-v6.html > [2] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/java.base/java/lang/Record.html > [3] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/java.compiler/javax/lang/model/element/RecordComponentElement.html > [4] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/preview-list.html > [5] http://cr.openjdk.java.net/~jlahoda/8250768/test.javadoc.00/ > [6] https://bugs.openjdk.java.net/browse/JDK-8250769 Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision: Updating copyright years. ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/703/files - new: https://git.openjdk.java.net/jdk/pull/703/files/a8046dde..56371c47 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=703&range=13 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=703&range=12-13 Stats: 103 lines in 103 files changed: 0 ins; 0 del; 103 mod Patch: https://git.openjdk.java.net/jdk/pull/703.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/703/head:pull/703 PR: https://git.openjdk.java.net/jdk/pull/703 From jlahoda at openjdk.java.net Fri Jan 8 17:22:19 2021 From: jlahoda at openjdk.java.net (Jan Lahoda) Date: Fri, 8 Jan 2021 17:22:19 GMT Subject: RFR: JDK-8250768: javac should be adapted to changes in JEP 12 [v15] In-Reply-To: References: Message-ID: <1l2ZGdCLlmLZ_hbqsEG0AnTrX7pob7FJ_kJ73_qLLu8=.a116a4b4-229e-41dc-ba22-d72f139ce2dd@github.com> > This is an update to javac and javadoc, to introduce support for Preview APIs, and generally improve javac and javadoc behavior to more closely adhere to JEP 12. > > The notable changes are: > > * adding support for Preview APIs (javac until now supported primarily only preview language features, and APIs associated with preview language features). This includes: > * the @PreviewFeature annotation has boolean attribute "reflective", which should be true for reflective Preview APIs, false otherwise. This replaces the existing "essentialAPI" attribute with roughly inverted meaning. > * the preview warnings for preview APIs are auto-suppressed as described in the JEP 12. E.g. the module that declares the preview API is free to use it without warnings > * improving error/warning messages. Please see [1] for a list of cases/examples. > * class files are only marked as preview if they are using a preview feature. [1] also shows if a class file is marked as preview or not. > * the PreviewFeature annotation has been moved to jdk.internal.javac package (originally was in the jdk.internal package). > * Preview API in JDK's javadoc no longer needs to specify @preview tag in the source files. javadoc will auto-generate a note for @PreviewFeature elements, see e.g. [2] and [3] (non-reflective and reflective API, respectively). A summary of preview elements is also provided [4]. Existing uses of @preview have been updated/removed. > * non-JDK javadoc is also enhanced to auto-generate preview notes for uses of Preview elements, and for declaring elements using preview language features [5]. > > Please also see the CSR [6] for more information. > > [1] http://cr.openjdk.java.net/~jlahoda/8250768/JEP12-errors-warnings-v6.html > [2] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/java.base/java/lang/Record.html > [3] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/java.compiler/javax/lang/model/element/RecordComponentElement.html > [4] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/preview-list.html > [5] http://cr.openjdk.java.net/~jlahoda/8250768/test.javadoc.00/ > [6] https://bugs.openjdk.java.net/browse/JDK-8250769 Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 59 commits: - Merging master into JDK-8250768 - Updating copyright years. - Fixing tests after a merge. - Merging master into JDK-8250768 - Merging recent master changes into JDK-8250768 - Fixing navigator for the PREVIEW page. - Fixing typo. - Removing obsolette @PreviewFeature. - Merging master into JDK-8250768 - Removing unnecessary property keys. - ... and 49 more: https://git.openjdk.java.net/jdk/compare/090bd3af...4f654955 ------------- Changes: https://git.openjdk.java.net/jdk/pull/703/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=703&range=14 Stats: 3802 lines in 133 files changed: 2724 ins; 695 del; 383 mod Patch: https://git.openjdk.java.net/jdk/pull/703.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/703/head:pull/703 PR: https://git.openjdk.java.net/jdk/pull/703 From jlahoda at openjdk.java.net Mon Jan 11 10:15:06 2021 From: jlahoda at openjdk.java.net (Jan Lahoda) Date: Mon, 11 Jan 2021 10:15:06 GMT Subject: Integrated: JDK-8250768: javac should be adapted to changes in JEP 12 In-Reply-To: References: Message-ID: On Fri, 16 Oct 2020 15:20:03 GMT, Jan Lahoda wrote: > This is an update to javac and javadoc, to introduce support for Preview APIs, and generally improve javac and javadoc behavior to more closely adhere to JEP 12. > > The notable changes are: > > * adding support for Preview APIs (javac until now supported primarily only preview language features, and APIs associated with preview language features). This includes: > * the @PreviewFeature annotation has boolean attribute "reflective", which should be true for reflective Preview APIs, false otherwise. This replaces the existing "essentialAPI" attribute with roughly inverted meaning. > * the preview warnings for preview APIs are auto-suppressed as described in the JEP 12. E.g. the module that declares the preview API is free to use it without warnings > * improving error/warning messages. Please see [1] for a list of cases/examples. > * class files are only marked as preview if they are using a preview feature. [1] also shows if a class file is marked as preview or not. > * the PreviewFeature annotation has been moved to jdk.internal.javac package (originally was in the jdk.internal package). > * Preview API in JDK's javadoc no longer needs to specify @preview tag in the source files. javadoc will auto-generate a note for @PreviewFeature elements, see e.g. [2] and [3] (non-reflective and reflective API, respectively). A summary of preview elements is also provided [4]. Existing uses of @preview have been updated/removed. > * non-JDK javadoc is also enhanced to auto-generate preview notes for uses of Preview elements, and for declaring elements using preview language features [5]. > > Please also see the CSR [6] for more information. > > [1] http://cr.openjdk.java.net/~jlahoda/8250768/JEP12-errors-warnings-v6.html > [2] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/java.base/java/lang/Record.html > [3] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/java.compiler/javax/lang/model/element/RecordComponentElement.html > [4] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/preview-list.html > [5] http://cr.openjdk.java.net/~jlahoda/8250768/test.javadoc.00/ > [6] https://bugs.openjdk.java.net/browse/JDK-8250769 This pull request has now been integrated. Changeset: 23548821 Author: Jan Lahoda URL: https://git.openjdk.java.net/jdk/commit/23548821 Stats: 3802 lines in 133 files changed: 2724 ins; 695 del; 383 mod 8250768: javac should be adapted to changes in JEP 12 Reviewed-by: mcimadamore, erikj, jjg, ihse ------------- PR: https://git.openjdk.java.net/jdk/pull/703 From jlahoda at openjdk.java.net Tue Jan 12 11:57:06 2021 From: jlahoda at openjdk.java.net (Jan Lahoda) Date: Tue, 12 Jan 2021 11:57:06 GMT Subject: RFR: 8257236: can't use var with a class named Z Message-ID: <1VnS-sqn-wstgNOmO3PWevaxifKEl4qQKQB1OtKWNu8=.3a3dae00-58c3-4603-a972-980f12a0b7a9@github.com> To implements the local variable type inference, JShell needs to generate a few code snippets, which include an auxiliary type parameter and local variables. The name of the type parameter and variables may currently clash with names in the initializer of the variable. The proposal here is to generate a synthetic name, which won't clash with anything in the var's initializer. ------------- Commit messages: - 8257236: can't use var with a class named Z Changes: https://git.openjdk.java.net/jdk/pull/2047/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2047&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8257236 Stats: 17 lines in 2 files changed: 12 ins; 0 del; 5 mod Patch: https://git.openjdk.java.net/jdk/pull/2047.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2047/head:pull/2047 PR: https://git.openjdk.java.net/jdk/pull/2047 From sundar at openjdk.java.net Tue Jan 12 12:13:56 2021 From: sundar at openjdk.java.net (Athijegannathan Sundararajan) Date: Tue, 12 Jan 2021 12:13:56 GMT Subject: RFR: 8257236: can't use var with a class named Z In-Reply-To: <1VnS-sqn-wstgNOmO3PWevaxifKEl4qQKQB1OtKWNu8=.3a3dae00-58c3-4603-a972-980f12a0b7a9@github.com> References: <1VnS-sqn-wstgNOmO3PWevaxifKEl4qQKQB1OtKWNu8=.3a3dae00-58c3-4603-a972-980f12a0b7a9@github.com> Message-ID: On Tue, 12 Jan 2021 11:52:20 GMT, Jan Lahoda wrote: > To implements the local variable type inference, JShell needs to generate a few code snippets, which include an auxiliary type parameter and local variables. The name of the type parameter and variables may currently clash with names in the initializer of the variable. The proposal here is to generate a synthetic name, which won't clash with anything in the var's initializer. Marked as reviewed by sundar (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2047 From jlahoda at openjdk.java.net Wed Jan 13 11:30:58 2021 From: jlahoda at openjdk.java.net (Jan Lahoda) Date: Wed, 13 Jan 2021 11:30:58 GMT Subject: Integrated: 8257236: can't use var with a class named Z In-Reply-To: <1VnS-sqn-wstgNOmO3PWevaxifKEl4qQKQB1OtKWNu8=.3a3dae00-58c3-4603-a972-980f12a0b7a9@github.com> References: <1VnS-sqn-wstgNOmO3PWevaxifKEl4qQKQB1OtKWNu8=.3a3dae00-58c3-4603-a972-980f12a0b7a9@github.com> Message-ID: On Tue, 12 Jan 2021 11:52:20 GMT, Jan Lahoda wrote: > To implements the local variable type inference, JShell needs to generate a few code snippets, which include an auxiliary type parameter and local variables. The name of the type parameter and variables may currently clash with names in the initializer of the variable. The proposal here is to generate a synthetic name, which won't clash with anything in the var's initializer. This pull request has now been integrated. Changeset: 77ca1031 Author: Jan Lahoda URL: https://git.openjdk.java.net/jdk/commit/77ca1031 Stats: 17 lines in 2 files changed: 12 ins; 0 del; 5 mod 8257236: can't use var with a class named Z Reviewed-by: sundar ------------- PR: https://git.openjdk.java.net/jdk/pull/2047 From ljiang at openjdk.java.net Thu Jan 14 14:05:11 2021 From: ljiang at openjdk.java.net (Leo Jiang) Date: Thu, 14 Jan 2021 14:05:11 GMT Subject: [jdk16] RFR: JDK-8259732: JDK 16 L10n resource file update - msg drop 10 Message-ID: This is the changes for JDK 16 msg drop 10. ------------- Commit messages: - JDK-8259732: JDK 16 L10n resource file update - msg drop 10 Changes: https://git.openjdk.java.net/jdk16/pull/123/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk16&pr=123&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8259732 Stats: 215 lines in 30 files changed: 118 ins; 16 del; 81 mod Patch: https://git.openjdk.java.net/jdk16/pull/123.diff Fetch: git fetch https://git.openjdk.java.net/jdk16 pull/123/head:pull/123 PR: https://git.openjdk.java.net/jdk16/pull/123 From ljiang at openjdk.java.net Thu Jan 14 14:13:02 2021 From: ljiang at openjdk.java.net (Leo Jiang) Date: Thu, 14 Jan 2021 14:13:02 GMT Subject: [jdk16] RFR: JDK-8259732: JDK 16 L10n resource file update - msg drop 10 In-Reply-To: References: Message-ID: On Thu, 14 Jan 2021 14:00:00 GMT, Leo Jiang wrote: > This is the changes for JDK 16 msg drop 10. [webrev.tar.gz](https://github.com/openjdk/jdk16/files/5814846/webrev.tar.gz) Since they're Unicode escape sequences in the l10n resource files, so I attached a human readable webrev, created by `git webrev` and converted. Pls find this to help your review. ------------- PR: https://git.openjdk.java.net/jdk16/pull/123 From ljiang at openjdk.java.net Thu Jan 14 14:27:25 2021 From: ljiang at openjdk.java.net (Leo Jiang) Date: Thu, 14 Jan 2021 14:27:25 GMT Subject: [jdk16] RFR: JDK-8259732: JDK 16 L10n resource file update - msg drop 10 [v2] In-Reply-To: References: Message-ID: > This is the changes for JDK 16 msg drop 10. Leo Jiang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision: - Merge branch 'master' into msgdrop - JDK-8259732: JDK 16 L10n resource file update - msg drop 10 ------------- Changes: - all: https://git.openjdk.java.net/jdk16/pull/123/files - new: https://git.openjdk.java.net/jdk16/pull/123/files/230117b4..d72f444a Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk16&pr=123&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk16&pr=123&range=00-01 Stats: 718 lines in 32 files changed: 616 ins; 38 del; 64 mod Patch: https://git.openjdk.java.net/jdk16/pull/123.diff Fetch: git fetch https://git.openjdk.java.net/jdk16 pull/123/head:pull/123 PR: https://git.openjdk.java.net/jdk16/pull/123 From ljiang at openjdk.java.net Thu Jan 14 15:38:09 2021 From: ljiang at openjdk.java.net (Leo Jiang) Date: Thu, 14 Jan 2021 15:38:09 GMT Subject: [jdk16] RFR: JDK-8259732: JDK 16 L10n resource file update - msg drop 10 In-Reply-To: References: Message-ID: On Thu, 14 Jan 2021 14:10:12 GMT, Leo Jiang wrote: >> This is the changes for JDK 16 msg drop 10. > > [webrev.tar.gz](https://github.com/openjdk/jdk16/files/5814846/webrev.tar.gz) > > Since they're Unicode escape sequences in the l10n resource files, so I attached a human readable webrev, created by `git webrev` and converted. Pls find this to help your review. @naotoj Would you have time to take a look at this change? Very appreciated! ------------- PR: https://git.openjdk.java.net/jdk16/pull/123 From naoto at openjdk.java.net Thu Jan 14 17:22:09 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Thu, 14 Jan 2021 17:22:09 GMT Subject: [jdk16] RFR: JDK-8259732: JDK 16 L10n resource file update - msg drop 10 [v2] In-Reply-To: References: Message-ID: On Thu, 14 Jan 2021 14:27:25 GMT, Leo Jiang wrote: >> This is the changes for JDK 16 msg drop 10. > > Leo Jiang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision: > > - Merge branch 'master' into msgdrop > - JDK-8259732: JDK 16 L10n resource file update - msg drop 10 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties line 518: > 516: doclet.footer_specified=\ > 517: The -footer option is no longer supported and will be ignored.\n\ > 518: It may be removed in a future release. I believe this is to fix no newline at the end (unrelated to l10n changes). Do we need to change the copyright year for this? ------------- PR: https://git.openjdk.java.net/jdk16/pull/123 From ljiang at openjdk.java.net Fri Jan 15 02:02:11 2021 From: ljiang at openjdk.java.net (Leo Jiang) Date: Fri, 15 Jan 2021 02:02:11 GMT Subject: [jdk16] RFR: JDK-8259732: JDK 16 L10n resource file update - msg drop 10 [v2] In-Reply-To: References: Message-ID: <1Bb8sf6zFDnQSM5kRQIlrgBNwEpO-IvxsPmN05F0QFs=.13eb3035-71d5-4310-98e5-d9989e51cf60@github.com> On Thu, 14 Jan 2021 17:19:11 GMT, Naoto Sato wrote: >> Leo Jiang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision: >> >> - Merge branch 'master' into msgdrop >> - JDK-8259732: JDK 16 L10n resource file update - msg drop 10 > > src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties line 518: > >> 516: doclet.footer_specified=\ >> 517: The -footer option is no longer supported and will be ignored.\n\ >> 518: It may be removed in a future release. > > I believe this is to fix no newline at the end (unrelated to l10n changes). Do we need to change the copyright year for this? Actually I was correcting the L217, changed {) -> {}. But 2 days ago, Jonathan Gibbons fixed it in another commit 6bb6093. I found his fix after running the merge. Looks both of us forgot to update the copyright year. Any suggestion? doclet.help.systemProperties.body=\ The {0} page lists references to system properties. ------------- PR: https://git.openjdk.java.net/jdk16/pull/123 From jlahoda at openjdk.java.net Fri Jan 15 09:34:13 2021 From: jlahoda at openjdk.java.net (Jan Lahoda) Date: Fri, 15 Jan 2021 09:34:13 GMT Subject: RFR: 8259820: JShell does not handle -source 8 properly Message-ID: When running JShell with `-C-source -C8`, only one (non-import) snippet can be processed. This is because, when cleaning javac state, the `REPL` package is looked up in the unnamed package, but with `-source 8`, there is no unnamed package, so the `REPL` package is not found and cleared properly. The proposed solution is to use `noModule` when running in non-module mode (i.e. with `-source 8`). ------------- Commit messages: - Adding @modules to test. - 8259820: JShell does not handle -source 8 properly Changes: https://git.openjdk.java.net/jdk/pull/2097/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2097&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8259820 Stats: 58 lines in 2 files changed: 56 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/2097.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2097/head:pull/2097 PR: https://git.openjdk.java.net/jdk/pull/2097 From sundar at openjdk.java.net Fri Jan 15 10:00:05 2021 From: sundar at openjdk.java.net (Athijegannathan Sundararajan) Date: Fri, 15 Jan 2021 10:00:05 GMT Subject: RFR: 8259820: JShell does not handle -source 8 properly In-Reply-To: References: Message-ID: On Fri, 15 Jan 2021 09:29:28 GMT, Jan Lahoda wrote: > When running JShell with `-C-source -C8`, only one (non-import) snippet can be processed. This is because, when cleaning javac state, the `REPL` package is looked up in the unnamed package, but with `-source 8`, there is no unnamed package, so the `REPL` package is not found and cleared properly. The proposed solution is to use `noModule` when running in non-module mode (i.e. with `-source 8`). Marked as reviewed by sundar (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2097 From jlahoda at openjdk.java.net Fri Jan 15 12:48:07 2021 From: jlahoda at openjdk.java.net (Jan Lahoda) Date: Fri, 15 Jan 2021 12:48:07 GMT Subject: Integrated: 8259820: JShell does not handle -source 8 properly In-Reply-To: References: Message-ID: On Fri, 15 Jan 2021 09:29:28 GMT, Jan Lahoda wrote: > When running JShell with `-C-source -C8`, only one (non-import) snippet can be processed. This is because, when cleaning javac state, the `REPL` package is looked up in the unnamed package, but with `-source 8`, there is no unnamed package, so the `REPL` package is not found and cleared properly. The proposed solution is to use `noModule` when running in non-module mode (i.e. with `-source 8`). This pull request has now been integrated. Changeset: 0ec2c969 Author: Jan Lahoda URL: https://git.openjdk.java.net/jdk/commit/0ec2c969 Stats: 58 lines in 2 files changed: 56 ins; 0 del; 2 mod 8259820: JShell does not handle -source 8 properly Reviewed-by: sundar ------------- PR: https://git.openjdk.java.net/jdk/pull/2097 From naoto at openjdk.java.net Sat Jan 16 00:51:09 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Sat, 16 Jan 2021 00:51:09 GMT Subject: [jdk16] RFR: JDK-8259732: JDK 16 L10n resource file update - msg drop 10 [v2] In-Reply-To: <1Bb8sf6zFDnQSM5kRQIlrgBNwEpO-IvxsPmN05F0QFs=.13eb3035-71d5-4310-98e5-d9989e51cf60@github.com> References: <1Bb8sf6zFDnQSM5kRQIlrgBNwEpO-IvxsPmN05F0QFs=.13eb3035-71d5-4310-98e5-d9989e51cf60@github.com> Message-ID: On Fri, 15 Jan 2021 01:59:07 GMT, Leo Jiang wrote: >> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties line 518: >> >>> 516: doclet.footer_specified=\ >>> 517: The -footer option is no longer supported and will be ignored.\n\ >>> 518: It may be removed in a future release. >> >> I believe this is to fix no newline at the end (unrelated to l10n changes). Do we need to change the copyright year for this? > > Actually I was correcting the L217, changed {) -> {}. But 2 days ago, Jonathan Gibbons fixed it in another commit 6bb6093. I found his fix after running the merge. Looks both of us forgot to update the copyright year. Any suggestion? > doclet.help.systemProperties.body=\ > The {0} page lists references to system properties. I believe your PR still contains the fix to add the newline at the end of the file (at L518). So I think you can simply change the copyright year in `standard.properties` file. ------------- PR: https://git.openjdk.java.net/jdk16/pull/123 From ljiang at openjdk.java.net Mon Jan 18 05:52:57 2021 From: ljiang at openjdk.java.net (Leo Jiang) Date: Mon, 18 Jan 2021 05:52:57 GMT Subject: [jdk16] RFR: JDK-8259732: JDK 16 L10n resource file update - msg drop 10 [v3] In-Reply-To: References: Message-ID: > This is the changes for JDK 16 msg drop 10. Leo Jiang has updated the pull request incrementally with one additional commit since the last revision: fix the missing copyright year for standard.properties ------------- Changes: - all: https://git.openjdk.java.net/jdk16/pull/123/files - new: https://git.openjdk.java.net/jdk16/pull/123/files/d72f444a..9c7574e2 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk16&pr=123&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk16&pr=123&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk16/pull/123.diff Fetch: git fetch https://git.openjdk.java.net/jdk16 pull/123/head:pull/123 PR: https://git.openjdk.java.net/jdk16/pull/123 From ljiang at openjdk.java.net Mon Jan 18 05:52:57 2021 From: ljiang at openjdk.java.net (Leo Jiang) Date: Mon, 18 Jan 2021 05:52:57 GMT Subject: [jdk16] RFR: JDK-8259732: JDK 16 L10n resource file update - msg drop 10 [v2] In-Reply-To: References: <1Bb8sf6zFDnQSM5kRQIlrgBNwEpO-IvxsPmN05F0QFs=.13eb3035-71d5-4310-98e5-d9989e51cf60@github.com> Message-ID: On Sat, 16 Jan 2021 00:48:43 GMT, Naoto Sato wrote: >> Actually I was correcting the L217, changed {) -> {}. But 2 days ago, Jonathan Gibbons fixed it in another commit 6bb6093. I found his fix after running the merge. Looks both of us forgot to update the copyright year. Any suggestion? >> doclet.help.systemProperties.body=\ >> The {0} page lists references to system properties. > > I believe your PR still contains the fix to add the newline at the end of the file (at L518). So I think you can simply change the copyright year in `standard.properties` file. Thx! Fixed the copyright year for this file. ------------- PR: https://git.openjdk.java.net/jdk16/pull/123 From naoto at openjdk.java.net Tue Jan 19 16:55:46 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Tue, 19 Jan 2021 16:55:46 GMT Subject: [jdk16] RFR: JDK-8259732: JDK 16 L10n resource file update - msg drop 10 [v3] In-Reply-To: References: Message-ID: On Mon, 18 Jan 2021 05:52:57 GMT, Leo Jiang wrote: >> This is the changes for JDK 16 msg drop 10. > > Leo Jiang has updated the pull request incrementally with one additional commit since the last revision: > > fix the missing copyright year for standard.properties Marked as reviewed by naoto (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk16/pull/123 From ljiang at openjdk.java.net Wed Jan 20 14:01:48 2021 From: ljiang at openjdk.java.net (Leo Jiang) Date: Wed, 20 Jan 2021 14:01:48 GMT Subject: [jdk16] Integrated: JDK-8259732: JDK 16 L10n resource file update - msg drop 10 In-Reply-To: References: Message-ID: On Thu, 14 Jan 2021 14:00:00 GMT, Leo Jiang wrote: > This is the changes for JDK 16 msg drop 10. This pull request has now been integrated. Changeset: 01205109 Author: Leo Jiang URL: https://git.openjdk.java.net/jdk16/commit/01205109 Stats: 215 lines in 30 files changed: 118 ins; 16 del; 81 mod 8259732: JDK 16 L10n resource file update - msg drop 10 Reviewed-by: naoto ------------- PR: https://git.openjdk.java.net/jdk16/pull/123 From jwilhelm at openjdk.java.net Thu Jan 21 04:41:15 2021 From: jwilhelm at openjdk.java.net (Jesper Wilhelmsson) Date: Thu, 21 Jan 2021 04:41:15 GMT Subject: RFR: Merge jdk16 Message-ID: Forwardport JDK 16 -> JDK 17 ------------- Commit messages: - Merge - 8259757: add a regression test for 8259353 and 8259601 - 8259732: JDK 16 L10n resource file update - msg drop 10 The webrevs contain the adjustments done while merging with regards to each parent branch: - master: https://webrevs.openjdk.java.net/?repo=jdk&pr=2176&range=00.0 - jdk16: https://webrevs.openjdk.java.net/?repo=jdk&pr=2176&range=00.1 Changes: https://git.openjdk.java.net/jdk/pull/2176/files Stats: 296 lines in 31 files changed: 200 ins; 16 del; 80 mod Patch: https://git.openjdk.java.net/jdk/pull/2176.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2176/head:pull/2176 PR: https://git.openjdk.java.net/jdk/pull/2176 From jwilhelm at openjdk.java.net Thu Jan 21 05:26:59 2021 From: jwilhelm at openjdk.java.net (Jesper Wilhelmsson) Date: Thu, 21 Jan 2021 05:26:59 GMT Subject: Integrated: Merge jdk16 In-Reply-To: References: Message-ID: <9sHQ5RFKu7eMA2dnKWQ9ZWXPzT_HnSJdXDZ2j4kX8to=.69bf5258-7371-4404-a1af-b54febf7cad7@github.com> On Thu, 21 Jan 2021 04:33:47 GMT, Jesper Wilhelmsson wrote: > Forwardport JDK 16 -> JDK 17 This pull request has now been integrated. Changeset: 133bcb09 Author: Jesper Wilhelmsson URL: https://git.openjdk.java.net/jdk/commit/133bcb09 Stats: 296 lines in 31 files changed: 200 ins; 16 del; 80 mod Merge ------------- PR: https://git.openjdk.java.net/jdk/pull/2176 From jlahoda at openjdk.java.net Thu Jan 28 10:58:58 2021 From: jlahoda at openjdk.java.net (Jan Lahoda) Date: Thu, 28 Jan 2021 10:58:58 GMT Subject: RFR: JDK-8252409: JShell: Intersection types cause NoSuchFieldError Message-ID: >From the bug: jshell> var test = (Serializable & Runnable) () -> {}; test ==> $Lambda$26/0x0000000800ba4248 at 5910e440 jshell> test | Exception java.lang.NoSuchFieldError: test | at (#2:1) jshell> test.toString() | Exception java.lang.NoSuchFieldError: test | at (#3:1) The reason is that the field generated for `var test = ...` has type `j.l.Object`, but the references to it use `Serializable`, and hence the field is not found. The proposal is to generate the field's type as an erased type of the intersection type. ------------- Commit messages: - Test cleanup. - JDK-8252409: JShell: Intersection types cause NoSuchFieldError Changes: https://git.openjdk.java.net/jdk/pull/2284/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2284&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8252409 Stats: 26 lines in 5 files changed: 15 ins; 0 del; 11 mod Patch: https://git.openjdk.java.net/jdk/pull/2284.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2284/head:pull/2284 PR: https://git.openjdk.java.net/jdk/pull/2284 From vromero at openjdk.java.net Thu Jan 28 13:21:41 2021 From: vromero at openjdk.java.net (Vicente Romero) Date: Thu, 28 Jan 2021 13:21:41 GMT Subject: RFR: JDK-8252409: JShell: Intersection types cause NoSuchFieldError In-Reply-To: References: Message-ID: On Thu, 28 Jan 2021 10:53:08 GMT, Jan Lahoda wrote: > From the bug: > jshell> var test = (Serializable & Runnable) () -> {}; > test ==> $Lambda$26/0x0000000800ba4248 at 5910e440 > > jshell> test > | Exception java.lang.NoSuchFieldError: test > | at (#2:1) > > jshell> test.toString() > | Exception java.lang.NoSuchFieldError: test > | at (#3:1) > > > The reason is that the field generated for `var test = ...` has type `j.l.Object`, but the references to it use `Serializable`, and hence the field is not found. The proposal is to generate the field's type as an erased type of the intersection type. looks good ------------- Marked as reviewed by vromero (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/2284 From jlahoda at openjdk.java.net Fri Jan 29 09:22:40 2021 From: jlahoda at openjdk.java.net (Jan Lahoda) Date: Fri, 29 Jan 2021 09:22:40 GMT Subject: Integrated: JDK-8252409: JShell: Intersection types cause NoSuchFieldError In-Reply-To: References: Message-ID: On Thu, 28 Jan 2021 10:53:08 GMT, Jan Lahoda wrote: > From the bug: > jshell> var test = (Serializable & Runnable) () -> {}; > test ==> $Lambda$26/0x0000000800ba4248 at 5910e440 > > jshell> test > | Exception java.lang.NoSuchFieldError: test > | at (#2:1) > > jshell> test.toString() > | Exception java.lang.NoSuchFieldError: test > | at (#3:1) > > > The reason is that the field generated for `var test = ...` has type `j.l.Object`, but the references to it use `Serializable`, and hence the field is not found. The proposal is to generate the field's type as an erased type of the intersection type. This pull request has now been integrated. Changeset: 06754734 Author: Jan Lahoda URL: https://git.openjdk.java.net/jdk/commit/06754734 Stats: 26 lines in 5 files changed: 15 ins; 0 del; 11 mod 8252409: JShell: Intersection types cause NoSuchFieldError Reviewed-by: vromero ------------- PR: https://git.openjdk.java.net/jdk/pull/2284 From jlahoda at openjdk.java.net Fri Jan 29 17:39:55 2021 From: jlahoda at openjdk.java.net (Jan Lahoda) Date: Fri, 29 Jan 2021 17:39:55 GMT Subject: RFR: 8241356: Use a more reliable way to encode Symbol flags Message-ID: [This is a GitHub copy of: https://mail.openjdk.java.net/pipermail/compiler-dev/2020-March/014389.html ] Currently, (com.sun.tools.javac.code.)Symbol/s have a long field "flags_field", which holds various one-bit information ("Flags") about the given Symbol. We currently have around 64 such Flags, which means we are out of bits in the long field, and adding new flags is not easy. We could change the "flags_field" to be a Set over enums, but this would increase the memory footprint notably, and would also slow-down access to flags. Currently, flags operations in javac are very fast and very common, so this is probably too much burden. There are also flags to which we need to access as bit masks, e.g. due to writing to classfile. My proposal here is to use an intermediate solution, until we find a better solution, or until a better solution is possible (like due to Valhalla). The idea is as follows: -the current long-based Flags are split into 4 groups: --"flat" Flags, long based, work exactly as before. --enum-based TypeSymbolFlags, MethodSymbolFlags and VarSymbolFlags, which are only applicable to TypeSymbols, MethodSymbols and VarSymbols, respectively, and are checked using methods like Symbol.isFlagSet and set/clear using methods Symbol.setFlag and Symbol.clearFlag. So these flags are mostly encapsulated, even though physically they are currently stored in the flags_field as well. There are ~~37~~ 40 "flat" flags and ~~16~~ 17 TypeSymbolFlags (methods and vars have less flags), 57 in total. This gives us at least 7 new flags before we run out of long bits in flags_field again - but even if we do, there are several easy mitigation strategies we could use, like: -create a new int/long field on TypeSymbols for the TypeSymbolFlags (probably preferable) -split TypeSymbolFlags into Class/Package/MethodSymbolFlags The positives of this solution include: -safe(r) access to the flags - the access to the extra/symbol-kind-specific flags is mostly encapsulated, and hence mostly safe -improves the abstractions at least for some flags -reasonably complex patch (attempts to encapsulate all the flags were troublesome in previous experiments) -the performances appears to be acceptable. The negative that I see is that the code includes several incompatible types of flags now. These cannot be easily confused by accident (as the type system will complain), but still we need to be aware of them when writing code. Some more alternatives: -add a new field to Symbol, like long extraFlags, and continue with bit masks as we did so far using this new field. The drawback is that it is more error prone (it would be difficult to ensure only the new/extra flags would be stored and read from extraFlags). -have a new field, and "flat" and non-"flat" enum-based encapsulated Flags, but don't separate Type/Method/Var flags. Probably something to consider, even though I am a bit reluctant to add new fields without trying to avoid it . Any feedback is welcome! ------------- Commit messages: - Whitespaces. - Cleanup. - Merging master into JDK-8241356 - 8241356: Use a more reliable way to encode Symbol flags Changes: https://git.openjdk.java.net/jdk/pull/2316/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2316&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8241356 Stats: 765 lines in 30 files changed: 331 ins; 198 del; 236 mod Patch: https://git.openjdk.java.net/jdk/pull/2316.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2316/head:pull/2316 PR: https://git.openjdk.java.net/jdk/pull/2316